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 14:42:21 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
442 d_old_pthread_create_joinable=''
443 old_pthread_create_joinable=''
698 ignore_versioned_solibs=''
822 d_stdio_stream_array=''
823 stdio_stream_array=''
866 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
869 : We must find out about Eunice early
871 if test -f /etc/unixtovms; then
872 eunicefix=/etc/unixtovms
874 if test -f /etc/unixtovms.exe; then
875 eunicefix=/etc/unixtovms.exe
879 : Possible local include directories to search.
880 : Set locincpth to "" in a hint file to defeat local include searches.
881 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
882 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
884 : no include file wanted by default
887 : list of known cpp symbols, sorted alphabetically
888 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
889 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
890 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
891 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
892 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
893 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
894 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
895 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
896 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
897 al="$al VMS Xenix286"
898 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
899 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
900 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
901 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
902 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
903 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
904 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
905 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
906 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
907 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
908 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
909 al="$al __SVR4_2__ __UMAXV__"
910 al="$al ____386BSD____ __alpha __alpha__ __amiga"
911 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
912 al="$al __host_mips__"
913 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
914 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
915 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
916 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
917 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
918 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
919 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
920 al="$al __mc88100 __mc88100__ __mips __mips__"
921 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
922 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
923 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
924 al="$al _host_mips _mips _unix"
925 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
926 al="$al apollo ardent att386 att3b"
927 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
928 al="$al cadmus clipper concurrent convex cray ctix"
929 al="$al dmert encore gcos gcx gimpel gould"
930 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
931 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
932 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
933 al="$al i186 i286 i386 i486 i8086"
934 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
935 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
936 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
937 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
938 al="$al mc88000 mc88100 merlin mert mips mvs n16"
939 al="$al ncl_el ncl_mr"
940 al="$al news1500 news1700 news1800 news1900 news3700"
941 al="$al news700 news800 news900 ns16000 ns32000"
942 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
943 al="$al parisc pc532 pdp11 plexus posix pyr"
944 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
945 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
946 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
947 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
948 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
949 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
952 : Trailing extension. Override this in a hint file, if needed.
954 : Extra object files, if any, needed on this platform.
957 : change the next line if compiling for Xenix/286 on Xenix/386
958 xlibpth='/usr/lib/386 /lib/386'
960 : Possible local library directories to search.
961 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
962 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
964 : general looking path for locating libraries
965 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
966 glibpth="$glibpth /lib /usr/lib $xlibpth"
967 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
968 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
970 : Private path used by Configure to find libraries. Its value
971 : is prepended to libpth. This variable takes care of special
972 : machines, like the mips. Usually, it should be empty.
975 : default library list
977 : some systems want to use only the non-versioned libso:s
978 ignore_versioned_solibs=''
979 : full support for void wanted by default
982 : set useposix=false in your hint file to disable the POSIX extension.
984 : set useopcode=false in your hint file to disable the Opcode extension.
986 : set usemultiplicity on the Configure command line to enable multiplicity.
987 : set usesocks on the Configure command line to enable socks.
988 : set usethreads on the Configure command line to enable threads.
989 : List of libraries we want.
990 : If anyone needs -lnet, put it in a hint file.
991 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
992 libswanted="$libswanted dld ld sun m c cposix posix"
993 libswanted="$libswanted ndir dir crypt sec"
994 libswanted="$libswanted ucb bsd BSD PW x"
995 : We probably want to search /usr/shlib before most other libraries.
996 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
997 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
998 glibpth="/usr/shlib $glibpth"
999 : Do not use vfork unless overridden by a hint file.
1002 : Find the basic shell for Bourne shell scripts
1006 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1009 if test -f "$xxx"; then
1012 : Build up a list and do a single loop so we can 'break' out.
1013 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1014 for xxx in sh bash ksh pdksh ash; do
1016 try="$try ${p}/${xxx}"
1020 if test -f "$xxx"; then
1023 elif test -f "$xxx.exe"; then
1034 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1036 Usually it's in /bin/sh. How did you even get this far?
1037 Please contact me (Perl Maintainers) at perlbug@perl.com and
1038 we'll try to straighten this all out.
1044 : see if sh knows # comments
1045 if `$sh -c '#' >/dev/null 2>&1`; then
1049 test -f $xcat || xcat=/usr/bin/cat
1054 if test -s today; then
1057 echo "#! $xcat" > try
1061 if test -s today; then
1069 echo "Your $sh doesn't grok # comments--I will strip them later on."
1072 echo "exec grep -v '^[ ]*#'" >spitshell
1074 $eunicefix spitshell
1075 spitshell=`pwd`/spitshell
1077 echo "I presume that if # doesn't work, #! won't work either!"
1082 : figure out how to guarantee sh startup
1084 '') startsh=${sharpbang}${sh} ;;
1096 : echo "Yup, it does."
1098 echo "Hmm... '$startsh' does not guarantee sh startup..."
1099 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1104 : Save command line options in file UU/cmdline.opt for later use in
1105 : generating config.sh.
1106 cat > cmdline.opt <<EOSH
1107 # Configure command line arguments.
1114 cat >>cmdline.opt <<EOSH
1115 config_arg$argn='$arg'
1117 argn=`expr $argn + 1`
1120 : produce awk script to parse command line options
1121 cat >options.awk <<'EOF'
1123 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1125 len = length(optstr);
1126 for (i = 1; i <= len; i++) {
1127 c = substr(optstr, i, 1);
1128 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1139 if (substr(str, 1, 1) != "-") {
1140 printf("'%s'\n", str);
1144 for (i = 2; i <= len; i++) {
1145 c = substr(str, i, 1);
1147 printf("-%s\n", substr(str, i));
1153 printf("'%s'\n", substr(str, i + 1));
1166 : process the command line options
1167 set X `for arg in "$@"; do echo "X$arg"; done |
1168 sed -e s/X// | awk -f options.awk`
1173 : set up default values
1183 rm -f optdef.sh posthint.sh
1184 cat >optdef.sh <<EOS
1190 while test $# -gt 0; do
1192 -d) shift; fastread=yes;;
1193 -e) shift; alldone=cont;;
1197 if test -r "$1"; then
1200 echo "$me: cannot read config file $1." >&2
1205 -h) shift; error=true;;
1206 -r) shift; reuseval=true;;
1207 -s) shift; silent=true; realsilent=true;;
1208 -E) shift; alldone=exit;;
1209 -K) shift; knowitall=true;;
1210 -O) shift; override=true;;
1211 -S) shift; silent=true; extractsh=true;;
1216 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1217 echo "$me: ignoring -D $1" >&2
1220 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1221 *) echo "$1='define'" >> optdef.sh;;
1228 *=) echo "$1" >> optdef.sh;;
1230 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1231 echo "$me: ignoring -U $1" >&2
1233 *) echo "$1='undef'" >> optdef.sh;;
1244 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1248 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1249 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1255 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1256 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1257 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1258 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1259 *) xxx=`echo $yyy|sed 's!:.*!!'`
1260 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1266 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1268 echo "$yyy=''" >> posthint.sh ;;
1273 echo "$yyy='$zzz'" >> posthint.sh ;;
1275 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1277 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1282 echo "$yyy=$zzz" >> posthint.sh ;;
1283 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1286 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1289 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1297 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1298 [-U symbol] [-U symbol=] [-A command:symbol...]
1299 -d : use defaults for all answers.
1300 -e : go on without questioning past the production of config.sh.
1301 -f : specify an alternate default configuration file.
1302 -h : print this help message and exit (with an error status).
1303 -r : reuse C symbols value if possible (skips costly nm extraction).
1304 -s : silent mode, only echoes questions and essential information.
1305 -D : define symbol to have some value:
1306 -D symbol symbol gets the value 'define'
1307 -D symbol=value symbol gets the value 'value'
1308 -E : stop at the end of questions, after having produced config.sh.
1309 -K : do not use unless you know what you are doing.
1310 -O : let -D and -U override definitions from loaded configuration file.
1311 -S : perform variable substitutions on all .SH files (can mix with -f)
1312 -U : undefine symbol:
1313 -U symbol symbol gets the value 'undef'
1314 -U symbol= symbol gets completely empty
1315 -A : manipulate symbol after the platform specific hints have been applied:
1316 -A symbol=value append " "value to symbol
1317 -A append:symbol=value append value to symbol
1318 -A define:symbol=value define symbol to have value
1319 -A clear:symbol define symbol to be ''
1320 -A define:symbol define symbol to be 'define'
1321 -A eval:symbol=value define symbol to be eval of value
1322 -A prepend:symbol=value prepend value to symbol
1323 -A undef:symbol define symbol to be 'undef'
1324 -A undef:symbol= define symbol to be ''
1325 -V : print version number and exit (with a zero status).
1332 case "$fastread$alldone" in
1335 if test ! -t 0; then
1336 echo "Say 'sh Configure', not 'sh <Configure'"
1344 true) exec 1>/dev/null;;
1347 : run the defines and the undefines, if any, but leave the file out there...
1350 : create the posthint manipulation script and leave the file out there...
1355 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1356 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1357 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1358 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1359 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1362 : Some greps do not return status, grrr.
1363 echo "grimblepritz" >grimble
1364 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1366 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1372 : the following should work in any shell
1376 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1377 cat >contains <<'EOSS'
1378 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1383 : Find the path to the source tree
1386 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1389 *) src=`cd ../$src && pwd` ;;
1402 if test -f $rsrc/Configure && \
1403 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1405 : found it, so we are ok.
1408 for src in . .. ../.. ../../.. ../../../..; do
1409 if test -f ../$src/Configure && \
1410 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1421 Sorry, I can't seem to locate the source dir for $package. Please start
1422 Configure with an explicit path -- i.e. /some/path/Configure.
1430 echo "Sources for $package found in \"$src\"." >&4
1434 : script used to extract .SH files with variable substitutions
1435 cat >extract <<'EOS'
1437 echo "Doing variable substitutions on .SH files..."
1438 if test -f $src/MANIFEST; then
1439 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1441 echo "(Looking for .SH files under the source directory.)"
1442 set x `(cd $src; find . -name "*.SH" -print)`
1446 0) set x `(cd $src; echo *.SH)`; shift;;
1448 if test ! -f $src/$1; then
1454 while test $name; do
1455 if test ! -d "$name"; then
1456 create="$name $create";
1457 name=`echo $name | sed -e "s|^[^/]*$||"`;
1458 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1463 for file in $create; do
1472 dir=`expr X$file : 'X\(.*\)/'`
1473 file=`expr X$file : 'X.*/\(.*\)'`
1474 (cd $dir && . ./$file)
1484 dir=`expr X$file : 'X\(.*\)/'`
1485 file=`expr X$file : 'X.*/\(.*\)'`
1486 (set x $dir; shift; eval $mkdir_p)
1496 if test -f $src/config_h.SH; then
1497 if test ! -f config.h; then
1498 : oops, they left it out of MANIFEST, probably, so do it anyway.
1504 : extract files and exit if asked to do so
1505 case "$extractsh" in
1507 case "$realsilent" in
1511 case "$config_sh" in
1512 '') config_sh='config.sh';;
1515 echo "Fetching answers from $config_sh..."
1518 test "$override" && . ./optdef.sh
1527 : Eunice requires " " instead of "", can you believe it
1530 echo "Beginning of configuration questions for $package."
1532 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1534 : first determine how to suppress newline on echo command
1536 echo "Checking echo to see how to suppress newlines..."
1537 (echo "hi there\c" ; echo " ") >.echotmp
1538 if $contains c .echotmp >/dev/null 2>&1 ; then
1549 echo $n "The star should be here-->$c"
1553 : Now test for existence of everything in MANIFEST
1555 if test -f $rsrc/MANIFEST; then
1556 echo "First let's make sure your kit is complete. Checking..." >&4
1557 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1560 for filelist in x??; do
1561 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1563 if test -s missing; then
1567 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1569 You have the option of continuing the configuration process, despite the
1570 distinct possibility that your kit is damaged, by typing 'y'es. If you
1571 do, don't blame me if something goes wrong. I advise you to type 'n'o
1572 and contact the author (perlbug@perl.com).
1575 echo $n "Continue? [n] $c" >&4
1579 echo "Continuing..." >&4
1583 echo "ABORTING..." >&4
1588 echo "Looks good..."
1591 echo "There is no MANIFEST file. I hope your kit is complete !"
1596 : Find the appropriate value for a newline for tr
1597 if test -n "$DJGPP"; then
1600 if test X"$trnl" = X; then
1601 case "`echo foo|tr '\n' x 2>/dev/null`" in
1605 if test X"$trnl" = X; then
1606 case "`echo foo|tr '\012' x 2>/dev/null`" in
1607 foox) trnl='\012' ;;
1610 if test X"$trnl" = X; then
1613 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1619 : compute the number of columns on the terminal for proper question formatting
1624 : set up the echo used in my read
1625 myecho="case \"\$xxxm\" in
1626 '') echo $n \"\$rp $c\" >&4;;
1628 '') echo $n \"[\$xxxm] $c\";;
1630 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1632 echo $n \"[\$xxxm] $c\" >&4
1634 echo $n \"\$rp [\$xxxm] $c\" >&4
1640 : now set up to do reads with possible shell escape and default assignment
1646 case "\$fastread" in
1647 yes) case "\$dflt" in
1650 case "\$silent-\$rp" in
1655 *) case "\$silent" in
1656 true) case "\$rp" in
1661 while expr "X\$ans" : "X!" >/dev/null; do
1665 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1673 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1682 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1687 echo "(OK, I'll run with -d after this question.)" >&4
1690 echo "*** Sorry, \$1 not supported yet." >&4
1700 echo "*** Substitution done -- please confirm."
1702 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1707 echo "*** Error -- try again."
1714 case "\$ans\$xxxm\$nostick" in
1726 : create .config dir to save info across Configure sessions
1727 test -d ../.config || mkdir ../.config
1728 cat >../.config/README <<EOF
1729 This directory created by Configure to save information that should
1730 persist across sessions for $package.
1732 You may safely delete it if you wish.
1735 : general instructions
1738 user=`(logname) 2>/dev/null`
1740 '') user=`whoami 2>&1`;;
1742 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1745 rp='Would you like to see the instructions?'
1756 This installation shell script will examine your system and ask you questions
1757 to determine how the perl5 package should be installed. If you get
1758 stuck on a question, you may use a ! shell escape to start a subshell or
1759 execute a command. Many of the questions will have default answers in square
1760 brackets; typing carriage return will give you the default.
1762 On some of the questions which ask for file or directory names you are allowed
1763 to use the ~name construct to specify the login directory belonging to "name",
1764 even if you don't have a shell which knows about that. Questions where this is
1765 allowed will be marked "(~name ok)".
1769 dflt='Type carriage return to continue'
1773 The prompter used in this script allows you to use shell variables and
1774 backticks in your answers. You may use $1, $2, etc... to refer to the words
1775 in the default answer, as if the default line was a set of arguments given to a
1776 script shell. This means you may also use $* to repeat the whole default line,
1777 so you do not have to re-type everything to add something to the default.
1779 Everytime there is a substitution, you will have to confirm. If there is an
1780 error (e.g. an unmatched backtick), the default answer will remain unchanged
1781 and you will be prompted again.
1783 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1784 the questions and use the computed defaults (or the previous answers if there
1785 was already a config.sh file). Type 'Configure -h' for a list of options.
1786 You may also start interactively and then answer '& -d' at any prompt to turn
1787 on the non-interactive behaviour for the remainder of the execution.
1793 Much effort has been expended to ensure that this shell script will run on any
1794 Unix system. If despite that it blows up on yours, your best bet is to edit
1795 Configure and run it again. If you can't run Configure for some reason,
1796 you'll have to generate a config.sh file by hand. Whatever problems you
1797 have, let me (perlbug@perl.com) know how I blew it.
1799 This installation script affects things in two ways:
1801 1) it may do direct variable substitutions on some of the files included
1803 2) it builds a config.h file for inclusion in C programs. You may edit
1804 any of these files as the need arises after running this script.
1806 If you make a mistake on a question, there is no easy way to back up to it
1807 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1808 files. Configure will offer to let you do this before it runs the SH files.
1811 dflt='Type carriage return to continue'
1813 case "$firsttime" in
1814 true) echo $user >>../.config/instruct;;
1818 : find out where common programs are
1820 echo "Locating common programs..." >&4
1833 if test -d \$dir/\$thing; then
1839 for thisthing in \$dir/\$thing; do
1840 : just loop through to pick last item
1842 if test -f \$thisthing; then
1845 elif test -f \$dir/\$thing.exe; then
1846 if test -n "$DJGPP"; then
1847 echo \$dir/\$thing.exe
1849 : on Eunice apparently
1899 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1900 pth="$pth /lib /usr/lib"
1901 for file in $loclist; do
1905 if test -f "$xxx"; then
1908 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1909 xxx=`./loc $file $file $pth`
1912 '') xxx=`./loc $file $file $pth`;;
1913 *) xxx=`./loc $xxx $xxx $pth`;;
1919 echo $file is in $xxx.
1922 echo $file is in $xxx.
1925 echo "I don't know where '$file' is, and my life depends on it." >&4
1926 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1932 echo "Don't worry if any of the following aren't found..."
1934 for file in $trylist; do
1938 if test -f "$xxx"; then
1941 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1942 xxx=`./loc $file $file $pth`
1945 '') xxx=`./loc $file $file $pth`;;
1946 *) xxx=`./loc $xxx $xxx $pth`;;
1952 echo $file is in $xxx.
1955 echo $file is in $xxx.
1958 echo "I don't see $file out there, $say."
1965 echo "Substituting grep for egrep."
1971 echo "Substituting cp for ln."
1977 echo "Hopefully test is built into your sh."
1980 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1981 echo "Using the test built into your sh."
1989 echo "Hopefully echo is built into your sh."
1994 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1995 $echo $n "hi there$c" >foo1
1996 echo $n "hi there$c" >foo2
1997 if cmp foo1 foo2 >/dev/null 2>&1; then
1998 echo "They are compatible. In fact, they may be identical."
2005 They are not compatible! You are probably running ksh on a non-USG system.
2006 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2007 have echo built in and we may have to run some Bourne shell scripts. That
2008 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2011 $echo $n "The star should be here-->$c"
2018 : determine whether symbolic links are supported
2021 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2022 echo "Symbolic links are supported." >&4
2025 echo "Symbolic links are NOT supported." >&4
2030 : see whether [:lower:] and [:upper:] are supported character classes
2032 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2034 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2038 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2039 # (0xc9 and 0xd1), therefore that is a nice testing point.
2040 if test "X$up" = X -o "X$low" = X; then
2041 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2047 if test "X$up" = X -o "X$low" = X; then
2048 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2054 if test "X$up" = X -o "X$low" = X; then
2055 case "`echo IJ | od -x 2>/dev/null`" in
2057 echo "Hey, this might be EBCDIC." >&4
2058 if test "X$up" = X -o "X$low" = X; then
2059 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2060 ij) up='[A-IJ-RS-Z]'
2065 if test "X$up" = X -o "X$low" = X; then
2066 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2076 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2078 echo "Using $up and $low to convert case." >&4
2081 echo "I don't know how to translate letters from upper to lower case." >&4
2082 echo "Your tr is not acting any way I know of." >&4
2086 : set up the translation script tr, must be called with ./tr of course
2090 '[A-Z][a-z]') exec $tr '$up' '$low';;
2091 '[a-z][A-Z]') exec $tr '$low' '$up';;
2098 : Try to determine whether config.sh was made on this system
2099 case "$config_sh" in
2101 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2102 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2103 # because the A-Z/a-z are not consecutive.
2104 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2105 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2106 newmyuname="$myuname"
2108 case "$knowitall" in
2110 if test -f ../config.sh; then
2111 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2112 eval "`grep myuname= ../config.sh`"
2114 if test "X$myuname" = "X$newmyuname"; then
2122 : Get old answers from old config file if Configure was run on the
2123 : same system, otherwise use the hints.
2126 if test -f config.sh; then
2128 rp="I see a config.sh file. Shall I use it to set the defaults?"
2131 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2132 *) echo "Fetching default answers from your old config.sh file..." >&4
2140 : Older versions did not always set $sh. Catch re-use of such
2149 if test ! -f config.sh; then
2152 First time through, eh? I have some defaults handy for some systems
2153 that need some extra help getting the Configure answers right:
2156 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2158 : Half the following guesses are probably wrong... If you have better
2159 : tests or hints, please send them to perlbug@perl.com
2160 : The metaconfig authors would also appreciate a copy...
2161 $test -f /irix && osname=irix
2162 $test -f /xenix && osname=sco_xenix
2163 $test -f /dynix && osname=dynix
2164 $test -f /dnix && osname=dnix
2165 $test -f /lynx.os && osname=lynxos
2166 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2167 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2168 $test -f /bin/mips && /bin/mips && osname=mips
2169 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2170 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2171 $test -d /usr/apollo/bin && osname=apollo
2172 $test -f /etc/saf/_sactab && osname=svr4
2173 $test -d /usr/include/minix && osname=minix
2174 if $test -d /MachTen -o -d /MachTen_Folder; then
2176 if $test -x /sbin/version; then
2177 osvers=`/sbin/version | $awk '{print $2}' |
2178 $sed -e 's/[A-Za-z]$//'`
2179 elif $test -x /usr/etc/version; then
2180 osvers=`/usr/etc/version | $awk '{print $2}' |
2181 $sed -e 's/[A-Za-z]$//'`
2186 $test -f /sys/posix.dll &&
2187 $test -f /usr/bin/what &&
2188 set X `/usr/bin/what /sys/posix.dll` &&
2189 $test "$3" = UWIN &&
2192 if $test -f $uname; then
2200 umips) osname=umips ;;
2203 [23]100) osname=mips ;;
2204 next*) osname=next ;;
2206 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2207 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2210 elif $test -f /etc/kconfig; then
2212 if test "$lns" = "$ln -s"; then
2214 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2216 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2223 if test -n "$DJGPP"; then
2232 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2234 'not found') osvers="$4"."$3" ;;
2235 '<3240'|'<>3240') osvers=3.2.0 ;;
2236 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2237 '=3250'|'>3250') osvers=3.2.5 ;;
2241 *dc.osx) osname=dcosx
2247 domainos) osname=apollo
2253 dynixptx*) osname=dynixptx
2254 osvers=`echo "$4"|sed 's/^v//'`
2256 freebsd) osname=freebsd
2258 genix) osname=genix ;;
2260 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2276 netbsd*) osname=netbsd
2279 news-os) osvers="$3"
2281 4*) osname=newsos4 ;;
2285 bsd386) osname=bsd386
2288 POSIX-BC | posix-bc ) osname=posix-bc
2291 powerux | power_ux | powermax_os | powermaxos | \
2292 powerunix | power_unix) osname=powerux
2295 next*) osname=next ;;
2296 solaris) osname=solaris
2298 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2305 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2309 titanos) osname=titanos
2318 ultrix) osname=ultrix
2321 osf1|mls+) case "$5" in
2324 osvers=`echo "$3" | sed 's/^[xvt]//'`
2326 hp*) osname=hp_osf1 ;;
2327 mips) osname=mips_osf1 ;;
2330 unixware) osname=svr5
2339 $2) case "$osname" in
2343 : svr4.x or possibly later
2353 if test -f /stand/boot ; then
2354 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2355 if test -n "$INITPROG" -a -f "$INITPROG"; then
2356 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2357 if test -n "$isesix"; then
2365 *) if test -f /etc/systemid; then
2367 set `echo $3 | $sed 's/\./ /g'` $4
2368 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2370 elif $test -f $src/hints/sco_$1_$2.sh; then
2372 elif $test -f $src/hints/sco_$1.sh; then
2377 '') : Still unknown. Probably a generic Sys V.
2386 *) case "$osname" in
2387 '') : Still unknown. Probably a generic BSD.
2395 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2396 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2397 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2400 $rm -f UU/kernel.what
2401 elif test -d c:/.; then
2408 : Now look for a hint file osname_osvers, unless one has been
2409 : specified already.
2412 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2413 : Also try without trailing minor version numbers.
2414 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2415 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2416 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2417 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2420 *) case "$osvers" in
2423 *) if $test -f $src/hints/$file.sh ; then
2425 elif $test -f $src/hints/$xfile.sh ; then
2427 elif $test -f $src/hints/$xxfile.sh ; then
2429 elif $test -f $src/hints/$xxxfile.sh ; then
2431 elif $test -f $src/hints/$xxxxfile.sh ; then
2433 elif $test -f "$src/hints/${osname}.sh" ; then
2442 if $test -f Policy.sh ; then
2445 none) dflt="Policy" ;;
2446 *) dflt="Policy $dflt" ;;
2451 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2455 if $test -f Policy.sh ; then
2458 There's also a Policy hint file available, which should make the
2459 site-specific (policy) questions easier to answer.
2466 You may give one or more space-separated answers, or "none" if appropriate.
2467 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2468 is a good thing. DO NOT give a wrong version or a wrong OS.
2472 rp="Which of these apply, if any?"
2475 for file in $tans; do
2476 if $test X$file = XPolicy -a -f Policy.sh; then
2478 $cat Policy.sh >> UU/config.sh
2479 elif $test -f $src/hints/$file.sh; then
2480 . $src/hints/$file.sh
2481 $cat $src/hints/$file.sh >> UU/config.sh
2482 elif $test X$tans = X -o X$tans = Xnone ; then
2485 : Give one chance to correct a possible typo.
2486 echo "$file.sh does not exist"
2488 rp="hint to use instead?"
2490 for file in $ans; do
2491 if $test -f "$src/hints/$file.sh"; then
2492 . $src/hints/$file.sh
2493 $cat $src/hints/$file.sh >> UU/config.sh
2494 elif $test X$ans = X -o X$ans = Xnone ; then
2497 echo "$file.sh does not exist -- ignored."
2504 : Remember our hint file for later.
2505 if $test -f "$src/hints/$file.sh" ; then
2515 echo "Fetching default answers from $config_sh..." >&4
2519 cp $config_sh config.sh 2>/dev/null
2529 test "$override" && . ./optdef.sh
2530 myuname="$newmyuname"
2532 : Restore computed paths
2533 for file in $loclist $trylist; do
2534 eval $file="\$_$file"
2539 Configure uses the operating system name and version to set some defaults.
2540 The default value is probably right if the name rings a bell. Otherwise,
2541 since spelling matters for me, either accept the default or answer "none"
2548 ''|' '|none) dflt=none ;;
2549 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2552 *) dflt="$osname" ;;
2554 rp="Operating system name?"
2558 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2564 ''|' '|none) dflt=none ;;
2565 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2566 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2568 ''|' ') dflt=none ;;
2573 *) dflt="$osvers" ;;
2575 rp="Operating system version?"
2585 : who configured the system
2586 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2587 cf_by=`(logname) 2>/dev/null`
2590 cf_by=`(whoami) 2>/dev/null`
2592 "") cf_by=unknown ;;
2596 : set up the script used to warn in case of inconsistency
2603 echo "*** WHOA THERE!!! ***" >&4
2604 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2605 rp=" Keep the $hint value?"
2608 y) td=$was; tu=$was;;
2612 : function used to set $1 to $val
2613 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2615 $define$undef) . ./whoa; eval "$var=\$td";;
2616 $undef$define) . ./whoa; eval "$var=\$tu";;
2617 *) eval "$var=$val";;
2622 Perl can be built to take advantage of threads, on some systems.
2623 To do so, Configure must be run with -Dusethreads.
2625 Note that threading is a highly experimental feature, and
2626 some known race conditions still remain. If you choose to try
2627 it, be very sure to not actually deploy it for production
2628 purposes. README.threads has more details, and is required
2629 reading if you enable threads.
2631 case "$usethreads" in
2632 $define|true|[yY]*) dflt='y';;
2635 rp='Build a threading Perl?'
2638 y|Y) val="$define" ;;
2644 case "$d_oldpthreads" in
2645 '') : Configure tests would be welcome here. For now, assume undef.
2647 *) val="$d_oldpthreads" ;;
2653 case "$usethreads" in
2654 "$define"|true|[yY]*)
2655 : Look for a hint-file generated 'call-back-unit'. If the
2656 : user has specified that a threading perl is to be built,
2657 : we may need to set or change some other defaults.
2658 if $test -f usethreads.cbu; then
2659 echo "Your platform has some specific hints for threaded builds, using them..."
2663 (Your platform doesn't have any specific hints for threaded builds.
2664 Assuming POSIX threads, then.)
2672 Perl can be built so that multiple Perl interpreters can coexist
2673 within the same Perl executable. To do so, Configure must be run with
2676 Normally you do not need this and you should answer no.
2679 case "$usemultiplicity" in
2680 $define|true|[yY]*) dflt='y';;
2683 rp='Build Perl for multiplicity?'
2686 y|Y) val="$define" ;;
2692 : determine where manual pages are on this system
2696 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2697 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2698 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2699 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2700 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2701 sysman=`./loc . /usr/man/man1 $syspath`
2704 if $test -d "$sysman"; then
2705 echo "System manual is in $sysman." >&4
2707 echo "Could not find manual pages in source form." >&4
2710 : see what memory models we can support
2713 $cat >pdp11.c <<'EOP'
2722 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2723 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2724 dflt='unsplit split'
2726 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2729 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2734 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2737 if $test -d /lib/large || $test -d /usr/lib/large; then
2740 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2749 Some systems have different model sizes. On most systems they are called
2750 small, medium, large, and huge. On the PDP11 they are called unsplit and
2751 split. If your system doesn't support different memory models, say "none".
2752 If you wish to force everything to one memory model, say "none" here and
2753 put the appropriate flags later when it asks you for other cc and ld flags.
2754 Venix systems may wish to put "none" and let the compiler figure things out.
2755 (In the following question multiple model names should be space separated.)
2757 The default for most systems is "none".
2760 rp="Which memory models are supported?"
2775 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2776 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2783 rp="What flag indicates separate I and D space?"
2791 *large*|*small*|*medium*|*huge*)
2798 rp="What flag indicates large model?"
2808 *huge*) case "$huge" in
2812 rp="What flag indicates huge model?"
2822 *medium*) case "$medium" in
2826 rp="What flag indicates medium model?"
2833 *) medium="$large";;
2836 *small*) case "$small" in
2840 rp="What flag indicates small model?"
2851 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2854 $rm -f pdp11.* pdp11
2856 : make some quick guesses about what we are up against
2858 $echo $n "Hmm... $c"
2868 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2869 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2871 echo "Looks kind of like an OSF/1 system, but we'll see..."
2873 elif test `echo abc | tr a-z A-Z` = Abc ; then
2874 xxx=`./loc addbib blurfl $pth`
2875 if $test -f $xxx; then
2876 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2880 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2881 echo "Looks kind of like an extended USG system, but we'll see..."
2883 echo "Looks kind of like a USG system, but we'll see..."
2887 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2888 echo "Looks kind of like a BSD system, but we'll see..."
2892 echo "Looks kind of like a Version 7 system, but we'll see..."
2895 case "$eunicefix" in
2898 There is, however, a strange, musty smell in the air that reminds me of
2899 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2903 : it so happens the Eunice I know will not run shell scripts in Unix format
2907 echo "Congratulations. You aren't running Eunice."
2911 : Detect OS2. The p_ variable is set above in the Head.U unit.
2916 I have the feeling something is not exactly right, however...don't tell me...
2917 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2922 if test -f /xenix; then
2923 echo "Actually, this looks more like a XENIX system..."
2928 echo "It's not Xenix..."
2933 if test -f /venix; then
2934 echo "Actually, this looks more like a VENIX system..."
2941 echo "Nor is it Venix..."
2944 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2945 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2948 : see if we need a special compiler
2956 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2957 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2971 On some older systems the default C compiler will not resolve multiple global
2972 references that happen to have the same name. On some such systems the "Mcc"
2973 command may be used to force these to be resolved. On other systems a "cc -M"
2974 command is required. (Note that the -M flag on other systems indicates a
2975 memory model to use!) If you have the Gnu C compiler, you might wish to use
2981 rp="Use which C compiler?"
2989 rp="Use which C compiler?"
2993 : Look for a hint-file generated 'call-back-unit'. Now that the
2994 : user has specified the compiler, we may need to set or change some
2996 if $test -f cc.cbu; then
3000 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3001 $cat >gccvers.c <<EOM
3006 printf("%s\n", __VERSION__);
3008 printf("%s\n", "1");
3014 if $cc -o gccvers gccvers.c; then
3015 gccversion=`./gccvers`
3016 case "$gccversion" in
3017 '') echo "You are not using GNU cc." ;;
3018 *) echo "You are using GNU cc $gccversion." ;;
3022 echo "*** WHOA THERE!!! ***" >&4
3023 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3024 case "$knowitall" in
3026 echo " You'd better start hunting for one and let me know about it." >&4
3032 case "$gccversion" in
3033 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3037 case "$usemorebits" in
3038 "$define"|true|[yY]*)
3040 uselongdouble="$define"
3041 usemorebits="$define"
3043 *) usemorebits="$undef"
3050 Perl can be built to understand large files (files larger than 2 gigabytes)
3051 on some systems. To do so, Configure must be run with -Duselargefiles.
3053 If this doesn't make any sense to you, just accept the default.
3055 case "$uselargefiles" in
3056 "$define"|true|[yY]*) dflt='y' ;;
3059 rp='Try to understand large files?'
3062 y|Y) val="$define" ;;
3067 case "$uselargefiles" in
3068 "$define") use64bits="$define" ;;
3073 Perl can be built to take advantage of explicit 64-bit interfaces,
3074 on some systems. To do so, Configure must be run with -Duse64bits.
3076 If this doesn't make any sense to you, just accept the default.
3078 case "$use64bits" in
3079 $define|true|[yY]*) dflt='y';;
3082 rp='Try to use explicit 64-bit interfaces, if available?'
3095 case "$archname64" in
3096 '') archname64='' ;; # not a typo
3099 case "$use64bits" in
3100 "$define"|true|[yY]*)
3101 : Look for a hint-file generated 'call-back-unit'. If the
3102 : user has specified that a 64 bit perl is to be built,
3103 : we may need to set or change some other defaults.
3104 if $test -f use64bits.cbu; then
3105 echo "Your platform has some specific hints for 64-bit builds, using them..."
3109 (Your platform doesn't have any specific hints for 64-bit builds.
3110 This is probably okay, especially if your system is a true 64-bit system.)
3112 case "$gccversion" in
3115 But since you seem to be using gcc,
3116 I will now add -DUSE_LONG_LONG to the compilation flags.
3118 ccflags="$ccflags -DUSE_LONG_LONG"
3125 : determine the architecture name
3127 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3128 tarch=`arch`"-$osname"
3129 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3130 if uname -m > tmparch 2>&1 ; then
3131 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3132 -e 's/$/'"-$osname/" tmparch`
3140 case "$myarchname" in
3143 echo "(Your architecture name used to be $myarchname.)"
3150 *) dflt="$archname";;
3152 rp='What is your architecture name'
3155 case "$usethreads" in
3157 echo "Threads selected." >&4
3159 *-thread*) echo "...and architecture name already has -thread." >&4
3161 *) archname="$archname-thread"
3162 echo "...setting architecture name to $archname." >&4
3167 case "$usemultiplicity" in
3169 echo "Multiplicity selected." >&4
3171 *-multi*) echo "...and architecture name already has -multi." >&4
3173 *) archname="$archname-multi"
3174 echo "...setting architecture name to $archname." >&4
3179 case "$use64bits" in
3181 echo "Explicit 64-bitness selected." >&4
3182 case "$archname64" in
3187 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3189 *) archname="$archname-$archname64"
3190 echo "...setting architecture name to $archname." >&4
3197 : decide how portable to be. Allow command line overrides.
3198 case "$d_portable" in
3200 *) d_portable="$define" ;;
3203 : set up shell script to do ~ expansion
3209 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3212 if $test -f /bin/csh; then
3213 /bin/csh -f -c "glob \$1"
3218 name=\`$expr x\$1 : '..\([^/]*\)'\`
3219 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3220 if $test ! -d "\$dir"; then
3222 echo "\$me: can't locate home directory for: \$name" >&2
3227 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3243 : now set up to get a file name
3247 cat <<'EOSC' >>getfile
3263 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3264 fn=`echo $fn | sed 's/(.*)//'`
3270 loc_file=`expr $fn : '.*:\(.*\)'`
3271 fn=`expr $fn : '\(.*\):.*'`
3279 */*) fullpath=true;;
3288 *e*) exp_file=true;;
3291 *p*) nopath_ok=true;;
3296 *d*) type='Directory';;
3297 *l*) type='Locate';;
3302 Locate) what='File';;
3307 case "$d_portable" in
3315 while test "$type"; do
3320 true) rp="$rp (~name ok)";;
3323 if test -f UU/getfile.ok && \
3324 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3343 value=`UU/filexp $ans`
3346 if test "$ans" != "$value"; then
3347 echo "(That expands to $value on this system.)"
3361 /*) value="$ansexp" ;;
3366 echo "I shall only accept a full path name, as in /bin/ls." >&4
3367 echo "Use a ! shell escape if you wish to check pathnames." >&4
3370 echo "Please give a full path name, starting with slash." >&4
3373 echo "Note that using ~name is ok provided it expands well." >&4
3386 for fp in $gfpth; do
3387 if test "X$fp" = X.; then
3392 if test -f "$pf"; then
3394 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3396 echo "($value is not a plain file, but that's ok.)"
3399 if test X"$type" = X; then
3406 for fp in $gfpth; do
3407 if test "X$fp" = X.; then
3412 if test -d "$pf"; then
3420 if test -d "$ansexp"; then
3421 echo "(Looking for $loc_file in directory $value.)"
3422 value="$value/$loc_file"
3423 ansexp="$ansexp/$loc_file"
3425 if test -f "$ansexp"; then
3428 case "$nopath_ok" in
3429 true) case "$value" in
3431 *) echo "Assuming $value will be in people's path."
3447 if test "$fastread" = yes; then
3452 rp="$what $value doesn't exist. Use that name anyway?"
3471 test "X$gfpthkeep" != Xy && gfpth=""
3474 : determine root of directory hierarchy where package will be installed.
3477 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3485 By default, $package will be installed in $dflt/bin, manual pages
3486 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3487 installation directories. Typically this is something like /usr/local.
3488 If you wish to have binaries under /usr/bin but other parts of the
3489 installation under /usr/local, that's ok: you will be prompted
3490 separately for each of the installation directories, the prefix being
3491 only used to set the defaults.
3495 rp='Installation prefix to use?'
3503 *) oldprefix="$prefix";;
3513 $define|true) afs=true ;;
3514 $undef|false) afs=false ;;
3515 *) if test -d /afs; then
3523 echo "AFS may be running... I'll be extra cautious then..." >&4
3525 echo "AFS does not seem to be running..." >&4
3528 : determine installation prefix for where package is to be installed.
3532 Since you are running AFS, I need to distinguish the directory in which
3533 files will reside from the directory in which they are installed (and from
3534 which they are presumably copied to the former directory by occult means).
3537 case "$installprefix" in
3538 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3539 *) dflt="$installprefix";;
3544 In some special cases, particularly when building $package for distribution,
3545 it is convenient to distinguish between the directory in which files should
3546 be installed from the directory ($prefix) in which they
3547 will eventually reside. For most users, these two directories are the same.
3550 case "$installprefix" in
3552 *) dflt=$installprefix;;
3556 rp='What installation prefix should I use for installing files?'
3558 installprefix="$ans"
3559 installprefixexp="$ansexp"
3561 : set the prefixit variable, to compute a suitable default value
3562 prefixit='case "$3" in
3564 case "$oldprefix" in
3565 "") eval "$1=\"\$$2\"";;
3572 ""|" ") eval "$1=\"\$$2\"";;
3578 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3580 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3581 /*-$oldprefix/*|\~*-$oldprefix/*)
3582 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3583 *) eval "$1=\"\$$2\"";;
3587 : set the base revision
3590 : get the patchlevel
3592 echo "Getting the current patchlevel..." >&4
3593 if $test -r $rsrc/patchlevel.h;then
3594 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3595 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3596 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
3602 $echo $n "(You have $package" $c
3605 *) $echo $n " $baserev" $c ;;
3607 $echo $n " patchlevel $patchlevel" $c
3608 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3611 if test 0 -eq "$subversion"; then
3612 version=`LC_ALL=C; export LC_ALL; \
3613 echo $baserev $patchlevel | \
3614 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3616 version=`LC_ALL=C; export LC_ALL; \
3617 echo $baserev $patchlevel $subversion | \
3618 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3621 : determine installation style
3622 : For now, try to deduce it from prefix unless it is already set.
3623 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3624 case "$installstyle" in
3625 '') case "$prefix" in
3626 *perl*) dflt='lib';;
3627 *) dflt='lib/perl5' ;;
3630 *) dflt='lib/perl5' ;;
3632 : Probably not worth prompting for this since we prompt for all
3633 : the directories individually, and the prompt would be too long and
3637 : determine where private library files go
3638 : Usual default is /usr/local/lib/perl5/$version.
3639 : Also allow things like /opt/perl/lib/$version, since
3640 : /opt/perl/lib/perl5... would be redundant.
3641 : The default "style" setting is made in installstyle.U
3642 case "$installstyle" in
3643 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3644 *) set dflt privlib lib/$version ;;
3649 There are some auxiliary files for $package that need to be put into a
3650 private library directory that is accessible by everyone.
3654 rp='Pathname where the private library files will reside?'
3657 privlibexp="$ansexp"
3658 : Change installation prefix, if necessary.
3659 if $test X"$prefix" != X"$installprefix"; then
3660 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3662 installprivlib="$privlibexp"
3665 : set the prefixup variable, to restore leading tilda escape
3666 prefixup='case "$prefixexp" in
3668 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3671 : determine where public architecture dependent libraries go
3674 : privlib default is /usr/local/lib/$package/$version
3675 : archlib default is /usr/local/lib/$package/$version/$archname
3676 : privlib may have an optional trailing /share.
3677 tdflt=`echo $privlib | $sed 's,/share$,,'`
3678 tdflt=$tdflt/$archname
3687 $spackage contains architecture-dependent library files. If you are
3688 sharing libraries in a heterogeneous environment, you might store
3689 these files in a separate location. Otherwise, you can just include
3690 them with the rest of the public library files.
3694 rp='Where do you want to put the public architecture-dependent libraries?'
3697 archlibexp="$ansexp"
3698 if $test X"$archlib" = X"$privlib"; then
3703 : Change installation prefix, if necessary.
3704 if $test X"$prefix" != X"$installprefix"; then
3705 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3707 installarchlib="$archlibexp"
3711 : Binary compatibility with 5.005 is not possible for builds
3712 : with advanced features
3713 case "$usethreads$usemultiplicity" in
3715 bincompat5005="$undef"
3716 d_bincompat5005="$undef"
3720 Perl 5.006 can be compiled for binary compatibility with 5.005.
3721 If you decide to do so, you will be able to continue using most
3722 of the extensions that were compiled for Perl 5.005.
3725 case "$bincompat5005$d_bincompat5005" in
3726 *"$undef"*) dflt=n ;;
3729 rp='Binary compatibility with Perl 5.005?'
3732 y*) val="$define" ;;
3737 case "$d_bincompat5005" in
3739 bincompat5005="$define"
3741 *) bincompat5005="$undef"
3742 d_bincompat5005="$undef"
3749 : see if setuid scripts can be secure
3752 Some kernels have a bug that prevents setuid #! scripts from being
3753 secure. Some sites have disabled setuid #! scripts because of this.
3755 First let's decide if your kernel supports secure setuid #! scripts.
3756 (If setuid #! scripts would be secure but have been disabled anyway,
3757 don't say that they are secure if asked.)
3762 if $test -d /dev/fd; then
3763 echo "#!$ls" >reflect
3764 chmod +x,u+s reflect
3765 ./reflect >flect 2>&1
3766 if $contains "/dev/fd" flect >/dev/null; then
3767 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3771 If you are not sure if they are secure, I can check but I'll need a
3772 username and password different from the one you are using right now.
3773 If you don't have such a username or don't want me to test, simply
3777 rp='Other username to test security of setuid scripts with?'
3782 case "$d_suidsafe" in
3783 '') echo "I'll assume setuid scripts are *not* secure." >&4
3786 echo "Well, the $hint value is *not* secure." >&4
3788 *) echo "Well, the $hint value *is* secure." >&4
3793 $rm -f reflect flect
3794 echo "#!$ls" >reflect
3795 chmod +x,u+s reflect
3798 echo '"su" will (probably) prompt you for '"$ans's password."
3799 su $ans -c './reflect >flect'
3800 if $contains "/dev/fd" flect >/dev/null; then
3801 echo "Okay, it looks like setuid scripts are secure." >&4
3804 echo "I don't think setuid scripts are secure." >&4
3809 rp='Does your kernel have *secure* setuid scripts?'
3812 [yY]*) val="$define";;
3817 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3818 echo "(That's for file descriptors, not floppy disks.)"
3824 $rm -f reflect flect
3826 : now see if they want to do setuid emulation
3829 case "$d_suidsafe" in
3832 echo "No need to emulate SUID scripts since they are secure here." >& 4
3836 Some systems have disabled setuid scripts, especially systems where
3837 setuid scripts cannot be secure. On systems where setuid scripts have
3838 been disabled, the setuid/setgid bits on scripts are currently
3839 useless. It is possible for $package to detect those bits and emulate
3840 setuid/setgid in a secure fashion. This emulation will only work if
3841 setuid scripts have been disabled in your kernel.
3845 "$define") dflt=y ;;
3848 rp="Do you want to do setuid/setgid emulation?"
3851 [yY]*) val="$define";;
3859 : What should the include directory be ?
3861 $echo $n "Hmm... $c"
3865 if $test -f /bin/mips && /bin/mips; then
3866 echo "Looks like a MIPS system..."
3867 $cat >usr.c <<'EOCP'
3868 #ifdef SYSTYPE_BSD43
3872 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3873 dflt='/bsd43/usr/include'
3877 mips_type='System V'
3879 $rm -f usr.c usr.out
3880 echo "and you're compiling with the $mips_type compiler and libraries."
3884 echo "Doesn't look like a MIPS system."
3894 case "$xxx_prompt" in
3897 rp='Where are the include files you want to use?'
3905 : see how we invoke the C preprocessor
3907 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3908 cat <<'EOT' >testcpp.c
3914 if test ! -f cppstdin; then
3915 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3916 # AIX cc -E doesn't show the absolute headerfile
3917 # locations but we'll cheat by using the -M flag.
3918 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
3920 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3923 echo "Keeping your $hint cppstdin wrapper."
3926 wrapper=`pwd`/cppstdin
3930 if $test "X$cppstdin" != "X" && \
3931 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3932 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3934 echo "You used to use $cppstdin $cppminus so we'll use that again."
3936 '') echo "But let's see if we can live without a wrapper..." ;;
3938 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3939 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3941 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3944 echo "(However, $cpprun $cpplast does not work, let's see...)"
3952 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3959 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3960 $cc -E <testcpp.c >testcpp.out 2>&1; \
3961 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3962 echo "Yup, it does."
3965 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3966 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3967 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3968 echo "Yup, it does."
3971 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3972 $cc -P <testcpp.c >testcpp.out 2>&1; \
3973 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3974 echo "Yipee, that works!"
3977 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3978 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3979 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3980 echo "At long last!"
3983 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3984 $cpp <testcpp.c >testcpp.out 2>&1; \
3985 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3989 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3990 $cpp - <testcpp.c >testcpp.out 2>&1; \
3991 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3992 echo "Hooray, it works! I was beginning to wonder."
3995 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3996 $wrapper <testcpp.c >testcpp.out 2>&1; \
3997 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4003 rp="No dice. I can't find a C preprocessor. Name one:"
4007 $x_cpp <testcpp.c >testcpp.out 2>&1
4008 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4009 echo "OK, that will do." >&4
4011 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4026 echo "Perhaps can we force $cc -E using a wrapper..."
4027 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4028 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4034 echo "Nope, we'll have to live without it..."
4048 "$wrapper"|'cppstdin') ;;
4049 *) $rm -f $wrapper;;
4051 $rm -f testcpp.c testcpp.out
4053 : Set private lib path
4056 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4061 '') dlist="$loclibpth $plibpth $glibpth";;
4062 *) dlist="$libpth";;
4065 : Now check and see which directories actually exist, avoiding duplicates
4069 if $test -d $xxx; then
4072 *) libpth="$libpth $xxx";;
4078 Some systems have incompatible or broken versions of libraries. Among
4079 the directories listed in the question below, please remove any you
4080 know not to be holding relevant libraries, and add any that are needed.
4081 Say "none" for none.
4092 rp="Directories to use for library searches?"
4099 : compute shared library extension
4102 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4112 On some systems, shared libraries may be available. Answer 'none' if
4113 you want to suppress searching of shared libraries for the remaining
4114 of this configuration.
4117 rp='What is the file extension used for shared libraries?'
4121 : Define several unixisms.
4122 : Hints files or command line option can be used to override them.
4123 : The convoluted testing is in case hints files set either the old
4126 '') case "$exe_ext" in
4128 *) _exe="$exe_ext" ;;
4133 '') case "$lib_ext" in
4140 '') case "$obj_ext" in
4147 '') case "$path_sep" in
4158 : Which makefile gets called first. This is used by make depend.
4159 case "$firstmakefile" in
4160 '') firstmakefile='makefile';;
4165 Perl can be built to use the SOCKS proxy protocol library. To do so,
4166 Configure must be run with -Dusesocks.
4168 Normally you do not need this and you should answer no.
4172 $define|true|[yY]*) dflt='y';;
4175 rp='Build Perl for SOCKS?'
4178 y|Y) val="$define" ;;
4184 : Looking for optional libraries
4186 echo "Checking for optional libraries..." >&4
4191 case "$libswanted" in
4192 '') libswanted='c_s';;
4196 libswanted="$libswanted socks5 socks5_sh"
4199 for thislib in $libswanted; do
4201 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4202 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4203 echo "Found -l$thislib (shared)."
4206 *) dflt="$dflt -l$thislib";;
4208 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4209 echo "Found -l$thislib (shared)."
4212 *) dflt="$dflt -l$thislib";;
4214 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4215 echo "Found -l$thislib."
4218 *) dflt="$dflt -l$thislib";;
4220 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4221 echo "Found -l$thislib."
4224 *) dflt="$dflt -l$thislib";;
4226 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4227 echo "Found -l${thislib}_s."
4230 *) dflt="$dflt -l${thislib}_s";;
4232 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4233 echo "Found -l$thislib."
4236 *) dflt="$dflt -l$thislib";;
4239 echo "No -l$thislib."
4250 ' '|'') dflt='none';;
4255 In order to compile $package on your machine, a number of libraries
4256 are usually needed. Include any other special libraries here as well.
4257 Say "none" for none. The default list is almost always right.
4261 rp="What libraries to use?"
4268 : determine optimization, if desired, or use for debug flag also
4270 ' '|$undef) dflt='none';;
4272 *) dflt="$optimize";;
4276 By default, $package compiles with the -O flag to use the optimizer.
4277 Alternately, you might want to use the symbolic debugger, which uses
4278 the -g flag (on traditional Unix systems). Either flag can be
4279 specified here. To use neither flag, specify the word "none".
4282 rp="What optimizer/debugger flag should be used?"
4286 'none') optimize=" ";;
4290 : We will not override a previous value, but we might want to
4291 : augment a hint file
4293 default|recommended)
4294 case "$gccversion" in
4295 1*) dflt='-fpcc-struct-return' ;;
4298 *-g*) dflt="$dflt -DDEBUGGING";;
4300 case "$gccversion" in
4301 2*) if test -d /etc/conf/kconfig.d &&
4302 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4308 case "$gccversion" in
4312 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4313 echo 'int main(void) { return 0; }' > gcctest.c
4314 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4315 echo "Yes, it does." 2>&1
4318 echo "Leaving current flags $ccflags alone." 2>&1
4320 *) dflt="$dflt -fno-strict-aliasing" ;;
4323 echo "Nope, it doesn't, but that's ok." 2>&1
4330 case "$mips_type" in
4331 *BSD*|'') inclwanted="$locincpth $usrinc";;
4332 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4334 for thisincl in $inclwanted; do
4335 if $test -d $thisincl; then
4336 if $test x$thisincl != x$usrinc; then
4339 *) dflt="$dflt -I$thisincl";;
4345 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4347 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4355 *) dflt="$dflt -D$2";;
4359 set signal.h LANGUAGE_C; eval $inctest
4363 ccflags="$ccflags -DSOCKS"
4368 default|recommended) dflt="$ccflags $dflt" ;;
4369 *) dflt="$ccflags";;
4377 Your C compiler may want other flags. For this question you should include
4378 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4379 but you should NOT include libraries or ld flags like -lwhatever. If you
4380 want $package to honor its debug switch, you should include -DDEBUGGING here.
4381 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4383 To use no flags, specify the word "none".
4389 rp="Any additional cc flags?"
4396 : the following weeds options from ccflags that are of no interest to cpp
4398 case "$gccversion" in
4399 1*) cppflags="$cppflags -D__GNUC__"
4401 case "$mips_type" in
4403 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4409 echo "Let me guess what the preprocessor flags are..." >&4
4423 *) ftry="$previous $flag";;
4425 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4426 >cpp1.out 2>/dev/null && \
4427 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4428 >cpp2.out 2>/dev/null && \
4429 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4430 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4432 cppflags="$cppflags $ftry"
4442 *-*) echo "They appear to be: $cppflags";;
4444 $rm -f cpp.c cpp?.out
4448 : flags used in final linking phase
4450 '') if ./venix; then
4456 *-posix*) dflt="$dflt -posix" ;;
4459 *) dflt="$ldflags";;
4462 : Try to guess additional flags to pick up local libraries.
4463 for thislibdir in $libpth; do
4464 case " $loclibpth " in
4467 *"-L$thislibdir "*) ;;
4468 *) dflt="$dflt -L$thislibdir" ;;
4480 Your C linker may need flags. For this question you should
4481 include -L/whatever and any other flags used by the C linker, but you
4482 should NOT include libraries like -lwhatever.
4484 Make sure you include the appropriate -L/path flags if your C linker
4485 does not normally search all of the directories you specified above,
4488 To use no flags, specify the word "none".
4492 rp="Any additional ld flags (NOT including libraries)?"
4498 rmlist="$rmlist pdp11"
4502 echo "Checking your choice of C compiler and flags for coherency..." >&4
4503 $cat > try.c <<'EOF'
4505 int main() { printf("Ok\n"); exit(0); }
4507 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4509 $cat >try.msg <<'EOM'
4510 I've tried to compile and run the following simple program:
4513 $cat try.c >> try.msg
4515 $cat >> try.msg <<EOM
4522 and I got the following output:
4526 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4527 if sh -c './try' >>try.msg 2>&1; then
4531 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4534 cat >> try.msg <<'EOQS'
4535 If $libs contains -lsfio, and sfio is mis-configured, then it
4536 sometimes (apparently) runs and exits with a 0 status, but with no
4537 output! It may have to do with sfio's use of _exit vs. exit.
4540 rp="You have a big problem. Shall I abort Configure"
4547 echo "The program compiled OK, but exited with status $?." >>try.msg
4548 rp="You have a problem. Shall I abort Configure"
4552 echo "I can't compile the test program." >>try.msg
4553 rp="You have a BIG problem. Shall I abort Configure"
4559 case "$knowitall" in
4561 echo "(The supplied flags or libraries might be incorrect.)"
4569 *) echo "Ok. Stopping Configure." >&4
4574 n) echo "OK, that should do.";;
4576 $rm -f try try.* core
4578 : determine filename position in cpp output
4580 echo "Computing filename position in cpp output for #include directives..." >&4
4581 echo '#include <stdio.h>' > foo.c
4584 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4585 $grep '^[ ]*#.*stdio\.h' | \
4586 while read cline; do
4589 while $test \$# -gt 0; do
4590 if $test -r \`echo \$1 | $tr -d '"'\`; then
4595 pos=\`expr \$pos + 1\`
4607 *) pos="${fieldn}th";;
4609 echo "Your cpp writes the filename in the $pos field of the line."
4611 : locate header file
4616 for usrincdir in $usrinc
4618 if test -f \$usrincdir/\$wanted; then
4619 echo "\$usrincdir/\$wanted"
4623 awkprg='{ print \$$fieldn }'
4624 echo "#include <\$wanted>" > foo\$\$.c
4625 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4626 $grep "^[ ]*#.*\$wanted" | \
4627 while read cline; do
4628 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4630 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4631 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4636 # status = 0: grep returned 0 lines, case statement not executed
4637 # status = 1: headerfile found
4638 # status = 2: while loop executed, no headerfile found
4642 if test \$status -eq 1; then
4649 : define an alternate in-header-list? function
4650 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4651 cont=true; xxf="echo \"<\$1> found.\" >&4";
4652 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4653 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4655 case $# in 4) instead=instead;; *) instead="at last";; esac;
4656 while $test "$cont"; do
4658 var=$2; eval "was=\$$2";
4659 if $test "$xxx" && $test -r "$xxx";
4661 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4664 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4665 set $yyy; shift; shift; yyy=$@;
4666 case $# in 0) cont="";;
4667 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4668 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4669 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4670 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4674 do set $yyy; var=$2; eval "was=\$$2";
4675 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4676 set $yyy; shift; shift; yyy=$@;
4679 : see if this is a malloc.h system
4680 set malloc.h i_malloc
4683 : see if stdlib is available
4684 set stdlib.h i_stdlib
4687 : determine which malloc to compile in
4689 case "$usemymalloc" in
4690 ''|[yY]*|true|$define) dflt='y' ;;
4693 rp="Do you wish to attempt to use the malloc that comes with $package?"
4699 mallocsrc='malloc.c'
4700 mallocobj="malloc$_o"
4701 d_mymalloc="$define"
4704 : Remove malloc from list of libraries to use
4705 echo "Removing unneeded -lmalloc from library list" >&4
4706 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4709 echo "libs = $libs" >&4
4721 : compute the return types of malloc and free
4723 $cat >malloc.c <<END
4727 #include <sys/types.h>
4741 case "$malloctype" in
4743 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4750 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4754 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4761 echo "Your system uses $freetype free(), it would seem." >&4
4765 The installation process will also create a directory for
4766 vendor-supplied add-ons. Vendors who supply perl with their system
4767 may find it convenient to place all vendor-supplied files in this
4768 directory rather than in the main distribution directory. This will
4769 ease upgrades between binary-compatible maintenance versions of perl.
4771 Of course you may also use these directories in whatever way you see
4772 fit. For example, you might use them to access modules shared over a
4773 company-wide network.
4775 The default answer should be fine for most people.
4776 This causes further questions about vendor add-ons to be skipped
4777 and no vendor-specific directories will be configured for perl.
4780 rp='Do you want to configure vendor-specific add-on directories?'
4781 case "$usevendorprefix" in
4782 define|true|[yY]*) dflt=y ;;
4788 rp='Installation prefix to use for vendor-supplied add-ons?'
4789 case "$vendorprefix" in
4791 *) dflt=$vendorprefix ;;
4795 case "$vendorprefix" in
4799 *) oldvendorprefix="$prefix";;
4803 usevendorprefix="$define"
4805 vendorprefixexp="$ansexp"
4807 *) usevendorprefix="$undef"
4813 case "$vendorprefix" in
4814 '') d_vendorlib="$undef"
4818 *) d_vendorlib="$define"
4819 : determine where vendor-supplied modules go.
4820 : Usual default is /usr/local/lib/perl5/vendor_perl
4821 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4822 case "$installstyle" in
4823 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4824 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4827 rp='Pathname for the vendor-supplied library files?'
4830 vendorlibexp="$ansexp"
4831 : Change installation prefix, if necessary.
4832 if $test X"$prefix" != X"$installprefix"; then
4833 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4835 installvendorlib="$vendorlibexp"
4840 : Cruising for prototypes
4842 echo "Checking out function prototypes..." >&4
4843 $cat >prototype.c <<'EOCP'
4844 int main(int argc, char *argv[]) {
4847 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4848 echo "Your C compiler appears to support function prototypes."
4851 echo "Your C compiler doesn't seem to understand function prototypes."
4858 case "$prototype" in
4860 *) ansi2knr='ansi2knr'
4865 This version of $package can only be compiled by a compiler that
4866 understands function prototypes. Unfortunately, your C compiler
4868 doesn't seem to understand them. Sorry about that.
4870 If GNU cc is available for your system, perhaps you could try that instead.
4872 Eventually, we hope to support building Perl with pre-ANSI compilers.
4873 If you would like to help in that effort, please contact <perlbug@perl.org>.
4875 Aborting Configure now.
4881 : determine where public executables go
4886 rp='Pathname where the public executables will reside?'
4888 if $test "X$ansexp" != "X$binexp"; then
4893 : Change installation prefix, if necessary.
4894 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4895 if $test X"$prefix" != X"$installprefix"; then
4896 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4898 installbin="$binexp"
4901 : determine whether to install perl also as /usr/bin/perl
4904 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4906 Many scripts expect to perl to be installed as /usr/bin/perl.
4907 I can install the perl you are about to compile also as /usr/bin/perl
4908 (in addition to $installbin/perl).
4910 case "$installusrbinperl" in
4911 "$undef"|[nN]*) dflt='n';;
4914 rp="Do you want to install perl as /usr/bin/perl?"
4917 [yY]*) val="$define";;
4923 set installusrbinperl
4926 : define a shorthand compile call
4930 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4931 : define a shorthand compile call for compilations that should be ok.
4935 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4938 echo "Checking for GNU C Library..." >&4
4939 cat >gnulibc.c <<EOM
4951 if eval $compile_ok && ./gnulibc; then
4953 echo "You are using the GNU C Library"
4956 echo "You are not using the GNU C Library"
4962 : see if nm is to be used to determine whether a symbol is defined or not
4966 case "$d_gnulibc" in
4969 echo "nm probably won't work on the GNU C Library." >&4
4975 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4977 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4978 echo "'nm' won't be sufficient on this sytem." >&4
4984 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4985 if $test $dflt -gt 20; then
4995 true|$define) dflt=y;;
5002 I can use $nm to extract the symbols from your C libraries. This
5003 is a time consuming task which may generate huge output on the disk (up
5004 to 3 megabytes) but that should make the symbols extraction faster. The
5005 alternative is to skip the 'nm' extraction part and to compile a small
5006 test program instead to determine whether each symbol is present. If
5007 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5008 this may be the best solution.
5010 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5013 rp="Shall I use $nm to extract C symbols from the libraries?"
5016 [Nn]*) usenm=false;;
5025 : nm options which may be necessary
5027 '') if $test -f /mach_boot; then
5029 elif $test -d /usr/ccs/lib; then
5030 nm_opt='-p' # Solaris (and SunOS?)
5031 elif $test -f /dgux; then
5033 elif $test -f /lib64/rld; then
5034 nm_opt='-p' # 64-bit Irix
5040 : nm options which may be necessary for shared libraries but illegal
5041 : for archive libraries. Thank you, Linux.
5042 case "$nm_so_opt" in
5043 '') case "$myuname" in
5045 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5046 nm_so_opt='--dynamic'
5055 : get list of predefined functions in a handy place
5060 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5067 *) for thislib in $libs; do
5070 : Handle C library specially below.
5073 thislib=`echo $thislib | $sed -e 's/^-l//'`
5074 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5076 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5078 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5080 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5082 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5084 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5086 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5091 libnames="$libnames $try"
5093 *) libnames="$libnames $thislib" ;;
5102 for xxx in $libpth; do
5103 $test -r $1 || set $xxx/libc.$so
5104 : The messy sed command sorts on library version numbers.
5106 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5107 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5109 s/[0-9][0-9]*/0000&/g
5110 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5113 sort | $sed -e 's/^.* //'`
5116 $test -r $1 || set /usr/ccs/lib/libc.$so
5117 $test -r $1 || set /lib/libsys_s$_a
5123 if $test -r "$1"; then
5124 echo "Your (shared) C library seems to be in $1."
5126 elif $test -r /lib/libc && $test -r /lib/clib; then
5127 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5129 libc='/lib/clib /lib/libc'
5130 if $test -r /lib/syslib; then
5131 echo "(Your math library is in /lib/syslib.)"
5132 libc="$libc /lib/syslib"
5134 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5135 echo "Your C library seems to be in $libc, as you said before."
5136 elif $test -r $incpath/usr/lib/libc$_a; then
5137 libc=$incpath/usr/lib/libc$_a;
5138 echo "Your C library seems to be in $libc. That's fine."
5139 elif $test -r /lib/libc$_a; then
5141 echo "Your C library seems to be in $libc. You're normal."
5143 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5145 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5146 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5147 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5149 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5151 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5154 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5156 if $test -r "$tans"; then
5157 echo "Your C library seems to be in $tans, of all places."
5163 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5167 If the guess above is wrong (which it might be if you're using a strange
5168 compiler, or your machine supports multiple models), you can override it here.
5173 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5175 I can't seem to find your C library. I've looked in the following places:
5178 $sed 's/^/ /' libpath
5181 None of these seems to contain your C library. I need to get its name...
5186 rp='Where is your C library?'
5191 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5192 set X `cat libnames`
5195 case $# in 1) xxx=file; esac
5196 echo "Extracting names from the following $xxx for later perusal:" >&4
5198 $sed 's/^/ /' libnames >&4
5200 $echo $n "This may take a while...$c" >&4
5204 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5205 *) $nm $nm_opt $file 2>/dev/null;;
5210 $grep fprintf libc.tmp > libc.ptf
5211 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5212 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5214 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5216 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5218 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5220 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5222 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5224 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5226 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5228 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5230 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5232 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5234 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5236 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5238 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5239 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5241 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5243 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5245 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5247 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5249 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5251 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5253 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5255 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5257 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5259 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5261 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5263 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5265 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5267 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5269 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5272 $nm -p $* 2>/dev/null >libc.tmp
5273 $grep fprintf libc.tmp > libc.ptf
5274 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5275 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5281 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5283 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5284 for thisname in $libnames $libc; do
5285 $ar t $thisname >>libc.tmp
5287 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5289 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5290 # Repeat libc to extract forwarders to DLL entries too
5291 for thisname in $libnames $libc; do
5292 $ar tv $thisname >>libc.tmp
5293 # Revision 50 of EMX has bug in $ar.
5294 # it will not extract forwarders to DLL entries
5295 # Use emximp which will extract exactly them.
5296 emximp -o tmp.imp $thisname \
5298 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5299 < tmp.imp >>libc.tmp
5302 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5305 echo "$ar didn't seem to work right." >&4
5306 echo "Maybe this is a Cray...trying bld instead..." >&4
5307 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5309 for thisname in $libnames; do
5311 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5312 $ar t $thisname >>libc.tmp
5316 echo "That didn't work either. Giving up." >&4
5323 if $test -f /lib/syscalls.exp; then
5325 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5326 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5330 $rm -f libnames libpath
5332 : see if dld is available
5336 : is a C symbol defined?
5339 -v) tf=libc.tmp; tc=""; tdc="";;
5340 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5341 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5344 case "$reuseval-$4" in
5346 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5352 if $contains $tlook $tf >/dev/null 2>&1;
5357 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5358 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5366 $define) tval=true;;
5372 : define an is-in-libc? function
5373 inlibc='echo " "; td=$define; tu=$undef;
5374 sym=$1; var=$2; eval "was=\$$2";
5376 case "$reuseval$was" in
5386 echo "$sym() found." >&4;
5387 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5389 echo "$sym() NOT found." >&4;
5390 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5394 $define) echo "$sym() found." >&4;;
5395 *) echo "$sym() NOT found." >&4;;
5399 : see if dlopen exists
5406 : determine which dynamic loading, if any, to compile in
5408 dldir="ext/DynaLoader"
5421 $define) dflt='y' ;;
5424 $define) dflt='y' ;;
5426 : Does a dl_xxx.xs file exist for this operating system
5427 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5430 rp="Do you wish to use dynamic loading?"
5437 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5438 dflt="$dldir/dl_${osname}.xs"
5439 elif $test "$d_dlopen" = "$define" ; then
5440 dflt="$dldir/dl_dlopen.xs"
5441 elif $test "$i_dld" = "$define" ; then
5442 dflt="$dldir/dl_dld.xs"
5447 *) dflt="$dldir/$dlsrc"
5450 echo "The following dynamic loading files are available:"
5451 : Can not go over to $dldir because getfile has path hard-coded in.
5452 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5453 rp="Source file to use for dynamic loading"
5459 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5463 Some systems may require passing special flags to $cc -c to
5464 compile modules that will be used to create a shared library.
5465 To use no flags, say "none".
5468 case "$cccdlflags" in
5469 '') case "$gccversion" in
5470 '') case "$osname" in
5472 next) dflt='none' ;;
5473 irix*) dflt='-KPIC' ;;
5474 svr4*|esix*|solaris) dflt='-KPIC' ;;
5475 sunos) dflt='-pic' ;;
5479 *) case "$osname" in
5480 svr4*|esix*|solaris) dflt='-fPIC' ;;
5485 *) dflt="$cccdlflags" ;;
5487 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5490 none) cccdlflags=' ' ;;
5491 *) cccdlflags="$ans" ;;
5496 Some systems use ld to create libraries that can be dynamically loaded,
5497 while other systems (such as those using ELF) use $cc.
5501 '') $cat >try.c <<'EOM'
5502 /* Test for whether ELF binaries are produced */
5507 int i = open("a.out",O_RDONLY);
5510 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5511 exit(0); /* succeed (yes, it's ELF) */
5516 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5518 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5522 echo "I'll use ld to build dynamic libraries."
5531 rp="What command should be used to create dynamic libraries?"
5537 Some systems may require passing special flags to $ld to create a
5538 library that can be dynamically loaded. If your ld flags include
5539 -L/other/path options to locate libraries outside your loader's normal
5540 search path, you may need to specify those -L options here as well. To
5541 use no flags, say "none".
5544 case "$lddlflags" in
5545 '') case "$osname" in
5546 beos) dflt='-nostart' ;;
5548 linux|irix*) dflt='-shared' ;;
5549 next) dflt='none' ;;
5550 solaris) dflt='-G' ;;
5551 sunos) dflt='-assert nodefinitions' ;;
5552 svr4*|esix*) dflt="-G $ldflags" ;;
5556 *) dflt="$lddlflags" ;;
5559 : Try to guess additional flags to pick up local libraries.
5560 : Be careful not to append to a plain 'none'
5564 for thisflag in $ldflags; do
5569 *) dflt="$dflt $thisflag" ;;
5576 ''|' ') dflt='none' ;;
5579 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5582 none) lddlflags=' ' ;;
5583 *) lddlflags="$ans" ;;
5588 Some systems may require passing special flags to $cc to indicate that
5589 the resulting executable will use dynamic linking. To use no flags,
5593 case "$ccdlflags" in
5594 '') case "$osname" in
5595 hpux) dflt='-Wl,-E' ;;
5596 linux) dflt='-rdynamic' ;;
5597 next) dflt='none' ;;
5598 sunos) dflt='none' ;;
5602 *) dflt="$ccdlflags" ;;
5604 rp="Any special flags to pass to $cc to use dynamic loading?"
5607 none) ccdlflags=' ' ;;
5608 *) ccdlflags="$ans" ;;
5622 # No dynamic loading being used, so don't bother even to prompt.
5625 *) case "$useshrplib" in
5626 '') case "$osname" in
5627 svr4*|dgux|dynixptx|esix|powerux|beos)
5629 also='Building a shared libperl is required for dynamic loading to work on your system.'
5634 also='Building a shared libperl is needed for MAB support.'
5652 The perl executable is normally obtained by linking perlmain.c with
5653 libperl${_a}, any static extensions (usually just DynaLoader), and
5654 any other libraries needed on this system (such as -lm, etc.). Since
5655 your system supports dynamic loading, it is probably possible to build
5656 a shared libperl.$so. If you will have more than one executable linked
5657 to libperl.$so, this will significantly reduce the size of each
5658 executable, but it may have a noticeable affect on performance. The
5659 default is probably sensible for your system.
5663 rp="Build a shared libperl.$so (y/n)"
5667 useshrplib='true' ;;
5668 *) useshrplib='false' ;;
5673 case "$useshrplib" in
5677 # Figure out a good name for libperl.so. Since it gets stored in
5678 # a version-specific architecture-dependent library, the version
5679 # number isn't really that important, except for making cc/ld happy.
5681 # A name such as libperl.so.3.1
5682 majmin="libperl.$so.$patchlevel.$subversion"
5683 # A name such as libperl.so.301
5684 majonly=`echo $patchlevel $subversion |
5685 $awk '{printf "%d%02d", $1, $2}'`
5686 majonly=libperl.$so.$majonly
5687 # I'd prefer to keep the os-specific stuff here to a minimum, and
5688 # rely on figuring it out from the naming of libc.
5689 case "${osname}${osvers}" in
5692 # XXX How handle the --version stuff for MAB?
5694 linux*) # ld won't link with a bare -lperl otherwise.
5697 *) # Try to guess based on whether libc has major.minor.
5699 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5700 *libc.$so.[0-9]*) dflt=$majonly ;;
5701 *) dflt=libperl.$so ;;
5711 I need to select a good name for the shared libperl. If your system uses
5712 library names with major and minor numbers, then you might want something
5713 like $majmin. Alternatively, if your system uses a single version
5714 number for shared libraries, then you might want to use $majonly.
5715 Or, your system might be quite happy with a simple libperl.$so.
5717 Since the shared libperl will get installed into a version-specific
5718 architecture-dependent directory, the version number of the shared perl
5719 library probably isn't important, so the default should be o.k.
5722 rp='What name do you want to give to the shared libperl?'
5725 echo "Ok, I'll use $libperl"
5728 libperl="libperl${_a}"
5732 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5736 WARNING: Use of the shrpdir variable for the installation location of
5737 the shared $libperl is not supported. It was never documented and
5738 will not work in this version. Let me (perlbug@perl.com)
5739 know of any problems this may cause.
5745 But your current setting of $shrpdir is
5746 the default anyway, so it's harmless.
5751 Further, your current attempted setting of $shrpdir
5752 conflicts with the value of $archlibexp/CORE
5753 that installperl will use.
5760 # How will the perl executable find the installed shared $libperl?
5761 # Add $xxx to ccdlflags.
5762 # If we can't figure out a command-line option, use $shrpenv to
5763 # set env LD_RUN_PATH. The main perl makefile uses this.
5764 shrpdir=$archlibexp/CORE
5767 if "$useshrplib"; then
5770 # We'll set it in Makefile.SH...
5776 xxx="-Wl,-R$shrpdir"
5778 linux|irix*|dec_osf)
5779 xxx="-Wl,-rpath,$shrpdir"
5782 # next doesn't like the default...
5785 # beos doesn't like the default, either.
5788 # hpux doesn't like the default, either.
5789 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5792 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5798 # Only add $xxx if it isn't already in ccdlflags.
5799 case " $ccdlflags " in
5801 *) ccdlflags="$ccdlflags $xxx"
5804 Adding $xxx to the flags
5805 passed to $ld so that the perl executable will find the
5806 installed shared $libperl.
5814 # Fix ccdlflags in AIX for building external extensions.
5815 # (For building Perl itself bare -bE:perl.exp is needed,
5816 # Makefile.SH takes care of this.)
5818 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5820 # Respect a hint or command-line value.
5822 '') shrpenv="$tmp_shrpenv" ;;
5824 case "$ldlibpthname" in
5825 '') ldlibpthname=LD_LIBRARY_PATH ;;
5826 none) ldlibpthname='' ;;
5829 : determine where manual pages go
5830 set man1dir man1dir none
5834 $spackage has manual pages available in source form.
5838 echo "However, you don't have nroff, so they're probably useless to you."
5840 '') man1dir="none";;
5843 echo "If you don't want the manual sources installed, answer 'none'."
5848 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5849 lookpath="$lookpath $prefixexp/man/p_man/man1"
5850 lookpath="$lookpath $prefixexp/man/u_man/man1"
5851 lookpath="$lookpath $prefixexp/man/man.1"
5853 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5854 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5864 rp="Where do the main $spackage manual pages (source) go?"
5866 if $test "X$man1direxp" != "X$ansexp"; then
5870 man1direxp="$ansexp"
5876 : Change installation prefix, if necessary.
5877 if $test X"$prefix" != X"$installprefix"; then
5878 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5880 installman1dir="$man1direxp"
5883 : What suffix to use on installed man pages
5890 rp="What suffix should be used for the main $spackage man pages?"
5892 '') case "$man1dir" in
5906 *) dflt="$man1ext";;
5913 : see if we can have long filenames
5915 rmlist="$rmlist /tmp/cf$$"
5916 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5917 first=123456789abcdef
5918 second=/tmp/cf$$/$first
5919 $rm -f $first $second
5920 if (echo hi >$first) 2>/dev/null; then
5921 if $test -f 123456789abcde; then
5922 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5925 if (echo hi >$second) 2>/dev/null; then
5926 if $test -f /tmp/cf$$/123456789abcde; then
5928 That's peculiar... You can have filenames longer than 14 characters, but only
5929 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5930 I shall consider your system cannot support long filenames at all.
5934 echo 'You can have filenames longer than 14 characters.' >&4
5939 How confusing! Some of your filesystems are sane enough to allow filenames
5940 longer than 14 characters but some others like /tmp can't even think about them.
5941 So, for now on, I shall assume your kernel does not allow them at all.
5948 You can't have filenames longer than 14 chars. You can't even think about them!
5954 $rm -rf /tmp/cf$$ 123456789abcde*
5956 : determine where library module manual pages go
5957 set man3dir man3dir none
5961 $spackage has manual pages for many of the library modules.
5967 However, you don't have nroff, so they're probably useless to you.
5970 '') man3dir="none";;
5974 case "$d_flexfnam" in
5977 However, your system can't handle the long file names like File::Basename.3.
5980 '') man3dir="none";;
5984 echo "If you don't want the manual sources installed, answer 'none'."
5985 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5987 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5988 if $test -d "$privlib/man/man3"; then
5991 WARNING: Previous versions of perl installed man3 pages into
5992 $privlib/man/man3. This version will suggest a
5993 new default of $dflt.
5997 rp='Do you wish to preserve the old behavior?(y/n)'
6000 y*) dflt="$privlib/man/man3" ;;
6006 *) dflt="$man3dir" ;;
6010 rp="Where do the $package library man pages (source) go?"
6013 man3direxp="$ansexp"
6019 : Change installation prefix, if necessary.
6020 if $test X"$prefix" != X"$installprefix"; then
6021 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6023 installman3dir="$man3direxp"
6026 : What suffix to use on installed man pages
6032 rp="What suffix should be used for the $package library man pages?"
6034 '') case "$man3dir" in
6048 *) dflt="$man3ext";;
6055 : see if we have to deal with yellow pages, now NIS.
6056 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6057 if $test -f /usr/etc/nibindd; then
6059 echo "I'm fairly confident you're on a NeXT."
6061 rp='Do you get the hosts file via NetInfo?'
6070 y*) hostcat='nidump hosts .';;
6071 *) case "$hostcat" in
6072 nidump*) hostcat='';;
6082 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6090 rp='Are you getting the hosts file via yellow pages?'
6093 y*) hostcat='ypcat hosts';;
6094 *) hostcat='cat /etc/hosts';;
6100 '') hostcat='cat /etc/hosts';;
6103 '') groupcat='cat /etc/group';;
6106 '') passcat='cat /etc/passwd';;
6109 : now get the host name
6111 echo "Figuring out host name..." >&4
6112 case "$myhostname" in
6114 echo 'Maybe "hostname" will work...'
6115 if tans=`sh -c hostname 2>&1` ; then
6123 if $test "$cont"; then
6125 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6126 if tans=`cat /etc/systemid 2>&1` ; then
6128 phostname='cat /etc/systemid'
6129 echo "Whadyaknow. Xenix always was a bit strange..."
6132 elif $test -r /etc/systemid; then
6133 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6136 if $test "$cont"; then
6137 echo 'No, maybe "uuname -l" will work...'
6138 if tans=`sh -c 'uuname -l' 2>&1` ; then
6140 phostname='uuname -l'
6142 echo 'Strange. Maybe "uname -n" will work...'
6143 if tans=`sh -c 'uname -n' 2>&1` ; then
6145 phostname='uname -n'
6147 echo 'Oh well, maybe I can mine it out of whoami.h...'
6148 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6149 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6150 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6152 case "$myhostname" in
6153 '') echo "Does this machine have an identity crisis or something?"
6156 echo "Well, you said $myhostname before..."
6157 phostname='echo $myhostname';;
6163 : you do not want to know about this
6168 if $test "$myhostname" ; then
6170 rp='Your host name appears to be "'$myhostname'".'" Right?"
6178 : bad guess or no guess
6179 while $test "X$myhostname" = X ; do
6181 rp="Please type the (one word) name of your host:"
6186 : translate upper to lower if necessary
6187 case "$myhostname" in
6189 echo "(Normalizing case in your host name)"
6190 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6194 case "$myhostname" in
6196 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6197 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6198 echo "(Trimming domain name from host name--host name is now $myhostname)"
6200 *) case "$mydomain" in
6203 test "X$hostcat" = "Xypcat hosts" &&
6204 ypmatch "$myhostname" hosts 2>/dev/null |\
6205 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6208 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6209 /[ ]$myhostname[ . ]/p" > hosts
6212 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6213 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6214 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6215 hosts | $sort | $uniq | \
6216 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6217 case `$echo X$dflt` in
6218 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6221 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6226 tans=`./loc resolv.conf X /etc /usr/etc`
6227 if $test -f "$tans"; then
6228 echo "(Attempting domain name extraction from $tans)"
6229 dflt=.`$sed -n -e 's/ / /g' \
6230 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6231 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6233 .) dflt=.`$sed -n -e 's/ / /g' \
6234 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6235 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6242 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6243 dflt=.`sh -c domainname 2>/dev/null`
6246 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6251 .) echo "(Lost all hope -- silly guess then)"
6257 *) dflt="$mydomain";;
6261 rp="What is your domain name?"
6271 : translate upper to lower if necessary
6274 echo "(Normalizing case in your domain name)"
6275 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6279 : a little sanity check here
6280 case "$phostname" in
6283 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6284 $myhostname$mydomain|$myhostname) ;;
6286 case "$phostname" in
6288 echo "(That doesn't agree with your whoami.h file, by the way.)"
6291 echo "(That doesn't agree with your $phostname command, by the way.)"
6301 I need to get your e-mail address in Internet format if possible, i.e.
6302 something like user@host.domain. Please answer accurately since I have
6303 no easy means to double check it. The default value provided below
6304 is most probably close to the reality but may not be valid from outside
6305 your organization...
6309 while test "$cont"; do
6311 '') dflt="$cf_by@$myhostname$mydomain";;
6312 *) dflt="$cf_email";;
6314 rp='What is your e-mail address?'
6320 rp='Address does not look like an Internet one. Use it anyway?'
6336 If you or somebody else will be maintaining perl at your site, please
6337 fill in the correct e-mail address here so that they may be contacted
6338 if necessary. Currently, the "perlbug" program included with perl
6339 will send mail to this address in addition to perlbug@perl.com. You may
6340 enter "none" for no administrator.
6343 case "$perladmin" in
6344 '') dflt="$cf_email";;
6345 *) dflt="$perladmin";;
6347 rp='Perl administrator e-mail address'
6351 : figure out how to guarantee perl startup
6352 case "$startperl" in
6354 case "$sharpbang" in
6358 I can use the #! construct to start perl on your system. This will
6359 make startup of perl scripts faster, but may cause problems if you
6360 want to share those scripts and perl is not in a standard place
6361 ($binexp/perl) on all your platforms. The alternative is to force
6362 a shell by starting the script with a single ':' character.
6366 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6369 none) startperl=": # use perl";;
6370 *) startperl="#!$ans"
6371 if $test 30 -lt `echo "$ans" | wc -c`; then
6374 WARNING: Some systems limit the #! command to 32 characters.
6375 If you experience difficulty running Perl scripts with #!, try
6376 installing Perl in a directory with a shorter pathname.
6382 *) startperl=": # use perl"
6387 echo "I'll use $startperl to start perl scripts."
6389 : figure best path for perl in scripts
6392 perlpath="$binexp/perl"
6393 case "$startperl" in
6398 I will use the "eval 'exec'" idiom to start Perl on your system.
6399 I can use the full path of your Perl binary for this purpose, but
6400 doing so may cause problems if you want to share those scripts and
6401 Perl is not always in a standard place ($binexp/perl).
6405 rp="What path shall I use in \"eval 'exec'\"?"
6412 case "$startperl" in
6414 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6417 : determine where public executable scripts go
6418 set scriptdir scriptdir
6420 case "$scriptdir" in
6423 : guess some guesses
6424 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6425 $test -d /usr/share/bin && dflt=/usr/share/bin
6426 $test -d /usr/local/script && dflt=/usr/local/script
6427 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6428 $test -d $prefixexp/script && dflt=$prefixexp/script
6432 *) dflt="$scriptdir"
6437 Some installations have a separate directory just for executable scripts so
6438 that they can mount it across multiple architectures but keep the scripts in
6439 one spot. You might, for example, have a subdirectory of /usr/share for this.
6440 Or you might just lump your scripts in with all your other executables.
6444 rp='Where do you keep publicly executable scripts?'
6446 if $test "X$ansexp" != "X$scriptdirexp"; then
6450 scriptdirexp="$ansexp"
6451 : Change installation prefix, if necessary.
6452 if $test X"$prefix" != X"$installprefix"; then
6453 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6455 installscript="$scriptdirexp"
6460 After $package is installed, you may wish to install various
6461 add-on modules and utilities. Typically, these add-ons will
6462 be installed under $prefix with the rest
6463 of this package. However, you may wish to install such add-ons
6464 elsewhere under a different prefix.
6466 If you do not wish to put everything under a single prefix, that's
6467 ok. You will be prompted for the individual locations; this siteprefix
6468 is only used to suggest the defaults.
6470 The default should be fine for most people.
6474 rp='Installation prefix to use for add-on modules and utilities?'
6475 : XXX Here might be another good place for an installstyle setting.
6476 case "$siteprefix" in
6478 *) dflt=$siteprefix ;;
6482 case "$siteprefix" in
6487 *) oldsiteprefix="$prefix";;
6492 siteprefixexp="$ansexp"
6494 : determine where site specific libraries go.
6495 : Usual default is /usr/local/lib/perl5/site_perl
6496 : The default "style" setting is made in installstyle.U
6497 : XXX No longer works with Prefixit stuff.
6498 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6499 case "$installstyle" in
6500 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6501 *) dflt=$siteprefix/lib/site_$prog ;;
6505 The installation process will create a directory for
6506 site-specific extensions and modules. Most users find it convenient
6507 to place all site-specific files in this directory rather than in the
6508 main distribution directory.
6512 rp='Pathname for the site-specific library files?'
6515 sitelibexp="$ansexp"
6516 : Change installation prefix, if necessary.
6517 if $test X"$prefix" != X"$installprefix"; then
6518 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6520 installsitelib="$sitelibexp"
6523 : determine where site specific architecture-dependent libraries go.
6524 : sitelib default is /usr/local/lib/perl5/site_perl/
6525 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6526 : sitelib may have an optional trailing /share.
6527 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6528 tdflt="$tdflt/$apiversion/$archname"
6529 set sitearch sitearch none
6532 '') dflt="$tdflt" ;;
6533 *) dflt="$sitearch" ;;
6537 The installation process will also create a directory for
6538 architecture-dependent site-specific extensions and modules.
6542 rp='Pathname for the site-specific architecture-dependent library files?'
6545 sitearchexp="$ansexp"
6546 : Change installation prefix, if necessary.
6547 if $test X"$prefix" != X"$installprefix"; then
6548 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6550 installsitearch="$sitearchexp"
6553 : determine where add-on public executables go
6555 '') dflt=$siteprefix/bin ;;
6559 rp='Pathname where the add-on public executables should be installed?'
6562 sitebinexp="$ansexp"
6563 : Change installation prefix, if necessary.
6564 if $test X"$prefix" != X"$installprefix"; then
6565 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6567 installsitebin="$sitebinexp"
6572 Perl can be built to take advantage of long doubles which
6573 (if available) may give more accuracy and range for floating point
6574 numbers. To do so, Configure must be run with -Duselongdouble.
6576 If this doesn't make any sense to you, just accept the default 'n'.
6578 case "$uselongdouble" in
6579 $define|true|[yY]*) dflt='y';;
6582 rp='Try to use long doubles if available?'
6585 y|Y) val="$define" ;;
6591 case "$uselongdouble" in
6592 "$define"|true|[yY]*)
6593 : Look for a hint-file generated 'call-back-unit'. If the
6594 : user has specified that long doubles should be used,
6595 : we may need to set or change some other defaults.
6596 if $test -f uselongdouble.cbu; then
6597 echo "Your platform has some specific hints for long doubles, using them..."
6598 . ./uselongdouble.cbu
6601 (Your platform doesn't have any specific hints for long doubles.)
6609 Previous version of $package used the standard IO mechanisms as defined
6610 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6611 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6612 the default. This abstraction layer can use AT&T's sfio (if you already
6613 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6614 problems with some extension modules. Using PerlIO with stdio is safe,
6615 but it is slower than plain stdio and therefore is not the default.
6617 If this doesn't make any sense to you, just accept the default 'n'.
6619 case "$useperlio" in
6620 $define|true|[yY]*) dflt='y';;
6623 rp='Use the experimental PerlIO abstraction layer?'
6630 echo "Ok, doing things the stdio way"
6637 case "$vendorprefix" in
6638 '') d_vendorbin="$undef"
6642 *) d_vendorbin="$define"
6643 : determine where vendor-supplied executables go.
6644 dflt=$vendorprefix/bin
6646 rp='Pathname for the vendor-supplied executables directory?'
6649 vendorbinexp="$ansexp"
6650 : Change installation prefix, if necessary.
6651 if $test X"$prefix" != X"$installprefix"; then
6652 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
6654 installvendorbin="$vendorbinexp"
6659 : Check how to convert floats to strings.
6660 if test "X$d_Gconvert" = X; then
6662 echo "Checking for an efficient way to convert floats to strings."
6665 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6666 char *myname = "gconvert";
6669 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6670 char *myname = "gcvt";
6673 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6674 char *myname = "sprintf";
6680 checkit(expect, got)
6684 if (strcmp(expect, got)) {
6685 printf("%s oddity: Expected %s, got %s\n",
6686 myname, expect, got);
6696 /* This must be 1st test on (which?) platform */
6697 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6698 Gconvert(0.1, 8, 0, buf);
6699 checkit("0.1", buf);
6701 Gconvert(1.0, 8, 0, buf);
6704 Gconvert(0.0, 8, 0, buf);
6707 Gconvert(-1.0, 8, 0, buf);
6710 /* Some Linux gcvt's give 1.e+5 here. */
6711 Gconvert(100000.0, 8, 0, buf);
6712 checkit("100000", buf);
6714 /* Some Linux gcvt's give -1.e+5 here. */
6715 Gconvert(-100000.0, 8, 0, buf);
6716 checkit("-100000", buf);
6721 case "$d_Gconvert" in
6722 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6723 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6724 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6725 *) xxx_list='gconvert gcvt sprintf' ;;
6728 for xxx_convert in $xxx_list; do
6729 echo "Trying $xxx_convert"
6731 set try -DTRY_$xxx_convert
6732 if eval $compile; then
6733 echo "$xxx_convert" found. >&4
6735 echo "I'll use $xxx_convert to convert floats into a string." >&4
6738 echo "...But $xxx_convert didn't work as I expected."
6741 echo "$xxx_convert NOT found." >&4
6745 case "$xxx_convert" in
6746 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6747 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6748 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6752 : see if inttypes.h is available
6753 : we want a real compile instead of Inhdr because some systems
6754 : have an inttypes.h which includes non-existent headers
6757 #include <inttypes.h>
6759 static int32_t foo32 = 0x12345678;
6763 if eval $compile; then
6764 echo "<inttypes.h> found." >&4
6767 echo "<inttypes.h> NOT found." >&4
6775 case "$use64bits" in
6778 $echo $n "Checking to see if your system supports int64_t...$c" >&4
6780 #include <sys/types.h>
6781 #$i_inttypes I_INTTYPES
6783 #include <inttypes.h>
6785 int64_t foo() { int64_t x; x = 7; return x; }
6787 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6789 echo " Yup, it does." >&4
6792 echo " Nope, it doesn't." >&4
6803 : check for lengths of integral types
6807 echo "Checking to see how big your integers are..." >&4
6808 $cat >intsize.c <<'EOCP'
6812 printf("intsize=%d;\n", sizeof(int));
6813 printf("longsize=%d;\n", sizeof(long));
6814 printf("shortsize=%d;\n", sizeof(short));
6819 if eval $compile_ok && ./intsize > /dev/null; then
6821 echo "Your integers are $intsize bytes long."
6822 echo "Your long integers are $longsize bytes long."
6823 echo "Your short integers are $shortsize bytes long."
6827 Help! I can't compile and run the intsize test program: please enlighten me!
6828 (This is probably a misconfiguration in your system or libraries, and
6829 you really ought to fix it. Still, I'll try anyway.)
6833 rp="What is the size of an integer (in bytes)?"
6837 rp="What is the size of a long integer (in bytes)?"
6841 rp="What is the size of a short integer (in bytes)?"
6847 $rm -f intsize intsize.*
6849 : check for long long
6851 $echo $n "Checking to see if your system supports long long...$c" >&4
6852 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6853 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6855 echo " Yup, it does." >&4
6858 echo " Nope, it doesn't." >&4
6864 : check for length of long long
6865 case "${d_longlong}${longlongsize}" in
6868 $echo $n "Checking to see how big your long longs are...$c" >&4
6869 $cat >try.c <<'EOCP'
6873 printf("%d\n", sizeof(long long));
6877 if eval $compile_ok; then
6878 longlongsize=`./try`
6879 $echo " $longlongsize bytes." >&4
6883 echo "(I can't seem to compile the test program. Guessing...)"
6884 rp="What is the size of a long long (in bytes)?"
6888 if $test "X$longsize" = "X$longlongsize"; then
6889 echo "(That isn't any different from an ordinary long.)"
6897 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6899 echo "Checking how to print 64-bit integers..." >&4
6901 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6903 $cat >try.c <<'EOCP'
6904 #include <sys/types.h>
6907 int q = 12345678901;
6912 if eval $compile; then
6916 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6917 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6918 echo "We will use %d."
6924 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6926 $cat >try.c <<'EOCP'
6927 #include <sys/types.h>
6930 long q = 12345678901;
6935 if eval $compile; then
6939 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6940 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6941 echo "We will use %ld."
6947 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6949 $cat >try.c <<'EOCP'
6950 #include <sys/types.h>
6951 #include <inttypes.h>
6954 int64_t q = 12345678901;
6955 printf("%" PRId64 "\n", q);
6959 if eval $compile; then
6963 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6964 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6965 echo "We will use the C9X style."
6971 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6973 $cat >try.c <<'EOCP'
6974 #include <sys/types.h>
6977 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6978 printf("%lld\n", q);
6982 if eval $compile; then
6986 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6987 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6988 echo "We will use the %lld style."
6994 if $test X"$sPRId64" = X -a X"$quad" != X; then
6996 #include <sys/types.h>
6999 $quad q = 12345678901;
7004 if eval $compile; then
7008 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
7009 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
7010 echo "We will use %lld."
7016 if $test X"$sPRId64" = X -a X"$quad" != X; then
7018 #include <sys/types.h>
7021 $quad q = 12345678901;
7026 if eval $compile; then
7030 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
7031 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
7032 echo "We will use %qd."
7038 if $test X"$sPRId64" = X; then
7039 echo "Cannot figure out how to print 64-bit integers." >&4
7044 fi # intsize -o longsize -o d_int64t -o d_longlong
7047 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
7048 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
7050 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
7051 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
7055 : check for length of double
7057 case "$doublesize" in
7059 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7060 $cat >try.c <<'EOCP'
7064 printf("%d\n", sizeof(double));
7068 if eval $compile_ok; then
7070 $echo " $doublesize bytes." >&4
7073 echo "(I can't seem to compile the test program. Guessing...)"
7074 rp="What is the size of a double precision number (in bytes)?"
7082 : check for long doubles
7084 $echo $n "Checking to see if your system supports long double...$c" >&4
7085 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7086 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7088 echo " Yup, it does." >&4
7091 echo " Nope, it doesn't." >&4
7097 : check for length of long double
7098 case "${d_longdbl}${longdblsize}" in
7101 $echo $n "Checking to see how big your long doubles are...$c" >&4
7102 $cat >try.c <<'EOCP'
7106 printf("%d\n", sizeof(long double));
7110 if eval $compile; then
7112 $echo " $longdblsize bytes." >&4
7116 echo "(I can't seem to compile the test program. Guessing...)" >&4
7117 rp="What is the size of a long double (in bytes)?"
7121 if $test "X$doublesize" = "X$longdblsize"; then
7122 echo "(That isn't any different from an ordinary double.)"
7130 if $test X"$d_longdbl" = X"$define"; then
7132 echo "Checking how to print long doubles..." >&4
7134 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7135 $cat >try.c <<'EOCP'
7136 #include <sys/types.h>
7140 printf("%.3f\n", d);
7144 if eval $compile; then
7148 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7149 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7150 echo "We will use %f."
7156 if $test X"$sPRIfldbl" = X; then
7157 $cat >try.c <<'EOCP'
7158 #include <sys/types.h>
7161 long double d = 123.456;
7162 printf("%.3llf\n", d);
7166 if eval $compile; then
7170 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7171 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7172 echo "We will use %llf."
7178 if $test X"$sPRIfldbl" = X; then
7179 $cat >try.c <<'EOCP'
7180 #include <sys/types.h>
7183 long double d = 123.456;
7184 printf("%.3Lf\n", d);
7188 if eval $compile; then
7192 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7193 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7194 echo "We will use %Lf."
7200 if $test X"$sPRIfldbl" = X; then
7201 $cat >try.c <<'EOCP'
7202 #include <sys/types.h>
7205 long double d = 123.456;
7206 printf("%.3lf\n", d);
7210 if eval $compile; then
7214 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7215 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7216 echo "We will use %lf."
7222 if $test X"$sPRIfldbl" = X; then
7223 echo "Cannot figure out how to print long doubles." >&4
7230 case "$sPRIfldbl" in
7231 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7232 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7234 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7235 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7239 : Initialize h_fcntl
7242 : Initialize h_sysfile
7245 : access call always available on UNIX
7249 : locate the flags for 'access()'
7253 $cat >access.c <<'EOCP'
7254 #include <sys/types.h>
7259 #include <sys/file.h>
7268 : check sys/file.h first, no particular reason here
7269 if $test `./findhdr sys/file.h` && \
7270 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7272 echo "<sys/file.h> defines the *_OK access constants." >&4
7273 elif $test `./findhdr fcntl.h` && \
7274 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7276 echo "<fcntl.h> defines the *_OK access constants." >&4
7277 elif $test `./findhdr unistd.h` && \
7278 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7279 echo "<unistd.h> defines the *_OK access constants." >&4
7281 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7287 : see if accessx exists
7288 set accessx d_accessx
7291 : see if alarm exists
7295 : see if atolf exists
7299 : see if atoll exists
7303 : Look for GNU-cc style attribute checking
7305 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7306 $cat >attrib.c <<'EOCP'
7308 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7310 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7311 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7312 echo "Your C compiler doesn't fully support __attribute__."
7315 echo "Your C compiler supports __attribute__."
7319 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7326 : see if bcmp exists
7330 : see if bcopy exists
7334 : see if this is a unistd.h system
7335 set unistd.h i_unistd
7338 : see if getpgrp exists
7339 set getpgrp d_getpgrp
7342 case "$d_getpgrp" in
7345 echo "Checking to see which flavor of getpgrp is in use..."
7348 #include <sys/types.h>
7350 # include <unistd.h>
7354 if (getuid() == 0) {
7355 printf("(I see you are running Configure as super-user...)\n");
7359 if (getpgrp(1) == 0)
7368 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7369 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7371 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7372 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7375 echo "I can't seem to compile and run the test program."
7377 xxx="a USG one, i.e. you use getpgrp()."
7379 # SVR4 systems can appear rather BSD-ish.
7382 xxx="a BSD one, i.e. you use getpgrp(pid)."
7386 xxx="probably a USG one, i.e. you use getpgrp()."
7391 echo "Assuming your getpgrp is $xxx" >&4
7400 : see if setpgrp exists
7401 set setpgrp d_setpgrp
7404 case "$d_setpgrp" in
7407 echo "Checking to see which flavor of setpgrp is in use..."
7410 #include <sys/types.h>
7412 # include <unistd.h>
7416 if (getuid() == 0) {
7417 printf("(I see you are running Configure as super-user...)\n");
7421 if (-1 == setpgrp(1, 1))
7424 if (setpgrp() != -1)
7430 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7431 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7433 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7434 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7437 echo "(I can't seem to compile and run the test program.)"
7439 xxx="a USG one, i.e. you use setpgrp()."
7441 # SVR4 systems can appear rather BSD-ish.
7444 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7448 xxx="probably a USG one, i.e. you use setpgrp()."
7453 echo "Assuming your setpgrp is $xxx" >&4
7461 : see if bzero exists
7465 : see if signal is declared as pointer to function returning int or void
7467 xxx=`./findhdr signal.h`
7468 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7469 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7470 echo "You have int (*signal())() instead of void." >&4
7472 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7473 echo "You have void (*signal())()." >&4
7475 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7476 echo "You have int (*signal())() instead of void." >&4
7478 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7479 echo "You have void (*signal())()." >&4
7482 case "$d_voidsig" in
7484 echo "I can't determine whether signal handler returns void or int..." >&4
7486 rp="What type does your signal handler return?"
7493 echo "As you already told me, signal handler returns void." >&4
7496 *) echo "As you already told me, signal handler returns int." >&4
7503 case "$d_voidsig" in
7504 "$define") signal_t="void";;
7509 : check for ability to cast large floats to 32-bit ints.
7511 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7512 if $test "$intsize" -ge 4; then
7519 #include <sys/types.h>
7521 $signal_t blech(s) int s; { exit(3); }
7528 signal(SIGFPE, blech);
7530 /* Don't let compiler optimize the test away. Store the number
7531 in a writable string for gcc to pass to sscanf under HP/UX.
7533 sprintf(str, "2147483647");
7534 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7538 /* x86 processors will probably give 0x8000 0000, which is a
7539 sign change. We don't want that. We want to mimic SPARC
7540 behavior here, which is to preserve the sign and give
7543 if (i32 != ($xxx) f)
7549 if eval $compile_ok; then
7553 echo "(I can't seem to compile the test program--assuming it can't)"
7561 echo "Nope, it can't."
7568 : check for ability to cast negative floats to unsigned
7570 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7573 #include <sys/types.h>
7575 $signal_t blech(s) int s; { exit(7); }
7576 $signal_t blech_in_list(s) int s; { exit(4); }
7577 unsigned long dummy_long(p) unsigned long p; { return p; }
7578 unsigned int dummy_int(p) unsigned int p; { return p; }
7579 unsigned short dummy_short(p) unsigned short p; { return p; }
7583 unsigned long along;
7585 unsigned short ashort;
7589 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7590 a direct f = -123. assignment. gcc-2.8.0 reportedly
7591 optimized the whole file away
7593 /* Store the number in a writable string for gcc to pass to
7596 sprintf(str, "-123");
7597 sscanf(str, "%lf", &f); /* f = -123.; */
7599 signal(SIGFPE, blech);
7600 along = (unsigned long)f;
7601 aint = (unsigned int)f;
7602 ashort = (unsigned short)f;
7603 if (along != (unsigned long)-123)
7605 if (aint != (unsigned int)-123)
7607 if (ashort != (unsigned short)-123)
7609 sprintf(str, "1073741824.");
7610 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7613 along = (unsigned long)f;
7614 if (along != 0x80000000)
7618 along = (unsigned long)f;
7619 if (along != 0x7fffffff)
7623 along = (unsigned long)f;
7624 if (along != 0x80000001)
7628 signal(SIGFPE, blech_in_list);
7629 sprintf(str, "123.");
7630 sscanf(str, "%lf", &f); /* f = 123.; */
7631 along = dummy_long((unsigned long)f);
7632 aint = dummy_int((unsigned int)f);
7633 ashort = dummy_short((unsigned short)f);
7634 if (along != (unsigned long)123)
7636 if (aint != (unsigned int)123)
7638 if (ashort != (unsigned short)123)
7645 if eval $compile_ok; then
7649 echo "(I can't seem to compile the test program--assuming it can't)"
7652 case "$castflags" in
7657 echo "Nope, it can't."
7664 : see if vprintf exists
7666 if set vprintf val -f d_vprintf; eval $csym; $val; then
7667 echo 'vprintf() found.' >&4
7669 $cat >vprintf.c <<'EOF'
7670 #include <varargs.h>
7672 int main() { xxx("foo"); }
7681 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7685 if eval $compile && ./vprintf; then
7686 echo "Your vsprintf() returns (int)." >&4
7689 echo "Your vsprintf() returns (char*)." >&4
7693 echo 'vprintf() NOT found.' >&4
7703 : see if chown exists
7707 : see if chroot exists
7711 : see if chsize exists
7715 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7716 while $test $# -ge 2; do
7718 $define) echo "#include <$2>";;
7722 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
7724 if eval $compile; then
7733 : see if this is a sys/uio.h system
7734 set sys/uio.h i_sysuio
7737 echo "Checking to see if your system supports struct iovec..." >&4
7738 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7740 case "$d_iovec_s" in
7741 "$define") echo "Yup, it does." >&4
7743 *) echo "Nope, it doesn't." >&4
7749 : see whether socket exists
7751 $echo $n "Hmm... $c" >&4
7752 if set socket val -f d_socket; eval $csym; $val; then
7753 echo "Looks like you have Berkeley networking support." >&4
7755 if set setsockopt val -f; eval $csym; $val; then
7758 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7762 if $contains socklib libc.list >/dev/null 2>&1; then
7763 echo "Looks like you have Berkeley networking support." >&4
7765 : we will have to assume that it supports the 4.2 BSD interface
7768 echo "You don't have Berkeley networking in libc$_a..." >&4
7769 if test "X$d_socket" = "X$define"; then
7770 echo "...but you seem to believe that you have sockets." >&4
7772 for net in net socket
7774 if test -f /usr/lib/lib$net$_a; then
7775 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7776 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7777 if $contains socket libc.list >/dev/null 2>&1; then
7782 echo "...but the Wollongong group seems to have hacked it in." >&4
7783 sockethdr="-I/usr/netinclude"
7786 echo "Found Berkeley sockets interface in lib$net." >& 4
7787 if $contains setsockopt libc.list >/dev/null 2>&1; then
7790 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7797 if test "X$d_socket" != "X$define"; then
7798 echo "or anywhere else I see." >&4
7806 : see if socketpair exists
7807 set socketpair d_sockpair
7812 echo "Checking the availability of certain socket constants..." >& 4
7813 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7814 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7816 #include <sys/types.h>
7817 #include <sys/socket.h>
7823 set try; if eval $compile; then
7826 set d_${enum}; eval $setvar
7830 set sendmsg d_sendmsg
7833 set recvmsg d_recvmsg
7837 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7838 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7840 case "$d_msghdr_s" in
7841 "$define") echo "Yup, it does." >&4
7843 *) echo "Nope, it doesn't." >&4
7847 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7848 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7850 case "$d_cmsghdr_s" in
7851 "$define") echo "Yup, it does." >&4
7853 *) echo "Nope, it doesn't." >&4
7857 : check for const keyword
7859 echo 'Checking to see if your C compiler knows about "const"...' >&4
7860 $cat >const.c <<'EOCP'
7861 typedef struct spug { int drokk; } spug;
7868 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7870 echo "Yup, it does."
7873 echo "Nope, it doesn't."
7878 : see if crypt exists
7880 if set crypt val -f d_crypt; eval $csym; $val; then
7881 echo 'crypt() found.' >&4
7885 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7886 if $test -z "$cryptlib"; then
7887 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7891 if $test -z "$cryptlib"; then
7892 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7896 if $test -z "$cryptlib"; then
7897 cryptlib=`./loc libcrypt$_a "" $libpth`
7901 if $test -z "$cryptlib"; then
7902 echo 'crypt() NOT found.' >&4
7911 : get csh whereabouts
7913 'csh') val="$undef" ;;
7918 : Respect a hint or command line value for full_csh.
7920 '') full_csh=$csh ;;
7923 : see if cuserid exists
7924 set cuserid d_cuserid
7927 : see if this is a limits.h system
7928 set limits.h i_limits
7931 : see if this is a float.h system
7935 : See if number of significant digits in a double precision number is known
7937 $cat >dbl_dig.c <<EOM
7947 printf("Contains DBL_DIG");
7950 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7951 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7952 echo "DBL_DIG found." >&4
7955 echo "DBL_DIG NOT found." >&4
7962 : see if difftime exists
7963 set difftime d_difftime
7966 : see if this is a dirent system
7968 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7970 echo "<dirent.h> found." >&4
7973 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7974 echo "<sys/dir.h> found." >&4
7977 xinc=`./findhdr sys/ndir.h`
7979 echo "<dirent.h> NOT found." >&4
7984 : Look for type of directory structure.
7986 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7988 case "$direntrytype" in
7991 $define) guess1='struct dirent' ;;
7992 *) guess1='struct direct' ;;
7995 *) guess1="$direntrytype"
8000 'struct dirent') guess2='struct direct' ;;
8001 *) guess2='struct dirent' ;;
8004 if $contains "$guess1" try.c >/dev/null 2>&1; then
8005 direntrytype="$guess1"
8006 echo "Your directory entries are $direntrytype." >&4
8007 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8008 direntrytype="$guess2"
8009 echo "Your directory entries seem to be $direntrytype." >&4
8011 echo "I don't recognize your system's directory entries." >&4
8012 rp="What type is used for directory entries on this system?"
8020 : see if the directory entry stores field length
8022 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8023 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8024 echo "Good, your directory entry keeps length information in d_namlen." >&4
8027 echo "Your directory entry does not know about the d_namlen field." >&4
8034 : see if dlerror exists
8037 set dlerror d_dlerror
8041 : see if dlfcn is available
8049 On a few systems, the dynamically loaded modules that perl generates and uses
8050 will need a different extension than shared libs. The default will probably
8058 rp='What is the extension of dynamically loaded modules'
8067 : Check if dlsym need a leading underscore
8073 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8074 $cat >dyna.c <<'EOM'
8083 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8085 #include <sys/types.h>
8099 int mode = RTLD_LAZY ;
8101 handle = dlopen("./dyna.$dlext", mode) ;
8102 if (handle == NULL) {
8107 symbol = dlsym(handle, "fred") ;
8108 if (symbol == NULL) {
8109 /* try putting a leading underscore */
8110 symbol = dlsym(handle, "_fred") ;
8111 if (symbol == NULL) {
8124 : Call the object file tmp-dyna.o in case dlext=o.
8125 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8126 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8127 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8128 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8131 1) echo "Test program failed using dlopen." >&4
8132 echo "Perhaps you should not use dynamic loading." >&4;;
8133 2) echo "Test program failed using dlsym." >&4
8134 echo "Perhaps you should not use dynamic loading." >&4;;
8135 3) echo "dlsym needs a leading underscore" >&4
8137 4) echo "dlsym doesn't need a leading underscore." >&4;;
8140 echo "I can't compile and run the test program." >&4
8141 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8146 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8151 hasproto='varname=$1; func=$2; shift; shift;
8152 while $test $# -ge 2; do
8154 $define) echo "#include <$2>";;
8158 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8159 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8160 echo "$func() prototype found.";
8163 echo "$func() prototype NOT found.";
8168 $rm -f try.c tryout.c'
8170 : see if prototype for drand48 is available
8172 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8175 : see if dup2 exists
8179 : see if eaccess exists
8180 set eaccess d_eaccess
8183 : see if endgrent exists
8184 set endgrent d_endgrent
8187 : see if endhostent exists
8188 set endhostent d_endhent
8191 : see if endnetent exists
8192 set endnetent d_endnent
8195 : see if endprotoent exists
8196 set endprotoent d_endpent
8199 : see if endpwent exists
8200 set endpwent d_endpwent
8203 : see if endservent exists
8204 set endservent d_endsent
8207 : see if endspent exists
8208 set endspent d_endspent
8211 : Locate the flags for 'open()'
8213 $cat >open3.c <<'EOCP'
8214 #include <sys/types.h>
8219 #include <sys/file.h>
8230 : check sys/file.h first to get FREAD on Sun
8231 if $test `./findhdr sys/file.h` && \
8232 set open3 -DI_SYS_FILE && eval $compile; then
8234 echo "<sys/file.h> defines the O_* constants..." >&4
8236 echo "and you have the 3 argument form of open()." >&4
8239 echo "but not the 3 argument form of open(). Oh, well." >&4
8242 elif $test `./findhdr fcntl.h` && \
8243 set open3 -DI_FCNTL && eval $compile; then
8245 echo "<fcntl.h> defines the O_* constants..." >&4
8247 echo "and you have the 3 argument form of open()." >&4
8250 echo "but not the 3 argument form of open(). Oh, well." >&4
8255 echo "I can't find the O_* constant definitions! You got problems." >&4
8261 : check for non-blocking I/O stuff
8262 case "$h_sysfile" in
8263 true) echo "#include <sys/file.h>" > head.c;;
8266 true) echo "#include <fcntl.h>" > head.c;;
8267 *) echo "#include <sys/fcntl.h>" > head.c;;
8272 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8273 case "$o_nonblock" in
8276 $cat >>try.c <<'EOCP'
8279 printf("O_NONBLOCK\n");
8283 printf("O_NDELAY\n");
8287 printf("FNDELAY\n");
8294 if eval $compile_ok; then
8296 case "$o_nonblock" in
8297 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8298 *) echo "Seems like we can use $o_nonblock.";;
8301 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8304 *) echo "Using $hint value $o_nonblock.";;
8306 $rm -f try try.* .out core
8309 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8315 #include <sys/types.h>
8317 #define MY_O_NONBLOCK $o_nonblock
8318 #ifndef errno /* XXX need better Configure test */
8321 $signal_t blech(x) int x; { exit(3); }
8323 $cat >> try.c <<'EOCP'
8331 pipe(pd); /* Down: child -> parent */
8332 pipe(pu); /* Up: parent -> child */
8335 close(pd[1]); /* Parent reads from pd[0] */
8336 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8337 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8339 signal(SIGALRM, blech);
8341 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8343 sprintf(string, "%d\n", ret);
8344 write(2, string, strlen(string));
8347 if (errno == EAGAIN) {
8353 if (errno == EWOULDBLOCK)
8354 printf("EWOULDBLOCK\n");
8357 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8358 sleep(2); /* Give it time to close our pipe */
8360 ret = read(pd[0], buf, 1); /* Should read EOF */
8362 sprintf(string, "%d\n", ret);
8363 write(3, string, strlen(string));
8367 close(pd[0]); /* We write to pd[1] */
8368 close(pu[1]); /* We read from pu[0] */
8369 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8370 close(pd[1]); /* Pipe pd is now fully closed! */
8371 exit(0); /* Bye bye, thank you for playing! */
8375 if eval $compile_ok; then
8376 echo "$startsh" >mtry
8377 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8379 ./mtry >/dev/null 2>&1
8381 0) eagain=`$cat try.out`;;
8382 1) echo "Could not perform non-blocking setting!";;
8383 2) echo "I did a successful read() for something that was not there!";;
8384 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8385 *) echo "Something terribly wrong happened during testing.";;
8387 rd_nodata=`$cat try.ret`
8388 echo "A read() system call with no data present returns $rd_nodata."
8389 case "$rd_nodata" in
8392 echo "(That's peculiar, fixing that to be -1.)"
8398 echo "Forcing errno EAGAIN on read() with no data available."
8402 echo "Your read() sets errno to $eagain when no data is available."
8405 status=`$cat try.err`
8407 0) echo "And it correctly returns 0 to signal EOF.";;
8408 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8409 *) echo "However, your read() returns '$status' on EOF??";;
8412 if test "$status" = "$rd_nodata"; then
8413 echo "WARNING: you can't distinguish between EOF and no data!"
8417 echo "I can't compile the test program--assuming errno EAGAIN will do."
8424 echo "Using $hint value $eagain."
8425 echo "Your read() returns $rd_nodata when no data is present."
8426 case "$d_eofnblk" in
8427 "$define") echo "And you can see EOF because read() returns 0.";;
8428 "$undef") echo "But you can't see EOF status from read() returned value.";;
8430 echo "(Assuming you can't see EOF status from read anyway.)"
8436 $rm -f try try.* .out core head.c mtry
8438 : see if fchmod exists
8442 : see if fchown exists
8446 : see if this is an fcntl system
8450 : see if sys/select.h has to be included
8451 set sys/select.h i_sysselct
8454 : see if we should include time.h, sys/time.h, or both
8456 if test "X$timeincl" = X; then
8457 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8458 $echo $n "I'm now running the test program...$c"
8459 $cat >try.c <<'EOCP'
8460 #include <sys/types.h>
8465 #ifdef SYSTIMEKERNEL
8468 #include <sys/time.h>
8471 #include <sys/select.h>
8480 struct timezone tzp;
8482 if (foo.tm_sec == foo.tm_sec)
8485 if (bar.tv_sec == bar.tv_sec)
8492 for s_timezone in '-DS_TIMEZONE' ''; do
8494 for s_timeval in '-DS_TIMEVAL' ''; do
8495 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8496 for i_time in '' '-DI_TIME'; do
8497 for i_systime in '-DI_SYSTIME' ''; do
8500 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8501 if eval $compile; then
8502 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8506 $echo $n "Succeeded with $flags$c"
8518 *SYSTIMEKERNEL*) i_systimek="$define"
8519 timeincl=`./findhdr sys/time.h`
8520 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8521 *) i_systimek="$undef";;
8524 *I_TIME*) i_time="$define"
8525 timeincl=`./findhdr time.h`" $timeincl"
8526 echo "We'll include <time.h>." >&4;;
8527 *) i_time="$undef";;
8530 *I_SYSTIME*) i_systime="$define"
8531 timeincl=`./findhdr sys/time.h`" $timeincl"
8532 echo "We'll include <sys/time.h>." >&4;;
8533 *) i_systime="$undef";;
8538 : check for fd_set items
8541 Checking to see how well your C compiler handles fd_set and friends ...
8543 $cat >fd_set.c <<EOCP
8544 #$i_systime I_SYS_TIME
8545 #$i_sysselct I_SYS_SELECT
8546 #$d_socket HAS_SOCKET
8547 #include <sys/types.h>
8549 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8552 #include <sys/time.h>
8555 #include <sys/select.h>
8564 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8571 set fd_set -DTRYBITS
8572 if eval $compile; then
8573 d_fds_bits="$define"
8575 echo "Well, your system knows about the normal fd_set typedef..." >&4
8577 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8578 d_fd_macros="$define"
8581 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8583 d_fd_macros="$undef"
8587 Hmm, your compiler has some difficulty with fd_set. Checking further...
8590 if eval $compile; then
8593 echo "Well, your system has some sort of fd_set available..." >&4
8595 echo "and you have the normal fd_set macros." >&4
8596 d_fd_macros="$define"
8599 but not the normal fd_set macros! Gross! More work for me...
8601 d_fd_macros="$undef"
8604 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8607 d_fd_macros="$undef"
8612 : see if fgetpos exists
8613 set fgetpos d_fgetpos
8616 : see if flock exists
8620 : see if fork exists
8624 : see if pathconf exists
8625 set pathconf d_pathconf
8628 : see if fpathconf exists
8629 set fpathconf d_fpathconf
8633 : see if llseek exists
8639 $echo $n "Checking to see if your system supports off64_t...$c" >&4
8641 #include <sys/types.h>
8643 off64_t foo() { off64_t x; x = 7; return x; }'
8645 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8647 echo " Yup, it does." >&4
8650 echo " Nope, it doesn't." >&4
8656 : check for fpos64_t
8658 $echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8660 #include <sys/stdio.h>
8661 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8663 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8665 echo " Yup, it does." >&4
8668 echo " Nope, it doesn't." >&4
8674 hasstruct='varname=$1; struct=$2; shift; shift;
8675 while $test $# -ge 2; do
8677 $define) echo "#include <$2>";;
8681 echo "int main () { struct $struct foo; }" >> try.c;
8683 if eval $compile; then
8692 : see if this is a sys/param system
8693 set sys/param.h i_sysparam
8696 : see if this is a sys/mount.h system
8697 set sys/mount.h i_sysmount
8700 : see if sys/types.h has to be included
8701 set sys/types.h i_systypes
8704 : see if this is a sys/vfs.h system
8705 set sys/vfs.h i_sysvfs
8708 : see if this is a sys/statfs.h system
8709 set sys/statfs.h i_sysstatfs
8713 : see if statfs exists
8717 echo "Checking to see if your system supports struct statfs..." >&4
8718 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
8720 case "$d_statfs_s" in
8721 "$define") echo "Yup, it does." >&4 ;;
8722 *) echo "Nope, it doesn't." >&4 ;;
8725 : see if struct statfs knows about f_flags
8726 case "$d_statfs_s" in
8728 echo "Checking to see if your struct statfs has f_flags field..." >&4
8729 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
8733 set d_statfs_f_flags
8737 case "$d_statfs_f_flags" in
8738 "$define") echo "Yup, it does." >&4 ;;
8739 *) echo "Nope, it doesn't." >&4 ;;
8742 echo "Checking to see if your system supports struct fs_data..." >&4
8743 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8745 case "$d_fs_data_s" in
8746 "$define") echo "Yup, it does." >&4 ;;
8747 *) echo "Nope, it doesn't." >&4 ;;
8750 : see if fseeko exists
8754 : see if fsetpos exists
8755 set fsetpos d_fsetpos
8759 : see if fstatfs exists
8760 set fstatfs d_fstatfs
8764 : see if statvfs exists
8765 set statvfs d_statvfs
8768 : see if fstatvfs exists
8769 set fstatvfs d_fstatvfs
8773 : see if ftello exists
8777 : see if getgrent exists
8778 set getgrent d_getgrent
8781 : see if gethostbyaddr exists
8782 set gethostbyaddr d_gethbyaddr
8785 : see if gethostbyname exists
8786 set gethostbyname d_gethbyname
8789 : see if gethostent exists
8790 set gethostent d_gethent
8793 : see how we will look up host name
8796 if set gethostname val -f d_gethname; eval $csym; $val; then
8797 echo 'gethostname() found.' >&4
8798 d_gethname="$define"
8801 if set uname val -f d_uname; eval $csym; $val; then
8804 uname() was found, but you're running xenix, and older versions of xenix
8805 have a broken uname(). If you don't really know whether your xenix is old
8806 enough to have a broken system call, use the default answer.
8813 rp='Is your uname() broken?'
8816 n*) d_uname="$define"; call=uname;;
8819 echo 'uname() found.' >&4
8826 case "$d_gethname" in
8827 '') d_gethname="$undef";;
8830 '') d_uname="$undef";;
8832 case "$d_uname$d_gethname" in
8837 Every now and then someone has a $call() that lies about the hostname
8838 but can't be fixed for political or economic reasons. If you wish, I can
8839 pretend $call() isn't there and maybe compute hostname at run-time
8840 thanks to the '$phostname' command.
8843 rp="Shall I ignore $call() from now on?"
8846 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8849 case "$phostname" in
8851 *) case "$aphostname" in
8857 file=`./loc $file $file $pth`
8858 aphostname=`echo $file $*`
8863 case "$d_uname$d_gethname" in
8866 case "$phostname" in
8868 echo "There will be no way for $package to get your hostname." >&4;;
8870 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8874 case "$d_phostname" in
8875 '') d_phostname="$undef";;
8878 : see if this is a netdb.h system
8882 : see if prototypes for various gethostxxx netdb.h functions are available
8884 set d_gethostprotos gethostent $i_netdb netdb.h
8887 : see if getlogin exists
8888 set getlogin d_getlogin
8891 : see if getmntent exists
8892 set getmntent d_getmntent
8895 : see if getnetbyaddr exists
8896 set getnetbyaddr d_getnbyaddr
8899 : see if getnetbyname exists
8900 set getnetbyname d_getnbyname
8903 : see if getnetent exists
8904 set getnetent d_getnent
8907 : see if prototypes for various getnetxxx netdb.h functions are available
8909 set d_getnetprotos getnetent $i_netdb netdb.h
8913 : see if getprotobyname exists
8914 set getprotobyname d_getpbyname
8917 : see if getprotobynumber exists
8918 set getprotobynumber d_getpbynumber
8921 : see if getprotoent exists
8922 set getprotoent d_getpent
8925 : see if getpgid exists
8926 set getpgid d_getpgid
8929 : see if getpgrp2 exists
8930 set getpgrp2 d_getpgrp2
8933 : see if getppid exists
8934 set getppid d_getppid
8937 : see if getpriority exists
8938 set getpriority d_getprior
8941 : see if prototypes for various getprotoxxx netdb.h functions are available
8943 set d_getprotoprotos getprotoent $i_netdb netdb.h
8946 : see if getpwent exists
8947 set getpwent d_getpwent
8951 : see if getservbyname exists
8952 set getservbyname d_getsbyname
8955 : see if getservbyport exists
8956 set getservbyport d_getsbyport
8959 : see if getservent exists
8960 set getservent d_getsent
8963 : see if prototypes for various getservxxx netdb.h functions are available
8965 set d_getservprotos getservent $i_netdb netdb.h
8968 : see if getspent exists
8969 set getspent d_getspent
8972 : see if getspnam exists
8973 set getspnam d_getspnam
8976 : see if gettimeofday or ftime exists
8977 set gettimeofday d_gettimeod
8979 case "$d_gettimeod" in
8985 val="$undef"; set d_ftime; eval $setvar
8988 case "$d_gettimeod$d_ftime" in
8991 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8995 : see if this is an grp system
9001 xxx=`./findhdr grp.h`
9002 $cppstdin $cppflags $cppminus < $xxx >$$.h
9004 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9016 set d_grpasswd; eval $setvar
9020 : see if hasmntopt exists
9021 set hasmntopt d_hasmntopt
9024 : see if this is a netinet/in.h or sys/in.h system
9025 set netinet/in.h i_niin sys/in.h i_sysin
9028 : see if arpa/inet.h has to be included
9029 set arpa/inet.h i_arpainet
9032 : see if htonl --and friends-- exists
9037 : Maybe they are macros.
9042 #include <sys/types.h>
9043 #$i_niin I_NETINET_IN
9045 #$i_arpainet I_ARPA_INET
9047 #include <netinet/in.h>
9053 #include <arpa/inet.h>
9056 printf("Defined as a macro.");
9059 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9060 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9062 echo "But it seems to be defined as a macro." >&4
9070 : see which of string.h or strings.h is needed
9072 strings=`./findhdr string.h`
9073 if $test "$strings" && $test -r "$strings"; then
9074 echo "Using <string.h> instead of <strings.h>." >&4
9078 strings=`./findhdr strings.h`
9079 if $test "$strings" && $test -r "$strings"; then
9080 echo "Using <strings.h> instead of <string.h>." >&4
9082 echo "No string header found -- You'll surely have problems." >&4
9088 "$undef") strings=`./findhdr strings.h`;;
9089 *) strings=`./findhdr string.h`;;
9094 if set index val -f; eval $csym; $val; then
9095 if set strchr val -f d_strchr; eval $csym; $val; then
9096 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9099 echo "strchr() found." >&4
9103 echo "index() found." >&4
9108 echo "index() found." >&4
9111 if set strchr val -f d_strchr; eval $csym; $val; then
9114 echo "strchr() found." >&4
9116 echo "No index() or strchr() found!" >&4
9121 set d_strchr; eval $setvar
9123 set d_index; eval $setvar
9125 : check whether inet_aton exists
9126 set inet_aton d_inetaton
9131 $cat >isascii.c <<'EOCP'
9143 if eval $compile; then
9144 echo "isascii() found." >&4
9147 echo "isascii() NOT found." >&4
9154 : see if killpg exists
9158 : see if lchown exists
9160 $cat > try.c <<'EOCP'
9161 /* System header to define __stub macros and hopefully few prototypes,
9162 which can conflict with char lchown(); below. */
9164 /* Override any gcc2 internal prototype to avoid an error. */
9165 /* We use char because int might match the return type of a gcc2
9166 builtin and then its argument prototype would still apply. */
9169 /* The GNU C library defines this for functions which it implements
9170 to always fail with ENOSYS. Some functions are actually named
9171 something starting with __ and the normal name is an alias. */
9172 #if defined (__stub_lchown) || defined (__stub___lchown)
9180 if eval $compile; then
9181 $echo "lchown() found." >&4
9184 $echo "lchown() NOT found." >&4
9190 : See if number of significant digits in a double precision number is known
9192 $cat >ldbl_dig.c <<EOM
9202 printf("Contains LDBL_DIG");
9205 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9206 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9207 echo "LDBL_DIG found." >&4
9210 echo "LDBL_DIG NOT found." >&4
9217 : see if link exists
9221 : see if localeconv exists
9222 set localeconv d_locconv
9225 : see if lockf exists
9229 : see if lstat exists
9233 : see if madvise exists
9234 set madvise d_madvise
9237 : see if mblen exists
9241 : see if mbstowcs exists
9242 set mbstowcs d_mbstowcs
9245 : see if mbtowc exists
9249 : see if memchr exists
9253 : see if memcmp exists
9257 : see if memcpy exists
9261 : see if memmove exists
9262 set memmove d_memmove
9265 : see if memset exists
9269 : see if mkdir exists
9273 : see if mkfifo exists
9277 : see if mktime exists
9281 : see if this is a sys/mman.h system
9282 set sys/mman.h i_sysmman
9285 : see if mmap exists
9288 : see what shmat returns
9289 : default to something harmless
9291 case "$i_sysmman$d_mmap" in
9293 $cat >mmap.c <<'END'
9294 #include <sys/mman.h>
9297 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9302 echo "and it returns ($mmaptype)." >&4
9308 : see if mprotect exists
9309 set mprotect d_mprotect
9312 : see if msgctl exists
9316 : see if msgget exists
9320 : see if msgsnd exists
9324 : see if msgrcv exists
9328 : see how much of the 'msg*(2)' library is present.
9331 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9332 *"$undef"*) h_msg=false;;
9336 case "`ipcs 2>&1`" in
9337 "SVID messages"*"not configured"*)
9338 echo "Your $osname does not have the msg*(2) configured." >&4
9353 : we could also check for sys/ipc.h ...
9354 if $h_msg && $test `./findhdr sys/msg.h`; then
9355 echo "You have the full msg*(2) library." >&4
9358 echo "You don't have the full msg*(2) library." >&4
9364 : see if msync exists
9368 : see if munmap exists
9372 : see if nice exists
9376 : see if POSIX threads are available
9377 set pthread.h i_pthread
9383 : how to create joinable pthreads
9384 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9386 echo "Checking what constant to use for creating joinable pthreads..." >&4
9387 $cat >try.c <<'EOCP'
9388 #include <pthread.h>
9390 int detachstate = JOINABLE;
9393 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9394 if eval $compile; then
9395 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9396 val="$undef" # Yes, undef.
9397 set d_old_pthread_create_joinable
9400 set old_pthread_create_joinable
9403 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9404 if eval $compile; then
9405 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9407 set d_old_pthread_create_joinable
9409 val=PTHREAD_CREATE_UNDETACHED
9410 set old_pthread_create_joinable
9413 set try -DJOINABLE=__UNDETACHED
9414 if eval $compile; then
9415 echo "You seem to use __UNDETACHED." >&4
9417 set d_old_pthread_create_joinable
9420 set old_pthread_create_joinable
9423 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9425 set d_old_pthread_create_joinable
9428 set old_pthread_create_joinable
9435 d_old_pthread_create_joinable="$undef"
9436 old_pthread_create_joinable=""
9439 : see if pause exists
9443 : see if pipe exists
9447 : see if poll exists
9452 : see whether the various POSIXish _yields exist
9454 #include <pthread.h>
9460 #ifdef PTHREAD_YIELD
9463 #ifdef PTHREAD_YIELD_NULL
9464 pthread_yield(NULL);
9470 : see if sched_yield exists
9471 set try -DSCHED_YIELD
9472 if eval $compile; then
9474 sched_yield='sched_yield()'
9478 case "$usethreads" in
9481 $define) echo 'sched_yield() found.' >&4 ;;
9482 *) echo 'sched_yield() NOT found.' >&4 ;;
9488 : see if pthread_yield exists
9489 set try -DPTHREAD_YIELD
9490 if eval $compile; then
9492 case "$sched_yield" in
9493 '') sched_yield='pthread_yield()' ;;
9496 set try -DPTHREAD_YIELD_NULL
9497 if eval $compile; then
9499 case "$sched_yield" in
9500 '') sched_yield='pthread_yield(NULL)' ;;
9506 case "$usethreads" in
9509 $define) echo 'pthread_yield() found.' >&4 ;;
9510 *) echo 'pthread_yield() NOT found.' >&4 ;;
9517 case "$sched_yield" in
9518 '') sched_yield=undef ;;
9523 : see if this is a pwd.h system
9529 xxx=`./findhdr pwd.h`
9530 $cppstdin $cppflags $cppminus < $xxx >$$.h
9532 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9540 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9548 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9556 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9564 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9572 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9580 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9588 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9600 set d_pwquota; eval $setvar
9601 set d_pwage; eval $setvar
9602 set d_pwchange; eval $setvar
9603 set d_pwclass; eval $setvar
9604 set d_pwexpire; eval $setvar
9605 set d_pwcomment; eval $setvar
9606 set d_pwgecos; eval $setvar
9607 set d_pwpasswd; eval $setvar
9611 : see if readdir and friends exist
9612 set readdir d_readdir
9614 set seekdir d_seekdir
9616 set telldir d_telldir
9618 set rewinddir d_rewinddir
9621 : see if readlink exists
9622 set readlink d_readlink
9625 : see if readv exists
9629 : see if rename exists
9633 : see if rmdir exists
9637 : see if memory.h is available.
9642 : See if it conflicts with string.h
9648 $cppstdin $cppflags $cppminus < $strings > mem.h
9649 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9651 echo "We won't be including <memory.h>."
9661 : can bcopy handle overlapping blocks?
9666 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9673 $cat >>try.c <<'EOCP'
9676 # include <memory.h>
9679 # include <stdlib.h>
9682 # include <string.h>
9684 # include <strings.h>
9687 # include <unistd.h> /* Needed for NetBSD */
9691 char buf[128], abc[128];
9697 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9699 for (align = 7; align >= 0; align--) {
9700 for (len = 36; len; len--) {
9703 for (off = 1; off <= len; off++) {
9704 bcopy(b, b+off, len);
9705 bcopy(b+off, b, len);
9706 if (bcmp(b, abc, len))
9715 if eval $compile_ok; then
9716 if ./try 2>/dev/null; then
9720 echo "It can't, sorry."
9721 case "$d_memmove" in
9722 "$define") echo "But that's Ok since you have memmove()." ;;
9726 echo "(I can't compile the test program, so we'll assume not...)"
9727 case "$d_memmove" in
9728 "$define") echo "But that's Ok since you have memmove()." ;;
9733 $rm -f try.* try core
9737 : can memcpy handle overlapping blocks?
9742 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9749 $cat >>try.c <<'EOCP'
9752 # include <memory.h>
9755 # include <stdlib.h>
9758 # include <string.h>
9760 # include <strings.h>
9763 # include <unistd.h> /* Needed for NetBSD */
9767 char buf[128], abc[128];
9773 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9774 try to store the string in read-only memory. */
9775 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9777 for (align = 7; align >= 0; align--) {
9778 for (len = 36; len; len--) {
9780 memcpy(b, abc, len);
9781 for (off = 1; off <= len; off++) {
9782 memcpy(b+off, b, len);
9783 memcpy(b, b+off, len);
9784 if (memcmp(b, abc, len))
9793 if eval $compile_ok; then
9794 if ./try 2>/dev/null; then
9798 echo "It can't, sorry."
9799 case "$d_memmove" in
9800 "$define") echo "But that's Ok since you have memmove()." ;;
9804 echo "(I can't compile the test program, so we'll assume not...)"
9805 case "$d_memmove" in
9806 "$define") echo "But that's Ok since you have memmove()." ;;
9811 $rm -f try.* try core
9815 : can memcmp be trusted to compare relative magnitude?
9820 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9827 $cat >>try.c <<'EOCP'
9830 # include <memory.h>
9833 # include <stdlib.h>
9836 # include <string.h>
9838 # include <strings.h>
9841 # include <unistd.h> /* Needed for NetBSD */
9847 if ((a < b) && memcmp(&a, &b, 1) < 0)
9853 if eval $compile_ok; then
9854 if ./try 2>/dev/null; then
9858 echo "No, it can't (it uses signed chars)."
9861 echo "(I can't compile the test program, so we'll assume not...)"
9865 $rm -f try.* try core
9869 : see if select exists
9873 : see if semctl exists
9877 : see if semget exists
9881 : see if semop exists
9885 : see how much of the 'sem*(2)' library is present.
9888 case "$d_semctl$d_semget$d_semop" in
9889 *"$undef"*) h_sem=false;;
9893 case "`ipcs 2>&1`" in
9894 "SVID messages"*"not configured"*)
9895 echo "Your $osname does not have the sem*(2) configured." >&4
9908 : we could also check for sys/ipc.h ...
9909 if $h_sem && $test `./findhdr sys/sem.h`; then
9910 echo "You have the full sem*(2) library." >&4
9913 echo "You don't have the full sem*(2) library." >&4
9919 : see whether sys/sem.h defines union semun
9921 $cat > try.c <<'END'
9922 #include <sys/types.h>
9923 #include <sys/ipc.h>
9924 #include <sys/sem.h>
9925 int main () { union semun semun; semun.buf = 0; }
9928 if eval $compile; then
9929 echo "You have union semun in <sys/sem.h>." >&4
9932 echo "You do not have union semun in <sys/sem.h>." >&4
9935 $rm -f try try.c try.h
9939 : see how to do semctl IPC_STAT
9942 : see whether semctl IPC_STAT can use union semun
9947 # define S_IRUSR S_IREAD
9948 # define S_IWUSR S_IWRITE
9949 # define S_IXUSR S_IEXEC
9951 # define S_IRUSR 0400
9952 # define S_IWUSR 0200
9953 # define S_IXUSR 0100
9955 # define S_IRGRP (S_IRUSR>>3)
9956 # define S_IWGRP (S_IWUSR>>3)
9957 # define S_IXGRP (S_IXUSR>>3)
9958 # define S_IROTH (S_IRUSR>>6)
9959 # define S_IWOTH (S_IWUSR>>6)
9960 # define S_IXOTH (S_IXUSR>>6)
9963 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9964 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9965 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9970 #include <sys/types.h>
9971 #include <sys/ipc.h>
9972 #include <sys/sem.h>
9973 #include <sys/stat.h>
9980 #$d_union_semun HAS_UNION_SEMUN
9983 #ifndef HAS_UNION_SEMUN
9986 struct semid_ds *buf;
9987 unsigned short *array;
9993 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9994 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9996 struct semid_ds argbuf;
9999 st = semctl(sem, 0, IPC_STAT, arg);
10003 # endif /* IPC_STAT */
10004 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10006 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10007 # endif /* IPC_RMID */
10008 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10010 #endif /* IPC_PRIVATE && ... */
10011 printf("semget failed: errno = %d\n", errno);
10017 if eval $compile; then
10020 semun) val="$define" ;;
10026 case "$d_semctl_semun" in
10028 echo "You can use union semun for semctl IPC_STAT." >&4
10031 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10036 : see whether semctl IPC_STAT can use struct semid_ds pointer
10037 $cat > try.c <<'END'
10038 #include <sys/types.h>
10039 #include <sys/ipc.h>
10040 #include <sys/sem.h>
10041 #include <sys/stat.h>
10049 struct semid_ds arg;
10052 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10053 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10056 st = semctl(sem, 0, IPC_STAT, &arg);
10058 printf("semid_ds\n");
10060 # endif /* IPC_STAT */
10061 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10063 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10064 # endif /* IPC_RMID */
10065 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10067 #endif /* IPC_PRIVATE && ... */
10068 printf("semget failed: errno = %d\n", errno);
10075 if eval $compile; then
10078 semid_ds) val="$define" ;;
10082 set d_semctl_semid_ds
10084 case "$d_semctl_semid_ds" in
10086 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10088 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10095 # We do not have the full sem*(2) library, so assume we can not
10101 set d_semctl_semid_ds
10106 : see if setegid exists
10107 set setegid d_setegid
10110 : see if seteuid exists
10111 set seteuid d_seteuid
10114 : see if setgrent exists
10115 set setgrent d_setgrent
10118 : see if sethostent exists
10119 set sethostent d_sethent
10122 : see if setlinebuf exists
10123 set setlinebuf d_setlinebuf
10126 : see if setlocale exists
10127 set setlocale d_setlocale
10130 : see if setnetent exists
10131 set setnetent d_setnent
10134 : see if setprotoent exists
10135 set setprotoent d_setpent
10138 : see if setpgid exists
10139 set setpgid d_setpgid
10142 : see if setpgrp2 exists
10143 set setpgrp2 d_setpgrp2
10146 : see if setpriority exists
10147 set setpriority d_setprior
10150 : see if setpwent exists
10151 set setpwent d_setpwent
10154 : see if setregid exists
10155 set setregid d_setregid
10157 set setresgid d_setresgid
10160 : see if setreuid exists
10161 set setreuid d_setreuid
10163 set setresuid d_setresuid
10166 : see if setrgid exists
10167 set setrgid d_setrgid
10170 : see if setruid exists
10171 set setruid d_setruid
10174 : see if setservent exists
10175 set setservent d_setsent
10178 : see if setsid exists
10179 set setsid d_setsid
10182 : see if setspent exists
10183 set setspent d_setspent
10186 : see if setvbuf exists
10187 set setvbuf d_setvbuf
10190 : see if sfio.h is available
10195 : see if sfio library is available
10206 : Ok, but do we want to use it.
10210 true|$define|[yY]*) dflt='y';;
10213 echo "$package can use the sfio library, but it is experimental."
10214 rp="You seem to have sfio available, do you want to try using it?"
10218 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10220 : Remove sfio from list of libraries to use
10221 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10224 echo "libs = $libs" >&4
10228 *) case "$usesfio" in
10229 true|$define|[yY]*)
10230 echo "Sorry, cannot find sfio on this machine" >&4
10231 echo "Ignoring your setting of usesfio=$usesfio" >&4
10239 $define) usesfio='true';;
10240 *) usesfio='false';;
10243 : see if shmctl exists
10244 set shmctl d_shmctl
10247 : see if shmget exists
10248 set shmget d_shmget
10251 : see if shmat exists
10254 : see what shmat returns
10257 $cat >shmat.c <<'END'
10258 #include <sys/shm.h>
10261 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10266 echo "and it returns ($shmattype)." >&4
10267 : see if a prototype for shmat is available
10268 xxx=`./findhdr sys/shm.h`
10269 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10270 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10281 set d_shmatprototype
10284 : see if shmdt exists
10288 : see how much of the 'shm*(2)' library is present.
10291 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10292 *"$undef"*) h_shm=false;;
10296 case "`ipcs 2>&1`" in
10297 "SVID shared memory"*"not configured"*)
10298 echo "Your $osname does not have the shm*(2) configured." >&4
10301 set shmctl d_shmctl
10303 set shmget d_shmget
10313 : we could also check for sys/ipc.h ...
10314 if $h_shm && $test `./findhdr sys/shm.h`; then
10315 echo "You have the full shm*(2) library." >&4
10318 echo "You don't have the full shm*(2) library." >&4
10325 : see if we have sigaction
10326 if set sigaction val -f d_sigaction; eval $csym; $val; then
10327 echo 'sigaction() found.' >&4
10328 $cat > try.c <<'EOP'
10330 #include <sys/types.h>
10331 #include <signal.h>
10334 struct sigaction act, oact;
10336 oact.sa_handler = 0;
10340 if eval $compile_ok; then
10343 echo "But you don't seem to have a useable struct sigaction." >&4
10347 echo 'sigaction NOT found.' >&4
10350 set d_sigaction; eval $setvar
10351 $rm -f try try$_o try.c
10353 : see if sigsetjmp exists
10355 case "$d_sigsetjmp" in
10357 $cat >try.c <<'EOP'
10358 #include <setjmp.h>
10363 if (sigsetjmp(env,1))
10366 siglongjmp(env, 1);
10371 if eval $compile; then
10372 if ./try >/dev/null 2>&1; then
10373 echo "POSIX sigsetjmp found." >&4
10377 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10383 echo "sigsetjmp not found." >&4
10387 *) val="$d_sigsetjmp"
10388 case "$d_sigsetjmp" in
10389 $define) echo "POSIX sigsetjmp found." >&4;;
10390 $undef) echo "sigsetjmp not found." >&4;;
10398 : see if sqrtl exists
10402 : see if sys/stat.h is available
10403 set sys/stat.h i_sysstat
10406 : see if stat knows about block sizes
10408 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10411 : see if _ptr and _cnt from stdio act std
10413 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10414 echo "(Looks like you have stdio.h from Linux.)"
10415 case "$stdio_ptr" in
10416 '') stdio_ptr='((fp)->_IO_read_ptr)'
10419 *) ptr_lval=$d_stdio_ptr_lval;;
10421 case "$stdio_cnt" in
10422 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10425 *) cnt_lval=$d_stdio_cnt_lval;;
10427 case "$stdio_base" in
10428 '') stdio_base='((fp)->_IO_read_base)';;
10430 case "$stdio_bufsiz" in
10431 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10434 case "$stdio_ptr" in
10435 '') stdio_ptr='((fp)->_ptr)'
10438 *) ptr_lval=$d_stdio_ptr_lval;;
10440 case "$stdio_cnt" in
10441 '') stdio_cnt='((fp)->_cnt)'
10444 *) cnt_lval=$d_stdio_cnt_lval;;
10446 case "$stdio_base" in
10447 '') stdio_base='((fp)->_base)';;
10449 case "$stdio_bufsiz" in
10450 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10453 : test whether _ptr and _cnt really work
10454 echo "Checking how std your stdio is..." >&4
10457 #define FILE_ptr(fp) $stdio_ptr
10458 #define FILE_cnt(fp) $stdio_cnt
10460 FILE *fp = fopen("try.c", "r");
10463 18 <= FILE_cnt(fp) &&
10464 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10472 if eval $compile; then
10474 echo "Your stdio acts pretty std."
10477 echo "Your stdio isn't very std."
10480 echo "Your stdio doesn't appear very std."
10486 : Can _ptr be used as an lvalue?
10487 case "$d_stdstdio$ptr_lval" in
10488 $define$define) val=$define ;;
10491 set d_stdio_ptr_lval
10494 : Can _cnt be used as an lvalue?
10495 case "$d_stdstdio$cnt_lval" in
10496 $define$define) val=$define ;;
10499 set d_stdio_cnt_lval
10502 : see if _base is also standard
10504 case "$d_stdstdio" in
10508 #define FILE_base(fp) $stdio_base
10509 #define FILE_bufsiz(fp) $stdio_bufsiz
10511 FILE *fp = fopen("try.c", "r");
10514 19 <= FILE_bufsiz(fp) &&
10515 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10522 if eval $compile; then
10524 echo "And its _base field acts std."
10527 echo "But its _base field isn't std."
10530 echo "However, it seems to be lacking the _base field."
10539 Checking how to access stdio streams by file descriptor number...
10541 case "$stdio_stream_array" in
10542 '') $cat >try.c <<EOCP
10545 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10549 for s in _iob __iob __sF
10551 set try -DSTDIO_STREAM_ARRAY=$s
10552 if eval $compile; then
10553 case "`./try$exe_ext`" in
10554 yes) stdio_stream_array=$s; break ;;
10558 $rm -f try.* try$exe_ext
10560 case "$stdio_stream_array" in
10562 I can't figure out how to access stdio streams by file descriptor number.
10564 d_stdio_stream_array="$undef"
10567 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10569 d_stdio_stream_array="$define"
10573 : see if strcoll exists
10574 set strcoll d_strcoll
10577 : check for structure copying
10579 echo "Checking to see if your C compiler can copy structs..." >&4
10580 $cat >try.c <<'EOCP'
10590 if $cc -c try.c >/dev/null 2>&1 ; then
10592 echo "Yup, it can."
10595 echo "Nope, it can't."
10601 : see if strerror and/or sys_errlist[] exist
10603 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10604 if set strerror val -f d_strerror; eval $csym; $val; then
10605 echo 'strerror() found.' >&4
10606 d_strerror="$define"
10607 d_strerrm='strerror(e)'
10608 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10609 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10610 d_syserrlst="$define"
10612 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10613 d_syserrlst="$undef"
10615 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10616 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10617 echo 'strerror() found in string header.' >&4
10618 d_strerror="$define"
10619 d_strerrm='strerror(e)'
10620 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10621 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10622 d_syserrlst="$define"
10624 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10625 d_syserrlst="$undef"
10627 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10628 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10629 d_strerror="$undef"
10630 d_syserrlst="$define"
10631 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10633 echo 'strerror() and sys_errlist[] NOT found.' >&4
10634 d_strerror="$undef"
10635 d_syserrlst="$undef"
10636 d_strerrm='"unknown"'
10640 : see if strtod exists
10641 set strtod d_strtod
10644 : see if strtol exists
10645 set strtol d_strtol
10648 : see if strtoul exists
10649 set strtoul d_strtoul
10652 : see if strtoull exists
10653 set strtoull d_strtoull
10656 : see if strxfrm exists
10657 set strxfrm d_strxfrm
10660 : see if symlink exists
10661 set symlink d_symlink
10664 : see if syscall exists
10665 set syscall d_syscall
10668 : see if sysconf exists
10669 set sysconf d_sysconf
10672 : see if system exists
10673 set system d_system
10676 : see if tcgetpgrp exists
10677 set tcgetpgrp d_tcgetpgrp
10680 : see if tcsetpgrp exists
10681 set tcsetpgrp d_tcsetpgrp
10684 : see if prototype for telldir is available
10686 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10689 : define an is-a-typedef? function
10690 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10692 "") inclist="sys/types.h";;
10694 eval "varval=\$$var";
10698 for inc in $inclist; do
10699 echo "#include <$inc>" >>temp.c;
10701 echo "#ifdef $type" >> temp.c;
10702 echo "printf(\"We have $type\");" >> temp.c;
10703 echo "#endif" >> temp.c;
10704 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10705 if $contains $type temp.E >/dev/null 2>&1; then
10706 eval "$var=\$type";
10711 *) eval "$var=\$varval";;
10714 : define an is-a-typedef? function that prompts if the type is not available.
10715 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10717 "") inclist="sys/types.h";;
10719 eval "varval=\$$var";
10723 for inc in $inclist; do
10724 echo "#include <$inc>" >>temp.c;
10726 echo "#ifdef $type" >> temp.c;
10727 echo "printf(\"We have $type\");" >> temp.c;
10728 echo "#endif" >> temp.c;
10729 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10731 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10732 if $contains $type temp.E >/dev/null 2>&1; then
10733 echo "$type found." >&4;
10734 eval "$var=\$type";
10736 echo "$type NOT found." >&4;
10742 *) eval "$var=\$varval";;
10745 : see if this is a sys/times.h system
10746 set sys/times.h i_systimes
10749 : see if times exists
10751 if set times val -f d_times; eval $csym; $val; then
10752 echo 'times() found.' >&4
10755 case "$i_systimes" in
10756 "$define") inc='sys/times.h';;
10758 rp="What is the type returned by times() on this system?"
10759 set clock_t clocktype long stdio.h sys/types.h $inc
10762 echo 'times() NOT found, hope that will do.' >&4
10767 : see if truncate exists
10768 set truncate d_truncate
10771 : see if tzname[] exists
10773 if set tzname val -a d_tzname; eval $csym; $val; then
10775 echo 'tzname[] found.' >&4
10778 echo 'tzname[] NOT found.' >&4
10783 : see if umask exists
10787 : see if ustat exists
10791 : backward compatibility for d_hvfork
10792 if test X$d_hvfork != X; then
10793 d_vfork="$d_hvfork"
10796 : see if there is a vfork
10801 : Ok, but do we want to use it. vfork is reportedly unreliable in
10802 : perl on Solaris 2.x, and probably elsewhere.
10806 case "$usevfork" in
10812 Perl can only use a vfork() that doesn't suffer from strict
10813 restrictions on calling functions or modifying global data in
10814 the child. For example, glibc-2.1 contains such a vfork()
10815 that is unsuitable. If your system provides a proper fork()
10816 call, chances are that you do NOT want perl to use vfork().
10819 rp="Do you still want to use vfork()?"
10824 echo "Ok, we won't use vfork()."
10833 $define) usevfork='true';;
10834 *) usevfork='false';;
10837 : see if this is an sysdir system
10838 set sys/dir.h i_sysdir
10841 : see if this is an sysndir system
10842 set sys/ndir.h i_sysndir
10845 : see if closedir exists
10846 set closedir d_closedir
10849 case "$d_closedir" in
10852 echo "Checking whether closedir() returns a status..." >&4
10853 cat > closedir.c <<EOM
10854 #$i_dirent I_DIRENT /**/
10855 #$i_sysdir I_SYS_DIR /**/
10856 #$i_sysndir I_SYS_NDIR /**/
10857 #$i_systypes I_SYS_TYPES /**/
10859 #if defined(I_SYS_TYPES)
10860 #include <sys/types.h>
10862 #if defined(I_DIRENT)
10863 #include <dirent.h>
10864 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10865 #include <sys/dir.h>
10869 #include <sys/ndir.h>
10873 #include <ndir.h> /* may be wrong in the future */
10875 #include <sys/dir.h>
10880 int main() { return closedir(opendir(".")); }
10883 if eval $compile_ok; then
10884 if ./closedir > /dev/null 2>&1 ; then
10885 echo "Yes, it does."
10888 echo "No, it doesn't."
10892 echo "(I can't seem to compile the test program--assuming it doesn't)"
10900 set d_void_closedir
10903 : check for volatile keyword
10905 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10906 $cat >try.c <<'EOCP'
10909 typedef struct _goo_struct goo_struct;
10910 goo_struct * volatile goo = ((goo_struct *)0);
10911 struct _goo_struct {
10916 typedef unsigned short foo_t;
10917 char *volatile foo;
10919 volatile foo_t blech;
10923 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10925 echo "Yup, it does."
10928 echo "Nope, it doesn't."
10934 : see if there is a wait4
10938 : see if waitpid exists
10939 set waitpid d_waitpid
10942 : see if wcstombs exists
10943 set wcstombs d_wcstombs
10946 : see if wctomb exists
10947 set wctomb d_wctomb
10950 : see if writev exists
10951 set writev d_writev
10954 : preserve RCS keywords in files with variable substitution, grrr
10959 Revision='$Revision'
10961 case "$crosscompile" in
10962 ''|[nN]*) crosscompile="$undef" ;;
10966 next|rhapsody) multiarch="$define" ;;
10968 case "$multiarch" in
10969 ''|[nN]*) multiarch="$undef" ;;
10972 : check for alignment requirements
10974 case "$crosscompile$multiarch" in
10977 You seem to be either cross-compiling or doing a multiarchitecture build,
10978 skipping the memory alignment check.
10981 case "$alignbytes" in
10982 '') alignbytes=8 ;;
10986 case "$alignbytes" in
10987 '') echo "Checking alignment constraints..." >&4
10988 $cat >try.c <<'EOCP'
10995 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10999 if eval $compile_ok; then
11003 echo "(I can't seem to compile the test program...)"
11006 *) dflt="$alignbytes"
11009 rp="Doubles must be aligned on a how-many-byte boundary?"
11017 : check for ordering of bytes in a long
11019 case "$crosscompile$multiarch" in
11022 You seem to be either cross-compiling or doing a multiarchitecture build,
11023 skipping the byteorder check.
11029 case "$byteorder" in
11032 In the following, larger digits indicate more significance. A big-endian
11033 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11034 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11035 machines may have weird orders like 3412. A Cray will report 87654321,
11036 an Alpha will report 12345678. If the test program works the default is
11038 I'm now running the test program...
11040 $cat >try.c <<'EOCP'
11047 char c[sizeof(long)];
11050 if (sizeof(long) > 4)
11051 u.l = (0x08070605L << 32) | 0x04030201L;
11054 for (i = 0; i < sizeof(long); i++)
11055 printf("%c", u.c[i]+'0');
11062 if eval $compile && ./try > /dev/null; then
11065 [1-4][1-4][1-4][1-4]|12345678|87654321)
11066 echo "(The test program ran ok.)"
11067 echo "byteorder=$dflt"
11070 ????|????????) echo "(The test program ran ok.)" ;;
11071 *) echo "(The test program didn't run right for some reason.)" ;;
11076 (I can't seem to compile the test program. Guessing big-endian...)
11079 case "$xxx_prompt" in
11081 rp="What is the order of bytes in a long?"
11095 : how do we catenate cpp tokens here?
11097 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11098 $cat >cpp_stuff.c <<'EOCP'
11099 #define RCAT(a,b)a/**/b
11100 #define ACAT(a,b)a ## b
11104 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11105 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11106 echo "Oh! Smells like ANSI's been here." >&4
11107 echo "We can catify or stringify, separately or together!"
11109 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11110 echo "Ah, yes! The good old days!" >&4
11111 echo "However, in the good old days we don't know how to stringify and"
11112 echo "catify at the same time."
11116 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11117 to have to edit the values of CAT[2-5] in config.h...
11119 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11123 : see if this is a db.h system
11129 : Check db version.
11131 echo "Checking Berkeley DB version ..." >&4
11137 #include <sys/types.h>
11142 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11143 int Major, Minor, Patch ;
11144 unsigned long Version ;
11145 (void)db_version(&Major, &Minor, &Patch) ;
11146 printf("You have Berkeley DB Version 2 or greater\n");
11148 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11149 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11150 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11151 Major, Minor, Patch) ;
11153 /* check that db.h & libdb are compatible */
11154 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11155 printf("db.h and libdb are incompatible\n") ;
11159 printf("db.h and libdb are compatible\n") ;
11161 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11162 + DB_VERSION_PATCH ;
11164 /* needs to be >= 2.3.4 */
11165 if (Version < 2003004) {
11166 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11167 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11173 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11174 printf("You have Berkeley DB Version 1\n");
11175 exit(0); /* DB version < 2: the coast is clear. */
11177 exit(1); /* <db.h> not Berkeley DB? */
11183 if eval $compile && ./try; then
11184 echo 'Looks OK.' >&4
11186 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11190 : Remove db from list of libraries to use
11191 echo "Removing unusable -ldb from library list" >&4
11192 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11195 echo "libs = $libs" >&4
11205 : Check the return type needed for hash
11207 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11213 #include <sys/types.h>
11216 #ifndef DB_VERSION_MAJOR
11217 u_int32_t hash_cb (ptr, size)
11225 info.hash = hash_cb;
11229 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11230 if $contains warning try.out >>/dev/null 2>&1 ; then
11233 db_hashtype='u_int32_t'
11236 : XXX Maybe we should just give up here.
11237 db_hashtype=u_int32_t
11239 echo "Help: I can't seem to compile the db test program." >&4
11240 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11243 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11245 *) db_hashtype=u_int32_t
11250 : Check the return type needed for prefix
11252 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11258 #include <sys/types.h>
11261 #ifndef DB_VERSION_MAJOR
11262 size_t prefix_cb (key1, key2)
11270 info.prefix = prefix_cb;
11274 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11275 if $contains warning try.out >>/dev/null 2>&1 ; then
11276 db_prefixtype='int'
11278 db_prefixtype='size_t'
11281 db_prefixtype='size_t'
11282 : XXX Maybe we should just give up here.
11284 echo "Help: I can't seem to compile the db test program." >&4
11285 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11288 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11290 *) db_prefixtype='size_t'
11294 : check for void type
11296 echo "Checking to see how well your C compiler groks the void type..." >&4
11297 case "$voidflags" in
11299 $cat >try.c <<'EOCP'
11305 extern void moo(); /* function returning void */
11306 void (*goo)(); /* ptr to func returning void */
11308 void *hue; /* generic ptr */
11321 int main() { sub(); }
11323 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11324 voidflags=$defvoidused
11325 echo "Good. It appears to support void to the level $package wants.">&4
11326 if $contains warning .out >/dev/null 2>&1; then
11327 echo "However, you might get some warnings that look like this:"
11331 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11332 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11333 echo "It supports 1..."
11334 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11335 echo "It also supports 2..."
11336 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11338 echo "And it supports 4 but not 8 definitely."
11340 echo "It doesn't support 4..."
11341 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11343 echo "But it supports 8."
11346 echo "Neither does it support 8."
11350 echo "It does not support 2..."
11351 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11353 echo "But it supports 4 and 8."
11355 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11357 echo "And it supports 4 but has not heard about 8."
11359 echo "However it supports 8 but not 4."
11364 echo "There is no support at all for void."
11369 case "$voidflags" in
11371 *) $cat >&4 <<'EOM'
11372 Support flag bits are:
11373 1: basic void declarations.
11374 2: arrays of pointers to functions returning void.
11375 4: operations between pointers to and addresses of void functions.
11376 8: generic void pointers.
11379 rp="Your void support flags add up to what?"
11387 : How can we generate normalized random numbers ?
11389 echo "Looking for a random number function..." >&4
11390 case "$randfunc" in
11392 if set drand48 val -f; eval $csym; $val; then
11394 echo "Good, found drand48()." >&4
11395 elif set random val -f; eval $csym; $val; then
11397 echo "OK, found random()." >&4
11400 echo "Yick, looks like I have to use rand()." >&4
11411 *-Dmy_rand=*|*-Dmy_srand=*)
11412 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11413 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11414 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11415 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11419 while $test "$cont"; do
11420 rp="Use which function to generate random numbers?"
11422 if $test "$ans" = "$dflt"; then
11428 if set $ans val -f; eval $csym; $val; then
11432 rp="I cannot find function $ans. Use that name anyway?"
11441 case "$randfunc" in
11443 drand01="drand48()"
11449 case "$randbits" in
11451 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11453 #$i_unistd I_UNISTD
11454 #$i_stdlib I_STDLIB
11457 # include <unistd.h>
11460 # include <stdlib.h>
11465 register unsigned long tmp;
11466 register unsigned long max = 0L;
11468 for (i = 1000; i; i--) {
11469 tmp = (unsigned long) $randfunc();
11470 if (tmp > max) max = tmp;
11472 for (i = 0; max; i++)
11478 if eval $compile_ok; then
11482 echo "(I can't seem to compile the test program...)"
11489 rp="How many bits does your $randfunc() function produce?"
11493 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11494 seedfunc="s$randfunc"
11495 randseedtype=unsigned
11499 rp="How many bits does your $randfunc() function produce?"
11502 seedfunc="s$randfunc"
11503 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11504 if set $seedfunc val -f; eval $csym; $val; then
11505 echo "(Using $seedfunc() to seed random generator)"
11507 echo "(Warning: no $seedfunc() to seed random generator)"
11510 randseedtype=unsigned
11518 echo "Determining whether or not we are on an EBCDIC system..." >&4
11519 $cat >tebcdic.c <<'EOM'
11522 if ('M'==0xd4) return 0;
11529 if eval $compile_ok; then
11531 echo "You have EBCDIC." >&4
11534 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11537 echo "I'm unable to compile the test program." >&4
11538 echo "I'll assume ASCII or some ISO Latin." >&4
11540 $rm -f tebcdic.c tebcdic
11546 Checking how to flush all pending stdio output...
11548 # I only know how to find the first 32 possibly open files on SunOS.
11549 # See also hints/sunos_4_1.sh and util.c --AD
11551 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11553 $cat >>try.c <<EOCP
11555 #$i_unistd I_UNISTD
11557 # include <unistd.h>
11559 #$d_sysconf HAS_SYSCONF
11560 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11561 #ifdef HAS_STDIO_STREAM_ARRAY
11562 # define STDIO_STREAM_ARRAY $stdio_stream_array
11565 FILE* p = fopen("try.out", "w");
11569 # ifdef TRY_FPRINTF
11573 #ifdef TRY_FFLUSH_NULL
11576 #ifdef TRY_FFLUSH_ALL
11578 long open_max = -1;
11579 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11580 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11582 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11583 open_max = sysconf(_SC_OPEN_MAX);
11586 open_max = FOPEN_MAX;
11589 open_max = OPEN_MAX;
11598 # ifdef HAS_STDIO_STREAM_ARRAY
11599 if (open_max > 0) {
11601 for (i = 0; i < open_max; i++)
11602 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11603 STDIO_STREAM_ARRAY[i]._file < open_max &&
11604 STDIO_STREAM_ARRAY[i]._flag)
11605 fflush(&STDIO_STREAM_ARRAY[i]);
11613 : first we have to find out how _not_ to flush
11614 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11616 set try -DTRY_FPUTC
11617 if eval $compile; then
11619 ./try$exe_ext 2>/dev/null
11620 if $test ! -s try.out -a "X$?" = X42; then
11626 set try -DTRY_FPRINTF
11628 if eval $compile; then
11630 ./try$exe_ext 2>/dev/null
11631 if $test ! -s try.out -a "X$?" = X42; then
11632 output=-DTRY_FPRINTF
11638 : check for fflush NULL behaviour
11639 case "$fflushNULL" in
11640 '') set try -DTRY_FFLUSH_NULL $output
11641 if eval $compile; then
11643 ./try$exe_ext 2>/dev/null
11645 if $test -s try.out -a "X$code" = X42; then
11646 fflushNULL="`$cat try.out`"
11648 if $test "X$code" != X42; then
11650 (If this test failed, don't worry, we'll try another method shortly.)
11655 $rm -f core try.core core.try.*
11656 case "$fflushNULL" in
11658 Your fflush(NULL) works okay.
11660 fflushNULL="$define"
11663 Your fflush(NULL) isn't working (contrary to ANSI C).
11665 fflushNULL="$undef"
11668 Cannot figure out whether your fflush(NULL) works or not.
11669 I'm assuming it doesn't (contrary to ANSI C).
11671 fflushNULL="$undef"
11675 $define|true|[yY]*)
11676 fflushNULL="$define"
11679 fflushNULL="$undef"
11682 : check explicit looping only if NULL did not work
11683 case "$fflushNULL" in
11685 : check for fflush all behaviour
11686 case "$fflushall" in
11687 '') set try -DTRY_FFLUSH_ALL $output
11688 if eval $compile; then
11690 (Now testing the other method--but note that also this may fail.)
11693 ./try$exe_ext 2>/dev/null
11694 if $test -s try.out -a "X$?" = X42; then
11695 fflushall="`$cat try.out`"
11698 $rm -f core try.core core.try.*
11699 case "$fflushall" in
11701 Whew. Flushing explicitly all the stdio streams works.
11703 fflushall="$define"
11706 Sigh. Flushing explicitly all the stdio streams doesn't work.
11711 Cannot figure out whether flushing stdio streams explicitly works or not.
11712 I'm assuming it doesn't.
11718 "$define"|true|[yY]*)
11719 fflushall="$define"
11726 *) fflushall="$undef"
11729 case "$fflushNULL$fflushall" in
11732 I cannot figure out how to flush pending stdio output.
11736 $rm -f try.* try$exe_ext
11738 : see what type file positions are declared as in the library
11739 rp="What is the type for file position used by fsetpos()?"
11740 set fpos_t fpostype long stdio.h sys/types.h
11743 : Store the full pathname to the ar program for use in the C program
11744 : Respect a hint or command line value for full_ar.
11749 : Store the full pathname to the sed program for use in the C program
11752 : see what type gids are declared as in the kernel
11754 echo "Looking for the type for group ids returned by getgid()."
11755 set gid_t gidtype xxx stdio.h sys/types.h
11759 xxx=`./findhdr sys/user.h`
11760 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11762 unsigned) dflt="$1 $2" ;;
11766 *) dflt="$gidtype";;
11769 gid_t) echo "gid_t found." ;;
11770 *) rp="What is the type for group ids returned by getgid()?"
11776 : see if getgroups exists
11777 set getgroups d_getgrps
11780 : see if setgroups exists
11781 set setgroups d_setgrps
11785 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11787 case "$d_getgrps$d_setgrps" in
11789 case "$groupstype" in
11790 '') dflt="$gidtype" ;;
11791 *) dflt="$groupstype" ;;
11794 What type of pointer is the second argument to getgroups() and setgroups()?
11795 Usually this is the same as group ids, $gidtype, but not always.
11798 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11802 *) groupstype="$gidtype";;
11805 : see what type lseek is declared as in the kernel
11806 rp="What is the type used for lseek's offset on this system?"
11807 set off_t lseektype long stdio.h sys/types.h
11811 $echo $n "Checking to see how big your file offsets are...$c" >&4
11813 #include <sys/types.h>
11817 printf("%d\n", sizeof($lseektype));
11821 if eval $compile_ok; then
11823 $echo " $lseeksize bytes." >&4
11827 echo "(I can't seem to compile the test program. Guessing...)"
11828 rp="What is the size of your file offsets (in bytes)?"
11835 echo "Checking if your $make program sets \$(MAKE)..." >&4
11836 case "$make_set_make" in
11838 $sed 's/^X //' > testmake.mak << 'EOF'
11840 X @echo 'maketemp="$(MAKE)"'
11842 case "`$make -f testmake.mak 2>/dev/null`" in
11843 *maketemp=*) make_set_make='#' ;;
11844 *) make_set_make="MAKE=$make" ;;
11846 $rm -f testmake.mak
11849 case "$make_set_make" in
11850 '#') echo "Yup, it does.";;
11851 *) echo "Nope, it doesn't.";;
11854 : see what type is used for mode_t
11855 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11856 set mode_t modetype int stdio.h sys/types.h
11859 : define a fucntion to check prototypes
11860 $cat > protochk <<EOSH
11863 optimize="$optimize"
11865 prototype="$prototype"
11870 $cat >> protochk <<'EOSH'
11875 while test $# -ge 2; do
11877 $define) echo "#include <$2>" >> try.c ;;
11878 literal) echo "$2" >> try.c ;;
11882 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11883 cat >> try.c <<'EOCP'
11884 #ifdef CAN_PROTOTYPE
11885 #define _(args) args
11890 echo "$foo" >> try.c
11891 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11892 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11898 $eunicefix protochk
11900 : see what type is used for size_t
11901 rp="What is the type used for the length parameter for string functions?"
11902 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11905 : check for type of arguments to gethostbyaddr.
11906 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11907 case "$d_gethbyaddr" in
11911 Checking to see what type of arguments are accepted by gethostbyaddr().
11913 hdrs="$define sys/types.h
11914 $d_socket sys/socket.h
11915 $i_niin netinet/in.h
11917 $i_unistd unistd.h"
11918 : The first arg can 'char *' or 'void *'
11919 : The second arg is some of integral type
11920 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11921 for yyy in size_t long int; do
11922 case "$netdb_host_type" in
11923 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11924 if ./protochk "$try" $hdrs; then
11925 echo "Your system accepts $xxx for the first arg."
11926 echo "...and $yyy for the second arg."
11927 netdb_host_type="$xxx"
11928 netdb_hlen_type="$yyy"
11934 : In case none of those worked, prompt the user.
11935 case "$netdb_host_type" in
11936 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11939 netdb_host_type=$ans
11940 rp='What is the type for the 2nd argument to gethostbyaddr?'
11943 netdb_hlen_type=$ans
11947 *) : no gethostbyaddr, so pick harmless defaults
11948 netdb_host_type='char *'
11949 netdb_hlen_type="$sizetype"
11952 # Remove the "const" if needed. -- but then we'll have a
11954 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11957 : check for type of argument to gethostbyname.
11958 if test "X$netdb_name_type" = X ; then
11959 case "$d_gethbyname" in
11963 Checking to see what type of argument is accepted by gethostbyname().
11965 hdrs="$define sys/types.h
11966 $d_socket sys/socket.h
11967 $i_niin netinet/in.h
11969 $i_unistd unistd.h"
11970 for xxx in "const char *" "char *"; do
11971 case "$netdb_name_type" in
11972 '') try="extern struct hostent *gethostbyname($xxx);"
11973 if ./protochk "$try" $hdrs; then
11974 echo "Your system accepts $xxx."
11975 netdb_name_type="$xxx"
11980 : In case none of those worked, prompt the user.
11981 case "$netdb_name_type" in
11982 '') rp='What is the type for the 1st argument to gethostbyname?'
11985 netdb_name_type=$ans
11989 *) : no gethostbyname, so pick harmless default
11990 netdb_name_type='char *'
11995 : check for type of 1st argument to getnetbyaddr.
11996 if test "X$netdb_net_type" = X ; then
11997 case "$d_getnbyaddr" in
12001 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12003 hdrs="$define sys/types.h
12004 $d_socket sys/socket.h
12005 $i_niin netinet/in.h
12007 $i_unistd unistd.h"
12008 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12009 case "$netdb_net_type" in
12010 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12011 if ./protochk "$try" $hdrs; then
12012 echo "Your system accepts $xxx."
12013 netdb_net_type="$xxx"
12018 : In case none of those worked, prompt the user.
12019 case "$netdb_net_type" in
12020 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12023 netdb_net_type=$ans
12027 *) : no getnetbyaddr, so pick harmless default
12028 netdb_net_type='long'
12032 : locate the preferred pager for this system
12046 '') dflt=/usr/ucb/more;;
12053 rp='What pager is used on your system?'
12057 : see what type pids are declared as in the kernel
12058 rp="What is the type of process ids on this system?"
12059 set pid_t pidtype int stdio.h sys/types.h
12062 : Find earliest binary compatible site_perl subdirectory perl can use.
12063 case "$bincompat5005" in
12064 "$define") xs_apiversion='5.005' ;;
12065 *) xs_apiversion=$apiversion ;; # The current site_perl version.
12067 : Find earliest pure perl site_perl subdirectory perl can use.
12068 : The versioned directories started at 5.005.
12069 pm_apiversion='5.005'
12071 : check for length of pointer
12075 $echo $n "Checking to see how big your pointers are...$c" >&4
12076 if test "$voidflags" -gt 7; then
12077 echo '#define VOID_PTR char *' > try.c
12079 echo '#define VOID_PTR void *' > try.c
12081 $cat >>try.c <<'EOCP'
12085 printf("%d\n", sizeof(VOID_PTR));
12090 if eval $compile_ok; then
12092 $echo " $ptrsize bytes." >&4
12095 echo "(I can't seem to compile the test program. Guessing...)" >&4
12096 rp="What is the size of a pointer (in bytes)?"
12104 : see if ar generates random libraries by itself
12106 echo "Checking how to generate random libraries on your machine..." >&4
12107 echo 'int bar1() { return bar2(); }' > bar1.c
12108 echo 'int bar2() { return 2; }' > bar2.c
12109 $cat > foo.c <<'EOP'
12110 int main() { printf("%d\n", bar1()); exit(0); }
12112 $cc $ccflags -c bar1.c >/dev/null 2>&1
12113 $cc $ccflags -c bar2.c >/dev/null 2>&1
12114 $cc $ccflags -c foo.c >/dev/null 2>&1
12115 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12116 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12117 ./foobar >/dev/null 2>&1; then
12118 echo "$ar appears to generate random libraries itself."
12121 elif $ar ts bar$_a >/dev/null 2>&1 &&
12122 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12123 ./foobar >/dev/null 2>&1; then
12124 echo "a table of contents needs to be added with '$ar ts'."
12131 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12132 $test -f $ranlib || ranlib=''
12135 if $test -n "$ranlib"; then
12136 echo "your system has '$ranlib'; we'll use that."
12139 echo "your system doesn't seem to support random libraries"
12140 echo "so we'll use lorder and tsort to order the libraries."
12147 : check for type of arguments to select.
12148 case "$selecttype" in
12149 '') case "$d_select" in
12152 Checking to see what type of arguments are accepted by select().
12154 hdrs="$define sys/types.h
12155 $i_systime sys/time.h
12156 $i_sysselct sys/select.h
12157 $d_socket sys/socket.h"
12158 : The first arg can be int, unsigned, or size_t
12159 : The last arg may or may not be 'const'
12161 : void pointer has been seen but using that
12162 : breaks the selectminbits test
12163 for xxx in 'fd_set *' 'int *'; do
12164 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12165 for tmo in 'struct timeval *' 'const struct timeval *'; do
12167 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12168 if ./protochk "$try" $hdrs; then
12169 echo "Your system accepts $xxx."
12178 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12179 case "$d_fd_set" in
12180 $define) dflt="fd_set *" ;;
12189 *) : no select, so pick a harmless default
12196 : check for the select 'width'
12197 case "$selectminbits" in
12198 '') case "$d_select" in
12202 Checking to see on how many bits at a time your select() operates...
12205 #include <sys/types.h>
12207 #$i_systime I_SYS_TIME
12208 #$i_systimek I_SYS_TIME_KERNEL
12213 # ifdef I_SYS_TIME_KERNEL
12216 # include <sys/time.h>
12217 # ifdef I_SYS_TIME_KERNEL
12221 #$i_sysselct I_SYS_SELECT
12222 #ifdef I_SYS_SELECT
12223 #include <sys/select.h>
12225 #$d_socket HAS_SOCKET
12227 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12231 #define S sizeof(*(b))
12233 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12234 #define NBITS (NBYTES * 8)
12243 fp = fopen("try.c", "r");
12249 b = ($selecttype)s;
12250 for (i = 0; i < NBITS; i++)
12254 select(fd + 1, b, 0, 0, &t);
12255 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12256 printf("%d\n", i + 1);
12261 if eval $compile_ok; then
12262 selectminbits=`./try`
12263 case "$selectminbits" in
12265 Cannot figure out on how many bits at a time your select() operates.
12266 I'll play safe and guess it is 32 bits.
12272 *) bits="$selectminbits bits" ;;
12274 echo "Your select() operates on $bits at a time." >&4
12276 rp='What is the minimum number of bits your select() operates on?'
12277 case "$byteorder" in
12278 1234|12345678) dflt=32 ;;
12283 selectminbits="$val"
12287 *) : no select, so pick a harmless default
12294 : Trace out the files included by signal.h, then look for SIGxxx names.
12295 : Remove SIGARRAYSIZE used by HPUX.
12296 : Remove SIGSTKSIZE used by Linux.
12297 : Remove SIGSTKSZ used by Posix.
12298 : Remove SIGTYP void lines used by OS2.
12299 xxx=`echo '#include <signal.h>' |
12300 $cppstdin $cppminus $cppflags 2>/dev/null |
12301 $grep '^[ ]*#.*include' |
12302 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12303 : Check this list of files to be sure we have parsed the cpp output ok.
12304 : This will also avoid potentially non-existent files, such
12307 for xx in $xxx /dev/null ; do
12308 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12310 : If we have found no files, at least try signal.h
12311 case "$xxxfiles" in
12312 '') xxxfiles=`./findhdr signal.h` ;;
12315 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12316 print substr($2, 4, 20)
12318 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12319 print substr($3, 4, 20)
12321 : Append some common names just in case the awk scan failed.
12322 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12323 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12324 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12325 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12326 : generate a few handy files for later
12327 $cat > signal.c <<'EOCP'
12328 #include <sys/types.h>
12329 #include <signal.h>
12333 /* Strange style to avoid deeply-nested #if/#else/#endif */
12336 # define NSIG (_NSIG)
12342 # define NSIG (SIGMAX+1)
12348 # define NSIG (SIG_MAX+1)
12354 # define NSIG (MAXSIG+1)
12360 # define NSIG (MAX_SIG+1)
12365 # ifdef SIGARRAYSIZE
12366 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12372 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12376 /* Default to some arbitrary number that's big enough to get most
12377 of the common signals.
12383 printf("NSIG %d\n", NSIG);
12389 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12391 printf "#ifdef SIG"; printf $1; printf "\n"
12392 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12393 printf $1; printf ");\n"
12397 printf "#endif /* JUST_NSIG */\n";
12401 $cat >signal.awk <<'EOP'
12402 BEGIN { ndups = 0 }
12403 $1 ~ /^NSIG$/ { nsig = $2 }
12404 ($1 !~ /^NSIG$/) && (NF == 2) {
12405 if ($2 > maxsig) { maxsig = $2 }
12406 if (sig_name[$2]) {
12407 dup_name[ndups] = $1
12408 dup_num[ndups] = $2
12420 printf("NSIG %d\n", nsig);
12421 for (n = 1; n < nsig; n++) {
12423 printf("%s %d\n", sig_name[n], sig_num[n])
12426 printf("NUM%d %d\n", n, n)
12429 for (n = 0; n < ndups; n++) {
12430 printf("%s %d\n", dup_name[n], dup_num[n])
12434 $cat >signal_cmd <<EOS
12436 if $test -s signal.lst; then
12437 echo "Using your existing signal.lst file"
12442 $cat >>signal_cmd <<'EOS'
12445 if eval $compile_ok; then
12446 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12448 echo "(I can't seem be able to compile the whole test program)" >&4
12449 echo "(I'll try it in little pieces.)" >&4
12450 set signal -DJUST_NSIG
12451 if eval $compile_ok; then
12452 ./signal$_exe > signal.nsg
12455 echo "I can't seem to figure out how many signals you have." >&4
12456 echo "Guessing 50." >&4
12457 echo 'NSIG 50' > signal.nsg
12459 : Now look at all the signal names, one at a time.
12460 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12461 $cat > signal.c <<EOCP
12462 #include <sys/types.h>
12463 #include <signal.h>
12466 printf("$xx %d\n", SIG${xx});
12471 if eval $compile; then
12472 echo "SIG${xx} found."
12473 ./signal$_exe >> signal.ls1
12475 echo "SIG${xx} NOT found."
12478 if $test -s signal.ls1; then
12479 $cat signal.nsg signal.ls1 |
12480 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12484 if $test -s signal.lst; then
12487 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12488 echo 'kill -l' >signal
12489 set X `csh -f <signal`
12493 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12495 echo $@ | $tr ' ' $trnl | \
12496 $awk '{ printf "%s %d\n", $1, ++s; }
12497 END { printf "NSIG %d\n", ++s }' >signal.lst
12499 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12501 chmod a+x signal_cmd
12502 $eunicefix signal_cmd
12504 : generate list of signal names
12506 case "$sig_name_init" in
12508 *) case "$sig_num_init" in
12509 ''|*,*) doinit=yes ;;
12514 echo "Generating a list of signal names and numbers..." >&4
12516 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12517 sig_name=`$awk 'BEGIN { printf "ZERO " }
12518 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12519 sig_num=`$awk 'BEGIN { printf "0 " }
12520 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12521 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12522 !/^NSIG/ { printf "\"%s\", ", $1 }
12523 END { printf "0\n" }' signal.lst`
12524 sig_num_init=`$awk 'BEGIN { printf "0, " }
12525 !/^NSIG/ { printf "%d, ", $2}
12526 END { printf "0\n"}' signal.lst`
12529 echo "The following $sig_count signals are available:"
12531 echo $sig_name | $awk \
12532 'BEGIN { linelen = 0 }
12534 for (i = 1; i <= NF; i++) {
12535 name = "SIG" $i " "
12536 linelen = linelen + length(name)
12537 if (linelen > 70) {
12539 linelen = length(name)
12545 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12547 : see what type is used for signed size_t
12548 set ssize_t ssizetype int stdio.h sys/types.h
12551 $cat > ssize.c <<EOM
12553 #include <sys/types.h>
12554 #define Size_t $sizetype
12555 #define SSize_t $dflt
12558 if (sizeof(Size_t) == sizeof(SSize_t))
12560 else if (sizeof(Size_t) == sizeof(int))
12569 if eval $compile_ok && ./ssize > /dev/null; then
12570 ssizetype=`./ssize`
12571 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12574 Help! I can't compile and run the ssize_t test program: please enlighten me!
12575 (This is probably a misconfiguration in your system or libraries, and
12576 you really ought to fix it. Still, I'll try anyway.)
12578 I need a type that is the same size as $sizetype, but is guaranteed to
12579 be signed. Common values are ssize_t, int and long.
12582 rp="What signed type is the same size as $sizetype?"
12586 $rm -f ssize ssize.*
12588 : see what type of char stdio uses.
12590 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12591 echo "Your stdio uses unsigned chars." >&4
12592 stdchar="unsigned char"
12594 echo "Your stdio uses signed chars." >&4
12598 : see if time exists
12600 if test "X$d_time" = X -o X"$timetype" = X; then
12601 if set time val -f d_time; eval $csym; $val; then
12602 echo 'time() found.' >&4
12604 rp="What is the type returned by time() on this system?"
12605 set time_t timetype long stdio.h sys/types.h
12608 echo 'time() not found, hope that will do.' >&4
12616 : see what type uids are declared as in the kernel
12618 echo "Looking for the type for user ids returned by getuid()."
12619 set uid_t uidtype xxx stdio.h sys/types.h
12623 xxx=`./findhdr sys/user.h`
12624 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12626 unsigned) dflt="$1 $2" ;;
12630 *) dflt="$uidtype";;
12633 uid_t) echo "uid_t found." ;;
12634 *) rp="What is the type for user ids returned by getuid()?"
12642 *_t) zzz="$uidtype" ;;
12645 echo "Checking the sign of $zzz..." >&4
12647 #include <sys/types.h>
12658 if eval $compile; then
12662 echo "(I can't execute the test program--guessing unsigned.)" >&4
12666 1) echo "Your $zzz is unsigned." ;;
12667 -1) echo "Your $zzz is signed." ;;
12673 echo "(I can't compile the test program--guessing unsigned.)" >&4
12677 : see if dbm.h is available
12678 : see if dbmclose exists
12679 set dbmclose d_dbmclose
12682 case "$d_dbmclose" in
12692 *) set rpcsvc/dbm.h i_rpcsvcdbm
12697 *) echo "We won't be including <dbm.h>"
12707 : see if this is a sys/file.h system
12712 : do we need to include sys/file.h ?
12716 if $h_sysfile; then
12718 echo "We'll be including <sys/file.h>." >&4
12721 echo "We won't be including <sys/file.h>." >&4
12731 : see if fcntl.h is there
12736 : see if we can include fcntl.h
12742 echo "We'll be including <fcntl.h>." >&4
12745 if $h_sysfile; then
12746 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12748 echo "We won't be including <fcntl.h>." >&4
12760 : see if locale.h is available
12761 set locale.h i_locale
12764 : see if mach cthreads are available
12765 if test "X$usethreads" = "X$define"; then
12766 set mach/cthreads.h i_machcthr
12769 i_machcthr="$undef"
12774 : see if this is a math.h system
12778 : see if this is a mntent.h system
12779 set mntent.h i_mntent
12782 : see if ndbm.h is available
12787 : see if dbm_open exists
12788 set dbm_open d_dbm_open
12790 case "$d_dbm_open" in
12793 echo "We won't be including <ndbm.h>"
12802 : see if net/errno.h is available
12804 set net/errno.h val
12807 : Unfortunately, it causes problems on some systems. Arrgh.
12810 cat > try.c <<'EOM'
12813 #include <net/errno.h>
12819 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12820 echo "We'll be including <net/errno.h>." >&4
12822 echo "We won't be including <net/errno.h>." >&4
12831 : see if netinet/tcp.h is available
12832 set netinet/tcp.h i_netinettcp
12835 : see if this is a poll.h system
12839 : get C preprocessor symbols handy
12841 $echo $n "Hmm... $c"
12842 echo $al | $tr ' ' $trnl >Cppsym.know
12843 $cat <<EOSS >Cppsym
12851 case "\$list\$#" in
12854 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12856 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12859 unknown="\$unknown \$sym"
12869 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12871 exit 0; _ _ _ _\1\\ \1\\
12874 echo "exit 1; _ _ _" >>Cppsym\$\$
12875 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12877 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12883 $rm -f Cppsym\$\$ Cppsym2\$\$
12888 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12890 : now check the C compiler for additional symbols
12891 postprocess_cc_v=''
12893 aix) postprocess_cc_v="|$tr , ' '" ;;
12900 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12903 -D*) echo "\$i" | $sed 's/^-D//';;
12904 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12909 postprocess_cc_v=''
12912 ./ccsym > ccsym1.raw
12913 if $test -s ccsym1.raw; then
12914 $sort ccsym1.raw | $uniq >ccsym.raw
12916 mv ccsym1.raw ccsym.raw
12919 $awk '/\=/ { print $0; next }
12920 { print $0"=1" }' ccsym.raw >ccsym.list
12921 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12922 $comm -13 ccsym.true ccsym.list >ccsym.own
12923 $comm -12 ccsym.true ccsym.list >ccsym.com
12924 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12926 if $test -z ccsym.raw; then
12927 echo "Your C compiler doesn't seem to define any symbols!" >&4
12929 echo "However, your C preprocessor defines the following symbols:"
12932 cppsymbols=`$cat Cppsym.true`
12933 cppsymbols=`echo $cppsymbols`
12934 cppccsymbols="$cppsymbols"
12936 if $test -s ccsym.com; then
12937 echo "Your C compiler and pre-processor define these symbols:"
12938 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12941 cppccsymbols=`$cat ccsym.com`
12942 cppccsymbols=`echo $cppccsymbols`
12943 $test "$silent" || sleep 1
12945 if $test -s ccsym.cpp; then
12946 $test "$also" && echo " "
12947 echo "Your C pre-processor ${also}defines the following symbols:"
12948 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12950 cppsymbols=`$cat ccsym.cpp`
12951 cppsymbols=`echo $cppsymbols`
12952 $test "$silent" || sleep 1
12954 if $test -s ccsym.own; then
12955 $test "$also" && echo " "
12956 echo "Your C compiler ${also}defines the following cpp symbols:"
12957 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12958 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12959 ccsymbols=`$cat ccsym.own`
12960 ccsymbols=`echo $ccsymbols`
12961 $test "$silent" || sleep 1
12966 : see if this is a termio system
12970 if $test `./findhdr termios.h`; then
12971 set tcsetattr i_termios
12977 "$define") echo "You have POSIX termios.h... good!" >&4;;
12978 *) if ./Cppsym pyr; then
12979 case "`/bin/universe`" in
12980 ucb) if $test `./findhdr sgtty.h`; then
12982 echo "<sgtty.h> found." >&4
12984 echo "System is pyramid with BSD universe."
12985 echo "<sgtty.h> not found--you could have problems." >&4
12987 *) if $test `./findhdr termio.h`; then
12989 echo "<termio.h> found." >&4
12991 echo "System is pyramid with USG universe."
12992 echo "<termio.h> not found--you could have problems." >&4
12996 if $test `./findhdr termio.h`; then
12997 echo "<termio.h> found." >&4
12999 elif $test `./findhdr sgtty.h`; then
13000 echo "<sgtty.h> found." >&4
13003 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13006 if $test `./findhdr sgtty.h`; then
13007 echo "<sgtty.h> found." >&4
13009 elif $test `./findhdr termio.h`; then
13010 echo "<termio.h> found." >&4
13013 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13017 set i_termio; eval $setvar
13018 val=$val2; set i_sgtty; eval $setvar
13019 val=$val3; set i_termios; eval $setvar
13021 : see if this is a shadow.h system
13022 set shadow.h i_shadow
13025 : see if this is a socks.h system
13026 set socks.h i_socks
13029 : see if stdarg is available
13031 if $test `./findhdr stdarg.h`; then
13032 echo "<stdarg.h> found." >&4
13035 echo "<stdarg.h> NOT found." >&4
13039 : see if varags is available
13041 if $test `./findhdr varargs.h`; then
13042 echo "<varargs.h> found." >&4
13044 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13047 : set up the varargs testing programs
13048 $cat > varargs.c <<EOP
13050 #include <stdarg.h>
13053 #include <varargs.h>
13057 int f(char *p, ...)
13071 p = va_arg(ap, char *);
13076 $cat > varargs <<EOP
13078 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13087 : now check which varargs header should be included
13092 if `./varargs I_STDARG`; then
13094 elif `./varargs I_VARARGS`; then
13099 if `./varargs I_VARARGS`; then
13106 echo "I could not find the definition for va_dcl... You have problems..." >&4
13107 val="$undef"; set i_stdarg; eval $setvar
13108 val="$undef"; set i_varargs; eval $setvar
13113 case "$i_varhdr" in
13115 val="$define"; set i_stdarg; eval $setvar
13116 val="$undef"; set i_varargs; eval $setvar
13119 val="$undef"; set i_stdarg; eval $setvar
13120 val="$define"; set i_varargs; eval $setvar
13123 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13127 : see if stddef is available
13128 set stddef.h i_stddef
13131 : see if sys/access.h is available
13132 set sys/access.h i_sysaccess
13135 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13136 set sys/filio.h i_sysfilio
13139 if $test `./findhdr sys/ioctl.h`; then
13141 echo '<sys/ioctl.h> found.' >&4
13144 if $test $i_sysfilio = "$define"; then
13145 echo '<sys/ioctl.h> NOT found.' >&4
13147 $test $i_sgtty = "$define" && xxx="sgtty.h"
13148 $test $i_termio = "$define" && xxx="termio.h"
13149 $test $i_termios = "$define" && xxx="termios.h"
13150 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13156 : see if sys/resource.h has to be included
13157 set sys/resource.h i_sysresrc
13160 : see if sys/security.h is available
13161 set sys/security.h i_syssecrt
13164 : see if this is a sys/statvfs.h system
13165 set sys/statvfs.h i_sysstatvfs
13168 : see if this is a sys/un.h system
13169 set sys/un.h i_sysun
13172 : see if this is a syswait system
13173 set sys/wait.h i_syswait
13176 : see if this is a ustat.h system
13177 set ustat.h i_ustat
13180 : see if this is an utime system
13181 set utime.h i_utime
13184 : see if this is a values.h system
13185 set values.h i_values
13188 : see if this is a vfork system
13191 set vfork.h i_vfork
13199 : see if gdbm.h is available
13204 : see if gdbm_open exists
13205 set gdbm_open d_gdbm_open
13207 case "$d_gdbm_open" in
13210 echo "We won't be including <gdbm.h>"
13220 echo "Looking for extensions..." >&4
13221 : If we are using the old config.sh, known_extensions may contain
13222 : old or inaccurate or duplicate values.
13223 known_extensions=''
13224 nonxs_extensions=''
13225 : We do not use find because it might not be available.
13226 : We do not just use MANIFEST because the user may have dropped
13227 : some additional extensions into the source tree and expect them
13230 : Function to recursively find available extensions, ignoring DynaLoader
13231 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13235 DynaLoader|dynaload) ;;
13237 if $test -f $xxx/$xxx.xs; then
13238 known_extensions="$known_extensions $1$xxx";
13239 elif $test -f $xxx/Makefile.PL; then
13240 nonxs_extensions="$nonxs_extensions $1$xxx";
13242 if $test -d $xxx -a $# -lt 10; then
13245 eval $find_extensions;
13257 eval $find_extensions
13258 set X $nonxs_extensions
13260 nonxs_extensions="$*"
13261 set X $known_extensions
13263 known_extensions="$*"
13266 : Now see which are supported on this system.
13268 for xxx in $known_extensions ; do
13272 $define) avail_ext="$avail_ext $xxx" ;;
13275 GDBM_File|gdbm_fil)
13277 $define) avail_ext="$avail_ext $xxx" ;;
13280 NDBM_File|ndbm_fil)
13282 $define) avail_ext="$avail_ext $xxx" ;;
13285 ODBM_File|odbm_fil)
13286 case "${i_dbm}${i_rpcsvcdbm}" in
13287 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13291 case "$useposix" in
13292 true|define|y) avail_ext="$avail_ext $xxx" ;;
13296 case "$useopcode" in
13297 true|define|y) avail_ext="$avail_ext $xxx" ;;
13301 case "$d_socket" in
13302 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13306 case "$usethreads" in
13307 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13311 : XXX Do we need a useipcsysv variable here
13312 case "${d_msg}${d_sem}${d_shm}" in
13313 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13316 *) avail_ext="$avail_ext $xxx"
13325 : Now see which nonxs extensions are supported on this system.
13326 : For now assume all are.
13328 for xxx in $nonxs_extensions ; do
13330 *) nonxs_ext="$nonxs_ext $xxx"
13342 A number of extensions are supplied with $package. You may choose to
13343 compile these extensions for dynamic loading (the default), compile
13344 them into the $package executable (static loading), or not include
13345 them at all. Answer "none" to include no extensions.
13346 Note that DynaLoader is always built and need not be mentioned here.
13349 case "$dynamic_ext" in
13350 '') dflt="$avail_ext" ;;
13351 *) dflt="$dynamic_ext"
13352 # Perhaps we are reusing an old out-of-date config.sh.
13355 if test X"$dynamic_ext" != X"$avail_ext"; then
13357 NOTICE: Your previous config.sh list may be incorrect.
13358 The extensions now available to you are
13360 but the default list from your previous config.sh is
13372 rp="What extensions do you wish to load dynamically?"
13375 none) dynamic_ext=' ' ;;
13376 *) dynamic_ext="$ans" ;;
13379 case "$static_ext" in
13381 : Exclude those already listed in dynamic linking
13383 for xxx in $avail_ext; do
13384 case " $dynamic_ext " in
13386 *) dflt="$dflt $xxx" ;;
13393 *) dflt="$static_ext"
13400 rp="What extensions do you wish to load statically?"
13403 none) static_ext=' ' ;;
13404 *) static_ext="$ans" ;;
13409 A number of extensions are supplied with $package. Answer "none"
13410 to include no extensions.
13411 Note that DynaLoader is always built and need not be mentioned here.
13414 case "$static_ext" in
13415 '') dflt="$avail_ext" ;;
13416 *) dflt="$static_ext"
13417 # Perhaps we are reusing an old out-of-date config.sh.
13420 if test X"$static_ext" != X"$avail_ext"; then
13422 NOTICE: Your previous config.sh list may be incorrect.
13423 The extensions now available to you are
13425 but the default list from your previous config.sh is
13434 : Exclude those that are not xs extensions
13438 rp="What extensions do you wish to include?"
13441 none) static_ext=' ' ;;
13442 *) static_ext="$ans" ;;
13447 set X $dynamic_ext $static_ext $nonxs_ext
13451 : Remove build directory name from cppstdin so it can be used from
13452 : either the present location or the final installed location.
13454 : Get out of the UU directory to get correct path name.
13456 case "$cppstdin" in
13458 echo "Stripping down cppstdin path name"
13464 : end of configuration questions
13466 echo "End of configuration questions."
13469 : back to where it started
13470 if test -d ../UU; then
13474 : configuration may be patched via a 'config.over' file
13475 if $test -f config.over; then
13478 rp='I see a config.over file. Do you wish to load it?'
13481 n*) echo "OK, I'll ignore it.";;
13483 echo "Configuration override changes have been loaded."
13488 : in case they want portability, strip down executable paths
13489 case "$d_portable" in
13492 echo "Stripping down executable paths..." >&4
13493 for file in $loclist $trylist; do
13495 eval $file=`basename $temp`
13500 : create config.sh file
13502 echo "Creating config.sh..." >&4
13503 $spitshell <<EOT >config.sh
13506 # This file was produced by running the Configure script. It holds all the
13507 # definitions figured out by Configure. Should you modify one of these values,
13508 # do not forget to propagate your changes by running "Configure -der". You may
13509 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13512 # Package name : $package
13513 # Source directory : $src
13514 # Configuration time: $cf_time
13515 # Configured by : $cf_by
13516 # Target system : $myuname
13526 Revision='$Revision'
13533 alignbytes='$alignbytes'
13534 ansi2knr='$ansi2knr'
13535 aphostname='$aphostname'
13536 apiversion='$apiversion'
13539 archlibexp='$archlibexp'
13540 archname64='$archname64'
13541 archname='$archname'
13542 archobjs='$archobjs'
13547 bincompat5005='$bincompat5005'
13551 byteorder='$byteorder'
13553 castflags='$castflags'
13556 cccdlflags='$cccdlflags'
13557 ccdlflags='$ccdlflags'
13559 ccsymbols='$ccsymbols'
13561 cf_email='$cf_email'
13566 clocktype='$clocktype'
13568 compress='$compress'
13569 contains='$contains'
13573 cpp_stuff='$cpp_stuff'
13574 cppccsymbols='$cppccsymbols'
13575 cppflags='$cppflags'
13577 cppminus='$cppminus'
13579 cppstdin='$cppstdin'
13580 cppsymbols='$cppsymbols'
13581 crosscompile='$crosscompile'
13582 cryptlib='$cryptlib'
13584 d_Gconvert='$d_Gconvert'
13585 d_PRIEldbl='$d_PRIEldbl'
13586 d_PRIFldbl='$d_PRIFldbl'
13587 d_PRIGldbl='$d_PRIGldbl'
13588 d_PRIX64='$d_PRIX64'
13589 d_PRId64='$d_PRId64'
13590 d_PRIeldbl='$d_PRIeldbl'
13591 d_PRIfldbl='$d_PRIfldbl'
13592 d_PRIgldbl='$d_PRIgldbl'
13593 d_PRIi64='$d_PRIi64'
13594 d_PRIo64='$d_PRIo64'
13595 d_PRIu64='$d_PRIu64'
13596 d_PRIx64='$d_PRIx64'
13597 d_access='$d_access'
13598 d_accessx='$d_accessx'
13600 d_archlib='$d_archlib'
13603 d_attribut='$d_attribut'
13606 d_bincompat5005='$d_bincompat5005'
13608 d_bsdgetpgrp='$d_bsdgetpgrp'
13609 d_bsdsetpgrp='$d_bsdsetpgrp'
13611 d_casti32='$d_casti32'
13612 d_castneg='$d_castneg'
13613 d_charvspr='$d_charvspr'
13615 d_chroot='$d_chroot'
13616 d_chsize='$d_chsize'
13617 d_closedir='$d_closedir'
13618 d_cmsghdr_s='$d_cmsghdr_s'
13622 d_cuserid='$d_cuserid'
13623 d_dbl_dig='$d_dbl_dig'
13624 d_difftime='$d_difftime'
13625 d_dirnamlen='$d_dirnamlen'
13626 d_dlerror='$d_dlerror'
13627 d_dlopen='$d_dlopen'
13628 d_dlsymun='$d_dlsymun'
13629 d_dosuid='$d_dosuid'
13630 d_drand48proto='$d_drand48proto'
13632 d_eaccess='$d_eaccess'
13633 d_endgrent='$d_endgrent'
13634 d_endhent='$d_endhent'
13635 d_endnent='$d_endnent'
13636 d_endpent='$d_endpent'
13637 d_endpwent='$d_endpwent'
13638 d_endsent='$d_endsent'
13639 d_endspent='$d_endspent'
13640 d_eofnblk='$d_eofnblk'
13641 d_eunice='$d_eunice'
13642 d_fchmod='$d_fchmod'
13643 d_fchown='$d_fchown'
13645 d_fd_macros='$d_fd_macros'
13646 d_fd_set='$d_fd_set'
13647 d_fds_bits='$d_fds_bits'
13648 d_fgetpos='$d_fgetpos'
13649 d_flexfnam='$d_flexfnam'
13652 d_fpathconf='$d_fpathconf'
13653 d_fpos64_t='$d_fpos64_t'
13654 d_fs_data_s='$d_fs_data_s'
13655 d_fseeko='$d_fseeko'
13656 d_fsetpos='$d_fsetpos'
13657 d_fstatfs='$d_fstatfs'
13658 d_fstatvfs='$d_fstatvfs'
13659 d_ftello='$d_ftello'
13661 d_getgrent='$d_getgrent'
13662 d_getgrps='$d_getgrps'
13663 d_gethbyaddr='$d_gethbyaddr'
13664 d_gethbyname='$d_gethbyname'
13665 d_gethent='$d_gethent'
13666 d_gethname='$d_gethname'
13667 d_gethostprotos='$d_gethostprotos'
13668 d_getlogin='$d_getlogin'
13669 d_getmntent='$d_getmntent'
13670 d_getnbyaddr='$d_getnbyaddr'
13671 d_getnbyname='$d_getnbyname'
13672 d_getnent='$d_getnent'
13673 d_getnetprotos='$d_getnetprotos'
13674 d_getpbyname='$d_getpbyname'
13675 d_getpbynumber='$d_getpbynumber'
13676 d_getpent='$d_getpent'
13677 d_getpgid='$d_getpgid'
13678 d_getpgrp2='$d_getpgrp2'
13679 d_getpgrp='$d_getpgrp'
13680 d_getppid='$d_getppid'
13681 d_getprior='$d_getprior'
13682 d_getprotoprotos='$d_getprotoprotos'
13683 d_getpwent='$d_getpwent'
13684 d_getsbyname='$d_getsbyname'
13685 d_getsbyport='$d_getsbyport'
13686 d_getsent='$d_getsent'
13687 d_getservprotos='$d_getservprotos'
13688 d_getspent='$d_getspent'
13689 d_getspnam='$d_getspnam'
13690 d_gettimeod='$d_gettimeod'
13691 d_gnulibc='$d_gnulibc'
13692 d_grpasswd='$d_grpasswd'
13693 d_hasmntopt='$d_hasmntopt'
13696 d_inetaton='$d_inetaton'
13697 d_int64t='$d_int64t'
13698 d_iovec_s='$d_iovec_s'
13699 d_isascii='$d_isascii'
13700 d_killpg='$d_killpg'
13701 d_lchown='$d_lchown'
13702 d_ldbl_dig='$d_ldbl_dig'
13704 d_llseek='$d_llseek'
13705 d_locconv='$d_locconv'
13707 d_longdbl='$d_longdbl'
13708 d_longlong='$d_longlong'
13710 d_madvise='$d_madvise'
13712 d_mbstowcs='$d_mbstowcs'
13713 d_mbtowc='$d_mbtowc'
13714 d_memchr='$d_memchr'
13715 d_memcmp='$d_memcmp'
13716 d_memcpy='$d_memcpy'
13717 d_memmove='$d_memmove'
13718 d_memset='$d_memset'
13720 d_mkfifo='$d_mkfifo'
13721 d_mktime='$d_mktime'
13723 d_mprotect='$d_mprotect'
13725 d_msg_ctrunc='$d_msg_ctrunc'
13726 d_msg_dontroute='$d_msg_dontroute'
13727 d_msg_oob='$d_msg_oob'
13728 d_msg_peek='$d_msg_peek'
13729 d_msg_proxy='$d_msg_proxy'
13730 d_msgctl='$d_msgctl'
13731 d_msgget='$d_msgget'
13732 d_msghdr_s='$d_msghdr_s'
13733 d_msgrcv='$d_msgrcv'
13734 d_msgsnd='$d_msgsnd'
13736 d_munmap='$d_munmap'
13737 d_mymalloc='$d_mymalloc'
13739 d_off64_t='$d_off64_t'
13740 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13741 d_oldpthreads='$d_oldpthreads'
13742 d_oldsock='$d_oldsock'
13744 d_pathconf='$d_pathconf'
13746 d_phostname='$d_phostname'
13749 d_portable='$d_portable'
13750 d_pthread_yield='$d_pthread_yield'
13752 d_pwchange='$d_pwchange'
13753 d_pwclass='$d_pwclass'
13754 d_pwcomment='$d_pwcomment'
13755 d_pwexpire='$d_pwexpire'
13756 d_pwgecos='$d_pwgecos'
13757 d_pwpasswd='$d_pwpasswd'
13758 d_pwquota='$d_pwquota'
13759 d_readdir='$d_readdir'
13760 d_readlink='$d_readlink'
13762 d_recvmsg='$d_recvmsg'
13763 d_rename='$d_rename'
13764 d_rewinddir='$d_rewinddir'
13766 d_safebcpy='$d_safebcpy'
13767 d_safemcpy='$d_safemcpy'
13768 d_sanemcmp='$d_sanemcmp'
13769 d_sched_yield='$d_sched_yield'
13770 d_scm_rights='$d_scm_rights'
13771 d_seekdir='$d_seekdir'
13772 d_select='$d_select'
13774 d_semctl='$d_semctl'
13775 d_semctl_semid_ds='$d_semctl_semid_ds'
13776 d_semctl_semun='$d_semctl_semun'
13777 d_semget='$d_semget'
13779 d_sendmsg='$d_sendmsg'
13780 d_setegid='$d_setegid'
13781 d_seteuid='$d_seteuid'
13782 d_setgrent='$d_setgrent'
13783 d_setgrps='$d_setgrps'
13784 d_sethent='$d_sethent'
13785 d_setlinebuf='$d_setlinebuf'
13786 d_setlocale='$d_setlocale'
13787 d_setnent='$d_setnent'
13788 d_setpent='$d_setpent'
13789 d_setpgid='$d_setpgid'
13790 d_setpgrp2='$d_setpgrp2'
13791 d_setpgrp='$d_setpgrp'
13792 d_setprior='$d_setprior'
13793 d_setpwent='$d_setpwent'
13794 d_setregid='$d_setregid'
13795 d_setresgid='$d_setresgid'
13796 d_setresuid='$d_setresuid'
13797 d_setreuid='$d_setreuid'
13798 d_setrgid='$d_setrgid'
13799 d_setruid='$d_setruid'
13800 d_setsent='$d_setsent'
13801 d_setsid='$d_setsid'
13802 d_setspent='$d_setspent'
13803 d_setvbuf='$d_setvbuf'
13807 d_shmatprototype='$d_shmatprototype'
13808 d_shmctl='$d_shmctl'
13810 d_shmget='$d_shmget'
13811 d_sigaction='$d_sigaction'
13812 d_sigsetjmp='$d_sigsetjmp'
13813 d_socket='$d_socket'
13814 d_sockpair='$d_sockpair'
13816 d_statblks='$d_statblks'
13817 d_statfs='$d_statfs'
13818 d_statfs_f_flags='$d_statfs_f_flags'
13819 d_statfs_s='$d_statfs_s'
13820 d_statvfs='$d_statvfs'
13821 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13822 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13823 d_stdio_stream_array='$d_stdio_stream_array'
13824 d_stdiobase='$d_stdiobase'
13825 d_stdstdio='$d_stdstdio'
13826 d_strchr='$d_strchr'
13827 d_strcoll='$d_strcoll'
13828 d_strctcpy='$d_strctcpy'
13829 d_strerrm='$d_strerrm'
13830 d_strerror='$d_strerror'
13831 d_strtod='$d_strtod'
13832 d_strtol='$d_strtol'
13833 d_strtoul='$d_strtoul'
13834 d_strtoull='$d_strtoull'
13835 d_strxfrm='$d_strxfrm'
13836 d_suidsafe='$d_suidsafe'
13837 d_symlink='$d_symlink'
13838 d_syscall='$d_syscall'
13839 d_sysconf='$d_sysconf'
13840 d_sysernlst='$d_sysernlst'
13841 d_syserrlst='$d_syserrlst'
13842 d_system='$d_system'
13843 d_tcgetpgrp='$d_tcgetpgrp'
13844 d_tcsetpgrp='$d_tcsetpgrp'
13845 d_telldir='$d_telldir'
13846 d_telldirproto='$d_telldirproto'
13849 d_truncate='$d_truncate'
13850 d_tzname='$d_tzname'
13853 d_union_semun='$d_union_semun'
13855 d_vendorbin='$d_vendorbin'
13856 d_vendorlib='$d_vendorlib'
13858 d_void_closedir='$d_void_closedir'
13859 d_voidsig='$d_voidsig'
13860 d_voidtty='$d_voidtty'
13861 d_volatile='$d_volatile'
13862 d_vprintf='$d_vprintf'
13864 d_waitpid='$d_waitpid'
13865 d_wcstombs='$d_wcstombs'
13866 d_wctomb='$d_wctomb'
13867 d_writev='$d_writev'
13870 db_hashtype='$db_hashtype'
13871 db_prefixtype='$db_prefixtype'
13872 defvoidused='$defvoidused'
13873 direntrytype='$direntrytype'
13876 doublesize='$doublesize'
13878 dynamic_ext='$dynamic_ext'
13884 eunicefix='$eunicefix'
13887 extensions='$extensions'
13888 fflushNULL='$fflushNULL'
13889 fflushall='$fflushall'
13891 firstmakefile='$firstmakefile'
13893 fpostype='$fpostype'
13894 freetype='$freetype'
13896 full_csh='$full_csh'
13897 full_sed='$full_sed'
13898 gccversion='$gccversion'
13902 groupcat='$groupcat'
13903 groupstype='$groupstype'
13906 h_sysfile='$h_sysfile'
13910 i_arpainet='$i_arpainet'
13911 i_bsdioctl='$i_bsdioctl'
13914 i_dirent='$i_dirent'
13921 i_inttypes='$i_inttypes'
13922 i_limits='$i_limits'
13923 i_locale='$i_locale'
13924 i_machcthr='$i_machcthr'
13925 i_malloc='$i_malloc'
13927 i_memory='$i_memory'
13928 i_mntent='$i_mntent'
13931 i_neterrno='$i_neterrno'
13932 i_netinettcp='$i_netinettcp'
13935 i_pthread='$i_pthread'
13937 i_rpcsvcdbm='$i_rpcsvcdbm'
13940 i_shadow='$i_shadow'
13942 i_stdarg='$i_stdarg'
13943 i_stddef='$i_stddef'
13944 i_stdlib='$i_stdlib'
13945 i_string='$i_string'
13946 i_sysaccess='$i_sysaccess'
13947 i_sysdir='$i_sysdir'
13948 i_sysfile='$i_sysfile'
13949 i_sysfilio='$i_sysfilio'
13951 i_sysioctl='$i_sysioctl'
13952 i_sysmman='$i_sysmman'
13953 i_sysmount='$i_sysmount'
13954 i_sysndir='$i_sysndir'
13955 i_sysparam='$i_sysparam'
13956 i_sysresrc='$i_sysresrc'
13957 i_syssecrt='$i_syssecrt'
13958 i_sysselct='$i_sysselct'
13959 i_syssockio='$i_syssockio'
13960 i_sysstat='$i_sysstat'
13961 i_sysstatfs='$i_sysstatfs'
13962 i_sysstatvfs='$i_sysstatvfs'
13963 i_systime='$i_systime'
13964 i_systimek='$i_systimek'
13965 i_systimes='$i_systimes'
13966 i_systypes='$i_systypes'
13967 i_sysuio='$i_sysuio'
13969 i_sysvfs='$i_sysvfs'
13970 i_syswait='$i_syswait'
13971 i_termio='$i_termio'
13972 i_termios='$i_termios'
13974 i_unistd='$i_unistd'
13977 i_values='$i_values'
13978 i_varargs='$i_varargs'
13979 i_varhdr='$i_varhdr'
13981 ignore_versioned_solibs='$ignore_versioned_solibs'
13984 installarchlib='$installarchlib'
13985 installbin='$installbin'
13986 installman1dir='$installman1dir'
13987 installman3dir='$installman3dir'
13988 installprefix='$installprefix'
13989 installprefixexp='$installprefixexp'
13990 installprivlib='$installprivlib'
13991 installscript='$installscript'
13992 installsitearch='$installsitearch'
13993 installsitebin='$installsitebin'
13994 installsitelib='$installsitelib'
13995 installstyle='$installstyle'
13996 installusrbinperl='$installusrbinperl'
13997 installvendorbin='$installvendorbin'
13998 installvendorlib='$installvendorlib'
14000 known_extensions='$known_extensions'
14004 lddlflags='$lddlflags'
14006 ldlibpthname='$ldlibpthname'
14013 libswanted='$libswanted'
14019 locincpth='$locincpth'
14020 loclibpth='$loclibpth'
14021 longdblsize='$longdblsize'
14022 longlongsize='$longlongsize'
14023 longsize='$longsize'
14027 lseeksize='$lseeksize'
14028 lseektype='$lseektype'
14032 make_set_make='$make_set_make'
14033 mallocobj='$mallocobj'
14034 mallocsrc='$mallocsrc'
14035 malloctype='$malloctype'
14037 man1direxp='$man1direxp'
14040 man3direxp='$man3direxp'
14044 mips_type='$mips_type'
14046 mmaptype='$mmaptype'
14048 modetype='$modetype'
14050 multiarch='$multiarch'
14052 myarchname='$myarchname'
14053 mydomain='$mydomain'
14054 myhostname='$myhostname'
14057 netdb_hlen_type='$netdb_hlen_type'
14058 netdb_host_type='$netdb_host_type'
14059 netdb_name_type='$netdb_name_type'
14060 netdb_net_type='$netdb_net_type'
14063 nm_so_opt='$nm_so_opt'
14064 nonxs_ext='$nonxs_ext'
14066 o_nonblock='$o_nonblock'
14068 old_pthread_create_joinable='$old_pthread_create_joinable'
14069 optimize='$optimize'
14070 orderlib='$orderlib'
14076 patchlevel='$patchlevel'
14077 path_sep='$path_sep'
14079 perladmin='$perladmin'
14080 perlpath='$perlpath'
14082 phostname='$phostname'
14085 pm_apiversion='$pm_apiversion'
14089 prefixexp='$prefixexp'
14091 privlibexp='$privlibexp'
14092 prototype='$prototype'
14094 randbits='$randbits'
14095 randfunc='$randfunc'
14096 randseedtype='$randseedtype'
14098 rd_nodata='$rd_nodata'
14102 sPRIEldbl='$sPRIEldbl'
14103 sPRIFldbl='$sPRIFldbl'
14104 sPRIGldbl='$sPRIGldbl'
14107 sPRIeldbl='$sPRIeldbl'
14108 sPRIfldbl='$sPRIfldbl'
14109 sPRIgldbl='$sPRIgldbl'
14114 sched_yield='$sched_yield'
14115 scriptdir='$scriptdir'
14116 scriptdirexp='$scriptdirexp'
14118 seedfunc='$seedfunc'
14119 selectminbits='$selectminbits'
14120 selecttype='$selecttype'
14121 sendmail='$sendmail'
14124 sharpbang='$sharpbang'
14125 shmattype='$shmattype'
14126 shortsize='$shortsize'
14129 sig_count='$sig_count'
14130 sig_name='$sig_name'
14131 sig_name_init='$sig_name_init'
14133 sig_num_init='$sig_num_init'
14134 signal_t='$signal_t'
14135 sitearch='$sitearch'
14136 sitearchexp='$sitearchexp'
14138 sitebinexp='$sitebinexp'
14140 sitelibexp='$sitelibexp'
14141 siteprefix='$siteprefix'
14142 siteprefixexp='$siteprefixexp'
14143 sizetype='$sizetype'
14148 sockethdr='$sockethdr'
14149 socketlib='$socketlib'
14151 spackage='$spackage'
14152 spitshell='$spitshell'
14155 ssizetype='$ssizetype'
14156 startperl='$startperl'
14158 static_ext='$static_ext'
14160 stdio_base='$stdio_base'
14161 stdio_bufsiz='$stdio_bufsiz'
14162 stdio_cnt='$stdio_cnt'
14163 stdio_filbuf='$stdio_filbuf'
14164 stdio_ptr='$stdio_ptr'
14165 stdio_stream_array='$stdio_stream_array'
14168 subversion='$subversion'
14175 timeincl='$timeincl'
14176 timetype='$timetype'
14185 use64bits='$use64bits'
14187 uselargefiles='$uselargefiles'
14188 uselongdouble='$uselongdouble'
14189 usemorebits='$usemorebits'
14190 usemultiplicity='$usemultiplicity'
14191 usemymalloc='$usemymalloc'
14193 useopcode='$useopcode'
14194 useperlio='$useperlio'
14195 useposix='$useposix'
14197 useshrplib='$useshrplib'
14198 usesocks='$usesocks'
14199 usethreads='$usethreads'
14200 usevendorprefix='$usevendorprefix'
14201 usevfork='$usevfork'
14204 vendorbin='$vendorbin'
14205 vendorbinexp='$vendorbinexp'
14206 vendorlib='$vendorlib'
14207 vendorlibexp='$vendorlibexp'
14208 vendorprefix='$vendorprefix'
14209 vendorprefixexp='$vendorprefixexp'
14212 voidflags='$voidflags'
14214 xs_apiversion='$xs_apiversion'
14219 : Add in command line options if available
14220 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14222 : add special variables
14223 $test -f $src/patchlevel.h && \
14224 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14225 echo "CONFIGDOTSH=true" >>config.sh
14227 : propagate old symbols
14228 if $test -f UU/config.sh; then
14229 <UU/config.sh sort | uniq >UU/oldconfig.sh
14230 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14231 sort | uniq -u >UU/oldsyms
14232 set X `cat UU/oldsyms`
14238 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14240 echo "# Variables propagated from previous config.sh file." >>config.sh
14241 for sym in `cat UU/oldsyms`; do
14242 echo " Propagating $hint variable "'$'"$sym..."
14243 eval 'tmp="$'"${sym}"'"'
14245 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14251 : Finish up by extracting the .SH files
14265 If you'd like to make any changes to the config.sh file before I begin
14266 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14269 rp="Press return or use a shell escape to edit config.sh:"
14274 *) : in case they cannot read
14275 sh 1>&4 -c "$ans";;
14280 : if this fails, just run all the .SH files by hand
14287 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14294 Now you need to generate make dependencies by running "$make depend".
14295 You might prefer to run it in background: "$make depend > makedepend.out &"
14296 It can take a while, so you might not want to run it right now.
14301 rp="Run $make depend now?"
14305 $make depend && echo "Now you must run a $make."
14308 echo "You must run '$make depend' then '$make'."
14311 elif test -f [Mm]akefile; then
14313 echo "Now you must run a $make."
14318 if $test -f Policy.sh; then
14321 If you compile $package on a different machine or from a different object
14322 directory, copy the Policy.sh file from this object directory to the
14323 new one before you run Configure -- this will help you with most of
14324 the policy defaults.
14328 if $test -f config.msg; then
14329 echo "Hmm. I also noted the following information while running:"
14331 $cat config.msg >&4
14334 $rm -f kit*isdone ark*isdone