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 16:30: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=''
865 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
868 : We must find out about Eunice early
870 if test -f /etc/unixtovms; then
871 eunicefix=/etc/unixtovms
873 if test -f /etc/unixtovms.exe; then
874 eunicefix=/etc/unixtovms.exe
878 : Possible local include directories to search.
879 : Set locincpth to "" in a hint file to defeat local include searches.
880 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
881 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
883 : no include file wanted by default
886 : list of known cpp symbols, sorted alphabetically
887 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
888 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
889 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
890 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
891 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
892 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
893 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
894 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
895 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
896 al="$al VMS Xenix286"
897 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
898 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
899 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
900 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
901 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
902 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
903 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
904 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
905 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
906 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
907 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
908 al="$al __SVR4_2__ __UMAXV__"
909 al="$al ____386BSD____ __alpha __alpha__ __amiga"
910 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
911 al="$al __host_mips__"
912 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
913 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
914 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
915 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
916 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
917 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
918 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
919 al="$al __mc88100 __mc88100__ __mips __mips__"
920 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
921 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
922 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
923 al="$al _host_mips _mips _unix"
924 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
925 al="$al apollo ardent att386 att3b"
926 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
927 al="$al cadmus clipper concurrent convex cray ctix"
928 al="$al dmert encore gcos gcx gimpel gould"
929 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
930 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
931 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
932 al="$al i186 i286 i386 i486 i8086"
933 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
934 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
935 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
936 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
937 al="$al mc88000 mc88100 merlin mert mips mvs n16"
938 al="$al ncl_el ncl_mr"
939 al="$al news1500 news1700 news1800 news1900 news3700"
940 al="$al news700 news800 news900 ns16000 ns32000"
941 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
942 al="$al parisc pc532 pdp11 plexus posix pyr"
943 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
944 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
945 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
946 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
947 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
948 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
951 : Trailing extension. Override this in a hint file, if needed.
953 : Extra object files, if any, needed on this platform.
956 : change the next line if compiling for Xenix/286 on Xenix/386
957 xlibpth='/usr/lib/386 /lib/386'
959 : Possible local library directories to search.
960 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
961 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
963 : general looking path for locating libraries
964 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
965 glibpth="$glibpth /lib /usr/lib $xlibpth"
966 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
967 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
969 : Private path used by Configure to find libraries. Its value
970 : is prepended to libpth. This variable takes care of special
971 : machines, like the mips. Usually, it should be empty.
974 : default library list
976 : some systems want to use only the non-versioned libso:s
977 ignore_versioned_solibs=''
978 : full support for void wanted by default
981 : set useposix=false in your hint file to disable the POSIX extension.
983 : set useopcode=false in your hint file to disable the Opcode extension.
985 : set usemultiplicity on the Configure command line to enable multiplicity.
986 : set usesocks on the Configure command line to enable socks.
987 : set usethreads on the Configure command line to enable threads.
988 : List of libraries we want.
989 : If anyone needs -lnet, put it in a hint file.
990 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
991 libswanted="$libswanted dld ld sun m c cposix posix"
992 libswanted="$libswanted ndir dir crypt sec"
993 libswanted="$libswanted ucb bsd BSD PW x"
994 : We probably want to search /usr/shlib before most other libraries.
995 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
996 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
997 glibpth="/usr/shlib $glibpth"
998 : Do not use vfork unless overridden by a hint file.
1001 : Find the basic shell for Bourne shell scripts
1005 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1008 if test -f "$xxx"; then
1011 : Build up a list and do a single loop so we can 'break' out.
1012 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1013 for xxx in sh bash ksh pdksh ash; do
1015 try="$try ${p}/${xxx}"
1019 if test -f "$xxx"; then
1022 elif test -f "$xxx.exe"; then
1033 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1035 Usually it's in /bin/sh. How did you even get this far?
1036 Please contact me (Perl Maintainers) at perlbug@perl.com and
1037 we'll try to straighten this all out.
1043 : see if sh knows # comments
1044 if `$sh -c '#' >/dev/null 2>&1`; then
1048 test -f $xcat || xcat=/usr/bin/cat
1053 if test -s today; then
1056 echo "#! $xcat" > try
1060 if test -s today; then
1068 echo "Your $sh doesn't grok # comments--I will strip them later on."
1071 echo "exec grep -v '^[ ]*#'" >spitshell
1073 $eunicefix spitshell
1074 spitshell=`pwd`/spitshell
1076 echo "I presume that if # doesn't work, #! won't work either!"
1081 : figure out how to guarantee sh startup
1083 '') startsh=${sharpbang}${sh} ;;
1095 : echo "Yup, it does."
1097 echo "Hmm... '$startsh' does not guarantee sh startup..."
1098 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1103 : Save command line options in file UU/cmdline.opt for later use in
1104 : generating config.sh.
1105 cat > cmdline.opt <<EOSH
1106 # Configure command line arguments.
1113 cat >>cmdline.opt <<EOSH
1114 config_arg$argn='$arg'
1116 argn=`expr $argn + 1`
1119 : produce awk script to parse command line options
1120 cat >options.awk <<'EOF'
1122 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1124 len = length(optstr);
1125 for (i = 1; i <= len; i++) {
1126 c = substr(optstr, i, 1);
1127 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1138 if (substr(str, 1, 1) != "-") {
1139 printf("'%s'\n", str);
1143 for (i = 2; i <= len; i++) {
1144 c = substr(str, i, 1);
1146 printf("-%s\n", substr(str, i));
1152 printf("'%s'\n", substr(str, i + 1));
1165 : process the command line options
1166 set X `for arg in "$@"; do echo "X$arg"; done |
1167 sed -e s/X// | awk -f options.awk`
1172 : set up default values
1182 rm -f optdef.sh posthint.sh
1183 cat >optdef.sh <<EOS
1189 while test $# -gt 0; do
1191 -d) shift; fastread=yes;;
1192 -e) shift; alldone=cont;;
1196 if test -r "$1"; then
1199 echo "$me: cannot read config file $1." >&2
1204 -h) shift; error=true;;
1205 -r) shift; reuseval=true;;
1206 -s) shift; silent=true; realsilent=true;;
1207 -E) shift; alldone=exit;;
1208 -K) shift; knowitall=true;;
1209 -O) shift; override=true;;
1210 -S) shift; silent=true; extractsh=true;;
1215 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1216 echo "$me: ignoring -D $1" >&2
1219 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1220 *) echo "$1='define'" >> optdef.sh;;
1227 *=) echo "$1" >> optdef.sh;;
1229 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1230 echo "$me: ignoring -U $1" >&2
1232 *) echo "$1='undef'" >> optdef.sh;;
1243 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1247 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1248 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1254 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1255 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1256 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1257 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1258 *) xxx=`echo $yyy|sed 's!:.*!!'`
1259 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1265 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1267 echo "$yyy=''" >> posthint.sh ;;
1272 echo "$yyy='$zzz'" >> posthint.sh ;;
1274 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1276 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1281 echo "$yyy=$zzz" >> posthint.sh ;;
1282 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1285 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1288 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1296 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1297 [-U symbol] [-U symbol=] [-A command:symbol...]
1298 -d : use defaults for all answers.
1299 -e : go on without questioning past the production of config.sh.
1300 -f : specify an alternate default configuration file.
1301 -h : print this help message and exit (with an error status).
1302 -r : reuse C symbols value if possible (skips costly nm extraction).
1303 -s : silent mode, only echoes questions and essential information.
1304 -D : define symbol to have some value:
1305 -D symbol symbol gets the value 'define'
1306 -D symbol=value symbol gets the value 'value'
1307 -E : stop at the end of questions, after having produced config.sh.
1308 -K : do not use unless you know what you are doing.
1309 -O : let -D and -U override definitions from loaded configuration file.
1310 -S : perform variable substitutions on all .SH files (can mix with -f)
1311 -U : undefine symbol:
1312 -U symbol symbol gets the value 'undef'
1313 -U symbol= symbol gets completely empty
1314 -A : manipulate symbol after the platform specific hints have been applied:
1315 -A symbol=value append " "value to symbol
1316 -A append:symbol=value append value to symbol
1317 -A define:symbol=value define symbol to have value
1318 -A clear:symbol define symbol to be ''
1319 -A define:symbol define symbol to be 'define'
1320 -A eval:symbol=value define symbol to be eval of value
1321 -A prepend:symbol=value prepend value to symbol
1322 -A undef:symbol define symbol to be 'undef'
1323 -A undef:symbol= define symbol to be ''
1324 -V : print version number and exit (with a zero status).
1331 case "$fastread$alldone" in
1334 if test ! -t 0; then
1335 echo "Say 'sh Configure', not 'sh <Configure'"
1343 true) exec 1>/dev/null;;
1346 : run the defines and the undefines, if any, but leave the file out there...
1349 : create the posthint manipulation script and leave the file out there...
1354 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1355 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1356 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1357 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1358 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1361 : Some greps do not return status, grrr.
1362 echo "grimblepritz" >grimble
1363 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1365 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1371 : the following should work in any shell
1375 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1376 cat >contains <<'EOSS'
1377 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1382 : Find the path to the source tree
1385 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1388 *) src=`cd ../$src && pwd` ;;
1401 if test -f $rsrc/Configure && \
1402 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1404 : found it, so we are ok.
1407 for src in . .. ../.. ../../.. ../../../..; do
1408 if test -f ../$src/Configure && \
1409 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1420 Sorry, I can't seem to locate the source dir for $package. Please start
1421 Configure with an explicit path -- i.e. /some/path/Configure.
1429 echo "Sources for $package found in \"$src\"." >&4
1433 : script used to extract .SH files with variable substitutions
1434 cat >extract <<'EOS'
1436 echo "Doing variable substitutions on .SH files..."
1437 if test -f $src/MANIFEST; then
1438 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1440 echo "(Looking for .SH files under the source directory.)"
1441 set x `(cd $src; find . -name "*.SH" -print)`
1445 0) set x `(cd $src; echo *.SH)`; shift;;
1447 if test ! -f $src/$1; then
1453 while test $name; do
1454 if test ! -d "$name"; then
1455 create="$name $create";
1456 name=`echo $name | sed -e "s|^[^/]*$||"`;
1457 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1462 for file in $create; do
1471 dir=`expr X$file : 'X\(.*\)/'`
1472 file=`expr X$file : 'X.*/\(.*\)'`
1473 (cd $dir && . ./$file)
1483 dir=`expr X$file : 'X\(.*\)/'`
1484 file=`expr X$file : 'X.*/\(.*\)'`
1485 (set x $dir; shift; eval $mkdir_p)
1495 if test -f $src/config_h.SH; then
1496 if test ! -f config.h; then
1497 : oops, they left it out of MANIFEST, probably, so do it anyway.
1503 : extract files and exit if asked to do so
1504 case "$extractsh" in
1506 case "$realsilent" in
1510 case "$config_sh" in
1511 '') config_sh='config.sh';;
1514 echo "Fetching answers from $config_sh..."
1517 test "$override" && . ./optdef.sh
1526 : Eunice requires " " instead of "", can you believe it
1529 echo "Beginning of configuration questions for $package."
1531 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1533 : first determine how to suppress newline on echo command
1535 echo "Checking echo to see how to suppress newlines..."
1536 (echo "hi there\c" ; echo " ") >.echotmp
1537 if $contains c .echotmp >/dev/null 2>&1 ; then
1548 echo $n "The star should be here-->$c"
1552 : Now test for existence of everything in MANIFEST
1554 if test -f $rsrc/MANIFEST; then
1555 echo "First let's make sure your kit is complete. Checking..." >&4
1556 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1559 for filelist in x??; do
1560 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1562 if test -s missing; then
1566 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1568 You have the option of continuing the configuration process, despite the
1569 distinct possibility that your kit is damaged, by typing 'y'es. If you
1570 do, don't blame me if something goes wrong. I advise you to type 'n'o
1571 and contact the author (perlbug@perl.com).
1574 echo $n "Continue? [n] $c" >&4
1578 echo "Continuing..." >&4
1582 echo "ABORTING..." >&4
1587 echo "Looks good..."
1590 echo "There is no MANIFEST file. I hope your kit is complete !"
1595 : Find the appropriate value for a newline for tr
1596 if test -n "$DJGPP"; then
1599 if test X"$trnl" = X; then
1600 case "`echo foo|tr '\n' x 2>/dev/null`" in
1604 if test X"$trnl" = X; then
1605 case "`echo foo|tr '\012' x 2>/dev/null`" in
1606 foox) trnl='\012' ;;
1609 if test X"$trnl" = X; then
1612 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1618 : compute the number of columns on the terminal for proper question formatting
1623 : set up the echo used in my read
1624 myecho="case \"\$xxxm\" in
1625 '') echo $n \"\$rp $c\" >&4;;
1627 '') echo $n \"[\$xxxm] $c\";;
1629 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1631 echo $n \"[\$xxxm] $c\" >&4
1633 echo $n \"\$rp [\$xxxm] $c\" >&4
1639 : now set up to do reads with possible shell escape and default assignment
1645 case "\$fastread" in
1646 yes) case "\$dflt" in
1649 case "\$silent-\$rp" in
1654 *) case "\$silent" in
1655 true) case "\$rp" in
1660 while expr "X\$ans" : "X!" >/dev/null; do
1664 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1672 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1681 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1686 echo "(OK, I'll run with -d after this question.)" >&4
1689 echo "*** Sorry, \$1 not supported yet." >&4
1699 echo "*** Substitution done -- please confirm."
1701 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1706 echo "*** Error -- try again."
1713 case "\$ans\$xxxm\$nostick" in
1725 : create .config dir to save info across Configure sessions
1726 test -d ../.config || mkdir ../.config
1727 cat >../.config/README <<EOF
1728 This directory created by Configure to save information that should
1729 persist across sessions for $package.
1731 You may safely delete it if you wish.
1734 : general instructions
1737 user=`(logname) 2>/dev/null`
1739 '') user=`whoami 2>&1`;;
1741 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1744 rp='Would you like to see the instructions?'
1755 This installation shell script will examine your system and ask you questions
1756 to determine how the perl5 package should be installed. If you get
1757 stuck on a question, you may use a ! shell escape to start a subshell or
1758 execute a command. Many of the questions will have default answers in square
1759 brackets; typing carriage return will give you the default.
1761 On some of the questions which ask for file or directory names you are allowed
1762 to use the ~name construct to specify the login directory belonging to "name",
1763 even if you don't have a shell which knows about that. Questions where this is
1764 allowed will be marked "(~name ok)".
1768 dflt='Type carriage return to continue'
1772 The prompter used in this script allows you to use shell variables and
1773 backticks in your answers. You may use $1, $2, etc... to refer to the words
1774 in the default answer, as if the default line was a set of arguments given to a
1775 script shell. This means you may also use $* to repeat the whole default line,
1776 so you do not have to re-type everything to add something to the default.
1778 Everytime there is a substitution, you will have to confirm. If there is an
1779 error (e.g. an unmatched backtick), the default answer will remain unchanged
1780 and you will be prompted again.
1782 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1783 the questions and use the computed defaults (or the previous answers if there
1784 was already a config.sh file). Type 'Configure -h' for a list of options.
1785 You may also start interactively and then answer '& -d' at any prompt to turn
1786 on the non-interactive behaviour for the remainder of the execution.
1792 Much effort has been expended to ensure that this shell script will run on any
1793 Unix system. If despite that it blows up on yours, your best bet is to edit
1794 Configure and run it again. If you can't run Configure for some reason,
1795 you'll have to generate a config.sh file by hand. Whatever problems you
1796 have, let me (perlbug@perl.com) know how I blew it.
1798 This installation script affects things in two ways:
1800 1) it may do direct variable substitutions on some of the files included
1802 2) it builds a config.h file for inclusion in C programs. You may edit
1803 any of these files as the need arises after running this script.
1805 If you make a mistake on a question, there is no easy way to back up to it
1806 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1807 files. Configure will offer to let you do this before it runs the SH files.
1810 dflt='Type carriage return to continue'
1812 case "$firsttime" in
1813 true) echo $user >>../.config/instruct;;
1817 : find out where common programs are
1819 echo "Locating common programs..." >&4
1832 if test -d \$dir/\$thing; then
1838 for thisthing in \$dir/\$thing; do
1839 : just loop through to pick last item
1841 if test -f \$thisthing; then
1844 elif test -f \$dir/\$thing.exe; then
1845 if test -n "$DJGPP"; then
1846 echo \$dir/\$thing.exe
1848 : on Eunice apparently
1898 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1899 pth="$pth /lib /usr/lib"
1900 for file in $loclist; do
1904 if test -f "$xxx"; then
1907 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1908 xxx=`./loc $file $file $pth`
1911 '') xxx=`./loc $file $file $pth`;;
1912 *) xxx=`./loc $xxx $xxx $pth`;;
1918 echo $file is in $xxx.
1921 echo $file is in $xxx.
1924 echo "I don't know where '$file' is, and my life depends on it." >&4
1925 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1931 echo "Don't worry if any of the following aren't found..."
1933 for file in $trylist; do
1937 if test -f "$xxx"; then
1940 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1941 xxx=`./loc $file $file $pth`
1944 '') xxx=`./loc $file $file $pth`;;
1945 *) xxx=`./loc $xxx $xxx $pth`;;
1951 echo $file is in $xxx.
1954 echo $file is in $xxx.
1957 echo "I don't see $file out there, $say."
1964 echo "Substituting grep for egrep."
1970 echo "Substituting cp for ln."
1976 echo "Hopefully test is built into your sh."
1979 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1980 echo "Using the test built into your sh."
1988 echo "Hopefully echo is built into your sh."
1993 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1994 $echo $n "hi there$c" >foo1
1995 echo $n "hi there$c" >foo2
1996 if cmp foo1 foo2 >/dev/null 2>&1; then
1997 echo "They are compatible. In fact, they may be identical."
2004 They are not compatible! You are probably running ksh on a non-USG system.
2005 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2006 have echo built in and we may have to run some Bourne shell scripts. That
2007 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2010 $echo $n "The star should be here-->$c"
2017 : determine whether symbolic links are supported
2020 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2021 echo "Symbolic links are supported." >&4
2024 echo "Symbolic links are NOT supported." >&4
2029 : see whether [:lower:] and [:upper:] are supported character classes
2031 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2033 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2037 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2038 # (0xc9 and 0xd1), therefore that is a nice testing point.
2039 if test "X$up" = X -o "X$low" = X; then
2040 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2046 if test "X$up" = X -o "X$low" = X; then
2047 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2053 if test "X$up" = X -o "X$low" = X; then
2054 case "`echo IJ | od -x 2>/dev/null`" in
2056 echo "Hey, this might be EBCDIC." >&4
2057 if test "X$up" = X -o "X$low" = X; then
2058 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2059 ij) up='[A-IJ-RS-Z]'
2064 if test "X$up" = X -o "X$low" = X; then
2065 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2075 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2077 echo "Using $up and $low to convert case." >&4
2080 echo "I don't know how to translate letters from upper to lower case." >&4
2081 echo "Your tr is not acting any way I know of." >&4
2085 : set up the translation script tr, must be called with ./tr of course
2089 '[A-Z][a-z]') exec $tr '$up' '$low';;
2090 '[a-z][A-Z]') exec $tr '$low' '$up';;
2097 : Try to determine whether config.sh was made on this system
2098 case "$config_sh" in
2100 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2101 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2102 # because the A-Z/a-z are not consecutive.
2103 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2104 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2105 newmyuname="$myuname"
2107 case "$knowitall" in
2109 if test -f ../config.sh; then
2110 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2111 eval "`grep myuname= ../config.sh`"
2113 if test "X$myuname" = "X$newmyuname"; then
2121 : Get old answers from old config file if Configure was run on the
2122 : same system, otherwise use the hints.
2125 if test -f config.sh; then
2127 rp="I see a config.sh file. Shall I use it to set the defaults?"
2130 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2131 *) echo "Fetching default answers from your old config.sh file..." >&4
2139 : Older versions did not always set $sh. Catch re-use of such
2148 if test ! -f config.sh; then
2151 First time through, eh? I have some defaults handy for some systems
2152 that need some extra help getting the Configure answers right:
2155 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2157 : Half the following guesses are probably wrong... If you have better
2158 : tests or hints, please send them to perlbug@perl.com
2159 : The metaconfig authors would also appreciate a copy...
2160 $test -f /irix && osname=irix
2161 $test -f /xenix && osname=sco_xenix
2162 $test -f /dynix && osname=dynix
2163 $test -f /dnix && osname=dnix
2164 $test -f /lynx.os && osname=lynxos
2165 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2166 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2167 $test -f /bin/mips && /bin/mips && osname=mips
2168 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2169 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2170 $test -d /usr/apollo/bin && osname=apollo
2171 $test -f /etc/saf/_sactab && osname=svr4
2172 $test -d /usr/include/minix && osname=minix
2173 if $test -d /MachTen -o -d /MachTen_Folder; then
2175 if $test -x /sbin/version; then
2176 osvers=`/sbin/version | $awk '{print $2}' |
2177 $sed -e 's/[A-Za-z]$//'`
2178 elif $test -x /usr/etc/version; then
2179 osvers=`/usr/etc/version | $awk '{print $2}' |
2180 $sed -e 's/[A-Za-z]$//'`
2185 $test -f /sys/posix.dll &&
2186 $test -f /usr/bin/what &&
2187 set X `/usr/bin/what /sys/posix.dll` &&
2188 $test "$3" = UWIN &&
2191 if $test -f $uname; then
2199 umips) osname=umips ;;
2202 [23]100) osname=mips ;;
2203 next*) osname=next ;;
2205 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2206 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2209 elif $test -f /etc/kconfig; then
2211 if test "$lns" = "$ln -s"; then
2213 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2215 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2222 if test -n "$DJGPP"; then
2231 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2233 'not found') osvers="$4"."$3" ;;
2234 '<3240'|'<>3240') osvers=3.2.0 ;;
2235 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2236 '=3250'|'>3250') osvers=3.2.5 ;;
2240 *dc.osx) osname=dcosx
2246 domainos) osname=apollo
2252 dynixptx*) osname=dynixptx
2253 osvers=`echo "$4"|sed 's/^v//'`
2255 freebsd) osname=freebsd
2257 genix) osname=genix ;;
2259 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2275 netbsd*) osname=netbsd
2278 news-os) osvers="$3"
2280 4*) osname=newsos4 ;;
2284 bsd386) osname=bsd386
2287 POSIX-BC | posix-bc ) osname=posix-bc
2290 powerux | power_ux | powermax_os | powermaxos | \
2291 powerunix | power_unix) osname=powerux
2294 next*) osname=next ;;
2295 solaris) osname=solaris
2297 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2304 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2308 titanos) osname=titanos
2317 ultrix) osname=ultrix
2320 osf1|mls+) case "$5" in
2323 osvers=`echo "$3" | sed 's/^[xvt]//'`
2325 hp*) osname=hp_osf1 ;;
2326 mips) osname=mips_osf1 ;;
2329 unixware) osname=svr5
2338 $2) case "$osname" in
2342 : svr4.x or possibly later
2352 if test -f /stand/boot ; then
2353 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2354 if test -n "$INITPROG" -a -f "$INITPROG"; then
2355 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2356 if test -n "$isesix"; then
2364 *) if test -f /etc/systemid; then
2366 set `echo $3 | $sed 's/\./ /g'` $4
2367 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2369 elif $test -f $src/hints/sco_$1_$2.sh; then
2371 elif $test -f $src/hints/sco_$1.sh; then
2376 '') : Still unknown. Probably a generic Sys V.
2385 *) case "$osname" in
2386 '') : Still unknown. Probably a generic BSD.
2394 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2395 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2396 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2399 $rm -f UU/kernel.what
2400 elif test -d c:/.; then
2407 : Now look for a hint file osname_osvers, unless one has been
2408 : specified already.
2411 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2412 : Also try without trailing minor version numbers.
2413 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2414 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2415 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2416 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2419 *) case "$osvers" in
2422 *) if $test -f $src/hints/$file.sh ; then
2424 elif $test -f $src/hints/$xfile.sh ; then
2426 elif $test -f $src/hints/$xxfile.sh ; then
2428 elif $test -f $src/hints/$xxxfile.sh ; then
2430 elif $test -f $src/hints/$xxxxfile.sh ; then
2432 elif $test -f "$src/hints/${osname}.sh" ; then
2441 if $test -f Policy.sh ; then
2444 none) dflt="Policy" ;;
2445 *) dflt="Policy $dflt" ;;
2450 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2454 if $test -f Policy.sh ; then
2457 There's also a Policy hint file available, which should make the
2458 site-specific (policy) questions easier to answer.
2465 You may give one or more space-separated answers, or "none" if appropriate.
2466 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2467 is a good thing. DO NOT give a wrong version or a wrong OS.
2471 rp="Which of these apply, if any?"
2474 for file in $tans; do
2475 if $test X$file = XPolicy -a -f Policy.sh; then
2477 $cat Policy.sh >> UU/config.sh
2478 elif $test -f $src/hints/$file.sh; then
2479 . $src/hints/$file.sh
2480 $cat $src/hints/$file.sh >> UU/config.sh
2481 elif $test X$tans = X -o X$tans = Xnone ; then
2484 : Give one chance to correct a possible typo.
2485 echo "$file.sh does not exist"
2487 rp="hint to use instead?"
2489 for file in $ans; do
2490 if $test -f "$src/hints/$file.sh"; then
2491 . $src/hints/$file.sh
2492 $cat $src/hints/$file.sh >> UU/config.sh
2493 elif $test X$ans = X -o X$ans = Xnone ; then
2496 echo "$file.sh does not exist -- ignored."
2503 : Remember our hint file for later.
2504 if $test -f "$src/hints/$file.sh" ; then
2514 echo "Fetching default answers from $config_sh..." >&4
2518 cp $config_sh config.sh 2>/dev/null
2528 test "$override" && . ./optdef.sh
2529 myuname="$newmyuname"
2531 : Restore computed paths
2532 for file in $loclist $trylist; do
2533 eval $file="\$_$file"
2538 Configure uses the operating system name and version to set some defaults.
2539 The default value is probably right if the name rings a bell. Otherwise,
2540 since spelling matters for me, either accept the default or answer "none"
2547 ''|' '|none) dflt=none ;;
2548 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2551 *) dflt="$osname" ;;
2553 rp="Operating system name?"
2557 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2563 ''|' '|none) dflt=none ;;
2564 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2565 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2567 ''|' ') dflt=none ;;
2572 *) dflt="$osvers" ;;
2574 rp="Operating system version?"
2584 : who configured the system
2585 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2586 cf_by=`(logname) 2>/dev/null`
2589 cf_by=`(whoami) 2>/dev/null`
2591 "") cf_by=unknown ;;
2595 : set up the script used to warn in case of inconsistency
2602 echo "*** WHOA THERE!!! ***" >&4
2603 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2604 rp=" Keep the $hint value?"
2607 y) td=$was; tu=$was;;
2611 : function used to set $1 to $val
2612 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2614 $define$undef) . ./whoa; eval "$var=\$td";;
2615 $undef$define) . ./whoa; eval "$var=\$tu";;
2616 *) eval "$var=$val";;
2621 Perl can be built to take advantage of threads, on some systems.
2622 To do so, Configure must be run with -Dusethreads.
2624 Note that threading is a highly experimental feature, and
2625 some known race conditions still remain. If you choose to try
2626 it, be very sure to not actually deploy it for production
2627 purposes. README.threads has more details, and is required
2628 reading if you enable threads.
2630 case "$usethreads" in
2631 $define|true|[yY]*) dflt='y';;
2634 rp='Build a threading Perl?'
2637 y|Y) val="$define" ;;
2643 case "$d_oldpthreads" in
2644 '') : Configure tests would be welcome here. For now, assume undef.
2646 *) val="$d_oldpthreads" ;;
2652 case "$usethreads" in
2653 "$define"|true|[yY]*)
2654 : Look for a hint-file generated 'call-back-unit'. If the
2655 : user has specified that a threading perl is to be built,
2656 : we may need to set or change some other defaults.
2657 if $test -f usethreads.cbu; then
2658 echo "Your platform has some specific hints for threaded builds, using them..."
2662 (Your platform doesn't have any specific hints for threaded builds.
2663 Assuming POSIX threads, then.)
2671 Perl can be built so that multiple Perl interpreters can coexist
2672 within the same Perl executable. To do so, Configure must be run with
2675 Normally you do not need this and you should answer no.
2678 case "$usemultiplicity" in
2679 $define|true|[yY]*) dflt='y';;
2682 rp='Build Perl for multiplicity?'
2685 y|Y) val="$define" ;;
2691 : determine where manual pages are on this system
2695 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2696 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2697 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2698 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2699 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2700 sysman=`./loc . /usr/man/man1 $syspath`
2703 if $test -d "$sysman"; then
2704 echo "System manual is in $sysman." >&4
2706 echo "Could not find manual pages in source form." >&4
2709 : see what memory models we can support
2712 $cat >pdp11.c <<'EOP'
2721 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2722 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2723 dflt='unsplit split'
2725 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2728 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2733 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2736 if $test -d /lib/large || $test -d /usr/lib/large; then
2739 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2748 Some systems have different model sizes. On most systems they are called
2749 small, medium, large, and huge. On the PDP11 they are called unsplit and
2750 split. If your system doesn't support different memory models, say "none".
2751 If you wish to force everything to one memory model, say "none" here and
2752 put the appropriate flags later when it asks you for other cc and ld flags.
2753 Venix systems may wish to put "none" and let the compiler figure things out.
2754 (In the following question multiple model names should be space separated.)
2756 The default for most systems is "none".
2759 rp="Which memory models are supported?"
2774 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2775 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2782 rp="What flag indicates separate I and D space?"
2790 *large*|*small*|*medium*|*huge*)
2797 rp="What flag indicates large model?"
2807 *huge*) case "$huge" in
2811 rp="What flag indicates huge model?"
2821 *medium*) case "$medium" in
2825 rp="What flag indicates medium model?"
2832 *) medium="$large";;
2835 *small*) case "$small" in
2839 rp="What flag indicates small model?"
2850 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2853 $rm -f pdp11.* pdp11
2855 : make some quick guesses about what we are up against
2857 $echo $n "Hmm... $c"
2867 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2868 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2870 echo "Looks kind of like an OSF/1 system, but we'll see..."
2872 elif test `echo abc | tr a-z A-Z` = Abc ; then
2873 xxx=`./loc addbib blurfl $pth`
2874 if $test -f $xxx; then
2875 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2879 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2880 echo "Looks kind of like an extended USG system, but we'll see..."
2882 echo "Looks kind of like a USG system, but we'll see..."
2886 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2887 echo "Looks kind of like a BSD system, but we'll see..."
2891 echo "Looks kind of like a Version 7 system, but we'll see..."
2894 case "$eunicefix" in
2897 There is, however, a strange, musty smell in the air that reminds me of
2898 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2902 : it so happens the Eunice I know will not run shell scripts in Unix format
2906 echo "Congratulations. You aren't running Eunice."
2910 : Detect OS2. The p_ variable is set above in the Head.U unit.
2915 I have the feeling something is not exactly right, however...don't tell me...
2916 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2921 if test -f /xenix; then
2922 echo "Actually, this looks more like a XENIX system..."
2927 echo "It's not Xenix..."
2932 if test -f /venix; then
2933 echo "Actually, this looks more like a VENIX system..."
2940 echo "Nor is it Venix..."
2943 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2944 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2947 : see if we need a special compiler
2955 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2956 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2970 On some older systems the default C compiler will not resolve multiple global
2971 references that happen to have the same name. On some such systems the "Mcc"
2972 command may be used to force these to be resolved. On other systems a "cc -M"
2973 command is required. (Note that the -M flag on other systems indicates a
2974 memory model to use!) If you have the Gnu C compiler, you might wish to use
2980 rp="Use which C compiler?"
2988 rp="Use which C compiler?"
2992 : Look for a hint-file generated 'call-back-unit'. Now that the
2993 : user has specified the compiler, we may need to set or change some
2995 if $test -f cc.cbu; then
2999 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3000 $cat >gccvers.c <<EOM
3005 printf("%s\n", __VERSION__);
3007 printf("%s\n", "1");
3013 if $cc -o gccvers gccvers.c; then
3014 gccversion=`./gccvers`
3015 case "$gccversion" in
3016 '') echo "You are not using GNU cc." ;;
3017 *) echo "You are using GNU cc $gccversion." ;;
3021 echo "*** WHOA THERE!!! ***" >&4
3022 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3023 case "$knowitall" in
3025 echo " You'd better start hunting for one and let me know about it." >&4
3031 case "$gccversion" in
3032 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3036 case "$usemorebits" in
3037 "$define"|true|[yY]*)
3039 uselongdouble="$define"
3040 usemorebits="$define"
3042 *) usemorebits="$undef"
3049 Perl can be built to understand large files (files larger than 2 gigabytes)
3050 on some systems. To do so, Configure must be run with -Duselargefiles.
3052 If this doesn't make any sense to you, just accept the default.
3054 case "$uselargefiles" in
3055 "$define"|true|[yY]*) dflt='y' ;;
3058 rp='Try to understand large files?'
3061 y|Y) val="$define" ;;
3066 case "$uselargefiles" in
3067 "$define") use64bits="$define" ;;
3072 Perl can be built to take advantage of explicit 64-bit interfaces,
3073 on some systems. To do so, Configure must be run with -Duse64bits.
3075 If this doesn't make any sense to you, just accept the default.
3077 case "$use64bits" in
3078 $define|true|[yY]*) dflt='y';;
3081 rp='Try to use explicit 64-bit interfaces, if available?'
3094 case "$archname64" in
3095 '') archname64='' ;; # not a typo
3098 case "$use64bits" in
3099 "$define"|true|[yY]*)
3100 : Look for a hint-file generated 'call-back-unit'. If the
3101 : user has specified that a 64 bit perl is to be built,
3102 : we may need to set or change some other defaults.
3103 if $test -f use64bits.cbu; then
3104 echo "Your platform has some specific hints for 64-bit builds, using them..."
3108 (Your platform doesn't have any specific hints for 64-bit builds.
3109 This is probably okay, especially if your system is a true 64-bit system.)
3111 case "$gccversion" in
3114 But since you seem to be using gcc,
3115 I will now add -DUSE_LONG_LONG to the compilation flags.
3117 ccflags="$ccflags -DUSE_LONG_LONG"
3124 : determine the architecture name
3126 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3127 tarch=`arch`"-$osname"
3128 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3129 if uname -m > tmparch 2>&1 ; then
3130 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3131 -e 's/$/'"-$osname/" tmparch`
3139 case "$myarchname" in
3142 echo "(Your architecture name used to be $myarchname.)"
3149 *) dflt="$archname";;
3151 rp='What is your architecture name'
3154 case "$usethreads" in
3156 echo "Threads selected." >&4
3158 *-thread*) echo "...and architecture name already has -thread." >&4
3160 *) archname="$archname-thread"
3161 echo "...setting architecture name to $archname." >&4
3166 case "$usemultiplicity" in
3168 echo "Multiplicity selected." >&4
3170 *-multi*) echo "...and architecture name already has -multi." >&4
3172 *) archname="$archname-multi"
3173 echo "...setting architecture name to $archname." >&4
3178 case "$use64bits" in
3180 echo "Explicit 64-bitness selected." >&4
3181 case "$archname64" in
3186 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3188 *) archname="$archname-$archname64"
3189 echo "...setting architecture name to $archname." >&4
3196 : decide how portable to be. Allow command line overrides.
3197 case "$d_portable" in
3199 *) d_portable="$define" ;;
3202 : set up shell script to do ~ expansion
3208 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3211 if $test -f /bin/csh; then
3212 /bin/csh -f -c "glob \$1"
3217 name=\`$expr x\$1 : '..\([^/]*\)'\`
3218 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3219 if $test ! -d "\$dir"; then
3221 echo "\$me: can't locate home directory for: \$name" >&2
3226 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3242 : now set up to get a file name
3246 cat <<'EOSC' >>getfile
3262 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3263 fn=`echo $fn | sed 's/(.*)//'`
3269 loc_file=`expr $fn : '.*:\(.*\)'`
3270 fn=`expr $fn : '\(.*\):.*'`
3278 */*) fullpath=true;;
3287 *e*) exp_file=true;;
3290 *p*) nopath_ok=true;;
3295 *d*) type='Directory';;
3296 *l*) type='Locate';;
3301 Locate) what='File';;
3306 case "$d_portable" in
3314 while test "$type"; do
3319 true) rp="$rp (~name ok)";;
3322 if test -f UU/getfile.ok && \
3323 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3342 value=`UU/filexp $ans`
3345 if test "$ans" != "$value"; then
3346 echo "(That expands to $value on this system.)"
3360 /*) value="$ansexp" ;;
3365 echo "I shall only accept a full path name, as in /bin/ls." >&4
3366 echo "Use a ! shell escape if you wish to check pathnames." >&4
3369 echo "Please give a full path name, starting with slash." >&4
3372 echo "Note that using ~name is ok provided it expands well." >&4
3385 for fp in $gfpth; do
3386 if test "X$fp" = X.; then
3391 if test -f "$pf"; then
3393 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3395 echo "($value is not a plain file, but that's ok.)"
3398 if test X"$type" = X; then
3405 for fp in $gfpth; do
3406 if test "X$fp" = X.; then
3411 if test -d "$pf"; then
3419 if test -d "$ansexp"; then
3420 echo "(Looking for $loc_file in directory $value.)"
3421 value="$value/$loc_file"
3422 ansexp="$ansexp/$loc_file"
3424 if test -f "$ansexp"; then
3427 case "$nopath_ok" in
3428 true) case "$value" in
3430 *) echo "Assuming $value will be in people's path."
3446 if test "$fastread" = yes; then
3451 rp="$what $value doesn't exist. Use that name anyway?"
3470 test "X$gfpthkeep" != Xy && gfpth=""
3473 : determine root of directory hierarchy where package will be installed.
3476 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3484 By default, $package will be installed in $dflt/bin, manual pages
3485 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3486 installation directories. Typically this is something like /usr/local.
3487 If you wish to have binaries under /usr/bin but other parts of the
3488 installation under /usr/local, that's ok: you will be prompted
3489 separately for each of the installation directories, the prefix being
3490 only used to set the defaults.
3494 rp='Installation prefix to use?'
3502 *) oldprefix="$prefix";;
3512 $define|true) afs=true ;;
3513 $undef|false) afs=false ;;
3514 *) if test -d /afs; then
3522 echo "AFS may be running... I'll be extra cautious then..." >&4
3524 echo "AFS does not seem to be running..." >&4
3527 : determine installation prefix for where package is to be installed.
3531 Since you are running AFS, I need to distinguish the directory in which
3532 files will reside from the directory in which they are installed (and from
3533 which they are presumably copied to the former directory by occult means).
3536 case "$installprefix" in
3537 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3538 *) dflt="$installprefix";;
3543 In some special cases, particularly when building $package for distribution,
3544 it is convenient to distinguish between the directory in which files should
3545 be installed from the directory ($prefix) in which they
3546 will eventually reside. For most users, these two directories are the same.
3549 case "$installprefix" in
3551 *) dflt=$installprefix;;
3555 rp='What installation prefix should I use for installing files?'
3557 installprefix="$ans"
3558 installprefixexp="$ansexp"
3560 : set the prefixit variable, to compute a suitable default value
3561 prefixit='case "$3" in
3563 case "$oldprefix" in
3564 "") eval "$1=\"\$$2\"";;
3571 ""|" ") eval "$1=\"\$$2\"";;
3577 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3579 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3580 /*-$oldprefix/*|\~*-$oldprefix/*)
3581 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3582 *) eval "$1=\"\$$2\"";;
3586 : set the base revision
3589 : get the patchlevel
3591 echo "Getting the current patchlevel..." >&4
3592 if $test -r $rsrc/patchlevel.h;then
3593 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3594 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3595 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
3601 $echo $n "(You have $package" $c
3604 *) $echo $n " $baserev" $c ;;
3606 $echo $n " patchlevel $patchlevel" $c
3607 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3610 if test 0 -eq "$subversion"; then
3611 version=`LC_ALL=C; export LC_ALL; \
3612 echo $baserev $patchlevel | \
3613 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3615 version=`LC_ALL=C; export LC_ALL; \
3616 echo $baserev $patchlevel $subversion | \
3617 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3620 : determine installation style
3621 : For now, try to deduce it from prefix unless it is already set.
3622 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3623 case "$installstyle" in
3624 '') case "$prefix" in
3625 *perl*) dflt='lib';;
3626 *) dflt='lib/perl5' ;;
3629 *) dflt='lib/perl5' ;;
3631 : Probably not worth prompting for this since we prompt for all
3632 : the directories individually, and the prompt would be too long and
3636 : determine where private library files go
3637 : Usual default is /usr/local/lib/perl5/$version.
3638 : Also allow things like /opt/perl/lib/$version, since
3639 : /opt/perl/lib/perl5... would be redundant.
3640 : The default "style" setting is made in installstyle.U
3641 case "$installstyle" in
3642 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3643 *) set dflt privlib lib/$version ;;
3648 There are some auxiliary files for $package that need to be put into a
3649 private library directory that is accessible by everyone.
3653 rp='Pathname where the private library files will reside?'
3656 privlibexp="$ansexp"
3657 : Change installation prefix, if necessary.
3658 if $test X"$prefix" != X"$installprefix"; then
3659 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3661 installprivlib="$privlibexp"
3664 : set the prefixup variable, to restore leading tilda escape
3665 prefixup='case "$prefixexp" in
3667 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3670 : determine where public architecture dependent libraries go
3673 : privlib default is /usr/local/lib/$package/$version
3674 : archlib default is /usr/local/lib/$package/$version/$archname
3675 : privlib may have an optional trailing /share.
3676 tdflt=`echo $privlib | $sed 's,/share$,,'`
3677 tdflt=$tdflt/$archname
3686 $spackage contains architecture-dependent library files. If you are
3687 sharing libraries in a heterogeneous environment, you might store
3688 these files in a separate location. Otherwise, you can just include
3689 them with the rest of the public library files.
3693 rp='Where do you want to put the public architecture-dependent libraries?'
3696 archlibexp="$ansexp"
3697 if $test X"$archlib" = X"$privlib"; then
3702 : Change installation prefix, if necessary.
3703 if $test X"$prefix" != X"$installprefix"; then
3704 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3706 installarchlib="$archlibexp"
3710 : Binary compatibility with 5.005 is not possible for builds
3711 : with advanced features
3712 case "$usethreads$usemultiplicity" in
3714 bincompat5005="$undef"
3715 d_bincompat5005="$undef"
3719 Perl 5.006 can be compiled for binary compatibility with 5.005.
3720 If you decide to do so, you will be able to continue using most
3721 of the extensions that were compiled for Perl 5.005.
3724 case "$bincompat5005$d_bincompat5005" in
3725 *"$undef"*) dflt=n ;;
3728 rp='Binary compatibility with Perl 5.005?'
3731 y*) val="$define" ;;
3736 case "$d_bincompat5005" in
3738 bincompat5005="$define"
3740 *) bincompat5005="$undef"
3741 d_bincompat5005="$undef"
3748 : see if setuid scripts can be secure
3751 Some kernels have a bug that prevents setuid #! scripts from being
3752 secure. Some sites have disabled setuid #! scripts because of this.
3754 First let's decide if your kernel supports secure setuid #! scripts.
3755 (If setuid #! scripts would be secure but have been disabled anyway,
3756 don't say that they are secure if asked.)
3761 if $test -d /dev/fd; then
3762 echo "#!$ls" >reflect
3763 chmod +x,u+s reflect
3764 ./reflect >flect 2>&1
3765 if $contains "/dev/fd" flect >/dev/null; then
3766 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3770 If you are not sure if they are secure, I can check but I'll need a
3771 username and password different from the one you are using right now.
3772 If you don't have such a username or don't want me to test, simply
3776 rp='Other username to test security of setuid scripts with?'
3781 case "$d_suidsafe" in
3782 '') echo "I'll assume setuid scripts are *not* secure." >&4
3785 echo "Well, the $hint value is *not* secure." >&4
3787 *) echo "Well, the $hint value *is* secure." >&4
3792 $rm -f reflect flect
3793 echo "#!$ls" >reflect
3794 chmod +x,u+s reflect
3797 echo '"su" will (probably) prompt you for '"$ans's password."
3798 su $ans -c './reflect >flect'
3799 if $contains "/dev/fd" flect >/dev/null; then
3800 echo "Okay, it looks like setuid scripts are secure." >&4
3803 echo "I don't think setuid scripts are secure." >&4
3808 rp='Does your kernel have *secure* setuid scripts?'
3811 [yY]*) val="$define";;
3816 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3817 echo "(That's for file descriptors, not floppy disks.)"
3823 $rm -f reflect flect
3825 : now see if they want to do setuid emulation
3828 case "$d_suidsafe" in
3831 echo "No need to emulate SUID scripts since they are secure here." >& 4
3835 Some systems have disabled setuid scripts, especially systems where
3836 setuid scripts cannot be secure. On systems where setuid scripts have
3837 been disabled, the setuid/setgid bits on scripts are currently
3838 useless. It is possible for $package to detect those bits and emulate
3839 setuid/setgid in a secure fashion. This emulation will only work if
3840 setuid scripts have been disabled in your kernel.
3844 "$define") dflt=y ;;
3847 rp="Do you want to do setuid/setgid emulation?"
3850 [yY]*) val="$define";;
3858 : What should the include directory be ?
3860 $echo $n "Hmm... $c"
3864 if $test -f /bin/mips && /bin/mips; then
3865 echo "Looks like a MIPS system..."
3866 $cat >usr.c <<'EOCP'
3867 #ifdef SYSTYPE_BSD43
3871 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3872 dflt='/bsd43/usr/include'
3876 mips_type='System V'
3878 $rm -f usr.c usr.out
3879 echo "and you're compiling with the $mips_type compiler and libraries."
3883 echo "Doesn't look like a MIPS system."
3893 case "$xxx_prompt" in
3896 rp='Where are the include files you want to use?'
3904 : see how we invoke the C preprocessor
3906 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3907 cat <<'EOT' >testcpp.c
3913 if test ! -f cppstdin; then
3914 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3915 # AIX cc -E doesn't show the absolute headerfile
3916 # locations but we'll cheat by using the -M flag.
3917 echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
3919 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3922 echo "Keeping your $hint cppstdin wrapper."
3925 wrapper=`pwd`/cppstdin
3929 if $test "X$cppstdin" != "X" && \
3930 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3931 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3933 echo "You used to use $cppstdin $cppminus so we'll use that again."
3935 '') echo "But let's see if we can live without a wrapper..." ;;
3937 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3938 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3940 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3943 echo "(However, $cpprun $cpplast does not work, let's see...)"
3951 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3958 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3959 $cc -E <testcpp.c >testcpp.out 2>&1; \
3960 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3961 echo "Yup, it does."
3964 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3965 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3966 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3967 echo "Yup, it does."
3970 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3971 $cc -P <testcpp.c >testcpp.out 2>&1; \
3972 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3973 echo "Yipee, that works!"
3976 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3977 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3978 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3979 echo "At long last!"
3982 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3983 $cpp <testcpp.c >testcpp.out 2>&1; \
3984 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3988 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3989 $cpp - <testcpp.c >testcpp.out 2>&1; \
3990 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3991 echo "Hooray, it works! I was beginning to wonder."
3994 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3995 $wrapper <testcpp.c >testcpp.out 2>&1; \
3996 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4002 rp="No dice. I can't find a C preprocessor. Name one:"
4006 $x_cpp <testcpp.c >testcpp.out 2>&1
4007 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4008 echo "OK, that will do." >&4
4010 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4025 echo "Perhaps can we force $cc -E using a wrapper..."
4026 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4027 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4033 echo "Nope, we'll have to live without it..."
4047 "$wrapper"|'cppstdin') ;;
4048 *) $rm -f $wrapper;;
4050 $rm -f testcpp.c testcpp.out
4052 : Set private lib path
4055 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4060 '') dlist="$loclibpth $plibpth $glibpth";;
4061 *) dlist="$libpth";;
4064 : Now check and see which directories actually exist, avoiding duplicates
4068 if $test -d $xxx; then
4071 *) libpth="$libpth $xxx";;
4077 Some systems have incompatible or broken versions of libraries. Among
4078 the directories listed in the question below, please remove any you
4079 know not to be holding relevant libraries, and add any that are needed.
4080 Say "none" for none.
4091 rp="Directories to use for library searches?"
4098 : compute shared library extension
4101 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4111 On some systems, shared libraries may be available. Answer 'none' if
4112 you want to suppress searching of shared libraries for the remaining
4113 of this configuration.
4116 rp='What is the file extension used for shared libraries?'
4120 : Define several unixisms.
4121 : Hints files or command line option can be used to override them.
4122 : The convoluted testing is in case hints files set either the old
4125 '') case "$exe_ext" in
4127 *) _exe="$exe_ext" ;;
4132 '') case "$lib_ext" in
4139 '') case "$obj_ext" in
4146 '') case "$path_sep" in
4157 : Which makefile gets called first. This is used by make depend.
4158 case "$firstmakefile" in
4159 '') firstmakefile='makefile';;
4164 Perl can be built to use the SOCKS proxy protocol library. To do so,
4165 Configure must be run with -Dusesocks.
4167 Normally you do not need this and you should answer no.
4171 $define|true|[yY]*) dflt='y';;
4174 rp='Build Perl for SOCKS?'
4177 y|Y) val="$define" ;;
4183 : Looking for optional libraries
4185 echo "Checking for optional libraries..." >&4
4190 case "$libswanted" in
4191 '') libswanted='c_s';;
4195 libswanted="$libswanted socks5 socks5_sh"
4198 for thislib in $libswanted; do
4200 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4201 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4202 echo "Found -l$thislib (shared)."
4205 *) dflt="$dflt -l$thislib";;
4207 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4208 echo "Found -l$thislib (shared)."
4211 *) dflt="$dflt -l$thislib";;
4213 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4214 echo "Found -l$thislib."
4217 *) dflt="$dflt -l$thislib";;
4219 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4220 echo "Found -l$thislib."
4223 *) dflt="$dflt -l$thislib";;
4225 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4226 echo "Found -l${thislib}_s."
4229 *) dflt="$dflt -l${thislib}_s";;
4231 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4232 echo "Found -l$thislib."
4235 *) dflt="$dflt -l$thislib";;
4238 echo "No -l$thislib."
4249 ' '|'') dflt='none';;
4254 In order to compile $package on your machine, a number of libraries
4255 are usually needed. Include any other special libraries here as well.
4256 Say "none" for none. The default list is almost always right.
4260 rp="What libraries to use?"
4267 : determine optimization, if desired, or use for debug flag also
4269 ' '|$undef) dflt='none';;
4271 *) dflt="$optimize";;
4275 By default, $package compiles with the -O flag to use the optimizer.
4276 Alternately, you might want to use the symbolic debugger, which uses
4277 the -g flag (on traditional Unix systems). Either flag can be
4278 specified here. To use neither flag, specify the word "none".
4281 rp="What optimizer/debugger flag should be used?"
4285 'none') optimize=" ";;
4289 : We will not override a previous value, but we might want to
4290 : augment a hint file
4292 default|recommended)
4293 case "$gccversion" in
4294 1*) dflt='-fpcc-struct-return' ;;
4297 *-g*) dflt="$dflt -DDEBUGGING";;
4299 case "$gccversion" in
4300 2*) if test -d /etc/conf/kconfig.d &&
4301 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4307 case "$gccversion" in
4311 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4312 echo 'int main(void) { return 0; }' > gcctest.c
4313 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4314 echo "Yes, it does." 2>&1
4317 echo "Leaving current flags $ccflags alone." 2>&1
4319 *) dflt="$dflt -fno-strict-aliasing" ;;
4322 echo "Nope, it doesn't, but that's ok." 2>&1
4329 case "$mips_type" in
4330 *BSD*|'') inclwanted="$locincpth $usrinc";;
4331 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4333 for thisincl in $inclwanted; do
4334 if $test -d $thisincl; then
4335 if $test x$thisincl != x$usrinc; then
4338 *) dflt="$dflt -I$thisincl";;
4344 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4346 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4354 *) dflt="$dflt -D$2";;
4358 set signal.h LANGUAGE_C; eval $inctest
4362 ccflags="$ccflags -DSOCKS"
4367 default|recommended) dflt="$ccflags $dflt" ;;
4368 *) dflt="$ccflags";;
4376 Your C compiler may want other flags. For this question you should include
4377 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4378 but you should NOT include libraries or ld flags like -lwhatever. If you
4379 want $package to honor its debug switch, you should include -DDEBUGGING here.
4380 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4382 To use no flags, specify the word "none".
4388 rp="Any additional cc flags?"
4395 : the following weeds options from ccflags that are of no interest to cpp
4397 case "$gccversion" in
4398 1*) cppflags="$cppflags -D__GNUC__"
4400 case "$mips_type" in
4402 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4408 echo "Let me guess what the preprocessor flags are..." >&4
4422 *) ftry="$previous $flag";;
4424 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4425 >cpp1.out 2>/dev/null && \
4426 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4427 >cpp2.out 2>/dev/null && \
4428 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4429 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4431 cppflags="$cppflags $ftry"
4441 *-*) echo "They appear to be: $cppflags";;
4443 $rm -f cpp.c cpp?.out
4447 : flags used in final linking phase
4449 '') if ./venix; then
4455 *-posix*) dflt="$dflt -posix" ;;
4458 *) dflt="$ldflags";;
4461 : Try to guess additional flags to pick up local libraries.
4462 for thislibdir in $libpth; do
4463 case " $loclibpth " in
4466 *"-L$thislibdir "*) ;;
4467 *) dflt="$dflt -L$thislibdir" ;;
4479 Your C linker may need flags. For this question you should
4480 include -L/whatever and any other flags used by the C linker, but you
4481 should NOT include libraries like -lwhatever.
4483 Make sure you include the appropriate -L/path flags if your C linker
4484 does not normally search all of the directories you specified above,
4487 To use no flags, specify the word "none".
4491 rp="Any additional ld flags (NOT including libraries)?"
4497 rmlist="$rmlist pdp11"
4501 echo "Checking your choice of C compiler and flags for coherency..." >&4
4502 $cat > try.c <<'EOF'
4504 int main() { printf("Ok\n"); exit(0); }
4506 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4508 $cat >try.msg <<'EOM'
4509 I've tried to compile and run the following simple program:
4512 $cat try.c >> try.msg
4514 $cat >> try.msg <<EOM
4521 and I got the following output:
4525 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4526 if sh -c './try' >>try.msg 2>&1; then
4530 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4533 cat >> try.msg <<'EOQS'
4534 If $libs contains -lsfio, and sfio is mis-configured, then it
4535 sometimes (apparently) runs and exits with a 0 status, but with no
4536 output! It may have to do with sfio's use of _exit vs. exit.
4539 rp="You have a big problem. Shall I abort Configure"
4546 echo "The program compiled OK, but exited with status $?." >>try.msg
4547 rp="You have a problem. Shall I abort Configure"
4551 echo "I can't compile the test program." >>try.msg
4552 rp="You have a BIG problem. Shall I abort Configure"
4558 case "$knowitall" in
4560 echo "(The supplied flags or libraries might be incorrect.)"
4568 *) echo "Ok. Stopping Configure." >&4
4573 n) echo "OK, that should do.";;
4575 $rm -f try try.* core
4577 : determine filename position in cpp output
4579 echo "Computing filename position in cpp output for #include directives..." >&4
4580 echo '#include <stdio.h>' > foo.c
4583 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4584 $grep '^[ ]*#.*stdio\.h' | \
4585 while read cline; do
4588 while $test \$# -gt 0; do
4589 if $test -r \`echo \$1 | $tr -d '"'\`; then
4594 pos=\`expr \$pos + 1\`
4606 *) pos="${fieldn}th";;
4608 echo "Your cpp writes the filename in the $pos field of the line."
4610 : locate header file
4615 for usrincdir in $usrinc
4617 if test -f \$usrincdir/\$wanted; then
4618 echo "\$usrincdir/\$wanted"
4622 awkprg='{ print \$$fieldn }'
4623 echo "#include <\$wanted>" > foo\$\$.c
4624 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4625 $grep "^[ ]*#.*\$wanted" | \
4626 while read cline; do
4627 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4629 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4630 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4635 # status = 0: grep returned 0 lines, case statement not executed
4636 # status = 1: headerfile found
4637 # status = 2: while loop executed, no headerfile found
4641 if test \$status -eq 1; then
4648 : define an alternate in-header-list? function
4649 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4650 cont=true; xxf="echo \"<\$1> found.\" >&4";
4651 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4652 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4654 case $# in 4) instead=instead;; *) instead="at last";; esac;
4655 while $test "$cont"; do
4657 var=$2; eval "was=\$$2";
4658 if $test "$xxx" && $test -r "$xxx";
4660 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4663 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4664 set $yyy; shift; shift; yyy=$@;
4665 case $# in 0) cont="";;
4666 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4667 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4668 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4669 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4673 do set $yyy; var=$2; eval "was=\$$2";
4674 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4675 set $yyy; shift; shift; yyy=$@;
4678 : see if this is a malloc.h system
4679 set malloc.h i_malloc
4682 : see if stdlib is available
4683 set stdlib.h i_stdlib
4686 : determine which malloc to compile in
4688 case "$usemymalloc" in
4689 ''|[yY]*|true|$define) dflt='y' ;;
4692 rp="Do you wish to attempt to use the malloc that comes with $package?"
4698 mallocsrc='malloc.c'
4699 mallocobj="malloc$_o"
4700 d_mymalloc="$define"
4703 : Remove malloc from list of libraries to use
4704 echo "Removing unneeded -lmalloc from library list" >&4
4705 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4708 echo "libs = $libs" >&4
4720 : compute the return types of malloc and free
4722 $cat >malloc.c <<END
4726 #include <sys/types.h>
4740 case "$malloctype" in
4742 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4749 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4753 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4760 echo "Your system uses $freetype free(), it would seem." >&4
4764 The installation process will also create a directory for
4765 vendor-supplied add-ons. Vendors who supply perl with their system
4766 may find it convenient to place all vendor-supplied files in this
4767 directory rather than in the main distribution directory. This will
4768 ease upgrades between binary-compatible maintenance versions of perl.
4770 Of course you may also use these directories in whatever way you see
4771 fit. For example, you might use them to access modules shared over a
4772 company-wide network.
4774 The default answer should be fine for most people.
4775 This causes further questions about vendor add-ons to be skipped
4776 and no vendor-specific directories will be configured for perl.
4779 rp='Do you want to configure vendor-specific add-on directories?'
4780 case "$usevendorprefix" in
4781 define|true|[yY]*) dflt=y ;;
4787 rp='Installation prefix to use for vendor-supplied add-ons?'
4788 case "$vendorprefix" in
4790 *) dflt=$vendorprefix ;;
4794 case "$vendorprefix" in
4798 *) oldvendorprefix="$prefix";;
4802 usevendorprefix="$define"
4804 vendorprefixexp="$ansexp"
4806 *) usevendorprefix="$undef"
4812 case "$vendorprefix" in
4813 '') d_vendorlib="$undef"
4817 *) d_vendorlib="$define"
4818 : determine where vendor-supplied modules go.
4819 : Usual default is /usr/local/lib/perl5/vendor_perl
4820 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4821 case "$installstyle" in
4822 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4823 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4826 rp='Pathname for the vendor-supplied library files?'
4829 vendorlibexp="$ansexp"
4830 : Change installation prefix, if necessary.
4831 if $test X"$prefix" != X"$installprefix"; then
4832 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4834 installvendorlib="$vendorlibexp"
4839 : Cruising for prototypes
4841 echo "Checking out function prototypes..." >&4
4842 $cat >prototype.c <<'EOCP'
4843 int main(int argc, char *argv[]) {
4846 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4847 echo "Your C compiler appears to support function prototypes."
4850 echo "Your C compiler doesn't seem to understand function prototypes."
4857 case "$prototype" in
4859 *) ansi2knr='ansi2knr'
4864 This version of $package can only be compiled by a compiler that
4865 understands function prototypes. Unfortunately, your C compiler
4867 doesn't seem to understand them. Sorry about that.
4869 If GNU cc is available for your system, perhaps you could try that instead.
4871 Eventually, we hope to support building Perl with pre-ANSI compilers.
4872 If you would like to help in that effort, please contact <perlbug@perl.org>.
4874 Aborting Configure now.
4880 : determine where public executables go
4885 rp='Pathname where the public executables will reside?'
4887 if $test "X$ansexp" != "X$binexp"; then
4892 : Change installation prefix, if necessary.
4893 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4894 if $test X"$prefix" != X"$installprefix"; then
4895 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4897 installbin="$binexp"
4900 : determine whether to install perl also as /usr/bin/perl
4903 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4905 Many scripts expect to perl to be installed as /usr/bin/perl.
4906 I can install the perl you are about to compile also as /usr/bin/perl
4907 (in addition to $installbin/perl).
4909 case "$installusrbinperl" in
4910 "$undef"|[nN]*) dflt='n';;
4913 rp="Do you want to install perl as /usr/bin/perl?"
4916 [yY]*) val="$define";;
4922 set installusrbinperl
4925 : define a shorthand compile call
4929 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4930 : define a shorthand compile call for compilations that should be ok.
4934 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4937 echo "Checking for GNU C Library..." >&4
4938 cat >gnulibc.c <<EOM
4950 if eval $compile_ok && ./gnulibc; then
4952 echo "You are using the GNU C Library"
4955 echo "You are not using the GNU C Library"
4961 : see if nm is to be used to determine whether a symbol is defined or not
4965 case "$d_gnulibc" in
4968 echo "nm probably won't work on the GNU C Library." >&4
4974 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4976 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4977 echo "'nm' won't be sufficient on this sytem." >&4
4983 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4984 if $test $dflt -gt 20; then
4994 true|$define) dflt=y;;
5001 I can use $nm to extract the symbols from your C libraries. This
5002 is a time consuming task which may generate huge output on the disk (up
5003 to 3 megabytes) but that should make the symbols extraction faster. The
5004 alternative is to skip the 'nm' extraction part and to compile a small
5005 test program instead to determine whether each symbol is present. If
5006 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5007 this may be the best solution.
5009 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5012 rp="Shall I use $nm to extract C symbols from the libraries?"
5015 [Nn]*) usenm=false;;
5024 : nm options which may be necessary
5026 '') if $test -f /mach_boot; then
5028 elif $test -d /usr/ccs/lib; then
5029 nm_opt='-p' # Solaris (and SunOS?)
5030 elif $test -f /dgux; then
5032 elif $test -f /lib64/rld; then
5033 nm_opt='-p' # 64-bit Irix
5039 : nm options which may be necessary for shared libraries but illegal
5040 : for archive libraries. Thank you, Linux.
5041 case "$nm_so_opt" in
5042 '') case "$myuname" in
5044 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5045 nm_so_opt='--dynamic'
5054 : get list of predefined functions in a handy place
5059 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5066 *) for thislib in $libs; do
5069 : Handle C library specially below.
5072 thislib=`echo $thislib | $sed -e 's/^-l//'`
5073 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5075 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5077 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5079 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5081 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5083 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5085 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5090 libnames="$libnames $try"
5092 *) libnames="$libnames $thislib" ;;
5101 for xxx in $libpth; do
5102 $test -r $1 || set $xxx/libc.$so
5103 : The messy sed command sorts on library version numbers.
5105 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5106 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5108 s/[0-9][0-9]*/0000&/g
5109 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5112 sort | $sed -e 's/^.* //'`
5115 $test -r $1 || set /usr/ccs/lib/libc.$so
5116 $test -r $1 || set /lib/libsys_s$_a
5122 if $test -r "$1"; then
5123 echo "Your (shared) C library seems to be in $1."
5125 elif $test -r /lib/libc && $test -r /lib/clib; then
5126 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5128 libc='/lib/clib /lib/libc'
5129 if $test -r /lib/syslib; then
5130 echo "(Your math library is in /lib/syslib.)"
5131 libc="$libc /lib/syslib"
5133 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5134 echo "Your C library seems to be in $libc, as you said before."
5135 elif $test -r $incpath/usr/lib/libc$_a; then
5136 libc=$incpath/usr/lib/libc$_a;
5137 echo "Your C library seems to be in $libc. That's fine."
5138 elif $test -r /lib/libc$_a; then
5140 echo "Your C library seems to be in $libc. You're normal."
5142 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5144 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5145 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5146 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5148 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5150 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5153 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5155 if $test -r "$tans"; then
5156 echo "Your C library seems to be in $tans, of all places."
5162 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5166 If the guess above is wrong (which it might be if you're using a strange
5167 compiler, or your machine supports multiple models), you can override it here.
5172 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5174 I can't seem to find your C library. I've looked in the following places:
5177 $sed 's/^/ /' libpath
5180 None of these seems to contain your C library. I need to get its name...
5185 rp='Where is your C library?'
5190 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5191 set X `cat libnames`
5194 case $# in 1) xxx=file; esac
5195 echo "Extracting names from the following $xxx for later perusal:" >&4
5197 $sed 's/^/ /' libnames >&4
5199 $echo $n "This may take a while...$c" >&4
5203 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5204 *) $nm $nm_opt $file 2>/dev/null;;
5209 $grep fprintf libc.tmp > libc.ptf
5210 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5211 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5213 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5215 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5217 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5219 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5221 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5223 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5225 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5227 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5229 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5231 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5233 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5235 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5237 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5238 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5240 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5242 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5244 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5246 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5248 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5250 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5252 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5254 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5256 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5258 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5260 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5262 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5264 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5266 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5268 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5271 $nm -p $* 2>/dev/null >libc.tmp
5272 $grep fprintf libc.tmp > libc.ptf
5273 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5274 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5280 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5282 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5283 for thisname in $libnames $libc; do
5284 $ar t $thisname >>libc.tmp
5286 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5288 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5289 # Repeat libc to extract forwarders to DLL entries too
5290 for thisname in $libnames $libc; do
5291 $ar tv $thisname >>libc.tmp
5292 # Revision 50 of EMX has bug in $ar.
5293 # it will not extract forwarders to DLL entries
5294 # Use emximp which will extract exactly them.
5295 emximp -o tmp.imp $thisname \
5297 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5298 < tmp.imp >>libc.tmp
5301 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5304 echo "$ar didn't seem to work right." >&4
5305 echo "Maybe this is a Cray...trying bld instead..." >&4
5306 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5308 for thisname in $libnames; do
5310 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5311 $ar t $thisname >>libc.tmp
5315 echo "That didn't work either. Giving up." >&4
5322 if $test -f /lib/syscalls.exp; then
5324 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5325 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5329 $rm -f libnames libpath
5331 : see if dld is available
5335 : is a C symbol defined?
5338 -v) tf=libc.tmp; tc=""; tdc="";;
5339 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5340 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5343 case "$reuseval-$4" in
5345 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5351 if $contains $tlook $tf >/dev/null 2>&1;
5356 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5357 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5365 $define) tval=true;;
5371 : define an is-in-libc? function
5372 inlibc='echo " "; td=$define; tu=$undef;
5373 sym=$1; var=$2; eval "was=\$$2";
5375 case "$reuseval$was" in
5385 echo "$sym() found." >&4;
5386 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5388 echo "$sym() NOT found." >&4;
5389 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5393 $define) echo "$sym() found." >&4;;
5394 *) echo "$sym() NOT found." >&4;;
5398 : see if dlopen exists
5405 : determine which dynamic loading, if any, to compile in
5407 dldir="ext/DynaLoader"
5420 $define) dflt='y' ;;
5423 $define) dflt='y' ;;
5425 : Does a dl_xxx.xs file exist for this operating system
5426 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5429 rp="Do you wish to use dynamic loading?"
5436 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5437 dflt="$dldir/dl_${osname}.xs"
5438 elif $test "$d_dlopen" = "$define" ; then
5439 dflt="$dldir/dl_dlopen.xs"
5440 elif $test "$i_dld" = "$define" ; then
5441 dflt="$dldir/dl_dld.xs"
5446 *) dflt="$dldir/$dlsrc"
5449 echo "The following dynamic loading files are available:"
5450 : Can not go over to $dldir because getfile has path hard-coded in.
5451 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5452 rp="Source file to use for dynamic loading"
5458 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5462 Some systems may require passing special flags to $cc -c to
5463 compile modules that will be used to create a shared library.
5464 To use no flags, say "none".
5467 case "$cccdlflags" in
5468 '') case "$gccversion" in
5469 '') case "$osname" in
5471 next) dflt='none' ;;
5472 irix*) dflt='-KPIC' ;;
5473 svr4*|esix*|solaris) dflt='-KPIC' ;;
5474 sunos) dflt='-pic' ;;
5478 *) case "$osname" in
5479 svr4*|esix*|solaris) dflt='-fPIC' ;;
5484 *) dflt="$cccdlflags" ;;
5486 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5489 none) cccdlflags=' ' ;;
5490 *) cccdlflags="$ans" ;;
5495 Some systems use ld to create libraries that can be dynamically loaded,
5496 while other systems (such as those using ELF) use $cc.
5500 '') $cat >try.c <<'EOM'
5501 /* Test for whether ELF binaries are produced */
5506 int i = open("a.out",O_RDONLY);
5509 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5510 exit(0); /* succeed (yes, it's ELF) */
5515 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5517 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5521 echo "I'll use ld to build dynamic libraries."
5530 rp="What command should be used to create dynamic libraries?"
5536 Some systems may require passing special flags to $ld to create a
5537 library that can be dynamically loaded. If your ld flags include
5538 -L/other/path options to locate libraries outside your loader's normal
5539 search path, you may need to specify those -L options here as well. To
5540 use no flags, say "none".
5543 case "$lddlflags" in
5544 '') case "$osname" in
5545 beos) dflt='-nostart' ;;
5547 linux|irix*) dflt='-shared' ;;
5548 next) dflt='none' ;;
5549 solaris) dflt='-G' ;;
5550 sunos) dflt='-assert nodefinitions' ;;
5551 svr4*|esix*) dflt="-G $ldflags" ;;
5555 *) dflt="$lddlflags" ;;
5558 : Try to guess additional flags to pick up local libraries.
5559 : Be careful not to append to a plain 'none'
5563 for thisflag in $ldflags; do
5568 *) dflt="$dflt $thisflag" ;;
5575 ''|' ') dflt='none' ;;
5578 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5581 none) lddlflags=' ' ;;
5582 *) lddlflags="$ans" ;;
5587 Some systems may require passing special flags to $cc to indicate that
5588 the resulting executable will use dynamic linking. To use no flags,
5592 case "$ccdlflags" in
5593 '') case "$osname" in
5594 hpux) dflt='-Wl,-E' ;;
5595 linux) dflt='-rdynamic' ;;
5596 next) dflt='none' ;;
5597 sunos) dflt='none' ;;
5601 *) dflt="$ccdlflags" ;;
5603 rp="Any special flags to pass to $cc to use dynamic loading?"
5606 none) ccdlflags=' ' ;;
5607 *) ccdlflags="$ans" ;;
5621 # No dynamic loading being used, so don't bother even to prompt.
5624 *) case "$useshrplib" in
5625 '') case "$osname" in
5626 svr4*|dgux|dynixptx|esix|powerux|beos)
5628 also='Building a shared libperl is required for dynamic loading to work on your system.'
5633 also='Building a shared libperl is needed for MAB support.'
5651 The perl executable is normally obtained by linking perlmain.c with
5652 libperl${_a}, any static extensions (usually just DynaLoader), and
5653 any other libraries needed on this system (such as -lm, etc.). Since
5654 your system supports dynamic loading, it is probably possible to build
5655 a shared libperl.$so. If you will have more than one executable linked
5656 to libperl.$so, this will significantly reduce the size of each
5657 executable, but it may have a noticeable affect on performance. The
5658 default is probably sensible for your system.
5662 rp="Build a shared libperl.$so (y/n)"
5666 useshrplib='true' ;;
5667 *) useshrplib='false' ;;
5672 case "$useshrplib" in
5676 # Figure out a good name for libperl.so. Since it gets stored in
5677 # a version-specific architecture-dependent library, the version
5678 # number isn't really that important, except for making cc/ld happy.
5680 # A name such as libperl.so.3.1
5681 majmin="libperl.$so.$patchlevel.$subversion"
5682 # A name such as libperl.so.301
5683 majonly=`echo $patchlevel $subversion |
5684 $awk '{printf "%d%02d", $1, $2}'`
5685 majonly=libperl.$so.$majonly
5686 # I'd prefer to keep the os-specific stuff here to a minimum, and
5687 # rely on figuring it out from the naming of libc.
5688 case "${osname}${osvers}" in
5691 # XXX How handle the --version stuff for MAB?
5693 linux*) # ld won't link with a bare -lperl otherwise.
5696 *) # Try to guess based on whether libc has major.minor.
5698 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5699 *libc.$so.[0-9]*) dflt=$majonly ;;
5700 *) dflt=libperl.$so ;;
5710 I need to select a good name for the shared libperl. If your system uses
5711 library names with major and minor numbers, then you might want something
5712 like $majmin. Alternatively, if your system uses a single version
5713 number for shared libraries, then you might want to use $majonly.
5714 Or, your system might be quite happy with a simple libperl.$so.
5716 Since the shared libperl will get installed into a version-specific
5717 architecture-dependent directory, the version number of the shared perl
5718 library probably isn't important, so the default should be o.k.
5721 rp='What name do you want to give to the shared libperl?'
5724 echo "Ok, I'll use $libperl"
5727 libperl="libperl${_a}"
5731 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5735 WARNING: Use of the shrpdir variable for the installation location of
5736 the shared $libperl is not supported. It was never documented and
5737 will not work in this version. Let me (perlbug@perl.com)
5738 know of any problems this may cause.
5744 But your current setting of $shrpdir is
5745 the default anyway, so it's harmless.
5750 Further, your current attempted setting of $shrpdir
5751 conflicts with the value of $archlibexp/CORE
5752 that installperl will use.
5759 # How will the perl executable find the installed shared $libperl?
5760 # Add $xxx to ccdlflags.
5761 # If we can't figure out a command-line option, use $shrpenv to
5762 # set env LD_RUN_PATH. The main perl makefile uses this.
5763 shrpdir=$archlibexp/CORE
5766 if "$useshrplib"; then
5769 # We'll set it in Makefile.SH...
5775 xxx="-Wl,-R$shrpdir"
5777 linux|irix*|dec_osf)
5778 xxx="-Wl,-rpath,$shrpdir"
5781 # next doesn't like the default...
5784 # beos doesn't like the default, either.
5787 # hpux doesn't like the default, either.
5788 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5791 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5797 # Only add $xxx if it isn't already in ccdlflags.
5798 case " $ccdlflags " in
5800 *) ccdlflags="$ccdlflags $xxx"
5803 Adding $xxx to the flags
5804 passed to $ld so that the perl executable will find the
5805 installed shared $libperl.
5813 # Fix ccdlflags in AIX for building external extensions.
5814 # (For building Perl itself bare -bE:perl.exp is needed,
5815 # Makefile.SH takes care of this.)
5817 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5819 # Respect a hint or command-line value.
5821 '') shrpenv="$tmp_shrpenv" ;;
5823 case "$ldlibpthname" in
5824 '') ldlibpthname=LD_LIBRARY_PATH ;;
5825 none) ldlibpthname='' ;;
5828 : determine where manual pages go
5829 set man1dir man1dir none
5833 $spackage has manual pages available in source form.
5837 echo "However, you don't have nroff, so they're probably useless to you."
5839 '') man1dir="none";;
5842 echo "If you don't want the manual sources installed, answer 'none'."
5847 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5848 lookpath="$lookpath $prefixexp/man/p_man/man1"
5849 lookpath="$lookpath $prefixexp/man/u_man/man1"
5850 lookpath="$lookpath $prefixexp/man/man.1"
5852 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5853 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5863 rp="Where do the main $spackage manual pages (source) go?"
5865 if $test "X$man1direxp" != "X$ansexp"; then
5869 man1direxp="$ansexp"
5875 : Change installation prefix, if necessary.
5876 if $test X"$prefix" != X"$installprefix"; then
5877 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5879 installman1dir="$man1direxp"
5882 : What suffix to use on installed man pages
5889 rp="What suffix should be used for the main $spackage man pages?"
5891 '') case "$man1dir" in
5905 *) dflt="$man1ext";;
5912 : see if we can have long filenames
5914 rmlist="$rmlist /tmp/cf$$"
5915 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5916 first=123456789abcdef
5917 second=/tmp/cf$$/$first
5918 $rm -f $first $second
5919 if (echo hi >$first) 2>/dev/null; then
5920 if $test -f 123456789abcde; then
5921 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5924 if (echo hi >$second) 2>/dev/null; then
5925 if $test -f /tmp/cf$$/123456789abcde; then
5927 That's peculiar... You can have filenames longer than 14 characters, but only
5928 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5929 I shall consider your system cannot support long filenames at all.
5933 echo 'You can have filenames longer than 14 characters.' >&4
5938 How confusing! Some of your filesystems are sane enough to allow filenames
5939 longer than 14 characters but some others like /tmp can't even think about them.
5940 So, for now on, I shall assume your kernel does not allow them at all.
5947 You can't have filenames longer than 14 chars. You can't even think about them!
5953 $rm -rf /tmp/cf$$ 123456789abcde*
5955 : determine where library module manual pages go
5956 set man3dir man3dir none
5960 $spackage has manual pages for many of the library modules.
5966 However, you don't have nroff, so they're probably useless to you.
5969 '') man3dir="none";;
5973 case "$d_flexfnam" in
5976 However, your system can't handle the long file names like File::Basename.3.
5979 '') man3dir="none";;
5983 echo "If you don't want the manual sources installed, answer 'none'."
5984 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5986 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5987 if $test -d "$privlib/man/man3"; then
5990 WARNING: Previous versions of perl installed man3 pages into
5991 $privlib/man/man3. This version will suggest a
5992 new default of $dflt.
5996 rp='Do you wish to preserve the old behavior?(y/n)'
5999 y*) dflt="$privlib/man/man3" ;;
6005 *) dflt="$man3dir" ;;
6009 rp="Where do the $package library man pages (source) go?"
6012 man3direxp="$ansexp"
6018 : Change installation prefix, if necessary.
6019 if $test X"$prefix" != X"$installprefix"; then
6020 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6022 installman3dir="$man3direxp"
6025 : What suffix to use on installed man pages
6031 rp="What suffix should be used for the $package library man pages?"
6033 '') case "$man3dir" in
6047 *) dflt="$man3ext";;
6054 : see if we have to deal with yellow pages, now NIS.
6055 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6056 if $test -f /usr/etc/nibindd; then
6058 echo "I'm fairly confident you're on a NeXT."
6060 rp='Do you get the hosts file via NetInfo?'
6069 y*) hostcat='nidump hosts .';;
6070 *) case "$hostcat" in
6071 nidump*) hostcat='';;
6081 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6089 rp='Are you getting the hosts file via yellow pages?'
6092 y*) hostcat='ypcat hosts';;
6093 *) hostcat='cat /etc/hosts';;
6099 '') hostcat='cat /etc/hosts';;
6102 '') groupcat='cat /etc/group';;
6105 '') passcat='cat /etc/passwd';;
6108 : now get the host name
6110 echo "Figuring out host name..." >&4
6111 case "$myhostname" in
6113 echo 'Maybe "hostname" will work...'
6114 if tans=`sh -c hostname 2>&1` ; then
6122 if $test "$cont"; then
6124 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6125 if tans=`cat /etc/systemid 2>&1` ; then
6127 phostname='cat /etc/systemid'
6128 echo "Whadyaknow. Xenix always was a bit strange..."
6131 elif $test -r /etc/systemid; then
6132 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6135 if $test "$cont"; then
6136 echo 'No, maybe "uuname -l" will work...'
6137 if tans=`sh -c 'uuname -l' 2>&1` ; then
6139 phostname='uuname -l'
6141 echo 'Strange. Maybe "uname -n" will work...'
6142 if tans=`sh -c 'uname -n' 2>&1` ; then
6144 phostname='uname -n'
6146 echo 'Oh well, maybe I can mine it out of whoami.h...'
6147 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6148 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6149 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6151 case "$myhostname" in
6152 '') echo "Does this machine have an identity crisis or something?"
6155 echo "Well, you said $myhostname before..."
6156 phostname='echo $myhostname';;
6162 : you do not want to know about this
6167 if $test "$myhostname" ; then
6169 rp='Your host name appears to be "'$myhostname'".'" Right?"
6177 : bad guess or no guess
6178 while $test "X$myhostname" = X ; do
6180 rp="Please type the (one word) name of your host:"
6185 : translate upper to lower if necessary
6186 case "$myhostname" in
6188 echo "(Normalizing case in your host name)"
6189 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6193 case "$myhostname" in
6195 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6196 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6197 echo "(Trimming domain name from host name--host name is now $myhostname)"
6199 *) case "$mydomain" in
6202 test "X$hostcat" = "Xypcat hosts" &&
6203 ypmatch "$myhostname" hosts 2>/dev/null |\
6204 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6207 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6208 /[ ]$myhostname[ . ]/p" > hosts
6211 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6212 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6213 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6214 hosts | $sort | $uniq | \
6215 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6216 case `$echo X$dflt` in
6217 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6220 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6225 tans=`./loc resolv.conf X /etc /usr/etc`
6226 if $test -f "$tans"; then
6227 echo "(Attempting domain name extraction from $tans)"
6228 dflt=.`$sed -n -e 's/ / /g' \
6229 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6230 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6232 .) dflt=.`$sed -n -e 's/ / /g' \
6233 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6234 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6241 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6242 dflt=.`sh -c domainname 2>/dev/null`
6245 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6250 .) echo "(Lost all hope -- silly guess then)"
6256 *) dflt="$mydomain";;
6260 rp="What is your domain name?"
6270 : translate upper to lower if necessary
6273 echo "(Normalizing case in your domain name)"
6274 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6278 : a little sanity check here
6279 case "$phostname" in
6282 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6283 $myhostname$mydomain|$myhostname) ;;
6285 case "$phostname" in
6287 echo "(That doesn't agree with your whoami.h file, by the way.)"
6290 echo "(That doesn't agree with your $phostname command, by the way.)"
6300 I need to get your e-mail address in Internet format if possible, i.e.
6301 something like user@host.domain. Please answer accurately since I have
6302 no easy means to double check it. The default value provided below
6303 is most probably close to the reality but may not be valid from outside
6304 your organization...
6308 while test "$cont"; do
6310 '') dflt="$cf_by@$myhostname$mydomain";;
6311 *) dflt="$cf_email";;
6313 rp='What is your e-mail address?'
6319 rp='Address does not look like an Internet one. Use it anyway?'
6335 If you or somebody else will be maintaining perl at your site, please
6336 fill in the correct e-mail address here so that they may be contacted
6337 if necessary. Currently, the "perlbug" program included with perl
6338 will send mail to this address in addition to perlbug@perl.com. You may
6339 enter "none" for no administrator.
6342 case "$perladmin" in
6343 '') dflt="$cf_email";;
6344 *) dflt="$perladmin";;
6346 rp='Perl administrator e-mail address'
6350 : figure out how to guarantee perl startup
6351 case "$startperl" in
6353 case "$sharpbang" in
6357 I can use the #! construct to start perl on your system. This will
6358 make startup of perl scripts faster, but may cause problems if you
6359 want to share those scripts and perl is not in a standard place
6360 ($binexp/perl) on all your platforms. The alternative is to force
6361 a shell by starting the script with a single ':' character.
6365 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6368 none) startperl=": # use perl";;
6369 *) startperl="#!$ans"
6370 if $test 30 -lt `echo "$ans" | wc -c`; then
6373 WARNING: Some systems limit the #! command to 32 characters.
6374 If you experience difficulty running Perl scripts with #!, try
6375 installing Perl in a directory with a shorter pathname.
6381 *) startperl=": # use perl"
6386 echo "I'll use $startperl to start perl scripts."
6388 : figure best path for perl in scripts
6391 perlpath="$binexp/perl"
6392 case "$startperl" in
6397 I will use the "eval 'exec'" idiom to start Perl on your system.
6398 I can use the full path of your Perl binary for this purpose, but
6399 doing so may cause problems if you want to share those scripts and
6400 Perl is not always in a standard place ($binexp/perl).
6404 rp="What path shall I use in \"eval 'exec'\"?"
6411 case "$startperl" in
6413 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6416 : determine where public executable scripts go
6417 set scriptdir scriptdir
6419 case "$scriptdir" in
6422 : guess some guesses
6423 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6424 $test -d /usr/share/bin && dflt=/usr/share/bin
6425 $test -d /usr/local/script && dflt=/usr/local/script
6426 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6427 $test -d $prefixexp/script && dflt=$prefixexp/script
6431 *) dflt="$scriptdir"
6436 Some installations have a separate directory just for executable scripts so
6437 that they can mount it across multiple architectures but keep the scripts in
6438 one spot. You might, for example, have a subdirectory of /usr/share for this.
6439 Or you might just lump your scripts in with all your other executables.
6443 rp='Where do you keep publicly executable scripts?'
6445 if $test "X$ansexp" != "X$scriptdirexp"; then
6449 scriptdirexp="$ansexp"
6450 : Change installation prefix, if necessary.
6451 if $test X"$prefix" != X"$installprefix"; then
6452 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6454 installscript="$scriptdirexp"
6459 After $package is installed, you may wish to install various
6460 add-on modules and utilities. Typically, these add-ons will
6461 be installed under $prefix with the rest
6462 of this package. However, you may wish to install such add-ons
6463 elsewhere under a different prefix.
6465 If you do not wish to put everything under a single prefix, that's
6466 ok. You will be prompted for the individual locations; this siteprefix
6467 is only used to suggest the defaults.
6469 The default should be fine for most people.
6473 rp='Installation prefix to use for add-on modules and utilities?'
6474 : XXX Here might be another good place for an installstyle setting.
6475 case "$siteprefix" in
6477 *) dflt=$siteprefix ;;
6481 case "$siteprefix" in
6486 *) oldsiteprefix="$prefix";;
6491 siteprefixexp="$ansexp"
6493 : determine where site specific libraries go.
6494 : Usual default is /usr/local/lib/perl5/site_perl
6495 : The default "style" setting is made in installstyle.U
6496 : XXX No longer works with Prefixit stuff.
6497 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6498 case "$installstyle" in
6499 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6500 *) dflt=$siteprefix/lib/site_$prog ;;
6504 The installation process will create a directory for
6505 site-specific extensions and modules. Most users find it convenient
6506 to place all site-specific files in this directory rather than in the
6507 main distribution directory.
6511 rp='Pathname for the site-specific library files?'
6514 sitelibexp="$ansexp"
6515 : Change installation prefix, if necessary.
6516 if $test X"$prefix" != X"$installprefix"; then
6517 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6519 installsitelib="$sitelibexp"
6522 : determine where site specific architecture-dependent libraries go.
6523 : sitelib default is /usr/local/lib/perl5/site_perl/
6524 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6525 : sitelib may have an optional trailing /share.
6526 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6527 tdflt="$tdflt/$apiversion/$archname"
6528 set sitearch sitearch none
6531 '') dflt="$tdflt" ;;
6532 *) dflt="$sitearch" ;;
6536 The installation process will also create a directory for
6537 architecture-dependent site-specific extensions and modules.
6541 rp='Pathname for the site-specific architecture-dependent library files?'
6544 sitearchexp="$ansexp"
6545 : Change installation prefix, if necessary.
6546 if $test X"$prefix" != X"$installprefix"; then
6547 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6549 installsitearch="$sitearchexp"
6552 : determine where add-on public executables go
6554 '') dflt=$siteprefix/bin ;;
6558 rp='Pathname where the add-on public executables should be installed?'
6561 sitebinexp="$ansexp"
6562 : Change installation prefix, if necessary.
6563 if $test X"$prefix" != X"$installprefix"; then
6564 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6566 installsitebin="$sitebinexp"
6571 Perl can be built to take advantage of long doubles which
6572 (if available) may give more accuracy and range for floating point
6573 numbers. To do so, Configure must be run with -Duselongdouble.
6575 If this doesn't make any sense to you, just accept the default 'n'.
6577 case "$uselongdouble" in
6578 $define|true|[yY]*) dflt='y';;
6581 rp='Try to use long doubles if available?'
6584 y|Y) val="$define" ;;
6590 case "$uselongdouble" in
6591 "$define"|true|[yY]*)
6592 : Look for a hint-file generated 'call-back-unit'. If the
6593 : user has specified that long doubles should be used,
6594 : we may need to set or change some other defaults.
6595 if $test -f uselongdouble.cbu; then
6596 echo "Your platform has some specific hints for long doubles, using them..."
6597 . ./uselongdouble.cbu
6600 (Your platform doesn't have any specific hints for long doubles.)
6608 Previous version of $package used the standard IO mechanisms as defined
6609 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6610 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6611 the default. This abstraction layer can use AT&T's sfio (if you already
6612 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6613 problems with some extension modules. Using PerlIO with stdio is safe,
6614 but it is slower than plain stdio and therefore is not the default.
6616 If this doesn't make any sense to you, just accept the default 'n'.
6618 case "$useperlio" in
6619 $define|true|[yY]*) dflt='y';;
6622 rp='Use the experimental PerlIO abstraction layer?'
6629 echo "Ok, doing things the stdio way"
6636 case "$vendorprefix" in
6637 '') d_vendorbin="$undef"
6641 *) d_vendorbin="$define"
6642 : determine where vendor-supplied executables go.
6643 dflt=$vendorprefix/bin
6645 rp='Pathname for the vendor-supplied executables directory?'
6648 vendorbinexp="$ansexp"
6649 : Change installation prefix, if necessary.
6650 if $test X"$prefix" != X"$installprefix"; then
6651 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
6653 installvendorbin="$vendorbinexp"
6658 : Check how to convert floats to strings.
6659 if test "X$d_Gconvert" = X; then
6661 echo "Checking for an efficient way to convert floats to strings."
6664 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6665 char *myname = "gconvert";
6668 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6669 char *myname = "gcvt";
6672 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6673 char *myname = "sprintf";
6679 checkit(expect, got)
6683 if (strcmp(expect, got)) {
6684 printf("%s oddity: Expected %s, got %s\n",
6685 myname, expect, got);
6695 /* This must be 1st test on (which?) platform */
6696 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6697 Gconvert(0.1, 8, 0, buf);
6698 checkit("0.1", buf);
6700 Gconvert(1.0, 8, 0, buf);
6703 Gconvert(0.0, 8, 0, buf);
6706 Gconvert(-1.0, 8, 0, buf);
6709 /* Some Linux gcvt's give 1.e+5 here. */
6710 Gconvert(100000.0, 8, 0, buf);
6711 checkit("100000", buf);
6713 /* Some Linux gcvt's give -1.e+5 here. */
6714 Gconvert(-100000.0, 8, 0, buf);
6715 checkit("-100000", buf);
6720 case "$d_Gconvert" in
6721 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6722 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6723 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6724 *) xxx_list='gconvert gcvt sprintf' ;;
6727 for xxx_convert in $xxx_list; do
6728 echo "Trying $xxx_convert"
6730 set try -DTRY_$xxx_convert
6731 if eval $compile; then
6732 echo "$xxx_convert" found. >&4
6734 echo "I'll use $xxx_convert to convert floats into a string." >&4
6737 echo "...But $xxx_convert didn't work as I expected."
6740 echo "$xxx_convert NOT found." >&4
6744 case "$xxx_convert" in
6745 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6746 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6747 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6751 : see if inttypes.h is available
6752 : we want a real compile instead of Inhdr because some systems
6753 : have an inttypes.h which includes non-existent headers
6756 #include <inttypes.h>
6758 static int32_t foo32 = 0x12345678;
6762 if eval $compile; then
6763 echo "<inttypes.h> found." >&4
6766 echo "<inttypes.h> NOT found." >&4
6774 case "$use64bits" in
6777 $echo $n "Checking to see if your system supports int64_t...$c" >&4
6779 #include <sys/types.h>
6780 #$i_inttypes I_INTTYPES
6782 #include <inttypes.h>
6784 int64_t foo() { int64_t x; x = 7; return x; }
6786 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6788 echo " Yup, it does." >&4
6791 echo " Nope, it doesn't." >&4
6802 : check for lengths of integral types
6806 echo "Checking to see how big your integers are..." >&4
6807 $cat >intsize.c <<'EOCP'
6811 printf("intsize=%d;\n", sizeof(int));
6812 printf("longsize=%d;\n", sizeof(long));
6813 printf("shortsize=%d;\n", sizeof(short));
6818 if eval $compile_ok && ./intsize > /dev/null; then
6820 echo "Your integers are $intsize bytes long."
6821 echo "Your long integers are $longsize bytes long."
6822 echo "Your short integers are $shortsize bytes long."
6826 Help! I can't compile and run the intsize test program: please enlighten me!
6827 (This is probably a misconfiguration in your system or libraries, and
6828 you really ought to fix it. Still, I'll try anyway.)
6832 rp="What is the size of an integer (in bytes)?"
6836 rp="What is the size of a long integer (in bytes)?"
6840 rp="What is the size of a short integer (in bytes)?"
6846 $rm -f intsize intsize.*
6848 : check for long long
6850 $echo $n "Checking to see if your system supports long long...$c" >&4
6851 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6852 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6854 echo " Yup, it does." >&4
6857 echo " Nope, it doesn't." >&4
6863 : check for length of long long
6864 case "${d_longlong}${longlongsize}" in
6867 $echo $n "Checking to see how big your long longs are...$c" >&4
6868 $cat >try.c <<'EOCP'
6872 printf("%d\n", sizeof(long long));
6876 if eval $compile_ok; then
6877 longlongsize=`./try`
6878 $echo " $longlongsize bytes." >&4
6882 echo "(I can't seem to compile the test program. Guessing...)"
6883 rp="What is the size of a long long (in bytes)?"
6887 if $test "X$longsize" = "X$longlongsize"; then
6888 echo "(That isn't any different from an ordinary long.)"
6896 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6898 echo "Checking how to print 64-bit integers..." >&4
6900 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6902 $cat >try.c <<'EOCP'
6903 #include <sys/types.h>
6906 int q = 12345678901;
6911 if eval $compile; then
6915 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6916 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6917 echo "We will use %d."
6923 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6925 $cat >try.c <<'EOCP'
6926 #include <sys/types.h>
6929 long q = 12345678901;
6934 if eval $compile; then
6938 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6939 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6940 echo "We will use %ld."
6946 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6948 $cat >try.c <<'EOCP'
6949 #include <sys/types.h>
6950 #include <inttypes.h>
6953 int64_t q = 12345678901;
6954 printf("%" PRId64 "\n", q);
6958 if eval $compile; then
6962 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6963 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6964 echo "We will use the C9X style."
6970 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6972 $cat >try.c <<'EOCP'
6973 #include <sys/types.h>
6976 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6977 printf("%lld\n", q);
6981 if eval $compile; then
6985 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6986 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6987 echo "We will use the %lld style."
6993 if $test X"$sPRId64" = X -a X"$quad" != X; then
6995 #include <sys/types.h>
6998 $quad q = 12345678901;
7003 if eval $compile; then
7007 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
7008 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
7009 echo "We will use %lld."
7015 if $test X"$sPRId64" = X -a X"$quad" != X; then
7017 #include <sys/types.h>
7020 $quad q = 12345678901;
7025 if eval $compile; then
7029 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
7030 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
7031 echo "We will use %qd."
7037 if $test X"$sPRId64" = X; then
7038 echo "Cannot figure out how to print 64-bit integers." >&4
7043 fi # intsize -o longsize -o d_int64t -o d_longlong
7046 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
7047 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
7049 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
7050 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
7054 : check for length of double
7056 case "$doublesize" in
7058 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7059 $cat >try.c <<'EOCP'
7063 printf("%d\n", sizeof(double));
7067 if eval $compile_ok; then
7069 $echo " $doublesize bytes." >&4
7072 echo "(I can't seem to compile the test program. Guessing...)"
7073 rp="What is the size of a double precision number (in bytes)?"
7081 : check for long doubles
7083 $echo $n "Checking to see if your system supports long double...$c" >&4
7084 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7085 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7087 echo " Yup, it does." >&4
7090 echo " Nope, it doesn't." >&4
7096 : check for length of long double
7097 case "${d_longdbl}${longdblsize}" in
7100 $echo $n "Checking to see how big your long doubles are...$c" >&4
7101 $cat >try.c <<'EOCP'
7105 printf("%d\n", sizeof(long double));
7109 if eval $compile; then
7111 $echo " $longdblsize bytes." >&4
7115 echo "(I can't seem to compile the test program. Guessing...)" >&4
7116 rp="What is the size of a long double (in bytes)?"
7120 if $test "X$doublesize" = "X$longdblsize"; then
7121 echo "(That isn't any different from an ordinary double.)"
7129 if $test X"$d_longdbl" = X"$define"; then
7131 echo "Checking how to print long doubles..." >&4
7133 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7134 $cat >try.c <<'EOCP'
7135 #include <sys/types.h>
7139 printf("%.3f\n", d);
7143 if eval $compile; then
7147 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7148 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7149 echo "We will use %f."
7155 if $test X"$sPRIfldbl" = X; then
7156 $cat >try.c <<'EOCP'
7157 #include <sys/types.h>
7160 long double d = 123.456;
7161 printf("%.3llf\n", d);
7165 if eval $compile; then
7169 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7170 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7171 echo "We will use %llf."
7177 if $test X"$sPRIfldbl" = X; then
7178 $cat >try.c <<'EOCP'
7179 #include <sys/types.h>
7182 long double d = 123.456;
7183 printf("%.3Lf\n", d);
7187 if eval $compile; then
7191 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7192 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7193 echo "We will use %Lf."
7199 if $test X"$sPRIfldbl" = X; then
7200 $cat >try.c <<'EOCP'
7201 #include <sys/types.h>
7204 long double d = 123.456;
7205 printf("%.3lf\n", d);
7209 if eval $compile; then
7213 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7214 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7215 echo "We will use %lf."
7221 if $test X"$sPRIfldbl" = X; then
7222 echo "Cannot figure out how to print long doubles." >&4
7229 case "$sPRIfldbl" in
7230 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7231 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7233 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7234 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7238 : Initialize h_fcntl
7241 : Initialize h_sysfile
7244 : access call always available on UNIX
7248 : locate the flags for 'access()'
7252 $cat >access.c <<'EOCP'
7253 #include <sys/types.h>
7258 #include <sys/file.h>
7267 : check sys/file.h first, no particular reason here
7268 if $test `./findhdr sys/file.h` && \
7269 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7271 echo "<sys/file.h> defines the *_OK access constants." >&4
7272 elif $test `./findhdr fcntl.h` && \
7273 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7275 echo "<fcntl.h> defines the *_OK access constants." >&4
7276 elif $test `./findhdr unistd.h` && \
7277 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7278 echo "<unistd.h> defines the *_OK access constants." >&4
7280 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7286 : see if accessx exists
7287 set accessx d_accessx
7290 : see if alarm exists
7294 : see if atolf exists
7298 : see if atoll exists
7302 : Look for GNU-cc style attribute checking
7304 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7305 $cat >attrib.c <<'EOCP'
7307 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7309 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7310 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7311 echo "Your C compiler doesn't fully support __attribute__."
7314 echo "Your C compiler supports __attribute__."
7318 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7325 : see if bcmp exists
7329 : see if bcopy exists
7333 : see if this is a unistd.h system
7334 set unistd.h i_unistd
7337 : see if getpgrp exists
7338 set getpgrp d_getpgrp
7341 case "$d_getpgrp" in
7344 echo "Checking to see which flavor of getpgrp is in use..."
7347 #include <sys/types.h>
7349 # include <unistd.h>
7353 if (getuid() == 0) {
7354 printf("(I see you are running Configure as super-user...)\n");
7358 if (getpgrp(1) == 0)
7367 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7368 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7370 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7371 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7374 echo "I can't seem to compile and run the test program."
7376 xxx="a USG one, i.e. you use getpgrp()."
7378 # SVR4 systems can appear rather BSD-ish.
7381 xxx="a BSD one, i.e. you use getpgrp(pid)."
7385 xxx="probably a USG one, i.e. you use getpgrp()."
7390 echo "Assuming your getpgrp is $xxx" >&4
7399 : see if setpgrp exists
7400 set setpgrp d_setpgrp
7403 case "$d_setpgrp" in
7406 echo "Checking to see which flavor of setpgrp is in use..."
7409 #include <sys/types.h>
7411 # include <unistd.h>
7415 if (getuid() == 0) {
7416 printf("(I see you are running Configure as super-user...)\n");
7420 if (-1 == setpgrp(1, 1))
7423 if (setpgrp() != -1)
7429 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7430 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7432 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7433 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7436 echo "(I can't seem to compile and run the test program.)"
7438 xxx="a USG one, i.e. you use setpgrp()."
7440 # SVR4 systems can appear rather BSD-ish.
7443 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7447 xxx="probably a USG one, i.e. you use setpgrp()."
7452 echo "Assuming your setpgrp is $xxx" >&4
7460 : see if bzero exists
7464 : see if signal is declared as pointer to function returning int or void
7466 xxx=`./findhdr signal.h`
7467 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7468 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7469 echo "You have int (*signal())() instead of void." >&4
7471 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7472 echo "You have void (*signal())()." >&4
7474 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7475 echo "You have int (*signal())() instead of void." >&4
7477 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7478 echo "You have void (*signal())()." >&4
7481 case "$d_voidsig" in
7483 echo "I can't determine whether signal handler returns void or int..." >&4
7485 rp="What type does your signal handler return?"
7492 echo "As you already told me, signal handler returns void." >&4
7495 *) echo "As you already told me, signal handler returns int." >&4
7502 case "$d_voidsig" in
7503 "$define") signal_t="void";;
7508 : check for ability to cast large floats to 32-bit ints.
7510 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7511 if $test "$intsize" -ge 4; then
7518 #include <sys/types.h>
7520 $signal_t blech(s) int s; { exit(3); }
7527 signal(SIGFPE, blech);
7529 /* Don't let compiler optimize the test away. Store the number
7530 in a writable string for gcc to pass to sscanf under HP/UX.
7532 sprintf(str, "2147483647");
7533 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7537 /* x86 processors will probably give 0x8000 0000, which is a
7538 sign change. We don't want that. We want to mimic SPARC
7539 behavior here, which is to preserve the sign and give
7542 if (i32 != ($xxx) f)
7548 if eval $compile_ok; then
7552 echo "(I can't seem to compile the test program--assuming it can't)"
7560 echo "Nope, it can't."
7567 : check for ability to cast negative floats to unsigned
7569 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7572 #include <sys/types.h>
7574 $signal_t blech(s) int s; { exit(7); }
7575 $signal_t blech_in_list(s) int s; { exit(4); }
7576 unsigned long dummy_long(p) unsigned long p; { return p; }
7577 unsigned int dummy_int(p) unsigned int p; { return p; }
7578 unsigned short dummy_short(p) unsigned short p; { return p; }
7582 unsigned long along;
7584 unsigned short ashort;
7588 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7589 a direct f = -123. assignment. gcc-2.8.0 reportedly
7590 optimized the whole file away
7592 /* Store the number in a writable string for gcc to pass to
7595 sprintf(str, "-123");
7596 sscanf(str, "%lf", &f); /* f = -123.; */
7598 signal(SIGFPE, blech);
7599 along = (unsigned long)f;
7600 aint = (unsigned int)f;
7601 ashort = (unsigned short)f;
7602 if (along != (unsigned long)-123)
7604 if (aint != (unsigned int)-123)
7606 if (ashort != (unsigned short)-123)
7608 sprintf(str, "1073741824.");
7609 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7612 along = (unsigned long)f;
7613 if (along != 0x80000000)
7617 along = (unsigned long)f;
7618 if (along != 0x7fffffff)
7622 along = (unsigned long)f;
7623 if (along != 0x80000001)
7627 signal(SIGFPE, blech_in_list);
7628 sprintf(str, "123.");
7629 sscanf(str, "%lf", &f); /* f = 123.; */
7630 along = dummy_long((unsigned long)f);
7631 aint = dummy_int((unsigned int)f);
7632 ashort = dummy_short((unsigned short)f);
7633 if (along != (unsigned long)123)
7635 if (aint != (unsigned int)123)
7637 if (ashort != (unsigned short)123)
7644 if eval $compile_ok; then
7648 echo "(I can't seem to compile the test program--assuming it can't)"
7651 case "$castflags" in
7656 echo "Nope, it can't."
7663 : see if vprintf exists
7665 if set vprintf val -f d_vprintf; eval $csym; $val; then
7666 echo 'vprintf() found.' >&4
7668 $cat >vprintf.c <<'EOF'
7669 #include <varargs.h>
7671 int main() { xxx("foo"); }
7680 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7684 if eval $compile && ./vprintf; then
7685 echo "Your vsprintf() returns (int)." >&4
7688 echo "Your vsprintf() returns (char*)." >&4
7692 echo 'vprintf() NOT found.' >&4
7702 : see if chown exists
7706 : see if chroot exists
7710 : see if chsize exists
7714 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7715 while $test $# -ge 2; do
7717 $define) echo "#include <$2>";;
7721 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
7723 if eval $compile; then
7732 : see if this is a sys/uio.h system
7733 set sys/uio.h i_sysuio
7736 echo "Checking to see if your system supports struct iovec..." >&4
7737 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7739 case "$d_iovec_s" in
7740 "$define") echo "Yup, it does." >&4
7742 *) echo "Nope, it doesn't." >&4
7748 : see whether socket exists
7750 $echo $n "Hmm... $c" >&4
7751 if set socket val -f d_socket; eval $csym; $val; then
7752 echo "Looks like you have Berkeley networking support." >&4
7754 if set setsockopt val -f; eval $csym; $val; then
7757 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7761 if $contains socklib libc.list >/dev/null 2>&1; then
7762 echo "Looks like you have Berkeley networking support." >&4
7764 : we will have to assume that it supports the 4.2 BSD interface
7767 echo "You don't have Berkeley networking in libc$_a..." >&4
7768 if test "X$d_socket" = "X$define"; then
7769 echo "...but you seem to believe that you have sockets." >&4
7771 for net in net socket
7773 if test -f /usr/lib/lib$net$_a; then
7774 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7775 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7776 if $contains socket libc.list >/dev/null 2>&1; then
7781 echo "...but the Wollongong group seems to have hacked it in." >&4
7782 sockethdr="-I/usr/netinclude"
7785 echo "Found Berkeley sockets interface in lib$net." >& 4
7786 if $contains setsockopt libc.list >/dev/null 2>&1; then
7789 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7796 if test "X$d_socket" != "X$define"; then
7797 echo "or anywhere else I see." >&4
7805 : see if socketpair exists
7806 set socketpair d_sockpair
7811 echo "Checking the availability of certain socket constants..." >& 4
7812 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7813 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7815 #include <sys/types.h>
7816 #include <sys/socket.h>
7822 set try; if eval $compile; then
7825 set d_${enum}; eval $setvar
7829 set sendmsg d_sendmsg
7832 set recvmsg d_recvmsg
7836 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7837 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7839 case "$d_msghdr_s" in
7840 "$define") echo "Yup, it does." >&4
7842 *) echo "Nope, it doesn't." >&4
7846 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7847 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7849 case "$d_cmsghdr_s" in
7850 "$define") echo "Yup, it does." >&4
7852 *) echo "Nope, it doesn't." >&4
7856 : check for const keyword
7858 echo 'Checking to see if your C compiler knows about "const"...' >&4
7859 $cat >const.c <<'EOCP'
7860 typedef struct spug { int drokk; } spug;
7867 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7869 echo "Yup, it does."
7872 echo "Nope, it doesn't."
7877 : see if crypt exists
7879 if set crypt val -f d_crypt; eval $csym; $val; then
7880 echo 'crypt() found.' >&4
7884 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7885 if $test -z "$cryptlib"; then
7886 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7890 if $test -z "$cryptlib"; then
7891 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7895 if $test -z "$cryptlib"; then
7896 cryptlib=`./loc libcrypt$_a "" $libpth`
7900 if $test -z "$cryptlib"; then
7901 echo 'crypt() NOT found.' >&4
7910 : get csh whereabouts
7912 'csh') val="$undef" ;;
7917 : Respect a hint or command line value for full_csh.
7919 '') full_csh=$csh ;;
7922 : see if cuserid exists
7923 set cuserid d_cuserid
7926 : see if this is a limits.h system
7927 set limits.h i_limits
7930 : see if this is a float.h system
7934 : See if number of significant digits in a double precision number is known
7936 $cat >dbl_dig.c <<EOM
7946 printf("Contains DBL_DIG");
7949 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7950 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7951 echo "DBL_DIG found." >&4
7954 echo "DBL_DIG NOT found." >&4
7961 : see if difftime exists
7962 set difftime d_difftime
7965 : see if this is a dirent system
7967 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7969 echo "<dirent.h> found." >&4
7972 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7973 echo "<sys/dir.h> found." >&4
7976 xinc=`./findhdr sys/ndir.h`
7978 echo "<dirent.h> NOT found." >&4
7983 : Look for type of directory structure.
7985 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7987 case "$direntrytype" in
7990 $define) guess1='struct dirent' ;;
7991 *) guess1='struct direct' ;;
7994 *) guess1="$direntrytype"
7999 'struct dirent') guess2='struct direct' ;;
8000 *) guess2='struct dirent' ;;
8003 if $contains "$guess1" try.c >/dev/null 2>&1; then
8004 direntrytype="$guess1"
8005 echo "Your directory entries are $direntrytype." >&4
8006 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8007 direntrytype="$guess2"
8008 echo "Your directory entries seem to be $direntrytype." >&4
8010 echo "I don't recognize your system's directory entries." >&4
8011 rp="What type is used for directory entries on this system?"
8019 : see if the directory entry stores field length
8021 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8022 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8023 echo "Good, your directory entry keeps length information in d_namlen." >&4
8026 echo "Your directory entry does not know about the d_namlen field." >&4
8033 : see if dlerror exists
8036 set dlerror d_dlerror
8040 : see if dlfcn is available
8048 On a few systems, the dynamically loaded modules that perl generates and uses
8049 will need a different extension than shared libs. The default will probably
8057 rp='What is the extension of dynamically loaded modules'
8066 : Check if dlsym need a leading underscore
8072 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8073 $cat >dyna.c <<'EOM'
8082 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8084 #include <sys/types.h>
8098 int mode = RTLD_LAZY ;
8100 handle = dlopen("./dyna.$dlext", mode) ;
8101 if (handle == NULL) {
8106 symbol = dlsym(handle, "fred") ;
8107 if (symbol == NULL) {
8108 /* try putting a leading underscore */
8109 symbol = dlsym(handle, "_fred") ;
8110 if (symbol == NULL) {
8123 : Call the object file tmp-dyna.o in case dlext=o.
8124 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8125 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8126 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8127 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8130 1) echo "Test program failed using dlopen." >&4
8131 echo "Perhaps you should not use dynamic loading." >&4;;
8132 2) echo "Test program failed using dlsym." >&4
8133 echo "Perhaps you should not use dynamic loading." >&4;;
8134 3) echo "dlsym needs a leading underscore" >&4
8136 4) echo "dlsym doesn't need a leading underscore." >&4;;
8139 echo "I can't compile and run the test program." >&4
8140 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8145 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8150 hasproto='varname=$1; func=$2; shift; shift;
8151 while $test $# -ge 2; do
8153 $define) echo "#include <$2>";;
8157 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8158 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8159 echo "$func() prototype found.";
8162 echo "$func() prototype NOT found.";
8167 $rm -f try.c tryout.c'
8169 : see if prototype for drand48 is available
8171 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8174 : see if dup2 exists
8178 : see if eaccess exists
8179 set eaccess d_eaccess
8182 : see if endgrent exists
8183 set endgrent d_endgrent
8186 : see if endhostent exists
8187 set endhostent d_endhent
8190 : see if endnetent exists
8191 set endnetent d_endnent
8194 : see if endprotoent exists
8195 set endprotoent d_endpent
8198 : see if endpwent exists
8199 set endpwent d_endpwent
8202 : see if endservent exists
8203 set endservent d_endsent
8206 : see if endspent exists
8207 set endspent d_endspent
8210 : Locate the flags for 'open()'
8212 $cat >open3.c <<'EOCP'
8213 #include <sys/types.h>
8218 #include <sys/file.h>
8229 : check sys/file.h first to get FREAD on Sun
8230 if $test `./findhdr sys/file.h` && \
8231 set open3 -DI_SYS_FILE && eval $compile; then
8233 echo "<sys/file.h> defines the O_* constants..." >&4
8235 echo "and you have the 3 argument form of open()." >&4
8238 echo "but not the 3 argument form of open(). Oh, well." >&4
8241 elif $test `./findhdr fcntl.h` && \
8242 set open3 -DI_FCNTL && eval $compile; then
8244 echo "<fcntl.h> defines the O_* constants..." >&4
8246 echo "and you have the 3 argument form of open()." >&4
8249 echo "but not the 3 argument form of open(). Oh, well." >&4
8254 echo "I can't find the O_* constant definitions! You got problems." >&4
8260 : check for non-blocking I/O stuff
8261 case "$h_sysfile" in
8262 true) echo "#include <sys/file.h>" > head.c;;
8265 true) echo "#include <fcntl.h>" > head.c;;
8266 *) echo "#include <sys/fcntl.h>" > head.c;;
8271 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8272 case "$o_nonblock" in
8275 $cat >>try.c <<'EOCP'
8278 printf("O_NONBLOCK\n");
8282 printf("O_NDELAY\n");
8286 printf("FNDELAY\n");
8293 if eval $compile_ok; then
8295 case "$o_nonblock" in
8296 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8297 *) echo "Seems like we can use $o_nonblock.";;
8300 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8303 *) echo "Using $hint value $o_nonblock.";;
8305 $rm -f try try.* .out core
8308 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8314 #include <sys/types.h>
8316 #define MY_O_NONBLOCK $o_nonblock
8317 #ifndef errno /* XXX need better Configure test */
8320 $signal_t blech(x) int x; { exit(3); }
8322 $cat >> try.c <<'EOCP'
8330 pipe(pd); /* Down: child -> parent */
8331 pipe(pu); /* Up: parent -> child */
8334 close(pd[1]); /* Parent reads from pd[0] */
8335 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8336 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8338 signal(SIGALRM, blech);
8340 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8342 sprintf(string, "%d\n", ret);
8343 write(2, string, strlen(string));
8346 if (errno == EAGAIN) {
8352 if (errno == EWOULDBLOCK)
8353 printf("EWOULDBLOCK\n");
8356 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8357 sleep(2); /* Give it time to close our pipe */
8359 ret = read(pd[0], buf, 1); /* Should read EOF */
8361 sprintf(string, "%d\n", ret);
8362 write(3, string, strlen(string));
8366 close(pd[0]); /* We write to pd[1] */
8367 close(pu[1]); /* We read from pu[0] */
8368 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8369 close(pd[1]); /* Pipe pd is now fully closed! */
8370 exit(0); /* Bye bye, thank you for playing! */
8374 if eval $compile_ok; then
8375 echo "$startsh" >mtry
8376 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8378 ./mtry >/dev/null 2>&1
8380 0) eagain=`$cat try.out`;;
8381 1) echo "Could not perform non-blocking setting!";;
8382 2) echo "I did a successful read() for something that was not there!";;
8383 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8384 *) echo "Something terribly wrong happened during testing.";;
8386 rd_nodata=`$cat try.ret`
8387 echo "A read() system call with no data present returns $rd_nodata."
8388 case "$rd_nodata" in
8391 echo "(That's peculiar, fixing that to be -1.)"
8397 echo "Forcing errno EAGAIN on read() with no data available."
8401 echo "Your read() sets errno to $eagain when no data is available."
8404 status=`$cat try.err`
8406 0) echo "And it correctly returns 0 to signal EOF.";;
8407 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8408 *) echo "However, your read() returns '$status' on EOF??";;
8411 if test "$status" = "$rd_nodata"; then
8412 echo "WARNING: you can't distinguish between EOF and no data!"
8416 echo "I can't compile the test program--assuming errno EAGAIN will do."
8423 echo "Using $hint value $eagain."
8424 echo "Your read() returns $rd_nodata when no data is present."
8425 case "$d_eofnblk" in
8426 "$define") echo "And you can see EOF because read() returns 0.";;
8427 "$undef") echo "But you can't see EOF status from read() returned value.";;
8429 echo "(Assuming you can't see EOF status from read anyway.)"
8435 $rm -f try try.* .out core head.c mtry
8437 : see if fchmod exists
8441 : see if fchown exists
8445 : see if this is an fcntl system
8449 : see if sys/select.h has to be included
8450 set sys/select.h i_sysselct
8453 : see if we should include time.h, sys/time.h, or both
8455 if test "X$timeincl" = X; then
8456 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8457 $echo $n "I'm now running the test program...$c"
8458 $cat >try.c <<'EOCP'
8459 #include <sys/types.h>
8464 #ifdef SYSTIMEKERNEL
8467 #include <sys/time.h>
8470 #include <sys/select.h>
8479 struct timezone tzp;
8481 if (foo.tm_sec == foo.tm_sec)
8484 if (bar.tv_sec == bar.tv_sec)
8491 for s_timezone in '-DS_TIMEZONE' ''; do
8493 for s_timeval in '-DS_TIMEVAL' ''; do
8494 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8495 for i_time in '' '-DI_TIME'; do
8496 for i_systime in '-DI_SYSTIME' ''; do
8499 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8500 if eval $compile; then
8501 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8505 $echo $n "Succeeded with $flags$c"
8517 *SYSTIMEKERNEL*) i_systimek="$define"
8518 timeincl=`./findhdr sys/time.h`
8519 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8520 *) i_systimek="$undef";;
8523 *I_TIME*) i_time="$define"
8524 timeincl=`./findhdr time.h`" $timeincl"
8525 echo "We'll include <time.h>." >&4;;
8526 *) i_time="$undef";;
8529 *I_SYSTIME*) i_systime="$define"
8530 timeincl=`./findhdr sys/time.h`" $timeincl"
8531 echo "We'll include <sys/time.h>." >&4;;
8532 *) i_systime="$undef";;
8537 : check for fd_set items
8540 Checking to see how well your C compiler handles fd_set and friends ...
8542 $cat >fd_set.c <<EOCP
8543 #$i_systime I_SYS_TIME
8544 #$i_sysselct I_SYS_SELECT
8545 #$d_socket HAS_SOCKET
8546 #include <sys/types.h>
8548 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8551 #include <sys/time.h>
8554 #include <sys/select.h>
8563 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8570 set fd_set -DTRYBITS
8571 if eval $compile; then
8572 d_fds_bits="$define"
8574 echo "Well, your system knows about the normal fd_set typedef..." >&4
8576 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8577 d_fd_macros="$define"
8580 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8582 d_fd_macros="$undef"
8586 Hmm, your compiler has some difficulty with fd_set. Checking further...
8589 if eval $compile; then
8592 echo "Well, your system has some sort of fd_set available..." >&4
8594 echo "and you have the normal fd_set macros." >&4
8595 d_fd_macros="$define"
8598 but not the normal fd_set macros! Gross! More work for me...
8600 d_fd_macros="$undef"
8603 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8606 d_fd_macros="$undef"
8611 : see if fgetpos exists
8612 set fgetpos d_fgetpos
8615 : see if flock exists
8619 : see if fork exists
8623 : see if pathconf exists
8624 set pathconf d_pathconf
8627 : see if fpathconf exists
8628 set fpathconf d_fpathconf
8632 : see if llseek exists
8638 $echo $n "Checking to see if your system supports off64_t...$c" >&4
8640 #include <sys/types.h>
8642 off64_t foo() { off64_t x; x = 7; return x; }'
8644 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8646 echo " Yup, it does." >&4
8649 echo " Nope, it doesn't." >&4
8655 : check for fpos64_t
8657 $echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8659 #include <sys/stdio.h>
8660 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8662 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8664 echo " Yup, it does." >&4
8667 echo " Nope, it doesn't." >&4
8673 hasstruct='varname=$1; struct=$2; shift; shift;
8674 while $test $# -ge 2; do
8676 $define) echo "#include <$2>";;
8680 echo "int main () { struct $struct foo; }" >> try.c;
8682 if eval $compile; then
8691 : see if this is a sys/param system
8692 set sys/param.h i_sysparam
8695 : see if this is a sys/mount.h system
8696 set sys/mount.h i_sysmount
8699 : see if sys/types.h has to be included
8700 set sys/types.h i_systypes
8703 : see if this is a sys/vfs.h system
8704 set sys/vfs.h i_sysvfs
8707 : see if this is a sys/statfs.h system
8708 set sys/statfs.h i_sysstatfs
8712 : see if statfs exists
8716 echo "Checking to see if your system supports struct statfs..." >&4
8717 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
8719 case "$d_statfs_s" in
8720 "$define") echo "Yup, it does." >&4 ;;
8721 *) echo "Nope, it doesn't." >&4 ;;
8724 : see if struct statfs knows about f_flags
8725 case "$d_statfs_s" in
8727 echo "Checking to see if your struct statfs has f_flags field..." >&4
8728 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
8732 set d_statfs_f_flags
8736 case "$d_statfs_f_flags" in
8737 "$define") echo "Yup, it does." >&4 ;;
8738 *) echo "Nope, it doesn't." >&4 ;;
8741 echo "Checking to see if your system supports struct fs_data..." >&4
8742 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8744 case "$d_fs_data_s" in
8745 "$define") echo "Yup, it does." >&4 ;;
8746 *) echo "Nope, it doesn't." >&4 ;;
8749 : see if fseeko exists
8753 : see if fsetpos exists
8754 set fsetpos d_fsetpos
8758 : see if fstatfs exists
8759 set fstatfs d_fstatfs
8763 : see if statvfs exists
8764 set statvfs d_statvfs
8767 : see if fstatvfs exists
8768 set fstatvfs d_fstatvfs
8772 : see if ftello exists
8776 : see if getgrent exists
8777 set getgrent d_getgrent
8780 : see if gethostbyaddr exists
8781 set gethostbyaddr d_gethbyaddr
8784 : see if gethostbyname exists
8785 set gethostbyname d_gethbyname
8788 : see if gethostent exists
8789 set gethostent d_gethent
8792 : see how we will look up host name
8795 if set gethostname val -f d_gethname; eval $csym; $val; then
8796 echo 'gethostname() found.' >&4
8797 d_gethname="$define"
8800 if set uname val -f d_uname; eval $csym; $val; then
8803 uname() was found, but you're running xenix, and older versions of xenix
8804 have a broken uname(). If you don't really know whether your xenix is old
8805 enough to have a broken system call, use the default answer.
8812 rp='Is your uname() broken?'
8815 n*) d_uname="$define"; call=uname;;
8818 echo 'uname() found.' >&4
8825 case "$d_gethname" in
8826 '') d_gethname="$undef";;
8829 '') d_uname="$undef";;
8831 case "$d_uname$d_gethname" in
8836 Every now and then someone has a $call() that lies about the hostname
8837 but can't be fixed for political or economic reasons. If you wish, I can
8838 pretend $call() isn't there and maybe compute hostname at run-time
8839 thanks to the '$phostname' command.
8842 rp="Shall I ignore $call() from now on?"
8845 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8848 case "$phostname" in
8850 *) case "$aphostname" in
8856 file=`./loc $file $file $pth`
8857 aphostname=`echo $file $*`
8862 case "$d_uname$d_gethname" in
8865 case "$phostname" in
8867 echo "There will be no way for $package to get your hostname." >&4;;
8869 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8873 case "$d_phostname" in
8874 '') d_phostname="$undef";;
8877 : see if this is a netdb.h system
8881 : see if prototypes for various gethostxxx netdb.h functions are available
8883 set d_gethostprotos gethostent $i_netdb netdb.h
8886 : see if getlogin exists
8887 set getlogin d_getlogin
8890 : see if getmntent exists
8891 set getmntent d_getmntent
8894 : see if getnetbyaddr exists
8895 set getnetbyaddr d_getnbyaddr
8898 : see if getnetbyname exists
8899 set getnetbyname d_getnbyname
8902 : see if getnetent exists
8903 set getnetent d_getnent
8906 : see if prototypes for various getnetxxx netdb.h functions are available
8908 set d_getnetprotos getnetent $i_netdb netdb.h
8912 : see if getprotobyname exists
8913 set getprotobyname d_getpbyname
8916 : see if getprotobynumber exists
8917 set getprotobynumber d_getpbynumber
8920 : see if getprotoent exists
8921 set getprotoent d_getpent
8924 : see if getpgid exists
8925 set getpgid d_getpgid
8928 : see if getpgrp2 exists
8929 set getpgrp2 d_getpgrp2
8932 : see if getppid exists
8933 set getppid d_getppid
8936 : see if getpriority exists
8937 set getpriority d_getprior
8940 : see if prototypes for various getprotoxxx netdb.h functions are available
8942 set d_getprotoprotos getprotoent $i_netdb netdb.h
8945 : see if getpwent exists
8946 set getpwent d_getpwent
8950 : see if getservbyname exists
8951 set getservbyname d_getsbyname
8954 : see if getservbyport exists
8955 set getservbyport d_getsbyport
8958 : see if getservent exists
8959 set getservent d_getsent
8962 : see if prototypes for various getservxxx netdb.h functions are available
8964 set d_getservprotos getservent $i_netdb netdb.h
8967 : see if getspent exists
8968 set getspent d_getspent
8971 : see if getspnam exists
8972 set getspnam d_getspnam
8975 : see if gettimeofday or ftime exists
8976 set gettimeofday d_gettimeod
8978 case "$d_gettimeod" in
8984 val="$undef"; set d_ftime; eval $setvar
8987 case "$d_gettimeod$d_ftime" in
8990 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8994 : see if this is an grp system
9000 xxx=`./findhdr grp.h`
9001 $cppstdin $cppflags $cppminus < $xxx >$$.h
9003 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9015 set d_grpasswd; eval $setvar
9019 : see if hasmntopt exists
9020 set hasmntopt d_hasmntopt
9023 : see if this is a netinet/in.h or sys/in.h system
9024 set netinet/in.h i_niin sys/in.h i_sysin
9027 : see if arpa/inet.h has to be included
9028 set arpa/inet.h i_arpainet
9031 : see if htonl --and friends-- exists
9036 : Maybe they are macros.
9041 #include <sys/types.h>
9042 #$i_niin I_NETINET_IN
9044 #$i_arpainet I_ARPA_INET
9046 #include <netinet/in.h>
9052 #include <arpa/inet.h>
9055 printf("Defined as a macro.");
9058 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9059 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9061 echo "But it seems to be defined as a macro." >&4
9069 : see which of string.h or strings.h is needed
9071 strings=`./findhdr string.h`
9072 if $test "$strings" && $test -r "$strings"; then
9073 echo "Using <string.h> instead of <strings.h>." >&4
9077 strings=`./findhdr strings.h`
9078 if $test "$strings" && $test -r "$strings"; then
9079 echo "Using <strings.h> instead of <string.h>." >&4
9081 echo "No string header found -- You'll surely have problems." >&4
9087 "$undef") strings=`./findhdr strings.h`;;
9088 *) strings=`./findhdr string.h`;;
9093 if set index val -f; eval $csym; $val; then
9094 if set strchr val -f d_strchr; eval $csym; $val; then
9095 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9098 echo "strchr() found." >&4
9102 echo "index() found." >&4
9107 echo "index() found." >&4
9110 if set strchr val -f d_strchr; eval $csym; $val; then
9113 echo "strchr() found." >&4
9115 echo "No index() or strchr() found!" >&4
9120 set d_strchr; eval $setvar
9122 set d_index; eval $setvar
9124 : check whether inet_aton exists
9125 set inet_aton d_inetaton
9130 $cat >isascii.c <<'EOCP'
9142 if eval $compile; then
9143 echo "isascii() found." >&4
9146 echo "isascii() NOT found." >&4
9153 : see if killpg exists
9157 : see if lchown exists
9159 $cat > try.c <<'EOCP'
9160 /* System header to define __stub macros and hopefully few prototypes,
9161 which can conflict with char lchown(); below. */
9163 /* Override any gcc2 internal prototype to avoid an error. */
9164 /* We use char because int might match the return type of a gcc2
9165 builtin and then its argument prototype would still apply. */
9168 /* The GNU C library defines this for functions which it implements
9169 to always fail with ENOSYS. Some functions are actually named
9170 something starting with __ and the normal name is an alias. */
9171 #if defined (__stub_lchown) || defined (__stub___lchown)
9179 if eval $compile; then
9180 $echo "lchown() found." >&4
9183 $echo "lchown() NOT found." >&4
9189 : See if number of significant digits in a double precision number is known
9191 $cat >ldbl_dig.c <<EOM
9201 printf("Contains LDBL_DIG");
9204 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9205 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9206 echo "LDBL_DIG found." >&4
9209 echo "LDBL_DIG NOT found." >&4
9216 : see if link exists
9220 : see if localeconv exists
9221 set localeconv d_locconv
9224 : see if lockf exists
9228 : see if lstat exists
9232 : see if madvise exists
9233 set madvise d_madvise
9236 : see if mblen exists
9240 : see if mbstowcs exists
9241 set mbstowcs d_mbstowcs
9244 : see if mbtowc exists
9248 : see if memchr exists
9252 : see if memcmp exists
9256 : see if memcpy exists
9260 : see if memmove exists
9261 set memmove d_memmove
9264 : see if memset exists
9268 : see if mkdir exists
9272 : see if mkfifo exists
9276 : see if mktime exists
9280 : see if this is a sys/mman.h system
9281 set sys/mman.h i_sysmman
9284 : see if mmap exists
9287 : see what shmat returns
9288 : default to something harmless
9290 case "$i_sysmman$d_mmap" in
9292 $cat >mmap.c <<'END'
9293 #include <sys/mman.h>
9296 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9301 echo "and it returns ($mmaptype)." >&4
9307 : see if mprotect exists
9308 set mprotect d_mprotect
9311 : see if msgctl exists
9315 : see if msgget exists
9319 : see if msgsnd exists
9323 : see if msgrcv exists
9327 : see how much of the 'msg*(2)' library is present.
9330 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9331 *"$undef"*) h_msg=false;;
9335 case "`ipcs 2>&1`" in
9336 "SVID messages"*"not configured"*)
9337 echo "Your $osname does not have the msg*(2) configured." >&4
9352 : we could also check for sys/ipc.h ...
9353 if $h_msg && $test `./findhdr sys/msg.h`; then
9354 echo "You have the full msg*(2) library." >&4
9357 echo "You don't have the full msg*(2) library." >&4
9363 : see if msync exists
9367 : see if munmap exists
9371 : see if nice exists
9375 : see if POSIX threads are available
9376 set pthread.h i_pthread
9382 : how to create joinable pthreads
9383 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9385 echo "Checking what constant to use for creating joinable pthreads..." >&4
9386 $cat >try.c <<'EOCP'
9387 #include <pthread.h>
9389 int detachstate = JOINABLE;
9392 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9393 if eval $compile; then
9394 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9395 val="$undef" # Yes, undef.
9396 set d_old_pthread_create_joinable
9399 set old_pthread_create_joinable
9402 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9403 if eval $compile; then
9404 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9406 set d_old_pthread_create_joinable
9408 val=PTHREAD_CREATE_UNDETACHED
9409 set old_pthread_create_joinable
9412 set try -DJOINABLE=__UNDETACHED
9413 if eval $compile; then
9414 echo "You seem to use __UNDETACHED." >&4
9416 set d_old_pthread_create_joinable
9419 set old_pthread_create_joinable
9422 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9424 set d_old_pthread_create_joinable
9427 set old_pthread_create_joinable
9434 d_old_pthread_create_joinable="$undef"
9435 old_pthread_create_joinable=""
9438 : see if pause exists
9442 : see if pipe exists
9446 : see if poll exists
9451 : see whether the various POSIXish _yields exist
9453 #include <pthread.h>
9459 #ifdef PTHREAD_YIELD
9462 #ifdef PTHREAD_YIELD_NULL
9463 pthread_yield(NULL);
9469 : see if sched_yield exists
9470 set try -DSCHED_YIELD
9471 if eval $compile; then
9473 sched_yield='sched_yield()'
9477 case "$usethreads" in
9480 $define) echo 'sched_yield() found.' >&4 ;;
9481 *) echo 'sched_yield() NOT found.' >&4 ;;
9487 : see if pthread_yield exists
9488 set try -DPTHREAD_YIELD
9489 if eval $compile; then
9491 case "$sched_yield" in
9492 '') sched_yield='pthread_yield()' ;;
9495 set try -DPTHREAD_YIELD_NULL
9496 if eval $compile; then
9498 case "$sched_yield" in
9499 '') sched_yield='pthread_yield(NULL)' ;;
9505 case "$usethreads" in
9508 $define) echo 'pthread_yield() found.' >&4 ;;
9509 *) echo 'pthread_yield() NOT found.' >&4 ;;
9516 case "$sched_yield" in
9517 '') sched_yield=undef ;;
9522 : see if this is a pwd.h system
9528 xxx=`./findhdr pwd.h`
9529 $cppstdin $cppflags $cppminus < $xxx >$$.h
9531 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9539 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9547 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9555 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9563 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9571 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9579 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9587 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9599 set d_pwquota; eval $setvar
9600 set d_pwage; eval $setvar
9601 set d_pwchange; eval $setvar
9602 set d_pwclass; eval $setvar
9603 set d_pwexpire; eval $setvar
9604 set d_pwcomment; eval $setvar
9605 set d_pwgecos; eval $setvar
9606 set d_pwpasswd; eval $setvar
9610 : see if readdir and friends exist
9611 set readdir d_readdir
9613 set seekdir d_seekdir
9615 set telldir d_telldir
9617 set rewinddir d_rewinddir
9620 : see if readlink exists
9621 set readlink d_readlink
9624 : see if readv exists
9628 : see if rename exists
9632 : see if rmdir exists
9636 : see if memory.h is available.
9641 : See if it conflicts with string.h
9647 $cppstdin $cppflags $cppminus < $strings > mem.h
9648 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9650 echo "We won't be including <memory.h>."
9660 : can bcopy handle overlapping blocks?
9665 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9672 $cat >>try.c <<'EOCP'
9675 # include <memory.h>
9678 # include <stdlib.h>
9681 # include <string.h>
9683 # include <strings.h>
9686 # include <unistd.h> /* Needed for NetBSD */
9690 char buf[128], abc[128];
9696 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9698 for (align = 7; align >= 0; align--) {
9699 for (len = 36; len; len--) {
9702 for (off = 1; off <= len; off++) {
9703 bcopy(b, b+off, len);
9704 bcopy(b+off, b, len);
9705 if (bcmp(b, abc, len))
9714 if eval $compile_ok; then
9715 if ./try 2>/dev/null; then
9719 echo "It can't, sorry."
9720 case "$d_memmove" in
9721 "$define") echo "But that's Ok since you have memmove()." ;;
9725 echo "(I can't compile the test program, so we'll assume not...)"
9726 case "$d_memmove" in
9727 "$define") echo "But that's Ok since you have memmove()." ;;
9732 $rm -f try.* try core
9736 : can memcpy handle overlapping blocks?
9741 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9748 $cat >>try.c <<'EOCP'
9751 # include <memory.h>
9754 # include <stdlib.h>
9757 # include <string.h>
9759 # include <strings.h>
9762 # include <unistd.h> /* Needed for NetBSD */
9766 char buf[128], abc[128];
9772 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9773 try to store the string in read-only memory. */
9774 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9776 for (align = 7; align >= 0; align--) {
9777 for (len = 36; len; len--) {
9779 memcpy(b, abc, len);
9780 for (off = 1; off <= len; off++) {
9781 memcpy(b+off, b, len);
9782 memcpy(b, b+off, len);
9783 if (memcmp(b, abc, len))
9792 if eval $compile_ok; then
9793 if ./try 2>/dev/null; then
9797 echo "It can't, sorry."
9798 case "$d_memmove" in
9799 "$define") echo "But that's Ok since you have memmove()." ;;
9803 echo "(I can't compile the test program, so we'll assume not...)"
9804 case "$d_memmove" in
9805 "$define") echo "But that's Ok since you have memmove()." ;;
9810 $rm -f try.* try core
9814 : can memcmp be trusted to compare relative magnitude?
9819 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9826 $cat >>try.c <<'EOCP'
9829 # include <memory.h>
9832 # include <stdlib.h>
9835 # include <string.h>
9837 # include <strings.h>
9840 # include <unistd.h> /* Needed for NetBSD */
9846 if ((a < b) && memcmp(&a, &b, 1) < 0)
9852 if eval $compile_ok; then
9853 if ./try 2>/dev/null; then
9857 echo "No, it can't (it uses signed chars)."
9860 echo "(I can't compile the test program, so we'll assume not...)"
9864 $rm -f try.* try core
9868 : see if select exists
9872 : see if semctl exists
9876 : see if semget exists
9880 : see if semop exists
9884 : see how much of the 'sem*(2)' library is present.
9887 case "$d_semctl$d_semget$d_semop" in
9888 *"$undef"*) h_sem=false;;
9892 case "`ipcs 2>&1`" in
9893 "SVID messages"*"not configured"*)
9894 echo "Your $osname does not have the sem*(2) configured." >&4
9907 : we could also check for sys/ipc.h ...
9908 if $h_sem && $test `./findhdr sys/sem.h`; then
9909 echo "You have the full sem*(2) library." >&4
9912 echo "You don't have the full sem*(2) library." >&4
9918 : see whether sys/sem.h defines union semun
9920 $cat > try.c <<'END'
9921 #include <sys/types.h>
9922 #include <sys/ipc.h>
9923 #include <sys/sem.h>
9924 int main () { union semun semun; semun.buf = 0; }
9927 if eval $compile; then
9928 echo "You have union semun in <sys/sem.h>." >&4
9931 echo "You do not have union semun in <sys/sem.h>." >&4
9934 $rm -f try try.c try.h
9938 : see how to do semctl IPC_STAT
9941 : see whether semctl IPC_STAT can use union semun
9946 # define S_IRUSR S_IREAD
9947 # define S_IWUSR S_IWRITE
9948 # define S_IXUSR S_IEXEC
9950 # define S_IRUSR 0400
9951 # define S_IWUSR 0200
9952 # define S_IXUSR 0100
9954 # define S_IRGRP (S_IRUSR>>3)
9955 # define S_IWGRP (S_IWUSR>>3)
9956 # define S_IXGRP (S_IXUSR>>3)
9957 # define S_IROTH (S_IRUSR>>6)
9958 # define S_IWOTH (S_IWUSR>>6)
9959 # define S_IXOTH (S_IXUSR>>6)
9962 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9963 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9964 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9969 #include <sys/types.h>
9970 #include <sys/ipc.h>
9971 #include <sys/sem.h>
9972 #include <sys/stat.h>
9979 #$d_union_semun HAS_UNION_SEMUN
9982 #ifndef HAS_UNION_SEMUN
9985 struct semid_ds *buf;
9986 unsigned short *array;
9992 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9993 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9995 struct semid_ds argbuf;
9998 st = semctl(sem, 0, IPC_STAT, arg);
10002 # endif /* IPC_STAT */
10003 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10005 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10006 # endif /* IPC_RMID */
10007 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10009 #endif /* IPC_PRIVATE && ... */
10010 printf("semget failed: errno = %d\n", errno);
10016 if eval $compile; then
10019 semun) val="$define" ;;
10025 case "$d_semctl_semun" in
10027 echo "You can use union semun for semctl IPC_STAT." >&4
10030 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10035 : see whether semctl IPC_STAT can use struct semid_ds pointer
10036 $cat > try.c <<'END'
10037 #include <sys/types.h>
10038 #include <sys/ipc.h>
10039 #include <sys/sem.h>
10040 #include <sys/stat.h>
10048 struct semid_ds arg;
10051 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10052 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10055 st = semctl(sem, 0, IPC_STAT, &arg);
10057 printf("semid_ds\n");
10059 # endif /* IPC_STAT */
10060 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10062 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10063 # endif /* IPC_RMID */
10064 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10066 #endif /* IPC_PRIVATE && ... */
10067 printf("semget failed: errno = %d\n", errno);
10074 if eval $compile; then
10077 semid_ds) val="$define" ;;
10081 set d_semctl_semid_ds
10083 case "$d_semctl_semid_ds" in
10085 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10087 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10094 # We do not have the full sem*(2) library, so assume we can not
10100 set d_semctl_semid_ds
10105 : see if setegid exists
10106 set setegid d_setegid
10109 : see if seteuid exists
10110 set seteuid d_seteuid
10113 : see if setgrent exists
10114 set setgrent d_setgrent
10117 : see if sethostent exists
10118 set sethostent d_sethent
10121 : see if setlinebuf exists
10122 set setlinebuf d_setlinebuf
10125 : see if setlocale exists
10126 set setlocale d_setlocale
10129 : see if setnetent exists
10130 set setnetent d_setnent
10133 : see if setprotoent exists
10134 set setprotoent d_setpent
10137 : see if setpgid exists
10138 set setpgid d_setpgid
10141 : see if setpgrp2 exists
10142 set setpgrp2 d_setpgrp2
10145 : see if setpriority exists
10146 set setpriority d_setprior
10149 : see if setpwent exists
10150 set setpwent d_setpwent
10153 : see if setregid exists
10154 set setregid d_setregid
10156 set setresgid d_setresgid
10159 : see if setreuid exists
10160 set setreuid d_setreuid
10162 set setresuid d_setresuid
10165 : see if setrgid exists
10166 set setrgid d_setrgid
10169 : see if setruid exists
10170 set setruid d_setruid
10173 : see if setservent exists
10174 set setservent d_setsent
10177 : see if setsid exists
10178 set setsid d_setsid
10181 : see if setspent exists
10182 set setspent d_setspent
10185 : see if setvbuf exists
10186 set setvbuf d_setvbuf
10189 : see if sfio.h is available
10194 : see if sfio library is available
10205 : Ok, but do we want to use it.
10209 true|$define|[yY]*) dflt='y';;
10212 echo "$package can use the sfio library, but it is experimental."
10213 rp="You seem to have sfio available, do you want to try using it?"
10217 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10219 : Remove sfio from list of libraries to use
10220 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10223 echo "libs = $libs" >&4
10227 *) case "$usesfio" in
10228 true|$define|[yY]*)
10229 echo "Sorry, cannot find sfio on this machine" >&4
10230 echo "Ignoring your setting of usesfio=$usesfio" >&4
10238 $define) usesfio='true';;
10239 *) usesfio='false';;
10242 : see if shmctl exists
10243 set shmctl d_shmctl
10246 : see if shmget exists
10247 set shmget d_shmget
10250 : see if shmat exists
10253 : see what shmat returns
10256 $cat >shmat.c <<'END'
10257 #include <sys/shm.h>
10260 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10265 echo "and it returns ($shmattype)." >&4
10266 : see if a prototype for shmat is available
10267 xxx=`./findhdr sys/shm.h`
10268 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10269 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10280 set d_shmatprototype
10283 : see if shmdt exists
10287 : see how much of the 'shm*(2)' library is present.
10290 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10291 *"$undef"*) h_shm=false;;
10295 case "`ipcs 2>&1`" in
10296 "SVID shared memory"*"not configured"*)
10297 echo "Your $osname does not have the shm*(2) configured." >&4
10300 set shmctl d_shmctl
10302 set shmget d_shmget
10312 : we could also check for sys/ipc.h ...
10313 if $h_shm && $test `./findhdr sys/shm.h`; then
10314 echo "You have the full shm*(2) library." >&4
10317 echo "You don't have the full shm*(2) library." >&4
10324 : see if we have sigaction
10325 if set sigaction val -f d_sigaction; eval $csym; $val; then
10326 echo 'sigaction() found.' >&4
10327 $cat > try.c <<'EOP'
10329 #include <sys/types.h>
10330 #include <signal.h>
10333 struct sigaction act, oact;
10335 oact.sa_handler = 0;
10339 if eval $compile_ok; then
10342 echo "But you don't seem to have a useable struct sigaction." >&4
10346 echo 'sigaction NOT found.' >&4
10349 set d_sigaction; eval $setvar
10350 $rm -f try try$_o try.c
10352 : see if sigsetjmp exists
10354 case "$d_sigsetjmp" in
10356 $cat >try.c <<'EOP'
10357 #include <setjmp.h>
10362 if (sigsetjmp(env,1))
10365 siglongjmp(env, 1);
10370 if eval $compile; then
10371 if ./try >/dev/null 2>&1; then
10372 echo "POSIX sigsetjmp found." >&4
10376 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10382 echo "sigsetjmp not found." >&4
10386 *) val="$d_sigsetjmp"
10387 case "$d_sigsetjmp" in
10388 $define) echo "POSIX sigsetjmp found." >&4;;
10389 $undef) echo "sigsetjmp not found." >&4;;
10397 : see if sqrtl exists
10401 : see if sys/stat.h is available
10402 set sys/stat.h i_sysstat
10405 : see if stat knows about block sizes
10407 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10410 : see if _ptr and _cnt from stdio act std
10412 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10413 echo "(Looks like you have stdio.h from Linux.)"
10414 case "$stdio_ptr" in
10415 '') stdio_ptr='((fp)->_IO_read_ptr)'
10418 *) ptr_lval=$d_stdio_ptr_lval;;
10420 case "$stdio_cnt" in
10421 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10424 *) cnt_lval=$d_stdio_cnt_lval;;
10426 case "$stdio_base" in
10427 '') stdio_base='((fp)->_IO_read_base)';;
10429 case "$stdio_bufsiz" in
10430 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10433 case "$stdio_ptr" in
10434 '') stdio_ptr='((fp)->_ptr)'
10437 *) ptr_lval=$d_stdio_ptr_lval;;
10439 case "$stdio_cnt" in
10440 '') stdio_cnt='((fp)->_cnt)'
10443 *) cnt_lval=$d_stdio_cnt_lval;;
10445 case "$stdio_base" in
10446 '') stdio_base='((fp)->_base)';;
10448 case "$stdio_bufsiz" in
10449 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10452 : test whether _ptr and _cnt really work
10453 echo "Checking how std your stdio is..." >&4
10456 #define FILE_ptr(fp) $stdio_ptr
10457 #define FILE_cnt(fp) $stdio_cnt
10459 FILE *fp = fopen("try.c", "r");
10462 18 <= FILE_cnt(fp) &&
10463 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10471 if eval $compile; then
10473 echo "Your stdio acts pretty std."
10476 echo "Your stdio isn't very std."
10479 echo "Your stdio doesn't appear very std."
10485 : Can _ptr be used as an lvalue?
10486 case "$d_stdstdio$ptr_lval" in
10487 $define$define) val=$define ;;
10490 set d_stdio_ptr_lval
10493 : Can _cnt be used as an lvalue?
10494 case "$d_stdstdio$cnt_lval" in
10495 $define$define) val=$define ;;
10498 set d_stdio_cnt_lval
10501 : see if _base is also standard
10503 case "$d_stdstdio" in
10507 #define FILE_base(fp) $stdio_base
10508 #define FILE_bufsiz(fp) $stdio_bufsiz
10510 FILE *fp = fopen("try.c", "r");
10513 19 <= FILE_bufsiz(fp) &&
10514 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10521 if eval $compile; then
10523 echo "And its _base field acts std."
10526 echo "But its _base field isn't std."
10529 echo "However, it seems to be lacking the _base field."
10538 Checking how to access stdio streams by file descriptor number...
10540 case "$stdio_stream_array" in
10541 '') $cat >try.c <<EOCP
10544 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10548 for s in _iob __iob __sF
10550 set try -DSTDIO_STREAM_ARRAY=$s
10551 if eval $compile; then
10552 case "`./try$exe_ext`" in
10553 yes) stdio_stream_array=$s; break ;;
10557 $rm -f try.* try$exe_ext
10559 case "$stdio_stream_array" in
10561 I can't figure out how to access stdio streams by file descriptor number.
10563 d_stdio_stream_array="$undef"
10566 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10568 d_stdio_stream_array="$define"
10572 : see if strcoll exists
10573 set strcoll d_strcoll
10576 : check for structure copying
10578 echo "Checking to see if your C compiler can copy structs..." >&4
10579 $cat >try.c <<'EOCP'
10589 if $cc -c try.c >/dev/null 2>&1 ; then
10591 echo "Yup, it can."
10594 echo "Nope, it can't."
10600 : see if strerror and/or sys_errlist[] exist
10602 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10603 if set strerror val -f d_strerror; eval $csym; $val; then
10604 echo 'strerror() found.' >&4
10605 d_strerror="$define"
10606 d_strerrm='strerror(e)'
10607 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10608 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10609 d_syserrlst="$define"
10611 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10612 d_syserrlst="$undef"
10614 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10615 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10616 echo 'strerror() found in string header.' >&4
10617 d_strerror="$define"
10618 d_strerrm='strerror(e)'
10619 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10620 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10621 d_syserrlst="$define"
10623 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10624 d_syserrlst="$undef"
10626 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10627 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10628 d_strerror="$undef"
10629 d_syserrlst="$define"
10630 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10632 echo 'strerror() and sys_errlist[] NOT found.' >&4
10633 d_strerror="$undef"
10634 d_syserrlst="$undef"
10635 d_strerrm='"unknown"'
10639 : see if strtod exists
10640 set strtod d_strtod
10643 : see if strtol exists
10644 set strtol d_strtol
10647 : see if strtoul exists
10648 set strtoul d_strtoul
10651 : see if strtoull exists
10652 set strtoull d_strtoull
10655 : see if strxfrm exists
10656 set strxfrm d_strxfrm
10659 : see if symlink exists
10660 set symlink d_symlink
10663 : see if syscall exists
10664 set syscall d_syscall
10667 : see if sysconf exists
10668 set sysconf d_sysconf
10671 : see if system exists
10672 set system d_system
10675 : see if tcgetpgrp exists
10676 set tcgetpgrp d_tcgetpgrp
10679 : see if tcsetpgrp exists
10680 set tcsetpgrp d_tcsetpgrp
10683 : see if prototype for telldir is available
10685 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10688 : define an is-a-typedef? function
10689 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10691 "") inclist="sys/types.h";;
10693 eval "varval=\$$var";
10697 for inc in $inclist; do
10698 echo "#include <$inc>" >>temp.c;
10700 echo "#ifdef $type" >> temp.c;
10701 echo "printf(\"We have $type\");" >> temp.c;
10702 echo "#endif" >> temp.c;
10703 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10704 if $contains $type temp.E >/dev/null 2>&1; then
10705 eval "$var=\$type";
10710 *) eval "$var=\$varval";;
10713 : define an is-a-typedef? function that prompts if the type is not available.
10714 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10716 "") inclist="sys/types.h";;
10718 eval "varval=\$$var";
10722 for inc in $inclist; do
10723 echo "#include <$inc>" >>temp.c;
10725 echo "#ifdef $type" >> temp.c;
10726 echo "printf(\"We have $type\");" >> temp.c;
10727 echo "#endif" >> temp.c;
10728 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10730 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10731 if $contains $type temp.E >/dev/null 2>&1; then
10732 echo "$type found." >&4;
10733 eval "$var=\$type";
10735 echo "$type NOT found." >&4;
10741 *) eval "$var=\$varval";;
10744 : see if this is a sys/times.h system
10745 set sys/times.h i_systimes
10748 : see if times exists
10750 if set times val -f d_times; eval $csym; $val; then
10751 echo 'times() found.' >&4
10754 case "$i_systimes" in
10755 "$define") inc='sys/times.h';;
10757 rp="What is the type returned by times() on this system?"
10758 set clock_t clocktype long stdio.h sys/types.h $inc
10761 echo 'times() NOT found, hope that will do.' >&4
10766 : see if truncate exists
10767 set truncate d_truncate
10770 : see if tzname[] exists
10772 if set tzname val -a d_tzname; eval $csym; $val; then
10774 echo 'tzname[] found.' >&4
10777 echo 'tzname[] NOT found.' >&4
10782 : see if umask exists
10786 : see if ustat exists
10790 : backward compatibility for d_hvfork
10791 if test X$d_hvfork != X; then
10792 d_vfork="$d_hvfork"
10795 : see if there is a vfork
10800 : Ok, but do we want to use it. vfork is reportedly unreliable in
10801 : perl on Solaris 2.x, and probably elsewhere.
10805 case "$usevfork" in
10811 Perl can only use a vfork() that doesn't suffer from strict
10812 restrictions on calling functions or modifying global data in
10813 the child. For example, glibc-2.1 contains such a vfork()
10814 that is unsuitable. If your system provides a proper fork()
10815 call, chances are that you do NOT want perl to use vfork().
10818 rp="Do you still want to use vfork()?"
10823 echo "Ok, we won't use vfork()."
10832 $define) usevfork='true';;
10833 *) usevfork='false';;
10836 : see if this is an sysdir system
10837 set sys/dir.h i_sysdir
10840 : see if this is an sysndir system
10841 set sys/ndir.h i_sysndir
10844 : see if closedir exists
10845 set closedir d_closedir
10848 case "$d_closedir" in
10851 echo "Checking whether closedir() returns a status..." >&4
10852 cat > closedir.c <<EOM
10853 #$i_dirent I_DIRENT /**/
10854 #$i_sysdir I_SYS_DIR /**/
10855 #$i_sysndir I_SYS_NDIR /**/
10856 #$i_systypes I_SYS_TYPES /**/
10858 #if defined(I_SYS_TYPES)
10859 #include <sys/types.h>
10861 #if defined(I_DIRENT)
10862 #include <dirent.h>
10863 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10864 #include <sys/dir.h>
10868 #include <sys/ndir.h>
10872 #include <ndir.h> /* may be wrong in the future */
10874 #include <sys/dir.h>
10879 int main() { return closedir(opendir(".")); }
10882 if eval $compile_ok; then
10883 if ./closedir > /dev/null 2>&1 ; then
10884 echo "Yes, it does."
10887 echo "No, it doesn't."
10891 echo "(I can't seem to compile the test program--assuming it doesn't)"
10899 set d_void_closedir
10902 : check for volatile keyword
10904 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10905 $cat >try.c <<'EOCP'
10908 typedef struct _goo_struct goo_struct;
10909 goo_struct * volatile goo = ((goo_struct *)0);
10910 struct _goo_struct {
10915 typedef unsigned short foo_t;
10916 char *volatile foo;
10918 volatile foo_t blech;
10922 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10924 echo "Yup, it does."
10927 echo "Nope, it doesn't."
10933 : see if there is a wait4
10937 : see if waitpid exists
10938 set waitpid d_waitpid
10941 : see if wcstombs exists
10942 set wcstombs d_wcstombs
10945 : see if wctomb exists
10946 set wctomb d_wctomb
10949 : see if writev exists
10950 set writev d_writev
10953 : preserve RCS keywords in files with variable substitution, grrr
10958 Revision='$Revision'
10960 case "$crosscompile" in
10961 ''|[nN]*) crosscompile="$undef" ;;
10965 next|rhapsody) multiarch="$define" ;;
10967 case "$multiarch" in
10968 ''|[nN]*) multiarch="$undef" ;;
10971 : check for alignment requirements
10973 case "$crosscompile$multiarch" in
10976 You seem to be either cross-compiling or doing a multiarchitecture build,
10977 skipping the memory alignment check.
10980 case "$alignbytes" in
10981 '') alignbytes=8 ;;
10985 case "$alignbytes" in
10986 '') echo "Checking alignment constraints..." >&4
10987 $cat >try.c <<'EOCP'
10994 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10998 if eval $compile_ok; then
11002 echo "(I can't seem to compile the test program...)"
11005 *) dflt="$alignbytes"
11008 rp="Doubles must be aligned on a how-many-byte boundary?"
11016 : check for ordering of bytes in a long
11018 case "$crosscompile$multiarch" in
11021 You seem to be either cross-compiling or doing a multiarchitecture build,
11022 skipping the byteorder check.
11028 case "$byteorder" in
11031 In the following, larger digits indicate more significance. A big-endian
11032 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11033 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11034 machines may have weird orders like 3412. A Cray will report 87654321,
11035 an Alpha will report 12345678. If the test program works the default is
11037 I'm now running the test program...
11039 $cat >try.c <<'EOCP'
11046 char c[sizeof(long)];
11049 if (sizeof(long) > 4)
11050 u.l = (0x08070605L << 32) | 0x04030201L;
11053 for (i = 0; i < sizeof(long); i++)
11054 printf("%c", u.c[i]+'0');
11061 if eval $compile && ./try > /dev/null; then
11064 [1-4][1-4][1-4][1-4]|12345678|87654321)
11065 echo "(The test program ran ok.)"
11066 echo "byteorder=$dflt"
11069 ????|????????) echo "(The test program ran ok.)" ;;
11070 *) echo "(The test program didn't run right for some reason.)" ;;
11075 (I can't seem to compile the test program. Guessing big-endian...)
11078 case "$xxx_prompt" in
11080 rp="What is the order of bytes in a long?"
11094 : how do we catenate cpp tokens here?
11096 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11097 $cat >cpp_stuff.c <<'EOCP'
11098 #define RCAT(a,b)a/**/b
11099 #define ACAT(a,b)a ## b
11103 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11104 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11105 echo "Oh! Smells like ANSI's been here." >&4
11106 echo "We can catify or stringify, separately or together!"
11108 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11109 echo "Ah, yes! The good old days!" >&4
11110 echo "However, in the good old days we don't know how to stringify and"
11111 echo "catify at the same time."
11115 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11116 to have to edit the values of CAT[2-5] in config.h...
11118 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11122 : see if this is a db.h system
11128 : Check db version.
11130 echo "Checking Berkeley DB version ..." >&4
11136 #include <sys/types.h>
11141 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11142 int Major, Minor, Patch ;
11143 unsigned long Version ;
11144 (void)db_version(&Major, &Minor, &Patch) ;
11145 printf("You have Berkeley DB Version 2 or greater\n");
11147 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11148 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11149 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11150 Major, Minor, Patch) ;
11152 /* check that db.h & libdb are compatible */
11153 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11154 printf("db.h and libdb are incompatible\n") ;
11158 printf("db.h and libdb are compatible\n") ;
11160 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11161 + DB_VERSION_PATCH ;
11163 /* needs to be >= 2.3.4 */
11164 if (Version < 2003004) {
11165 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11166 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11172 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11173 printf("You have Berkeley DB Version 1\n");
11174 exit(0); /* DB version < 2: the coast is clear. */
11176 exit(1); /* <db.h> not Berkeley DB? */
11182 if eval $compile && ./try; then
11183 echo 'Looks OK.' >&4
11185 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11189 : Remove db from list of libraries to use
11190 echo "Removing unusable -ldb from library list" >&4
11191 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11194 echo "libs = $libs" >&4
11204 : Check the return type needed for hash
11206 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11212 #include <sys/types.h>
11215 #ifndef DB_VERSION_MAJOR
11216 u_int32_t hash_cb (ptr, size)
11224 info.hash = hash_cb;
11228 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11229 if $contains warning try.out >>/dev/null 2>&1 ; then
11232 db_hashtype='u_int32_t'
11235 : XXX Maybe we should just give up here.
11236 db_hashtype=u_int32_t
11238 echo "Help: I can't seem to compile the db test program." >&4
11239 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11242 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11244 *) db_hashtype=u_int32_t
11249 : Check the return type needed for prefix
11251 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11257 #include <sys/types.h>
11260 #ifndef DB_VERSION_MAJOR
11261 size_t prefix_cb (key1, key2)
11269 info.prefix = prefix_cb;
11273 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11274 if $contains warning try.out >>/dev/null 2>&1 ; then
11275 db_prefixtype='int'
11277 db_prefixtype='size_t'
11280 db_prefixtype='size_t'
11281 : XXX Maybe we should just give up here.
11283 echo "Help: I can't seem to compile the db test program." >&4
11284 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11287 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11289 *) db_prefixtype='size_t'
11293 : check for void type
11295 echo "Checking to see how well your C compiler groks the void type..." >&4
11296 case "$voidflags" in
11298 $cat >try.c <<'EOCP'
11304 extern void moo(); /* function returning void */
11305 void (*goo)(); /* ptr to func returning void */
11307 void *hue; /* generic ptr */
11320 int main() { sub(); }
11322 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11323 voidflags=$defvoidused
11324 echo "Good. It appears to support void to the level $package wants.">&4
11325 if $contains warning .out >/dev/null 2>&1; then
11326 echo "However, you might get some warnings that look like this:"
11330 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11331 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11332 echo "It supports 1..."
11333 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11334 echo "It also supports 2..."
11335 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11337 echo "And it supports 4 but not 8 definitely."
11339 echo "It doesn't support 4..."
11340 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11342 echo "But it supports 8."
11345 echo "Neither does it support 8."
11349 echo "It does not support 2..."
11350 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11352 echo "But it supports 4 and 8."
11354 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11356 echo "And it supports 4 but has not heard about 8."
11358 echo "However it supports 8 but not 4."
11363 echo "There is no support at all for void."
11368 case "$voidflags" in
11370 *) $cat >&4 <<'EOM'
11371 Support flag bits are:
11372 1: basic void declarations.
11373 2: arrays of pointers to functions returning void.
11374 4: operations between pointers to and addresses of void functions.
11375 8: generic void pointers.
11378 rp="Your void support flags add up to what?"
11386 : How can we generate normalized random numbers ?
11388 echo "Looking for a random number function..." >&4
11389 case "$randfunc" in
11391 if set drand48 val -f; eval $csym; $val; then
11393 echo "Good, found drand48()." >&4
11394 elif set random val -f; eval $csym; $val; then
11396 echo "OK, found random()." >&4
11399 echo "Yick, looks like I have to use rand()." >&4
11410 *-Dmy_rand=*|*-Dmy_srand=*)
11411 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11412 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11413 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11414 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11418 while $test "$cont"; do
11419 rp="Use which function to generate random numbers?"
11421 if $test "$ans" = "$dflt"; then
11427 if set $ans val -f; eval $csym; $val; then
11431 rp="I cannot find function $ans. Use that name anyway?"
11440 case "$randfunc" in
11442 drand01="drand48()"
11448 case "$randbits" in
11450 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11452 #$i_unistd I_UNISTD
11453 #$i_stdlib I_STDLIB
11456 # include <unistd.h>
11459 # include <stdlib.h>
11464 register unsigned long tmp;
11465 register unsigned long max = 0L;
11467 for (i = 1000; i; i--) {
11468 tmp = (unsigned long) $randfunc();
11469 if (tmp > max) max = tmp;
11471 for (i = 0; max; i++)
11477 if eval $compile_ok; then
11481 echo "(I can't seem to compile the test program...)"
11488 rp="How many bits does your $randfunc() function produce?"
11492 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11493 seedfunc="s$randfunc"
11494 randseedtype=unsigned
11498 rp="How many bits does your $randfunc() function produce?"
11501 seedfunc="s$randfunc"
11502 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11503 if set $seedfunc val -f; eval $csym; $val; then
11504 echo "(Using $seedfunc() to seed random generator)"
11506 echo "(Warning: no $seedfunc() to seed random generator)"
11509 randseedtype=unsigned
11517 echo "Determining whether or not we are on an EBCDIC system..." >&4
11518 $cat >tebcdic.c <<'EOM'
11521 if ('M'==0xd4) return 0;
11528 if eval $compile_ok; then
11530 echo "You have EBCDIC." >&4
11533 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11536 echo "I'm unable to compile the test program." >&4
11537 echo "I'll assume ASCII or some ISO Latin." >&4
11539 $rm -f tebcdic.c tebcdic
11545 Checking how to flush all pending stdio output...
11547 # I only know how to find the first 32 possibly open files on SunOS.
11548 # See also hints/sunos_4_1.sh and util.c --AD
11550 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11552 $cat >>try.c <<EOCP
11554 #$i_unistd I_UNISTD
11556 # include <unistd.h>
11558 #$d_sysconf HAS_SYSCONF
11559 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11560 #ifdef HAS_STDIO_STREAM_ARRAY
11561 # define STDIO_STREAM_ARRAY $stdio_stream_array
11564 FILE* p = fopen("try.out", "w");
11568 # ifdef TRY_FPRINTF
11572 #ifdef TRY_FFLUSH_NULL
11575 #ifdef TRY_FFLUSH_ALL
11577 long open_max = -1;
11578 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11579 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11581 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11582 open_max = sysconf(_SC_OPEN_MAX);
11585 open_max = FOPEN_MAX;
11588 open_max = OPEN_MAX;
11597 # ifdef HAS_STDIO_STREAM_ARRAY
11598 if (open_max > 0) {
11600 for (i = 0; i < open_max; i++)
11601 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11602 STDIO_STREAM_ARRAY[i]._file < open_max &&
11603 STDIO_STREAM_ARRAY[i]._flag)
11604 fflush(&STDIO_STREAM_ARRAY[i]);
11612 : first we have to find out how _not_ to flush
11613 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11615 set try -DTRY_FPUTC
11616 if eval $compile; then
11618 ./try$exe_ext 2>/dev/null
11619 if $test ! -s try.out -a "X$?" = X42; then
11625 set try -DTRY_FPRINTF
11627 if eval $compile; then
11629 ./try$exe_ext 2>/dev/null
11630 if $test ! -s try.out -a "X$?" = X42; then
11631 output=-DTRY_FPRINTF
11637 : check for fflush NULL behaviour
11638 case "$fflushNULL" in
11639 '') set try -DTRY_FFLUSH_NULL $output
11640 if eval $compile; then
11642 ./try$exe_ext 2>/dev/null
11644 if $test -s try.out -a "X$code" = X42; then
11645 fflushNULL="`$cat try.out`"
11647 if $test "X$code" != X42; then
11649 (If this test failed, don't worry, we'll try another method shortly.)
11654 $rm -f core try.core core.try.*
11655 case "$fflushNULL" in
11657 Your fflush(NULL) works okay.
11659 fflushNULL="$define"
11662 Your fflush(NULL) isn't working (contrary to ANSI C).
11664 fflushNULL="$undef"
11667 Cannot figure out whether your fflush(NULL) works or not.
11668 I'm assuming it doesn't (contrary to ANSI C).
11670 fflushNULL="$undef"
11674 $define|true|[yY]*)
11675 fflushNULL="$define"
11678 fflushNULL="$undef"
11681 : check explicit looping only if NULL did not work
11682 case "$fflushNULL" in
11684 : check for fflush all behaviour
11685 case "$fflushall" in
11686 '') set try -DTRY_FFLUSH_ALL $output
11687 if eval $compile; then
11689 (Now testing the other method--but note that also this may fail.)
11692 ./try$exe_ext 2>/dev/null
11693 if $test -s try.out -a "X$?" = X42; then
11694 fflushall="`$cat try.out`"
11697 $rm -f core try.core core.try.*
11698 case "$fflushall" in
11700 Whew. Flushing explicitly all the stdio streams works.
11702 fflushall="$define"
11705 Sigh. Flushing explicitly all the stdio streams doesn't work.
11710 Cannot figure out whether flushing stdio streams explicitly works or not.
11711 I'm assuming it doesn't.
11717 "$define"|true|[yY]*)
11718 fflushall="$define"
11725 *) fflushall="$undef"
11728 case "$fflushNULL$fflushall" in
11731 I cannot figure out how to flush pending stdio output.
11735 $rm -f try.* try$exe_ext
11737 : see what type file positions are declared as in the library
11738 rp="What is the type for file position used by fsetpos()?"
11739 set fpos_t fpostype long stdio.h sys/types.h
11742 : Store the full pathname to the ar program for use in the C program
11743 : Respect a hint or command line value for full_ar.
11748 : Store the full pathname to the sed program for use in the C program
11751 : see what type gids are declared as in the kernel
11753 echo "Looking for the type for group ids returned by getgid()."
11754 set gid_t gidtype xxx stdio.h sys/types.h
11758 xxx=`./findhdr sys/user.h`
11759 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11761 unsigned) dflt="$1 $2" ;;
11765 *) dflt="$gidtype";;
11768 gid_t) echo "gid_t found." ;;
11769 *) rp="What is the type for group ids returned by getgid()?"
11775 : see if getgroups exists
11776 set getgroups d_getgrps
11779 : see if setgroups exists
11780 set setgroups d_setgrps
11784 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11786 case "$d_getgrps$d_setgrps" in
11788 case "$groupstype" in
11789 '') dflt="$gidtype" ;;
11790 *) dflt="$groupstype" ;;
11793 What type of pointer is the second argument to getgroups() and setgroups()?
11794 Usually this is the same as group ids, $gidtype, but not always.
11797 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11801 *) groupstype="$gidtype";;
11804 : see what type lseek is declared as in the kernel
11805 rp="What is the type used for lseek's offset on this system?"
11806 set off_t lseektype long stdio.h sys/types.h
11810 $echo $n "Checking to see how big your file offsets are...$c" >&4
11812 #include <sys/types.h>
11816 printf("%d\n", sizeof($lseektype));
11820 if eval $compile_ok; then
11822 $echo " $lseeksize bytes." >&4
11826 echo "(I can't seem to compile the test program. Guessing...)"
11827 rp="What is the size of your file offsets (in bytes)?"
11834 echo "Checking if your $make program sets \$(MAKE)..." >&4
11835 case "$make_set_make" in
11837 $sed 's/^X //' > testmake.mak << 'EOF'
11839 X @echo 'maketemp="$(MAKE)"'
11841 case "`$make -f testmake.mak 2>/dev/null`" in
11842 *maketemp=*) make_set_make='#' ;;
11843 *) make_set_make="MAKE=$make" ;;
11845 $rm -f testmake.mak
11848 case "$make_set_make" in
11849 '#') echo "Yup, it does.";;
11850 *) echo "Nope, it doesn't.";;
11853 : see what type is used for mode_t
11854 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11855 set mode_t modetype int stdio.h sys/types.h
11858 : define a fucntion to check prototypes
11859 $cat > protochk <<EOSH
11862 optimize="$optimize"
11864 prototype="$prototype"
11869 $cat >> protochk <<'EOSH'
11874 while test $# -ge 2; do
11876 $define) echo "#include <$2>" >> try.c ;;
11877 literal) echo "$2" >> try.c ;;
11881 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11882 cat >> try.c <<'EOCP'
11883 #ifdef CAN_PROTOTYPE
11884 #define _(args) args
11889 echo "$foo" >> try.c
11890 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11891 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11897 $eunicefix protochk
11899 : see what type is used for size_t
11900 rp="What is the type used for the length parameter for string functions?"
11901 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11904 : check for type of arguments to gethostbyaddr.
11905 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11906 case "$d_gethbyaddr" in
11910 Checking to see what type of arguments are accepted by gethostbyaddr().
11912 hdrs="$define sys/types.h
11913 $d_socket sys/socket.h
11914 $i_niin netinet/in.h
11916 $i_unistd unistd.h"
11917 : The first arg can 'char *' or 'void *'
11918 : The second arg is some of integral type
11919 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11920 for yyy in size_t long int; do
11921 case "$netdb_host_type" in
11922 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11923 if ./protochk "$try" $hdrs; then
11924 echo "Your system accepts $xxx for the first arg."
11925 echo "...and $yyy for the second arg."
11926 netdb_host_type="$xxx"
11927 netdb_hlen_type="$yyy"
11933 : In case none of those worked, prompt the user.
11934 case "$netdb_host_type" in
11935 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11938 netdb_host_type=$ans
11939 rp='What is the type for the 2nd argument to gethostbyaddr?'
11942 netdb_hlen_type=$ans
11946 *) : no gethostbyaddr, so pick harmless defaults
11947 netdb_host_type='char *'
11948 netdb_hlen_type="$sizetype"
11951 # Remove the "const" if needed. -- but then we'll have a
11953 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11956 : check for type of argument to gethostbyname.
11957 if test "X$netdb_name_type" = X ; then
11958 case "$d_gethbyname" in
11962 Checking to see what type of argument is accepted by gethostbyname().
11964 hdrs="$define sys/types.h
11965 $d_socket sys/socket.h
11966 $i_niin netinet/in.h
11968 $i_unistd unistd.h"
11969 for xxx in "const char *" "char *"; do
11970 case "$netdb_name_type" in
11971 '') try="extern struct hostent *gethostbyname($xxx);"
11972 if ./protochk "$try" $hdrs; then
11973 echo "Your system accepts $xxx."
11974 netdb_name_type="$xxx"
11979 : In case none of those worked, prompt the user.
11980 case "$netdb_name_type" in
11981 '') rp='What is the type for the 1st argument to gethostbyname?'
11984 netdb_name_type=$ans
11988 *) : no gethostbyname, so pick harmless default
11989 netdb_name_type='char *'
11994 : check for type of 1st argument to getnetbyaddr.
11995 if test "X$netdb_net_type" = X ; then
11996 case "$d_getnbyaddr" in
12000 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12002 hdrs="$define sys/types.h
12003 $d_socket sys/socket.h
12004 $i_niin netinet/in.h
12006 $i_unistd unistd.h"
12007 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12008 case "$netdb_net_type" in
12009 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12010 if ./protochk "$try" $hdrs; then
12011 echo "Your system accepts $xxx."
12012 netdb_net_type="$xxx"
12017 : In case none of those worked, prompt the user.
12018 case "$netdb_net_type" in
12019 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12022 netdb_net_type=$ans
12026 *) : no getnetbyaddr, so pick harmless default
12027 netdb_net_type='long'
12031 : locate the preferred pager for this system
12045 '') dflt=/usr/ucb/more;;
12052 rp='What pager is used on your system?'
12056 : see what type pids are declared as in the kernel
12057 rp="What is the type of process ids on this system?"
12058 set pid_t pidtype int stdio.h sys/types.h
12061 : Find earliest binary compatible site_perl subdirectory perl can use.
12062 case "$bincompat5005" in
12063 "$define") xs_apiversion='5.005' ;;
12064 *) xs_apiversion=$apiversion ;; # The current site_perl version.
12066 : Find earliest pure perl site_perl subdirectory perl can use.
12067 : The versioned directories started at 5.005.
12068 pm_apiversion='5.005'
12070 : check for length of pointer
12074 $echo $n "Checking to see how big your pointers are...$c" >&4
12075 if test "$voidflags" -gt 7; then
12076 echo '#define VOID_PTR char *' > try.c
12078 echo '#define VOID_PTR void *' > try.c
12080 $cat >>try.c <<'EOCP'
12084 printf("%d\n", sizeof(VOID_PTR));
12089 if eval $compile_ok; then
12091 $echo " $ptrsize bytes." >&4
12094 echo "(I can't seem to compile the test program. Guessing...)" >&4
12095 rp="What is the size of a pointer (in bytes)?"
12103 : see if ar generates random libraries by itself
12105 echo "Checking how to generate random libraries on your machine..." >&4
12106 echo 'int bar1() { return bar2(); }' > bar1.c
12107 echo 'int bar2() { return 2; }' > bar2.c
12108 $cat > foo.c <<'EOP'
12109 int main() { printf("%d\n", bar1()); exit(0); }
12111 $cc $ccflags -c bar1.c >/dev/null 2>&1
12112 $cc $ccflags -c bar2.c >/dev/null 2>&1
12113 $cc $ccflags -c foo.c >/dev/null 2>&1
12114 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12115 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12116 ./foobar >/dev/null 2>&1; then
12117 echo "$ar appears to generate random libraries itself."
12120 elif $ar ts bar$_a >/dev/null 2>&1 &&
12121 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12122 ./foobar >/dev/null 2>&1; then
12123 echo "a table of contents needs to be added with '$ar ts'."
12130 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12131 $test -f $ranlib || ranlib=''
12134 if $test -n "$ranlib"; then
12135 echo "your system has '$ranlib'; we'll use that."
12138 echo "your system doesn't seem to support random libraries"
12139 echo "so we'll use lorder and tsort to order the libraries."
12146 : check for type of arguments to select.
12147 case "$selecttype" in
12148 '') case "$d_select" in
12151 Checking to see what type of arguments are accepted by select().
12153 hdrs="$define sys/types.h
12154 $i_systime sys/time.h
12155 $i_sysselct sys/select.h
12156 $d_socket sys/socket.h"
12157 : The first arg can be int, unsigned, or size_t
12158 : The last arg may or may not be 'const'
12160 : void pointer has been seen but using that
12161 : breaks the selectminbits test
12162 for xxx in 'fd_set *' 'int *'; do
12163 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12164 for tmo in 'struct timeval *' 'const struct timeval *'; do
12166 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12167 if ./protochk "$try" $hdrs; then
12168 echo "Your system accepts $xxx."
12177 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12178 case "$d_fd_set" in
12179 $define) dflt="fd_set *" ;;
12188 *) : no select, so pick a harmless default
12195 : check for the select 'width'
12196 case "$selectminbits" in
12197 '') case "$d_select" in
12201 Checking to see on how many bits at a time your select() operates...
12204 #include <sys/types.h>
12206 #$i_systime I_SYS_TIME
12207 #$i_systimek I_SYS_TIME_KERNEL
12212 # ifdef I_SYS_TIME_KERNEL
12215 # include <sys/time.h>
12216 # ifdef I_SYS_TIME_KERNEL
12220 #$i_sysselct I_SYS_SELECT
12221 #ifdef I_SYS_SELECT
12222 #include <sys/select.h>
12224 #$d_socket HAS_SOCKET
12226 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12230 #define S sizeof(*(b))
12232 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12233 #define NBITS (NBYTES * 8)
12242 fp = fopen("try.c", "r");
12248 b = ($selecttype)s;
12249 for (i = 0; i < NBITS; i++)
12253 select(fd + 1, b, 0, 0, &t);
12254 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12255 printf("%d\n", i + 1);
12260 if eval $compile_ok; then
12261 selectminbits=`./try`
12262 case "$selectminbits" in
12264 Cannot figure out on how many bits at a time your select() operates.
12265 I'll play safe and guess it is 32 bits.
12271 *) bits="$selectminbits bits" ;;
12273 echo "Your select() operates on $bits at a time." >&4
12275 rp='What is the minimum number of bits your select() operates on?'
12276 case "$byteorder" in
12277 1234|12345678) dflt=32 ;;
12282 selectminbits="$val"
12286 *) : no select, so pick a harmless default
12293 : Trace out the files included by signal.h, then look for SIGxxx names.
12294 : Remove SIGARRAYSIZE used by HPUX.
12295 : Remove SIGSTKSIZE used by Linux.
12296 : Remove SIGSTKSZ used by Posix.
12297 : Remove SIGTYP void lines used by OS2.
12298 xxx=`echo '#include <signal.h>' |
12299 $cppstdin $cppminus $cppflags 2>/dev/null |
12300 $grep '^[ ]*#.*include' |
12301 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12302 : Check this list of files to be sure we have parsed the cpp output ok.
12303 : This will also avoid potentially non-existent files, such
12306 for xx in $xxx /dev/null ; do
12307 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12309 : If we have found no files, at least try signal.h
12310 case "$xxxfiles" in
12311 '') xxxfiles=`./findhdr signal.h` ;;
12314 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12315 print substr($2, 4, 20)
12317 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12318 print substr($3, 4, 20)
12320 : Append some common names just in case the awk scan failed.
12321 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12322 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12323 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12324 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12325 : generate a few handy files for later
12326 $cat > signal.c <<'EOCP'
12327 #include <sys/types.h>
12328 #include <signal.h>
12332 /* Strange style to avoid deeply-nested #if/#else/#endif */
12335 # define NSIG (_NSIG)
12341 # define NSIG (SIGMAX+1)
12347 # define NSIG (SIG_MAX+1)
12353 # define NSIG (MAXSIG+1)
12359 # define NSIG (MAX_SIG+1)
12364 # ifdef SIGARRAYSIZE
12365 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12371 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12375 /* Default to some arbitrary number that's big enough to get most
12376 of the common signals.
12382 printf("NSIG %d\n", NSIG);
12388 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12390 printf "#ifdef SIG"; printf $1; printf "\n"
12391 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12392 printf $1; printf ");\n"
12396 printf "#endif /* JUST_NSIG */\n";
12400 $cat >signal.awk <<'EOP'
12401 BEGIN { ndups = 0 }
12402 $1 ~ /^NSIG$/ { nsig = $2 }
12403 ($1 !~ /^NSIG$/) && (NF == 2) {
12404 if ($2 > maxsig) { maxsig = $2 }
12405 if (sig_name[$2]) {
12406 dup_name[ndups] = $1
12407 dup_num[ndups] = $2
12419 printf("NSIG %d\n", nsig);
12420 for (n = 1; n < nsig; n++) {
12422 printf("%s %d\n", sig_name[n], sig_num[n])
12425 printf("NUM%d %d\n", n, n)
12428 for (n = 0; n < ndups; n++) {
12429 printf("%s %d\n", dup_name[n], dup_num[n])
12433 $cat >signal_cmd <<EOS
12435 if $test -s signal.lst; then
12436 echo "Using your existing signal.lst file"
12441 $cat >>signal_cmd <<'EOS'
12444 if eval $compile_ok; then
12445 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12447 echo "(I can't seem be able to compile the whole test program)" >&4
12448 echo "(I'll try it in little pieces.)" >&4
12449 set signal -DJUST_NSIG
12450 if eval $compile_ok; then
12451 ./signal$_exe > signal.nsg
12454 echo "I can't seem to figure out how many signals you have." >&4
12455 echo "Guessing 50." >&4
12456 echo 'NSIG 50' > signal.nsg
12458 : Now look at all the signal names, one at a time.
12459 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12460 $cat > signal.c <<EOCP
12461 #include <sys/types.h>
12462 #include <signal.h>
12465 printf("$xx %d\n", SIG${xx});
12470 if eval $compile; then
12471 echo "SIG${xx} found."
12472 ./signal$_exe >> signal.ls1
12474 echo "SIG${xx} NOT found."
12477 if $test -s signal.ls1; then
12478 $cat signal.nsg signal.ls1 |
12479 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12483 if $test -s signal.lst; then
12486 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12487 echo 'kill -l' >signal
12488 set X `csh -f <signal`
12492 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12494 echo $@ | $tr ' ' $trnl | \
12495 $awk '{ printf "%s %d\n", $1, ++s; }
12496 END { printf "NSIG %d\n", ++s }' >signal.lst
12498 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12500 chmod a+x signal_cmd
12501 $eunicefix signal_cmd
12503 : generate list of signal names
12505 case "$sig_name_init" in
12507 *) case "$sig_num_init" in
12508 ''|*,*) doinit=yes ;;
12513 echo "Generating a list of signal names and numbers..." >&4
12515 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12516 sig_name=`$awk 'BEGIN { printf "ZERO " }
12517 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12518 sig_num=`$awk 'BEGIN { printf "0 " }
12519 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12520 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12521 !/^NSIG/ { printf "\"%s\", ", $1 }
12522 END { printf "0\n" }' signal.lst`
12523 sig_num_init=`$awk 'BEGIN { printf "0, " }
12524 !/^NSIG/ { printf "%d, ", $2}
12525 END { printf "0\n"}' signal.lst`
12528 echo "The following $sig_count signals are available:"
12530 echo $sig_name | $awk \
12531 'BEGIN { linelen = 0 }
12533 for (i = 1; i <= NF; i++) {
12534 name = "SIG" $i " "
12535 linelen = linelen + length(name)
12536 if (linelen > 70) {
12538 linelen = length(name)
12544 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12546 : see what type is used for signed size_t
12547 set ssize_t ssizetype int stdio.h sys/types.h
12550 $cat > ssize.c <<EOM
12552 #include <sys/types.h>
12553 #define Size_t $sizetype
12554 #define SSize_t $dflt
12557 if (sizeof(Size_t) == sizeof(SSize_t))
12559 else if (sizeof(Size_t) == sizeof(int))
12568 if eval $compile_ok && ./ssize > /dev/null; then
12569 ssizetype=`./ssize`
12570 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12573 Help! I can't compile and run the ssize_t test program: please enlighten me!
12574 (This is probably a misconfiguration in your system or libraries, and
12575 you really ought to fix it. Still, I'll try anyway.)
12577 I need a type that is the same size as $sizetype, but is guaranteed to
12578 be signed. Common values are ssize_t, int and long.
12581 rp="What signed type is the same size as $sizetype?"
12585 $rm -f ssize ssize.*
12587 : see what type of char stdio uses.
12589 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12590 echo "Your stdio uses unsigned chars." >&4
12591 stdchar="unsigned char"
12593 echo "Your stdio uses signed chars." >&4
12597 : see if time exists
12599 if test "X$d_time" = X -o X"$timetype" = X; then
12600 if set time val -f d_time; eval $csym; $val; then
12601 echo 'time() found.' >&4
12603 rp="What is the type returned by time() on this system?"
12604 set time_t timetype long stdio.h sys/types.h
12607 echo 'time() not found, hope that will do.' >&4
12615 : see what type uids are declared as in the kernel
12617 echo "Looking for the type for user ids returned by getuid()."
12618 set uid_t uidtype xxx stdio.h sys/types.h
12622 xxx=`./findhdr sys/user.h`
12623 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12625 unsigned) dflt="$1 $2" ;;
12629 *) dflt="$uidtype";;
12632 uid_t) echo "uid_t found." ;;
12633 *) rp="What is the type for user ids returned by getuid()?"
12641 *_t) zzz="$uidtype" ;;
12644 echo "Checking the sign of $zzz..." >&4
12646 #include <sys/types.h>
12657 if eval $compile; then
12661 echo "(I can't execute the test program--guessing unsigned.)" >&4
12665 1) echo "Your $zzz is unsigned." ;;
12666 -1) echo "Your $zzz is signed." ;;
12672 echo "(I can't compile the test program--guessing unsigned.)" >&4
12676 : see if dbm.h is available
12677 : see if dbmclose exists
12678 set dbmclose d_dbmclose
12681 case "$d_dbmclose" in
12691 *) set rpcsvc/dbm.h i_rpcsvcdbm
12696 *) echo "We won't be including <dbm.h>"
12706 : see if this is a sys/file.h system
12711 : do we need to include sys/file.h ?
12715 if $h_sysfile; then
12717 echo "We'll be including <sys/file.h>." >&4
12720 echo "We won't be including <sys/file.h>." >&4
12730 : see if fcntl.h is there
12735 : see if we can include fcntl.h
12741 echo "We'll be including <fcntl.h>." >&4
12744 if $h_sysfile; then
12745 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12747 echo "We won't be including <fcntl.h>." >&4
12759 : see if locale.h is available
12760 set locale.h i_locale
12763 : see if mach cthreads are available
12764 if test "X$usethreads" = "X$define"; then
12765 set mach/cthreads.h i_machcthr
12768 i_machcthr="$undef"
12773 : see if this is a math.h system
12777 : see if this is a mntent.h system
12778 set mntent.h i_mntent
12781 : see if ndbm.h is available
12786 : see if dbm_open exists
12787 set dbm_open d_dbm_open
12789 case "$d_dbm_open" in
12792 echo "We won't be including <ndbm.h>"
12801 : see if net/errno.h is available
12803 set net/errno.h val
12806 : Unfortunately, it causes problems on some systems. Arrgh.
12809 cat > try.c <<'EOM'
12812 #include <net/errno.h>
12818 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12819 echo "We'll be including <net/errno.h>." >&4
12821 echo "We won't be including <net/errno.h>." >&4
12830 : see if netinet/tcp.h is available
12831 set netinet/tcp.h i_netinettcp
12834 : see if this is a poll.h system
12838 : get C preprocessor symbols handy
12840 $echo $n "Hmm... $c"
12841 echo $al | $tr ' ' $trnl >Cppsym.know
12842 $cat <<EOSS >Cppsym
12850 case "\$list\$#" in
12853 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12855 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12858 unknown="\$unknown \$sym"
12868 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12870 exit 0; _ _ _ _\1\\ \1\\
12873 echo "exit 1; _ _ _" >>Cppsym\$\$
12874 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12876 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12882 $rm -f Cppsym\$\$ Cppsym2\$\$
12887 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12889 : now check the C compiler for additional symbols
12890 postprocess_cc_v=''
12892 aix) postprocess_cc_v="|$tr , ' '" ;;
12899 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12902 -D*) echo "\$i" | $sed 's/^-D//';;
12903 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12908 postprocess_cc_v=''
12911 ./ccsym > ccsym1.raw
12912 if $test -s ccsym1.raw; then
12913 $sort ccsym1.raw | $uniq >ccsym.raw
12915 mv ccsym1.raw ccsym.raw
12918 $awk '/\=/ { print $0; next }
12919 { print $0"=1" }' ccsym.raw >ccsym.list
12920 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12921 $comm -13 ccsym.true ccsym.list >ccsym.own
12922 $comm -12 ccsym.true ccsym.list >ccsym.com
12923 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12925 if $test -z ccsym.raw; then
12926 echo "Your C compiler doesn't seem to define any symbols!" >&4
12928 echo "However, your C preprocessor defines the following symbols:"
12931 cppsymbols=`$cat Cppsym.true`
12932 cppsymbols=`echo $cppsymbols`
12933 cppccsymbols="$cppsymbols"
12935 if $test -s ccsym.com; then
12936 echo "Your C compiler and pre-processor define these symbols:"
12937 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12940 cppccsymbols=`$cat ccsym.com`
12941 cppccsymbols=`echo $cppccsymbols`
12942 $test "$silent" || sleep 1
12944 if $test -s ccsym.cpp; then
12945 $test "$also" && echo " "
12946 echo "Your C pre-processor ${also}defines the following symbols:"
12947 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12949 cppsymbols=`$cat ccsym.cpp`
12950 cppsymbols=`echo $cppsymbols`
12951 $test "$silent" || sleep 1
12953 if $test -s ccsym.own; then
12954 $test "$also" && echo " "
12955 echo "Your C compiler ${also}defines the following cpp symbols:"
12956 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12957 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12958 ccsymbols=`$cat ccsym.own`
12959 ccsymbols=`echo $ccsymbols`
12960 $test "$silent" || sleep 1
12965 : see if this is a termio system
12969 if $test `./findhdr termios.h`; then
12970 set tcsetattr i_termios
12976 "$define") echo "You have POSIX termios.h... good!" >&4;;
12977 *) if ./Cppsym pyr; then
12978 case "`/bin/universe`" in
12979 ucb) if $test `./findhdr sgtty.h`; then
12981 echo "<sgtty.h> found." >&4
12983 echo "System is pyramid with BSD universe."
12984 echo "<sgtty.h> not found--you could have problems." >&4
12986 *) if $test `./findhdr termio.h`; then
12988 echo "<termio.h> found." >&4
12990 echo "System is pyramid with USG universe."
12991 echo "<termio.h> not found--you could have problems." >&4
12995 if $test `./findhdr termio.h`; then
12996 echo "<termio.h> found." >&4
12998 elif $test `./findhdr sgtty.h`; then
12999 echo "<sgtty.h> found." >&4
13002 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13005 if $test `./findhdr sgtty.h`; then
13006 echo "<sgtty.h> found." >&4
13008 elif $test `./findhdr termio.h`; then
13009 echo "<termio.h> found." >&4
13012 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13016 set i_termio; eval $setvar
13017 val=$val2; set i_sgtty; eval $setvar
13018 val=$val3; set i_termios; eval $setvar
13020 : see if this is a shadow.h system
13021 set shadow.h i_shadow
13024 : see if this is a socks.h system
13025 set socks.h i_socks
13028 : see if stdarg is available
13030 if $test `./findhdr stdarg.h`; then
13031 echo "<stdarg.h> found." >&4
13034 echo "<stdarg.h> NOT found." >&4
13038 : see if varags is available
13040 if $test `./findhdr varargs.h`; then
13041 echo "<varargs.h> found." >&4
13043 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13046 : set up the varargs testing programs
13047 $cat > varargs.c <<EOP
13049 #include <stdarg.h>
13052 #include <varargs.h>
13056 int f(char *p, ...)
13070 p = va_arg(ap, char *);
13075 $cat > varargs <<EOP
13077 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13086 : now check which varargs header should be included
13091 if `./varargs I_STDARG`; then
13093 elif `./varargs I_VARARGS`; then
13098 if `./varargs I_VARARGS`; then
13105 echo "I could not find the definition for va_dcl... You have problems..." >&4
13106 val="$undef"; set i_stdarg; eval $setvar
13107 val="$undef"; set i_varargs; eval $setvar
13112 case "$i_varhdr" in
13114 val="$define"; set i_stdarg; eval $setvar
13115 val="$undef"; set i_varargs; eval $setvar
13118 val="$undef"; set i_stdarg; eval $setvar
13119 val="$define"; set i_varargs; eval $setvar
13122 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13126 : see if stddef is available
13127 set stddef.h i_stddef
13130 : see if sys/access.h is available
13131 set sys/access.h i_sysaccess
13134 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13135 set sys/filio.h i_sysfilio
13138 if $test `./findhdr sys/ioctl.h`; then
13140 echo '<sys/ioctl.h> found.' >&4
13143 if $test $i_sysfilio = "$define"; then
13144 echo '<sys/ioctl.h> NOT found.' >&4
13146 $test $i_sgtty = "$define" && xxx="sgtty.h"
13147 $test $i_termio = "$define" && xxx="termio.h"
13148 $test $i_termios = "$define" && xxx="termios.h"
13149 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13155 : see if sys/resource.h has to be included
13156 set sys/resource.h i_sysresrc
13159 : see if sys/security.h is available
13160 set sys/security.h i_syssecrt
13163 : see if this is a sys/statvfs.h system
13164 set sys/statvfs.h i_sysstatvfs
13167 : see if this is a sys/un.h system
13168 set sys/un.h i_sysun
13171 : see if this is a syswait system
13172 set sys/wait.h i_syswait
13175 : see if this is a ustat.h system
13176 set ustat.h i_ustat
13179 : see if this is an utime system
13180 set utime.h i_utime
13183 : see if this is a values.h system
13184 set values.h i_values
13187 : see if this is a vfork system
13190 set vfork.h i_vfork
13198 : see if gdbm.h is available
13203 : see if gdbm_open exists
13204 set gdbm_open d_gdbm_open
13206 case "$d_gdbm_open" in
13209 echo "We won't be including <gdbm.h>"
13219 echo "Looking for extensions..." >&4
13220 : If we are using the old config.sh, known_extensions may contain
13221 : old or inaccurate or duplicate values.
13222 known_extensions=''
13223 nonxs_extensions=''
13224 : We do not use find because it might not be available.
13225 : We do not just use MANIFEST because the user may have dropped
13226 : some additional extensions into the source tree and expect them
13229 : Function to recursively find available extensions, ignoring DynaLoader
13230 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13234 DynaLoader|dynaload) ;;
13236 if $test -f $xxx/$xxx.xs; then
13237 known_extensions="$known_extensions $1$xxx";
13238 elif $test -f $xxx/Makefile.PL; then
13239 nonxs_extensions="$nonxs_extensions $1$xxx";
13241 if $test -d $xxx -a $# -lt 10; then
13244 eval $find_extensions;
13256 eval $find_extensions
13257 set X $nonxs_extensions
13259 nonxs_extensions="$*"
13260 set X $known_extensions
13262 known_extensions="$*"
13265 : Now see which are supported on this system.
13267 for xxx in $known_extensions ; do
13271 $define) avail_ext="$avail_ext $xxx" ;;
13274 GDBM_File|gdbm_fil)
13276 $define) avail_ext="$avail_ext $xxx" ;;
13279 NDBM_File|ndbm_fil)
13281 $define) avail_ext="$avail_ext $xxx" ;;
13284 ODBM_File|odbm_fil)
13285 case "${i_dbm}${i_rpcsvcdbm}" in
13286 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13290 case "$useposix" in
13291 true|define|y) avail_ext="$avail_ext $xxx" ;;
13295 case "$useopcode" in
13296 true|define|y) avail_ext="$avail_ext $xxx" ;;
13300 case "$d_socket" in
13301 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13305 case "$usethreads" in
13306 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13310 : XXX Do we need a useipcsysv variable here
13311 case "${d_msg}${d_sem}${d_shm}" in
13312 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13315 *) avail_ext="$avail_ext $xxx"
13324 : Now see which nonxs extensions are supported on this system.
13325 : For now assume all are.
13327 for xxx in $nonxs_extensions ; do
13329 *) nonxs_ext="$nonxs_ext $xxx"
13341 A number of extensions are supplied with $package. You may choose to
13342 compile these extensions for dynamic loading (the default), compile
13343 them into the $package executable (static loading), or not include
13344 them at all. Answer "none" to include no extensions.
13345 Note that DynaLoader is always built and need not be mentioned here.
13348 case "$dynamic_ext" in
13349 '') dflt="$avail_ext" ;;
13350 *) dflt="$dynamic_ext"
13351 # Perhaps we are reusing an old out-of-date config.sh.
13354 if test X"$dynamic_ext" != X"$avail_ext"; then
13356 NOTICE: Your previous config.sh list may be incorrect.
13357 The extensions now available to you are
13359 but the default list from your previous config.sh is
13371 rp="What extensions do you wish to load dynamically?"
13374 none) dynamic_ext=' ' ;;
13375 *) dynamic_ext="$ans" ;;
13378 case "$static_ext" in
13380 : Exclude those already listed in dynamic linking
13382 for xxx in $avail_ext; do
13383 case " $dynamic_ext " in
13385 *) dflt="$dflt $xxx" ;;
13392 *) dflt="$static_ext"
13399 rp="What extensions do you wish to load statically?"
13402 none) static_ext=' ' ;;
13403 *) static_ext="$ans" ;;
13408 A number of extensions are supplied with $package. Answer "none"
13409 to include no extensions.
13410 Note that DynaLoader is always built and need not be mentioned here.
13413 case "$static_ext" in
13414 '') dflt="$avail_ext" ;;
13415 *) dflt="$static_ext"
13416 # Perhaps we are reusing an old out-of-date config.sh.
13419 if test X"$static_ext" != X"$avail_ext"; then
13421 NOTICE: Your previous config.sh list may be incorrect.
13422 The extensions now available to you are
13424 but the default list from your previous config.sh is
13433 : Exclude those that are not xs extensions
13437 rp="What extensions do you wish to include?"
13440 none) static_ext=' ' ;;
13441 *) static_ext="$ans" ;;
13446 set X $dynamic_ext $static_ext $nonxs_ext
13450 : Remove build directory name from cppstdin so it can be used from
13451 : either the present location or the final installed location.
13453 : Get out of the UU directory to get correct path name.
13455 case "$cppstdin" in
13457 echo "Stripping down cppstdin path name"
13463 : end of configuration questions
13465 echo "End of configuration questions."
13468 : back to where it started
13469 if test -d ../UU; then
13473 : configuration may be patched via a 'config.over' file
13474 if $test -f config.over; then
13477 rp='I see a config.over file. Do you wish to load it?'
13480 n*) echo "OK, I'll ignore it.";;
13482 echo "Configuration override changes have been loaded."
13487 : in case they want portability, strip down executable paths
13488 case "$d_portable" in
13491 echo "Stripping down executable paths..." >&4
13492 for file in $loclist $trylist; do
13494 eval $file=`basename $temp`
13499 : create config.sh file
13501 echo "Creating config.sh..." >&4
13502 $spitshell <<EOT >config.sh
13505 # This file was produced by running the Configure script. It holds all the
13506 # definitions figured out by Configure. Should you modify one of these values,
13507 # do not forget to propagate your changes by running "Configure -der". You may
13508 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13511 # Package name : $package
13512 # Source directory : $src
13513 # Configuration time: $cf_time
13514 # Configured by : $cf_by
13515 # Target system : $myuname
13525 Revision='$Revision'
13532 alignbytes='$alignbytes'
13533 ansi2knr='$ansi2knr'
13534 aphostname='$aphostname'
13535 apiversion='$apiversion'
13538 archlibexp='$archlibexp'
13539 archname64='$archname64'
13540 archname='$archname'
13541 archobjs='$archobjs'
13546 bincompat5005='$bincompat5005'
13550 byteorder='$byteorder'
13552 castflags='$castflags'
13555 cccdlflags='$cccdlflags'
13556 ccdlflags='$ccdlflags'
13558 ccsymbols='$ccsymbols'
13560 cf_email='$cf_email'
13565 clocktype='$clocktype'
13567 compress='$compress'
13568 contains='$contains'
13572 cpp_stuff='$cpp_stuff'
13573 cppccsymbols='$cppccsymbols'
13574 cppflags='$cppflags'
13576 cppminus='$cppminus'
13578 cppstdin='$cppstdin'
13579 cppsymbols='$cppsymbols'
13580 crosscompile='$crosscompile'
13581 cryptlib='$cryptlib'
13583 d_Gconvert='$d_Gconvert'
13584 d_PRIEldbl='$d_PRIEldbl'
13585 d_PRIFldbl='$d_PRIFldbl'
13586 d_PRIGldbl='$d_PRIGldbl'
13587 d_PRIX64='$d_PRIX64'
13588 d_PRId64='$d_PRId64'
13589 d_PRIeldbl='$d_PRIeldbl'
13590 d_PRIfldbl='$d_PRIfldbl'
13591 d_PRIgldbl='$d_PRIgldbl'
13592 d_PRIi64='$d_PRIi64'
13593 d_PRIo64='$d_PRIo64'
13594 d_PRIu64='$d_PRIu64'
13595 d_PRIx64='$d_PRIx64'
13596 d_access='$d_access'
13597 d_accessx='$d_accessx'
13599 d_archlib='$d_archlib'
13602 d_attribut='$d_attribut'
13605 d_bincompat5005='$d_bincompat5005'
13607 d_bsdgetpgrp='$d_bsdgetpgrp'
13608 d_bsdsetpgrp='$d_bsdsetpgrp'
13610 d_casti32='$d_casti32'
13611 d_castneg='$d_castneg'
13612 d_charvspr='$d_charvspr'
13614 d_chroot='$d_chroot'
13615 d_chsize='$d_chsize'
13616 d_closedir='$d_closedir'
13617 d_cmsghdr_s='$d_cmsghdr_s'
13621 d_cuserid='$d_cuserid'
13622 d_dbl_dig='$d_dbl_dig'
13623 d_difftime='$d_difftime'
13624 d_dirnamlen='$d_dirnamlen'
13625 d_dlerror='$d_dlerror'
13626 d_dlopen='$d_dlopen'
13627 d_dlsymun='$d_dlsymun'
13628 d_dosuid='$d_dosuid'
13629 d_drand48proto='$d_drand48proto'
13631 d_eaccess='$d_eaccess'
13632 d_endgrent='$d_endgrent'
13633 d_endhent='$d_endhent'
13634 d_endnent='$d_endnent'
13635 d_endpent='$d_endpent'
13636 d_endpwent='$d_endpwent'
13637 d_endsent='$d_endsent'
13638 d_endspent='$d_endspent'
13639 d_eofnblk='$d_eofnblk'
13640 d_eunice='$d_eunice'
13641 d_fchmod='$d_fchmod'
13642 d_fchown='$d_fchown'
13644 d_fd_macros='$d_fd_macros'
13645 d_fd_set='$d_fd_set'
13646 d_fds_bits='$d_fds_bits'
13647 d_fgetpos='$d_fgetpos'
13648 d_flexfnam='$d_flexfnam'
13651 d_fpathconf='$d_fpathconf'
13652 d_fpos64_t='$d_fpos64_t'
13653 d_fs_data_s='$d_fs_data_s'
13654 d_fseeko='$d_fseeko'
13655 d_fsetpos='$d_fsetpos'
13656 d_fstatfs='$d_fstatfs'
13657 d_fstatvfs='$d_fstatvfs'
13658 d_ftello='$d_ftello'
13660 d_getgrent='$d_getgrent'
13661 d_getgrps='$d_getgrps'
13662 d_gethbyaddr='$d_gethbyaddr'
13663 d_gethbyname='$d_gethbyname'
13664 d_gethent='$d_gethent'
13665 d_gethname='$d_gethname'
13666 d_gethostprotos='$d_gethostprotos'
13667 d_getlogin='$d_getlogin'
13668 d_getmntent='$d_getmntent'
13669 d_getnbyaddr='$d_getnbyaddr'
13670 d_getnbyname='$d_getnbyname'
13671 d_getnent='$d_getnent'
13672 d_getnetprotos='$d_getnetprotos'
13673 d_getpbyname='$d_getpbyname'
13674 d_getpbynumber='$d_getpbynumber'
13675 d_getpent='$d_getpent'
13676 d_getpgid='$d_getpgid'
13677 d_getpgrp2='$d_getpgrp2'
13678 d_getpgrp='$d_getpgrp'
13679 d_getppid='$d_getppid'
13680 d_getprior='$d_getprior'
13681 d_getprotoprotos='$d_getprotoprotos'
13682 d_getpwent='$d_getpwent'
13683 d_getsbyname='$d_getsbyname'
13684 d_getsbyport='$d_getsbyport'
13685 d_getsent='$d_getsent'
13686 d_getservprotos='$d_getservprotos'
13687 d_getspent='$d_getspent'
13688 d_getspnam='$d_getspnam'
13689 d_gettimeod='$d_gettimeod'
13690 d_gnulibc='$d_gnulibc'
13691 d_grpasswd='$d_grpasswd'
13692 d_hasmntopt='$d_hasmntopt'
13695 d_inetaton='$d_inetaton'
13696 d_int64t='$d_int64t'
13697 d_iovec_s='$d_iovec_s'
13698 d_isascii='$d_isascii'
13699 d_killpg='$d_killpg'
13700 d_lchown='$d_lchown'
13701 d_ldbl_dig='$d_ldbl_dig'
13703 d_llseek='$d_llseek'
13704 d_locconv='$d_locconv'
13706 d_longdbl='$d_longdbl'
13707 d_longlong='$d_longlong'
13709 d_madvise='$d_madvise'
13711 d_mbstowcs='$d_mbstowcs'
13712 d_mbtowc='$d_mbtowc'
13713 d_memchr='$d_memchr'
13714 d_memcmp='$d_memcmp'
13715 d_memcpy='$d_memcpy'
13716 d_memmove='$d_memmove'
13717 d_memset='$d_memset'
13719 d_mkfifo='$d_mkfifo'
13720 d_mktime='$d_mktime'
13722 d_mprotect='$d_mprotect'
13724 d_msg_ctrunc='$d_msg_ctrunc'
13725 d_msg_dontroute='$d_msg_dontroute'
13726 d_msg_oob='$d_msg_oob'
13727 d_msg_peek='$d_msg_peek'
13728 d_msg_proxy='$d_msg_proxy'
13729 d_msgctl='$d_msgctl'
13730 d_msgget='$d_msgget'
13731 d_msghdr_s='$d_msghdr_s'
13732 d_msgrcv='$d_msgrcv'
13733 d_msgsnd='$d_msgsnd'
13735 d_munmap='$d_munmap'
13736 d_mymalloc='$d_mymalloc'
13738 d_off64_t='$d_off64_t'
13739 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13740 d_oldpthreads='$d_oldpthreads'
13741 d_oldsock='$d_oldsock'
13743 d_pathconf='$d_pathconf'
13745 d_phostname='$d_phostname'
13748 d_portable='$d_portable'
13749 d_pthread_yield='$d_pthread_yield'
13751 d_pwchange='$d_pwchange'
13752 d_pwclass='$d_pwclass'
13753 d_pwcomment='$d_pwcomment'
13754 d_pwexpire='$d_pwexpire'
13755 d_pwgecos='$d_pwgecos'
13756 d_pwpasswd='$d_pwpasswd'
13757 d_pwquota='$d_pwquota'
13758 d_readdir='$d_readdir'
13759 d_readlink='$d_readlink'
13761 d_recvmsg='$d_recvmsg'
13762 d_rename='$d_rename'
13763 d_rewinddir='$d_rewinddir'
13765 d_safebcpy='$d_safebcpy'
13766 d_safemcpy='$d_safemcpy'
13767 d_sanemcmp='$d_sanemcmp'
13768 d_sched_yield='$d_sched_yield'
13769 d_scm_rights='$d_scm_rights'
13770 d_seekdir='$d_seekdir'
13771 d_select='$d_select'
13773 d_semctl='$d_semctl'
13774 d_semctl_semid_ds='$d_semctl_semid_ds'
13775 d_semctl_semun='$d_semctl_semun'
13776 d_semget='$d_semget'
13778 d_sendmsg='$d_sendmsg'
13779 d_setegid='$d_setegid'
13780 d_seteuid='$d_seteuid'
13781 d_setgrent='$d_setgrent'
13782 d_setgrps='$d_setgrps'
13783 d_sethent='$d_sethent'
13784 d_setlinebuf='$d_setlinebuf'
13785 d_setlocale='$d_setlocale'
13786 d_setnent='$d_setnent'
13787 d_setpent='$d_setpent'
13788 d_setpgid='$d_setpgid'
13789 d_setpgrp2='$d_setpgrp2'
13790 d_setpgrp='$d_setpgrp'
13791 d_setprior='$d_setprior'
13792 d_setpwent='$d_setpwent'
13793 d_setregid='$d_setregid'
13794 d_setresgid='$d_setresgid'
13795 d_setresuid='$d_setresuid'
13796 d_setreuid='$d_setreuid'
13797 d_setrgid='$d_setrgid'
13798 d_setruid='$d_setruid'
13799 d_setsent='$d_setsent'
13800 d_setsid='$d_setsid'
13801 d_setspent='$d_setspent'
13802 d_setvbuf='$d_setvbuf'
13806 d_shmatprototype='$d_shmatprototype'
13807 d_shmctl='$d_shmctl'
13809 d_shmget='$d_shmget'
13810 d_sigaction='$d_sigaction'
13811 d_sigsetjmp='$d_sigsetjmp'
13812 d_socket='$d_socket'
13813 d_sockpair='$d_sockpair'
13815 d_statblks='$d_statblks'
13816 d_statfs='$d_statfs'
13817 d_statfs_f_flags='$d_statfs_f_flags'
13818 d_statfs_s='$d_statfs_s'
13819 d_statvfs='$d_statvfs'
13820 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13821 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13822 d_stdio_stream_array='$d_stdio_stream_array'
13823 d_stdiobase='$d_stdiobase'
13824 d_stdstdio='$d_stdstdio'
13825 d_strchr='$d_strchr'
13826 d_strcoll='$d_strcoll'
13827 d_strctcpy='$d_strctcpy'
13828 d_strerrm='$d_strerrm'
13829 d_strerror='$d_strerror'
13830 d_strtod='$d_strtod'
13831 d_strtol='$d_strtol'
13832 d_strtoul='$d_strtoul'
13833 d_strtoull='$d_strtoull'
13834 d_strxfrm='$d_strxfrm'
13835 d_suidsafe='$d_suidsafe'
13836 d_symlink='$d_symlink'
13837 d_syscall='$d_syscall'
13838 d_sysconf='$d_sysconf'
13839 d_sysernlst='$d_sysernlst'
13840 d_syserrlst='$d_syserrlst'
13841 d_system='$d_system'
13842 d_tcgetpgrp='$d_tcgetpgrp'
13843 d_tcsetpgrp='$d_tcsetpgrp'
13844 d_telldir='$d_telldir'
13845 d_telldirproto='$d_telldirproto'
13848 d_truncate='$d_truncate'
13849 d_tzname='$d_tzname'
13852 d_union_semun='$d_union_semun'
13854 d_vendorbin='$d_vendorbin'
13855 d_vendorlib='$d_vendorlib'
13857 d_void_closedir='$d_void_closedir'
13858 d_voidsig='$d_voidsig'
13859 d_voidtty='$d_voidtty'
13860 d_volatile='$d_volatile'
13861 d_vprintf='$d_vprintf'
13863 d_waitpid='$d_waitpid'
13864 d_wcstombs='$d_wcstombs'
13865 d_wctomb='$d_wctomb'
13866 d_writev='$d_writev'
13869 db_hashtype='$db_hashtype'
13870 db_prefixtype='$db_prefixtype'
13871 defvoidused='$defvoidused'
13872 direntrytype='$direntrytype'
13875 doublesize='$doublesize'
13877 dynamic_ext='$dynamic_ext'
13883 eunicefix='$eunicefix'
13886 extensions='$extensions'
13887 fflushNULL='$fflushNULL'
13888 fflushall='$fflushall'
13890 firstmakefile='$firstmakefile'
13892 fpostype='$fpostype'
13893 freetype='$freetype'
13895 full_csh='$full_csh'
13896 full_sed='$full_sed'
13897 gccversion='$gccversion'
13901 groupcat='$groupcat'
13902 groupstype='$groupstype'
13905 h_sysfile='$h_sysfile'
13909 i_arpainet='$i_arpainet'
13910 i_bsdioctl='$i_bsdioctl'
13913 i_dirent='$i_dirent'
13920 i_inttypes='$i_inttypes'
13921 i_limits='$i_limits'
13922 i_locale='$i_locale'
13923 i_machcthr='$i_machcthr'
13924 i_malloc='$i_malloc'
13926 i_memory='$i_memory'
13927 i_mntent='$i_mntent'
13930 i_neterrno='$i_neterrno'
13931 i_netinettcp='$i_netinettcp'
13934 i_pthread='$i_pthread'
13936 i_rpcsvcdbm='$i_rpcsvcdbm'
13939 i_shadow='$i_shadow'
13941 i_stdarg='$i_stdarg'
13942 i_stddef='$i_stddef'
13943 i_stdlib='$i_stdlib'
13944 i_string='$i_string'
13945 i_sysaccess='$i_sysaccess'
13946 i_sysdir='$i_sysdir'
13947 i_sysfile='$i_sysfile'
13948 i_sysfilio='$i_sysfilio'
13950 i_sysioctl='$i_sysioctl'
13951 i_sysmman='$i_sysmman'
13952 i_sysmount='$i_sysmount'
13953 i_sysndir='$i_sysndir'
13954 i_sysparam='$i_sysparam'
13955 i_sysresrc='$i_sysresrc'
13956 i_syssecrt='$i_syssecrt'
13957 i_sysselct='$i_sysselct'
13958 i_syssockio='$i_syssockio'
13959 i_sysstat='$i_sysstat'
13960 i_sysstatfs='$i_sysstatfs'
13961 i_sysstatvfs='$i_sysstatvfs'
13962 i_systime='$i_systime'
13963 i_systimek='$i_systimek'
13964 i_systimes='$i_systimes'
13965 i_systypes='$i_systypes'
13966 i_sysuio='$i_sysuio'
13968 i_sysvfs='$i_sysvfs'
13969 i_syswait='$i_syswait'
13970 i_termio='$i_termio'
13971 i_termios='$i_termios'
13973 i_unistd='$i_unistd'
13976 i_values='$i_values'
13977 i_varargs='$i_varargs'
13978 i_varhdr='$i_varhdr'
13980 ignore_versioned_solibs='$ignore_versioned_solibs'
13983 installarchlib='$installarchlib'
13984 installbin='$installbin'
13985 installman1dir='$installman1dir'
13986 installman3dir='$installman3dir'
13987 installprefix='$installprefix'
13988 installprefixexp='$installprefixexp'
13989 installprivlib='$installprivlib'
13990 installscript='$installscript'
13991 installsitearch='$installsitearch'
13992 installsitebin='$installsitebin'
13993 installsitelib='$installsitelib'
13994 installstyle='$installstyle'
13995 installusrbinperl='$installusrbinperl'
13996 installvendorbin='$installvendorbin'
13997 installvendorlib='$installvendorlib'
13999 known_extensions='$known_extensions'
14003 lddlflags='$lddlflags'
14005 ldlibpthname='$ldlibpthname'
14012 libswanted='$libswanted'
14018 locincpth='$locincpth'
14019 loclibpth='$loclibpth'
14020 longdblsize='$longdblsize'
14021 longlongsize='$longlongsize'
14022 longsize='$longsize'
14026 lseeksize='$lseeksize'
14027 lseektype='$lseektype'
14031 make_set_make='$make_set_make'
14032 mallocobj='$mallocobj'
14033 mallocsrc='$mallocsrc'
14034 malloctype='$malloctype'
14036 man1direxp='$man1direxp'
14039 man3direxp='$man3direxp'
14042 mips_type='$mips_type'
14044 mmaptype='$mmaptype'
14046 modetype='$modetype'
14048 multiarch='$multiarch'
14050 myarchname='$myarchname'
14051 mydomain='$mydomain'
14052 myhostname='$myhostname'
14055 netdb_hlen_type='$netdb_hlen_type'
14056 netdb_host_type='$netdb_host_type'
14057 netdb_name_type='$netdb_name_type'
14058 netdb_net_type='$netdb_net_type'
14061 nm_so_opt='$nm_so_opt'
14062 nonxs_ext='$nonxs_ext'
14064 o_nonblock='$o_nonblock'
14066 old_pthread_create_joinable='$old_pthread_create_joinable'
14067 optimize='$optimize'
14068 orderlib='$orderlib'
14074 patchlevel='$patchlevel'
14075 path_sep='$path_sep'
14077 perladmin='$perladmin'
14078 perlpath='$perlpath'
14080 phostname='$phostname'
14083 pm_apiversion='$pm_apiversion'
14087 prefixexp='$prefixexp'
14089 privlibexp='$privlibexp'
14090 prototype='$prototype'
14092 randbits='$randbits'
14093 randfunc='$randfunc'
14094 randseedtype='$randseedtype'
14096 rd_nodata='$rd_nodata'
14100 sPRIEldbl='$sPRIEldbl'
14101 sPRIFldbl='$sPRIFldbl'
14102 sPRIGldbl='$sPRIGldbl'
14105 sPRIeldbl='$sPRIeldbl'
14106 sPRIfldbl='$sPRIfldbl'
14107 sPRIgldbl='$sPRIgldbl'
14112 sched_yield='$sched_yield'
14113 scriptdir='$scriptdir'
14114 scriptdirexp='$scriptdirexp'
14116 seedfunc='$seedfunc'
14117 selectminbits='$selectminbits'
14118 selecttype='$selecttype'
14119 sendmail='$sendmail'
14122 sharpbang='$sharpbang'
14123 shmattype='$shmattype'
14124 shortsize='$shortsize'
14127 sig_count='$sig_count'
14128 sig_name='$sig_name'
14129 sig_name_init='$sig_name_init'
14131 sig_num_init='$sig_num_init'
14132 signal_t='$signal_t'
14133 sitearch='$sitearch'
14134 sitearchexp='$sitearchexp'
14136 sitebinexp='$sitebinexp'
14138 sitelibexp='$sitelibexp'
14139 siteprefix='$siteprefix'
14140 siteprefixexp='$siteprefixexp'
14141 sizetype='$sizetype'
14146 sockethdr='$sockethdr'
14147 socketlib='$socketlib'
14149 spackage='$spackage'
14150 spitshell='$spitshell'
14153 ssizetype='$ssizetype'
14154 startperl='$startperl'
14156 static_ext='$static_ext'
14158 stdio_base='$stdio_base'
14159 stdio_bufsiz='$stdio_bufsiz'
14160 stdio_cnt='$stdio_cnt'
14161 stdio_filbuf='$stdio_filbuf'
14162 stdio_ptr='$stdio_ptr'
14163 stdio_stream_array='$stdio_stream_array'
14166 subversion='$subversion'
14173 timeincl='$timeincl'
14174 timetype='$timetype'
14183 use64bits='$use64bits'
14185 uselargefiles='$uselargefiles'
14186 uselongdouble='$uselongdouble'
14187 usemorebits='$usemorebits'
14188 usemultiplicity='$usemultiplicity'
14189 usemymalloc='$usemymalloc'
14191 useopcode='$useopcode'
14192 useperlio='$useperlio'
14193 useposix='$useposix'
14195 useshrplib='$useshrplib'
14196 usesocks='$usesocks'
14197 usethreads='$usethreads'
14198 usevendorprefix='$usevendorprefix'
14199 usevfork='$usevfork'
14202 vendorbin='$vendorbin'
14203 vendorbinexp='$vendorbinexp'
14204 vendorlib='$vendorlib'
14205 vendorlibexp='$vendorlibexp'
14206 vendorprefix='$vendorprefix'
14207 vendorprefixexp='$vendorprefixexp'
14210 voidflags='$voidflags'
14212 xs_apiversion='$xs_apiversion'
14217 : Add in command line options if available
14218 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14220 : add special variables
14221 $test -f $src/patchlevel.h && \
14222 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14223 echo "CONFIGDOTSH=true" >>config.sh
14225 : propagate old symbols
14226 if $test -f UU/config.sh; then
14227 <UU/config.sh sort | uniq >UU/oldconfig.sh
14228 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14229 sort | uniq -u >UU/oldsyms
14230 set X `cat UU/oldsyms`
14236 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14238 echo "# Variables propagated from previous config.sh file." >>config.sh
14239 for sym in `cat UU/oldsyms`; do
14240 echo " Propagating $hint variable "'$'"$sym..."
14241 eval 'tmp="$'"${sym}"'"'
14243 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14249 : Finish up by extracting the .SH files
14263 If you'd like to make any changes to the config.sh file before I begin
14264 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14267 rp="Press return or use a shell escape to edit config.sh:"
14272 *) : in case they cannot read
14273 sh 1>&4 -c "$ans";;
14278 : if this fails, just run all the .SH files by hand
14285 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14292 Now you need to generate make dependencies by running "$make depend".
14293 You might prefer to run it in background: "$make depend > makedepend.out &"
14294 It can take a while, so you might not want to run it right now.
14299 rp="Run $make depend now?"
14303 $make depend && echo "Now you must run a $make."
14306 echo "You must run '$make depend' then '$make'."
14309 elif test -f [Mm]akefile; then
14311 echo "Now you must run a $make."
14316 if $test -f Policy.sh; then
14319 If you compile $package on a different machine or from a different object
14320 directory, copy the Policy.sh file from this object directory to the
14321 new one before you run Configure -- this will help you with most of
14322 the policy defaults.
14326 if $test -f config.msg; then
14327 echo "Hmm. I also noted the following information while running:"
14329 $cat config.msg >&4
14332 $rm -f kit*isdone ark*isdone