3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Mon Sep 20 12:12:09 EET DST 1999 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
441 d_old_pthread_create_joinable=''
442 old_pthread_create_joinable=''
691 ignore_versioned_solibs=''
812 d_stdio_stream_array=''
813 stdio_stream_array=''
849 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
852 : We must find out about Eunice early
854 if test -f /etc/unixtovms; then
855 eunicefix=/etc/unixtovms
857 if test -f /etc/unixtovms.exe; then
858 eunicefix=/etc/unixtovms.exe
862 : Possible local include directories to search.
863 : Set locincpth to "" in a hint file to defeat local include searches.
864 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
865 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
867 : no include file wanted by default
870 : list of known cpp symbols, sorted alphabetically
871 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
872 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
873 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
874 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
875 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
876 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
877 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
878 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
879 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
880 al="$al VMS Xenix286"
881 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
882 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
883 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
884 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
885 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
886 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
887 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
888 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
889 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
890 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
891 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
892 al="$al __SVR4_2__ __UMAXV__"
893 al="$al ____386BSD____ __alpha __alpha__ __amiga"
894 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
895 al="$al __host_mips__"
896 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
897 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
898 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
899 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
900 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
901 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
902 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
903 al="$al __mc88100 __mc88100__ __mips __mips__"
904 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
905 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
906 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
907 al="$al _host_mips _mips _unix"
908 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
909 al="$al apollo ardent att386 att3b"
910 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
911 al="$al cadmus clipper concurrent convex cray ctix"
912 al="$al dmert encore gcos gcx gimpel gould"
913 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
914 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
915 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
916 al="$al i186 i286 i386 i486 i8086"
917 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
918 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
919 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
920 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
921 al="$al mc88000 mc88100 merlin mert mips mvs n16"
922 al="$al ncl_el ncl_mr"
923 al="$al news1500 news1700 news1800 news1900 news3700"
924 al="$al news700 news800 news900 ns16000 ns32000"
925 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
926 al="$al parisc pc532 pdp11 plexus posix pyr"
927 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
928 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
929 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
930 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
931 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
932 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
935 : Trailing extension. Override this in a hint file, if needed.
937 : Extra object files, if any, needed on this platform.
940 : change the next line if compiling for Xenix/286 on Xenix/386
941 xlibpth='/usr/lib/386 /lib/386'
943 : Possible local library directories to search.
944 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
945 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
947 : general looking path for locating libraries
948 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
949 glibpth="$glibpth /lib /usr/lib $xlibpth"
950 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
951 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
953 : Private path used by Configure to find libraries. Its value
954 : is prepended to libpth. This variable takes care of special
955 : machines, like the mips. Usually, it should be empty.
958 : default library list
960 : some systems want to use only the non-versioned libso:s
961 ignore_versioned_solibs=''
962 : full support for void wanted by default
965 : set useposix=false in your hint file to disable the POSIX extension.
967 : set useopcode=false in your hint file to disable the Opcode extension.
969 : set usemultiplicity on the Configure command line to enable multiplicity.
970 : set usesocks on the Configure command line to enable socks.
971 : set usethreads on the Configure command line to enable threads.
972 : List of libraries we want.
973 : If anyone needs -lnet, put it in a hint file.
974 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
975 libswanted="$libswanted dld ld sun m c cposix posix"
976 libswanted="$libswanted ndir dir crypt sec"
977 libswanted="$libswanted ucb bsd BSD PW x"
978 : We probably want to search /usr/shlib before most other libraries.
979 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
980 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
981 glibpth="/usr/shlib $glibpth"
982 : Do not use vfork unless overridden by a hint file.
985 : Find the basic shell for Bourne shell scripts
989 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
992 if test -f "$xxx"; then
995 : Build up a list and do a single loop so we can 'break' out.
996 pth=`echo $PATH | sed -e "s/$p_/ /g"`
997 for xxx in sh bash ksh pdksh ash; do
999 try="$try ${p}/${xxx}"
1003 if test -f "$xxx"; then
1006 elif test -f "$xxx.exe"; then
1017 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1019 Usually it's in /bin/sh. How did you even get this far?
1020 Please contact me (Perl Maintainers) at perlbug@perl.com and
1021 we'll try to straighten this all out.
1027 : see if sh knows # comments
1028 if `$sh -c '#' >/dev/null 2>&1`; then
1032 test -f $xcat || xcat=/usr/bin/cat
1037 if test -s today; then
1040 echo "#! $xcat" > try
1044 if test -s today; then
1052 echo "Your $sh doesn't grok # comments--I will strip them later on."
1055 echo "exec grep -v '^[ ]*#'" >spitshell
1057 $eunicefix spitshell
1058 spitshell=`pwd`/spitshell
1060 echo "I presume that if # doesn't work, #! won't work either!"
1065 : figure out how to guarantee sh startup
1067 '') startsh=${sharpbang}${sh} ;;
1079 : echo "Yup, it does."
1081 echo "Hmm... '$startsh' does not guarantee sh startup..."
1082 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1087 : Save command line options in file UU/cmdline.opt for later use in
1088 : generating config.sh.
1089 cat > cmdline.opt <<EOSH
1090 # Configure command line arguments.
1097 cat >>cmdline.opt <<EOSH
1098 config_arg$argn='$arg'
1100 argn=`expr $argn + 1`
1103 : produce awk script to parse command line options
1104 cat >options.awk <<'EOF'
1106 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1108 len = length(optstr);
1109 for (i = 1; i <= len; i++) {
1110 c = substr(optstr, i, 1);
1111 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1122 if (substr(str, 1, 1) != "-") {
1123 printf("'%s'\n", str);
1127 for (i = 2; i <= len; i++) {
1128 c = substr(str, i, 1);
1130 printf("-%s\n", substr(str, i));
1136 printf("'%s'\n", substr(str, i + 1));
1149 : process the command line options
1150 set X `for arg in "$@"; do echo "X$arg"; done |
1151 sed -e s/X// | awk -f options.awk`
1156 : set up default values
1166 rm -f optdef.sh posthint.sh
1167 cat >optdef.sh <<EOS
1173 while test $# -gt 0; do
1175 -d) shift; fastread=yes;;
1176 -e) shift; alldone=cont;;
1180 if test -r "$1"; then
1183 echo "$me: cannot read config file $1." >&2
1188 -h) shift; error=true;;
1189 -r) shift; reuseval=true;;
1190 -s) shift; silent=true; realsilent=true;;
1191 -E) shift; alldone=exit;;
1192 -K) shift; knowitall=true;;
1193 -O) shift; override=true;;
1194 -S) shift; silent=true; extractsh=true;;
1199 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1200 echo "$me: ignoring -D $1" >&2
1203 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1204 *) echo "$1='define'" >> optdef.sh;;
1211 *=) echo "$1" >> optdef.sh;;
1213 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1214 echo "$me: ignoring -U $1" >&2
1216 *) echo "$1='undef'" >> optdef.sh;;
1225 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1226 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1235 *=*) zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1236 yyy=`echo $yyy|sed 's!=.*!!'`
1244 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh
1247 echo "$yyy=''" >> posthint.sh
1253 echo "$yyy='$zzz'" >> posthint.sh
1256 echo "eval \"$yyy=$zzz\"" >> posthint.sh
1259 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh
1265 echo "$yyy=$zzz" >> posthint.sh
1267 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2
1271 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1274 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1282 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1283 [-U symbol] [-U symbol=] [-A command:symbol...]
1284 -d : use defaults for all answers.
1285 -e : go on without questioning past the production of config.sh.
1286 -f : specify an alternate default configuration file.
1287 -h : print this help message and exit (with an error status).
1288 -r : reuse C symbols value if possible (skips costly nm extraction).
1289 -s : silent mode, only echoes questions and essential information.
1290 -D : define symbol to have some value:
1291 -D symbol symbol gets the value 'define'
1292 -D symbol=value symbol gets the value 'value'
1293 -E : stop at the end of questions, after having produced config.sh.
1294 -K : do not use unless you know what you are doing.
1295 -O : let -D and -U override definitions from loaded configuration file.
1296 -S : perform variable substitutions on all .SH files (can mix with -f)
1297 -U : undefine symbol:
1298 -U symbol symbol gets the value 'undef'
1299 -U symbol= symbol gets completely empty
1300 -A : manipulate symbol after the platform specific hints have been applied:
1301 -A append:symbol=value append value to symbol
1302 -A define:symbol=value define symbol to have value
1303 -A symbol=value define symbol to have value
1304 -A clear:symbol define symbol to be ''
1305 -A define:symbol define symbol to be 'define'
1306 -A eval:symbol=value define symbol to be eval of value
1307 -A prepend:symbol=value prepend value to symbol
1308 -A undef:symbol define symbol to be 'undef'
1309 -A undef:symbol= define symbol to be ''
1310 -V : print version number and exit (with a zero status).
1317 case "$fastread$alldone" in
1320 if test ! -t 0; then
1321 echo "Say 'sh Configure', not 'sh <Configure'"
1329 true) exec 1>/dev/null;;
1332 : run the defines and the undefines, if any, but leave the file out there...
1335 : create the posthint manipulation script and leave the file out there...
1341 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1342 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1343 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1344 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1345 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1348 : Some greps do not return status, grrr.
1349 echo "grimblepritz" >grimble
1350 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1352 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1358 : the following should work in any shell
1362 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1363 cat >contains <<'EOSS'
1364 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1369 : Find the path to the source tree
1372 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1375 *) src=`cd ../$src && pwd` ;;
1388 if test -f $rsrc/Configure && \
1389 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1391 : found it, so we are ok.
1394 for src in . .. ../.. ../../.. ../../../..; do
1395 if test -f ../$src/Configure && \
1396 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1407 Sorry, I can't seem to locate the source dir for $package. Please start
1408 Configure with an explicit path -- i.e. /some/path/Configure.
1416 echo "Sources for $package found in \"$src\"." >&4
1420 : script used to extract .SH files with variable substitutions
1421 cat >extract <<'EOS'
1423 echo "Doing variable substitutions on .SH files..."
1424 if test -f $src/MANIFEST; then
1425 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1427 echo "(Looking for .SH files under the source directory.)"
1428 set x `(cd $src; find . -name "*.SH" -print)`
1432 0) set x `(cd $src; echo *.SH)`; shift;;
1434 if test ! -f $src/$1; then
1440 while test $name; do
1441 if test ! -d "$name"; then
1442 create="$name $create";
1443 name=`echo $name | sed -e "s|^[^/]*$||"`;
1444 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1449 for file in $create; do
1458 dir=`expr X$file : 'X\(.*\)/'`
1459 file=`expr X$file : 'X.*/\(.*\)'`
1460 (cd $dir && . ./$file)
1470 dir=`expr X$file : 'X\(.*\)/'`
1471 file=`expr X$file : 'X.*/\(.*\)'`
1472 (set x $dir; shift; eval $mkdir_p)
1482 if test -f $src/config_h.SH; then
1483 if test ! -f config.h; then
1484 : oops, they left it out of MANIFEST, probably, so do it anyway.
1490 : extract files and exit if asked to do so
1491 case "$extractsh" in
1493 case "$realsilent" in
1497 case "$config_sh" in
1498 '') config_sh='config.sh';;
1501 echo "Fetching answers from $config_sh..."
1504 test "$override" && . ./optdef.sh
1513 : Eunice requires " " instead of "", can you believe it
1516 echo "Beginning of configuration questions for $package."
1518 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1520 : first determine how to suppress newline on echo command
1522 echo "Checking echo to see how to suppress newlines..."
1523 (echo "hi there\c" ; echo " ") >.echotmp
1524 if $contains c .echotmp >/dev/null 2>&1 ; then
1535 echo $n "The star should be here-->$c"
1539 : Now test for existence of everything in MANIFEST
1541 if test -f $rsrc/MANIFEST; then
1542 echo "First let's make sure your kit is complete. Checking..." >&4
1543 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1546 for filelist in x??; do
1547 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1549 if test -s missing; then
1553 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1555 You have the option of continuing the configuration process, despite the
1556 distinct possibility that your kit is damaged, by typing 'y'es. If you
1557 do, don't blame me if something goes wrong. I advise you to type 'n'o
1558 and contact the author (perlbug@perl.com).
1561 echo $n "Continue? [n] $c" >&4
1565 echo "Continuing..." >&4
1569 echo "ABORTING..." >&4
1574 echo "Looks good..."
1577 echo "There is no MANIFEST file. I hope your kit is complete !"
1582 : Find the appropriate value for a newline for tr
1583 if test -n "$DJGPP"; then
1586 if test X"$trnl" = X; then
1587 case "`echo foo|tr '\n' x 2>/dev/null`" in
1591 if test X"$trnl" = X; then
1592 case "`echo foo|tr '\012' x 2>/dev/null`" in
1593 foox) trnl='\012' ;;
1596 if test X"$trnl" = X; then
1599 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1605 : compute the number of columns on the terminal for proper question formatting
1610 : set up the echo used in my read
1611 myecho="case \"\$xxxm\" in
1612 '') echo $n \"\$rp $c\" >&4;;
1614 '') echo $n \"[\$xxxm] $c\";;
1616 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1618 echo $n \"[\$xxxm] $c\" >&4
1620 echo $n \"\$rp [\$xxxm] $c\" >&4
1626 : now set up to do reads with possible shell escape and default assignment
1632 case "\$fastread" in
1633 yes) case "\$dflt" in
1636 case "\$silent-\$rp" in
1641 *) case "\$silent" in
1642 true) case "\$rp" in
1647 while expr "X\$ans" : "X!" >/dev/null; do
1651 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1659 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1668 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1673 echo "(OK, I'll run with -d after this question.)" >&4
1676 echo "*** Sorry, \$1 not supported yet." >&4
1686 echo "*** Substitution done -- please confirm."
1688 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1693 echo "*** Error -- try again."
1700 case "\$ans\$xxxm\$nostick" in
1712 : create .config dir to save info across Configure sessions
1713 test -d ../.config || mkdir ../.config
1714 cat >../.config/README <<EOF
1715 This directory created by Configure to save information that should
1716 persist across sessions for $package.
1718 You may safely delete it if you wish.
1721 : general instructions
1724 user=`(logname) 2>/dev/null`
1726 '') user=`whoami 2>&1`;;
1728 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1731 rp='Would you like to see the instructions?'
1742 This installation shell script will examine your system and ask you questions
1743 to determine how the perl5 package should be installed. If you get
1744 stuck on a question, you may use a ! shell escape to start a subshell or
1745 execute a command. Many of the questions will have default answers in square
1746 brackets; typing carriage return will give you the default.
1748 On some of the questions which ask for file or directory names you are allowed
1749 to use the ~name construct to specify the login directory belonging to "name",
1750 even if you don't have a shell which knows about that. Questions where this is
1751 allowed will be marked "(~name ok)".
1755 dflt='Type carriage return to continue'
1759 The prompter used in this script allows you to use shell variables and
1760 backticks in your answers. You may use $1, $2, etc... to refer to the words
1761 in the default answer, as if the default line was a set of arguments given to a
1762 script shell. This means you may also use $* to repeat the whole default line,
1763 so you do not have to re-type everything to add something to the default.
1765 Everytime there is a substitution, you will have to confirm. If there is an
1766 error (e.g. an unmatched backtick), the default answer will remain unchanged
1767 and you will be prompted again.
1769 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1770 the questions and use the computed defaults (or the previous answers if there
1771 was already a config.sh file). Type 'Configure -h' for a list of options.
1772 You may also start interactively and then answer '& -d' at any prompt to turn
1773 on the non-interactive behaviour for the remainder of the execution.
1779 Much effort has been expended to ensure that this shell script will run on any
1780 Unix system. If despite that it blows up on yours, your best bet is to edit
1781 Configure and run it again. If you can't run Configure for some reason,
1782 you'll have to generate a config.sh file by hand. Whatever problems you
1783 have, let me (perlbug@perl.com) know how I blew it.
1785 This installation script affects things in two ways:
1787 1) it may do direct variable substitutions on some of the files included
1789 2) it builds a config.h file for inclusion in C programs. You may edit
1790 any of these files as the need arises after running this script.
1792 If you make a mistake on a question, there is no easy way to back up to it
1793 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1794 files. Configure will offer to let you do this before it runs the SH files.
1797 dflt='Type carriage return to continue'
1799 case "$firsttime" in
1800 true) echo $user >>../.config/instruct;;
1804 : find out where common programs are
1806 echo "Locating common programs..." >&4
1819 if test -d \$dir/\$thing; then
1825 for thisthing in \$dir/\$thing; do
1826 : just loop through to pick last item
1828 if test -f \$thisthing; then
1831 elif test -f \$dir/\$thing.exe; then
1832 if test -n "$DJGPP"; then
1833 echo \$dir/\$thing.exe
1835 : on Eunice apparently
1885 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1886 pth="$pth /lib /usr/lib"
1887 for file in $loclist; do
1891 if test -f "$xxx"; then
1894 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1895 xxx=`./loc $file $file $pth`
1898 '') xxx=`./loc $file $file $pth`;;
1899 *) xxx=`./loc $xxx $xxx $pth`;;
1905 echo $file is in $xxx.
1908 echo $file is in $xxx.
1911 echo "I don't know where '$file' is, and my life depends on it." >&4
1912 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1918 echo "Don't worry if any of the following aren't found..."
1920 for file in $trylist; do
1924 if test -f "$xxx"; then
1927 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1928 xxx=`./loc $file $file $pth`
1931 '') xxx=`./loc $file $file $pth`;;
1932 *) xxx=`./loc $xxx $xxx $pth`;;
1938 echo $file is in $xxx.
1941 echo $file is in $xxx.
1944 echo "I don't see $file out there, $say."
1951 echo "Substituting grep for egrep."
1957 echo "Substituting cp for ln."
1963 echo "Hopefully test is built into your sh."
1966 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1967 echo "Using the test built into your sh."
1975 echo "Hopefully echo is built into your sh."
1980 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1981 $echo $n "hi there$c" >foo1
1982 echo $n "hi there$c" >foo2
1983 if cmp foo1 foo2 >/dev/null 2>&1; then
1984 echo "They are compatible. In fact, they may be identical."
1991 They are not compatible! You are probably running ksh on a non-USG system.
1992 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1993 have echo built in and we may have to run some Bourne shell scripts. That
1994 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1997 $echo $n "The star should be here-->$c"
2004 : determine whether symbolic links are supported
2007 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2008 echo "Symbolic links are supported." >&4
2011 echo "Symbolic links are NOT supported." >&4
2016 : see whether [:lower:] and [:upper:] are supported character classes
2018 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2020 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2024 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2025 # (0xc9 and 0xd1), therefore that is a nice testing point.
2026 if test "X$up" = X -o "X$low" = X; then
2027 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2033 if test "X$up" = X -o "X$low" = X; then
2034 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2040 if test "X$up" = X -o "X$low" = X; then
2041 case "`echo IJ | od -x 2>/dev/null`" in
2043 echo "Hey, this might be EBCDIC." >&4
2044 if test "X$up" = X -o "X$low" = X; then
2045 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2046 ij) up='[A-IJ-RS-Z]'
2051 if test "X$up" = X -o "X$low" = X; then
2052 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2062 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2064 echo "Using $up and $low to convert case." >&4
2067 echo "I don't know how to translate letters from upper to lower case." >&4
2068 echo "Your tr is not acting any way I know of." >&4
2072 : set up the translation script tr, must be called with ./tr of course
2076 '[A-Z][a-z]') exec $tr '$up' '$low';;
2077 '[a-z][A-Z]') exec $tr '$low' '$up';;
2084 : Try to determine whether config.sh was made on this system
2085 case "$config_sh" in
2087 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2088 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2089 # because the A-Z/a-z are not consecutive.
2090 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2091 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2092 newmyuname="$myuname"
2094 case "$knowitall" in
2096 if test -f ../config.sh; then
2097 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2098 eval "`grep myuname= ../config.sh`"
2100 if test "X$myuname" = "X$newmyuname"; then
2108 : Get old answers from old config file if Configure was run on the
2109 : same system, otherwise use the hints.
2112 if test -f config.sh; then
2114 rp="I see a config.sh file. Shall I use it to set the defaults?"
2117 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2118 *) echo "Fetching default answers from your old config.sh file..." >&4
2126 : Older versions did not always set $sh. Catch re-use of such
2135 if test ! -f config.sh; then
2138 First time through, eh? I have some defaults handy for some systems
2139 that need some extra help getting the Configure answers right:
2142 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2144 : Half the following guesses are probably wrong... If you have better
2145 : tests or hints, please send them to perlbug@perl.com
2146 : The metaconfig authors would also appreciate a copy...
2147 $test -f /irix && osname=irix
2148 $test -f /xenix && osname=sco_xenix
2149 $test -f /dynix && osname=dynix
2150 $test -f /dnix && osname=dnix
2151 $test -f /lynx.os && osname=lynxos
2152 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2153 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2154 $test -f /bin/mips && /bin/mips && osname=mips
2155 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2156 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2157 $test -d /usr/apollo/bin && osname=apollo
2158 $test -f /etc/saf/_sactab && osname=svr4
2159 $test -d /usr/include/minix && osname=minix
2160 if $test -d /MachTen -o -d /MachTen_Folder; then
2162 if $test -x /sbin/version; then
2163 osvers=`/sbin/version | $awk '{print $2}' |
2164 $sed -e 's/[A-Za-z]$//'`
2165 elif $test -x /usr/etc/version; then
2166 osvers=`/usr/etc/version | $awk '{print $2}' |
2167 $sed -e 's/[A-Za-z]$//'`
2172 $test -f /sys/posix.dll &&
2173 $test -f /usr/bin/what &&
2174 set X `/usr/bin/what /sys/posix.dll` &&
2175 $test "$3" = UWIN &&
2178 if $test -f $uname; then
2186 umips) osname=umips ;;
2189 [23]100) osname=mips ;;
2190 next*) osname=next ;;
2192 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2193 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2196 elif $test -f /etc/kconfig; then
2198 if test "$lns" = "$ln -s"; then
2200 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2202 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2209 if test -n "$DJGPP"; then
2218 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2220 'not found') osvers="$4"."$3" ;;
2221 '<3240'|'<>3240') osvers=3.2.0 ;;
2222 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2223 '=3250'|'>3250') osvers=3.2.5 ;;
2227 *dc.osx) osname=dcosx
2233 domainos) osname=apollo
2239 dynixptx*) osname=dynixptx
2240 osvers=`echo "$4"|sed 's/^v//'`
2242 freebsd) osname=freebsd
2244 genix) osname=genix ;;
2246 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2262 netbsd*) osname=netbsd
2265 news-os) osvers="$3"
2267 4*) osname=newsos4 ;;
2271 bsd386) osname=bsd386
2274 POSIX-BC | posix-bc ) osname=posix-bc
2277 powerux | power_ux | powermax_os | powermaxos | \
2278 powerunix | power_unix) osname=powerux
2281 next*) osname=next ;;
2282 solaris) osname=solaris
2284 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2291 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2295 titanos) osname=titanos
2304 ultrix) osname=ultrix
2307 osf1|mls+) case "$5" in
2310 osvers=`echo "$3" | sed 's/^[xvt]//'`
2312 hp*) osname=hp_osf1 ;;
2313 mips) osname=mips_osf1 ;;
2322 $2) case "$osname" in
2326 : svr4.x or possibly later
2336 if test -f /stand/boot ; then
2337 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2338 if test -n "$INITPROG" -a -f "$INITPROG"; then
2339 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2340 if test -n "$isesix"; then
2348 *) if test -f /etc/systemid; then
2350 set `echo $3 | $sed 's/\./ /g'` $4
2351 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2353 elif $test -f $src/hints/sco_$1_$2.sh; then
2355 elif $test -f $src/hints/sco_$1.sh; then
2360 '') : Still unknown. Probably a generic Sys V.
2369 *) case "$osname" in
2370 '') : Still unknown. Probably a generic BSD.
2378 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2379 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2380 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2383 $rm -f UU/kernel.what
2384 elif test -d c:/.; then
2391 : Now look for a hint file osname_osvers, unless one has been
2392 : specified already.
2395 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2396 : Also try without trailing minor version numbers.
2397 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2398 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2399 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2400 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2403 *) case "$osvers" in
2406 *) if $test -f $src/hints/$file.sh ; then
2408 elif $test -f $src/hints/$xfile.sh ; then
2410 elif $test -f $src/hints/$xxfile.sh ; then
2412 elif $test -f $src/hints/$xxxfile.sh ; then
2414 elif $test -f $src/hints/$xxxxfile.sh ; then
2416 elif $test -f "$src/hints/${osname}.sh" ; then
2425 if $test -f Policy.sh ; then
2428 none) dflt="Policy" ;;
2429 *) dflt="Policy $dflt" ;;
2434 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2438 if $test -f Policy.sh ; then
2441 There's also a Policy hint file available, which should make the
2442 site-specific (policy) questions easier to answer.
2449 You may give one or more space-separated answers, or "none" if appropriate.
2450 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2451 is a good thing. DO NOT give a wrong version or a wrong OS.
2455 rp="Which of these apply, if any?"
2458 for file in $tans; do
2459 if $test X$file = XPolicy -a -f Policy.sh; then
2461 $cat Policy.sh >> UU/config.sh
2462 elif $test -f $src/hints/$file.sh; then
2463 . $src/hints/$file.sh
2464 $cat $src/hints/$file.sh >> UU/config.sh
2465 elif $test X$tans = X -o X$tans = Xnone ; then
2468 : Give one chance to correct a possible typo.
2469 echo "$file.sh does not exist"
2471 rp="hint to use instead?"
2473 for file in $ans; do
2474 if $test -f "$src/hints/$file.sh"; then
2475 . $src/hints/$file.sh
2476 $cat $src/hints/$file.sh >> UU/config.sh
2477 elif $test X$ans = X -o X$ans = Xnone ; then
2480 echo "$file.sh does not exist -- ignored."
2487 : Remember our hint file for later.
2488 if $test -f "$src/hints/$file.sh" ; then
2498 echo "Fetching default answers from $config_sh..." >&4
2502 cp $config_sh config.sh 2>/dev/null
2512 test "$override" && . ./optdef.sh
2513 myuname="$newmyuname"
2515 : Restore computed paths
2516 for file in $loclist $trylist; do
2517 eval $file="\$_$file"
2522 Configure uses the operating system name and version to set some defaults.
2523 The default value is probably right if the name rings a bell. Otherwise,
2524 since spelling matters for me, either accept the default or answer "none"
2531 ''|' '|none) dflt=none ;;
2532 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2535 *) dflt="$osname" ;;
2537 rp="Operating system name?"
2541 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2547 ''|' '|none) dflt=none ;;
2548 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2549 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2551 ''|' ') dflt=none ;;
2556 *) dflt="$osvers" ;;
2558 rp="Operating system version?"
2568 : who configured the system
2569 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2570 cf_by=`(logname) 2>/dev/null`
2573 cf_by=`(whoami) 2>/dev/null`
2575 "") cf_by=unknown ;;
2579 : set up the script used to warn in case of inconsistency
2586 echo "*** WHOA THERE!!! ***" >&4
2587 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2588 rp=" Keep the $hint value?"
2591 y) td=$was; tu=$was;;
2595 : function used to set $1 to $val
2596 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2598 $define$undef) . ./whoa; eval "$var=\$td";;
2599 $undef$define) . ./whoa; eval "$var=\$tu";;
2600 *) eval "$var=$val";;
2605 Perl can be built to take advantage of threads, on some systems.
2606 To do so, Configure must be run with -Dusethreads.
2608 Note that threading is a highly experimental feature, and
2609 some known race conditions still remain. If you choose to try
2610 it, be very sure to not actually deploy it for production
2611 purposes. README.threads has more details, and is required
2612 reading if you enable threads.
2614 case "$usethreads" in
2615 $define|true|[yY]*) dflt='y';;
2618 rp='Build a threading Perl?'
2621 y|Y) val="$define" ;;
2627 case "$d_oldpthreads" in
2628 '') : Configure tests would be welcome here. For now, assume undef.
2630 *) val="$d_oldpthreads" ;;
2636 case "$usethreads" in
2637 "$define"|true|[yY]*)
2638 : Look for a hint-file generated 'call-back-unit'. If the
2639 : user has specified that a threading perl is to be built,
2640 : we may need to set or change some other defaults.
2641 if $test -f usethreads.cbu; then
2642 echo "Your platform has some specific hints for threaded builds, using them..."
2646 (Your platform doesn't have any specific hints for threaded builds.
2647 Assuming POSIX threads, then.)
2655 Perl can be built so that multiple Perl interpreters can coexist
2656 within the same Perl executable. To do so, Configure must be run with
2659 Normally you do not need this and you should answer no.
2662 case "$usemultiplicity" in
2663 $define|true|[yY]*) dflt='y';;
2666 rp='Build Perl for multiplicity?'
2669 y|Y) val="$define" ;;
2675 : determine where manual pages are on this system
2679 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2680 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2681 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2682 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2683 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2684 sysman=`./loc . /usr/man/man1 $syspath`
2687 if $test -d "$sysman"; then
2688 echo "System manual is in $sysman." >&4
2690 echo "Could not find manual pages in source form." >&4
2693 : see what memory models we can support
2696 $cat >pdp11.c <<'EOP'
2705 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2706 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2707 dflt='unsplit split'
2709 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2712 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2717 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2720 if $test -d /lib/large || $test -d /usr/lib/large; then
2723 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2732 Some systems have different model sizes. On most systems they are called
2733 small, medium, large, and huge. On the PDP11 they are called unsplit and
2734 split. If your system doesn't support different memory models, say "none".
2735 If you wish to force everything to one memory model, say "none" here and
2736 put the appropriate flags later when it asks you for other cc and ld flags.
2737 Venix systems may wish to put "none" and let the compiler figure things out.
2738 (In the following question multiple model names should be space separated.)
2740 The default for most systems is "none".
2743 rp="Which memory models are supported?"
2758 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2759 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2766 rp="What flag indicates separate I and D space?"
2774 *large*|*small*|*medium*|*huge*)
2781 rp="What flag indicates large model?"
2791 *huge*) case "$huge" in
2795 rp="What flag indicates huge model?"
2805 *medium*) case "$medium" in
2809 rp="What flag indicates medium model?"
2816 *) medium="$large";;
2819 *small*) case "$small" in
2823 rp="What flag indicates small model?"
2834 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2837 $rm -f pdp11.* pdp11
2839 : make some quick guesses about what we are up against
2841 $echo $n "Hmm... $c"
2851 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2852 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2854 echo "Looks kind of like an OSF/1 system, but we'll see..."
2856 elif test `echo abc | tr a-z A-Z` = Abc ; then
2857 xxx=`./loc addbib blurfl $pth`
2858 if $test -f $xxx; then
2859 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2863 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2864 echo "Looks kind of like an extended USG system, but we'll see..."
2866 echo "Looks kind of like a USG system, but we'll see..."
2870 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2871 echo "Looks kind of like a BSD system, but we'll see..."
2875 echo "Looks kind of like a Version 7 system, but we'll see..."
2878 case "$eunicefix" in
2881 There is, however, a strange, musty smell in the air that reminds me of
2882 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2886 : it so happens the Eunice I know will not run shell scripts in Unix format
2890 echo "Congratulations. You aren't running Eunice."
2894 : Detect OS2. The p_ variable is set above in the Head.U unit.
2899 I have the feeling something is not exactly right, however...don't tell me...
2900 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2905 if test -f /xenix; then
2906 echo "Actually, this looks more like a XENIX system..."
2911 echo "It's not Xenix..."
2916 if test -f /venix; then
2917 echo "Actually, this looks more like a VENIX system..."
2924 echo "Nor is it Venix..."
2927 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2928 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2931 : see if we need a special compiler
2939 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2940 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2954 On some older systems the default C compiler will not resolve multiple global
2955 references that happen to have the same name. On some such systems the "Mcc"
2956 command may be used to force these to be resolved. On other systems a "cc -M"
2957 command is required. (Note that the -M flag on other systems indicates a
2958 memory model to use!) If you have the Gnu C compiler, you might wish to use
2964 rp="Use which C compiler?"
2972 rp="Use which C compiler?"
2976 : Look for a hint-file generated 'call-back-unit'. Now that the
2977 : user has specified the compiler, we may need to set or change some
2979 if $test -f cc.cbu; then
2983 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2984 $cat >gccvers.c <<EOM
2989 printf("%s\n", __VERSION__);
2991 printf("%s\n", "1");
2997 if $cc -o gccvers gccvers.c; then
2998 gccversion=`./gccvers`
2999 case "$gccversion" in
3000 '') echo "You are not using GNU cc." ;;
3001 *) echo "You are using GNU cc $gccversion." ;;
3005 echo "*** WHOA THERE!!! ***" >&4
3006 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3007 case "$knowitall" in
3009 echo " You'd better start hunting for one and let me know about it." >&4
3015 case "$gccversion" in
3016 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3020 case "$usemorebits" in
3021 "$define"|true|[yY]*)
3023 uselongdouble="$define"
3024 usemorebits="$define"
3026 *) usemorebits="$undef"
3032 Perl can be built to take advantage of explicit 64-bit interfaces,
3033 on some systems. To do so, Configure must be run with -Duse64bits.
3035 If this doesn't make any sense to you, just accept the default 'n'.
3037 case "$use64bits" in
3038 $define|true|[yY]*) dflt='y';;
3041 rp='Try to use explicit 64-bit interfaces, if available?'
3054 case "$archname64" in
3055 '') archname64='' ;; # not a typo
3058 case "$use64bits" in
3059 "$define"|true|[yY]*)
3060 : Look for a hint-file generated 'call-back-unit'. If the
3061 : user has specified that a 64 bit perl is to be built,
3062 : we may need to set or change some other defaults.
3063 if $test -f use64bits.cbu; then
3064 echo "Your platform has some specific hints for 64-bit builds, using them..."
3068 (Your platform doesn't have any specific hints for 64-bit builds.
3069 This is probably okay, especially if your system is a true 64-bit system.)
3071 case "$gccversion" in
3074 But since you seem to be using gcc,
3075 I will now add -DUSE_LONG_LONG to the compilation flags.
3077 ccflags="$ccflags -DUSE_LONG_LONG"
3084 : determine the architecture name
3086 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3087 tarch=`arch`"-$osname"
3088 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3089 if uname -m > tmparch 2>&1 ; then
3090 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3091 -e 's/$/'"-$osname/" tmparch`
3099 case "$myarchname" in
3102 echo "(Your architecture name used to be $myarchname.)"
3109 *) dflt="$archname";;
3111 rp='What is your architecture name'
3114 case "$usethreads" in
3116 echo "Threads selected." >&4
3118 *-thread*) echo "...and architecture name already has -thread." >&4
3120 *) archname="$archname-thread"
3121 echo "...setting architecture name to $archname." >&4
3126 case "$usemultiplicity" in
3128 echo "Multiplicity selected." >&4
3130 *-multi*) echo "...and architecture name already has -multi." >&4
3132 *) archname="$archname-multi"
3133 echo "...setting architecture name to $archname." >&4
3138 case "$use64bits" in
3140 echo "Explicit 64-bitness selected." >&4
3141 case "$archname64" in
3146 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3148 *) archname="$archname-$archname64"
3149 echo "...setting architecture name to $archname." >&4
3156 : decide how portable to be. Allow command line overrides.
3157 case "$d_portable" in
3159 *) d_portable="$define" ;;
3162 : set up shell script to do ~ expansion
3168 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3171 if $test -f /bin/csh; then
3172 /bin/csh -f -c "glob \$1"
3177 name=\`$expr x\$1 : '..\([^/]*\)'\`
3178 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3179 if $test ! -d "\$dir"; then
3181 echo "\$me: can't locate home directory for: \$name" >&2
3186 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3202 : now set up to get a file name
3206 cat <<'EOSC' >>getfile
3222 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3223 fn=`echo $fn | sed 's/(.*)//'`
3229 loc_file=`expr $fn : '.*:\(.*\)'`
3230 fn=`expr $fn : '\(.*\):.*'`
3238 */*) fullpath=true;;
3247 *e*) exp_file=true;;
3250 *p*) nopath_ok=true;;
3255 *d*) type='Directory';;
3256 *l*) type='Locate';;
3261 Locate) what='File';;
3266 case "$d_portable" in
3274 while test "$type"; do
3279 true) rp="$rp (~name ok)";;
3282 if test -f UU/getfile.ok && \
3283 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3302 value=`UU/filexp $ans`
3305 if test "$ans" != "$value"; then
3306 echo "(That expands to $value on this system.)"
3320 /*) value="$ansexp" ;;
3325 echo "I shall only accept a full path name, as in /bin/ls." >&4
3326 echo "Use a ! shell escape if you wish to check pathnames." >&4
3329 echo "Please give a full path name, starting with slash." >&4
3332 echo "Note that using ~name is ok provided it expands well." >&4
3345 for fp in $gfpth; do
3346 if test "X$fp" = X.; then
3351 if test -f "$pf"; then
3353 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3355 echo "($value is not a plain file, but that's ok.)"
3358 if test X"$type" = X; then
3365 for fp in $gfpth; do
3366 if test "X$fp" = X.; then
3371 if test -d "$pf"; then
3379 if test -d "$ansexp"; then
3380 echo "(Looking for $loc_file in directory $value.)"
3381 value="$value/$loc_file"
3382 ansexp="$ansexp/$loc_file"
3384 if test -f "$ansexp"; then
3387 case "$nopath_ok" in
3388 true) case "$value" in
3390 *) echo "Assuming $value will be in people's path."
3406 if test "$fastread" = yes; then
3411 rp="$what $value doesn't exist. Use that name anyway?"
3430 test "X$gfpthkeep" != Xy && gfpth=""
3433 : determine root of directory hierarchy where package will be installed.
3436 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3444 By default, $package will be installed in $dflt/bin, manual pages
3445 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3446 installation directories. Typically this is something like /usr/local.
3447 If you wish to have binaries under /usr/bin but other parts of the
3448 installation under /usr/local, that's ok: you will be prompted
3449 separately for each of the installation directories, the prefix being
3450 only used to set the defaults.
3454 rp='Installation prefix to use?'
3462 *) oldprefix="$prefix";;
3472 $define|true) afs=true ;;
3473 $undef|false) afs=false ;;
3474 *) if test -d /afs; then
3482 echo "AFS may be running... I'll be extra cautious then..." >&4
3484 echo "AFS does not seem to be running..." >&4
3487 : determine installation prefix for where package is to be installed.
3491 Since you are running AFS, I need to distinguish the directory in which
3492 files will reside from the directory in which they are installed (and from
3493 which they are presumably copied to the former directory by occult means).
3496 case "$installprefix" in
3497 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3498 *) dflt="$installprefix";;
3503 In some special cases, particularly when building $package for distribution,
3504 it is convenient to distinguish between the directory in which files should
3505 be installed from the directory ($prefix) in which they
3506 will eventually reside. For most users, these two directories are the same.
3509 case "$installprefix" in
3511 *) dflt=$installprefix;;
3515 rp='What installation prefix should I use for installing files?'
3517 installprefix="$ans"
3518 installprefixexp="$ansexp"
3520 : set the prefixit variable, to compute a suitable default value
3521 prefixit='case "$3" in
3523 case "$oldprefix" in
3524 "") eval "$1=\"\$$2\"";;
3531 ""|" ") eval "$1=\"\$$2\"";;
3537 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3539 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3540 /*-$oldprefix/*|\~*-$oldprefix/*)
3541 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3542 *) eval "$1=\"\$$2\"";;
3546 : set the base revision
3549 : get the patchlevel
3551 echo "Getting the current patchlevel..." >&4
3552 if $test -r $rsrc/patchlevel.h;then
3553 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3554 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3559 $echo $n "(You have $package" $c
3562 *) $echo $n " $baserev" $c ;;
3564 $echo $n " patchlevel $patchlevel" $c
3565 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3568 if test 0 -eq "$subversion"; then
3569 version=`LC_ALL=C; export LC_ALL; \
3570 echo $baserev $patchlevel | \
3571 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3573 version=`LC_ALL=C; export LC_ALL; \
3574 echo $baserev $patchlevel $subversion | \
3575 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3577 : Figure out perl API version. Perhaps this should be in patchlevel.h
3578 if test "$subversion" -lt 50; then
3579 apiversion=`LC_ALL=C; export LC_ALL; \
3580 LANGUAGE=C; export LANGUAGE; \
3581 echo $baserev $patchlevel | \
3582 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3584 apiversion="$version"
3587 : determine installation style
3588 : For now, try to deduce it from prefix unless it is already set.
3589 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3590 case "$installstyle" in
3591 '') case "$prefix" in
3592 *perl*) dflt='lib';;
3593 *) dflt='lib/perl5' ;;
3596 *) dflt='lib/perl5' ;;
3598 : Probably not worth prompting for this since we prompt for all
3599 : the directories individually, and the prompt would be too long and
3603 : determine where private library files go
3604 : Usual default is /usr/local/lib/perl5/$version.
3605 : Also allow things like /opt/perl/lib/$version, since
3606 : /opt/perl/lib/perl5... would be redundant.
3607 : The default "style" setting is made in installstyle.U
3608 case "$installstyle" in
3609 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3610 *) set dflt privlib lib/$version ;;
3615 There are some auxiliary files for $package that need to be put into a
3616 private library directory that is accessible by everyone.
3620 rp='Pathname where the private library files will reside?'
3623 privlibexp="$ansexp"
3624 : Change installation prefix, if necessary.
3625 if $test X"$prefix" != X"$installprefix"; then
3626 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3628 installprivlib="$privlibexp"
3631 : set the prefixup variable, to restore leading tilda escape
3632 prefixup='case "$prefixexp" in
3634 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3637 : determine where public architecture dependent libraries go
3640 : privlib default is /usr/local/lib/$package/$version
3641 : archlib default is /usr/local/lib/$package/$version/$archname
3642 : privlib may have an optional trailing /share.
3643 tdflt=`echo $privlib | $sed 's,/share$,,'`
3644 tdflt=$tdflt/$archname
3653 $spackage contains architecture-dependent library files. If you are
3654 sharing libraries in a heterogeneous environment, you might store
3655 these files in a separate location. Otherwise, you can just include
3656 them with the rest of the public library files.
3660 rp='Where do you want to put the public architecture-dependent libraries?'
3663 archlibexp="$ansexp"
3664 if $test X"$archlib" = X"$privlib"; then
3669 : Change installation prefix, if necessary.
3670 if $test X"$prefix" != X"$installprefix"; then
3671 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3673 installarchlib="$archlibexp"
3677 : Binary compatibility with 5.005 is not possible for builds
3678 : with advanced features
3679 case "$usethreads$usemultiplicity" in
3681 bincompat5005="$undef"
3682 d_bincompat5005="$undef"
3686 Perl 5.006 can be compiled for binary compatibility with 5.005.
3687 If you decide to do so, you will be able to continue using most
3688 of the extensions that were compiled for Perl 5.005.
3691 case "$bincompat5005$d_bincompat5005" in
3692 *"$undef"*) dflt=n ;;
3695 rp='Binary compatibility with Perl 5.005?'
3698 y*) val="$define" ;;
3703 case "$d_bincompat5005" in
3705 bincompat5005="$define"
3707 *) bincompat5005="$undef"
3708 d_bincompat5005="$undef"
3715 : see if setuid scripts can be secure
3718 Some kernels have a bug that prevents setuid #! scripts from being
3719 secure. Some sites have disabled setuid #! scripts because of this.
3721 First let's decide if your kernel supports secure setuid #! scripts.
3722 (If setuid #! scripts would be secure but have been disabled anyway,
3723 don't say that they are secure if asked.)
3728 if $test -d /dev/fd; then
3729 echo "#!$ls" >reflect
3730 chmod +x,u+s reflect
3731 ./reflect >flect 2>&1
3732 if $contains "/dev/fd" flect >/dev/null; then
3733 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3737 If you are not sure if they are secure, I can check but I'll need a
3738 username and password different from the one you are using right now.
3739 If you don't have such a username or don't want me to test, simply
3743 rp='Other username to test security of setuid scripts with?'
3748 case "$d_suidsafe" in
3749 '') echo "I'll assume setuid scripts are *not* secure." >&4
3752 echo "Well, the $hint value is *not* secure." >&4
3754 *) echo "Well, the $hint value *is* secure." >&4
3759 $rm -f reflect flect
3760 echo "#!$ls" >reflect
3761 chmod +x,u+s reflect
3764 echo '"su" will (probably) prompt you for '"$ans's password."
3765 su $ans -c './reflect >flect'
3766 if $contains "/dev/fd" flect >/dev/null; then
3767 echo "Okay, it looks like setuid scripts are secure." >&4
3770 echo "I don't think setuid scripts are secure." >&4
3775 rp='Does your kernel have *secure* setuid scripts?'
3778 [yY]*) val="$define";;
3783 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3784 echo "(That's for file descriptors, not floppy disks.)"
3790 $rm -f reflect flect
3792 : now see if they want to do setuid emulation
3795 case "$d_suidsafe" in
3798 echo "No need to emulate SUID scripts since they are secure here." >& 4
3802 Some systems have disabled setuid scripts, especially systems where
3803 setuid scripts cannot be secure. On systems where setuid scripts have
3804 been disabled, the setuid/setgid bits on scripts are currently
3805 useless. It is possible for $package to detect those bits and emulate
3806 setuid/setgid in a secure fashion. This emulation will only work if
3807 setuid scripts have been disabled in your kernel.
3811 "$define") dflt=y ;;
3814 rp="Do you want to do setuid/setgid emulation?"
3817 [yY]*) val="$define";;
3825 : What should the include directory be ?
3827 $echo $n "Hmm... $c"
3831 if $test -f /bin/mips && /bin/mips; then
3832 echo "Looks like a MIPS system..."
3833 $cat >usr.c <<'EOCP'
3834 #ifdef SYSTYPE_BSD43
3838 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3839 dflt='/bsd43/usr/include'
3843 mips_type='System V'
3845 $rm -f usr.c usr.out
3846 echo "and you're compiling with the $mips_type compiler and libraries."
3850 echo "Doesn't look like a MIPS system."
3860 case "$xxx_prompt" in
3863 rp='Where are the include files you want to use?'
3871 : see how we invoke the C preprocessor
3873 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3874 cat <<'EOT' >testcpp.c
3880 if test ! -f cppstdin; then
3881 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3882 # AIX cc -E doesn't show the absolute headerfile
3883 # locations but we'll cheat by using the -M flag.
3884 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
3886 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3889 echo "Keeping your $hint cppstdin wrapper."
3892 wrapper=`pwd`/cppstdin
3896 if $test "X$cppstdin" != "X" && \
3897 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3898 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3900 echo "You used to use $cppstdin $cppminus so we'll use that again."
3902 '') echo "But let's see if we can live without a wrapper..." ;;
3904 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3905 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3907 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3910 echo "(However, $cpprun $cpplast does not work, let's see...)"
3918 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3925 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3926 $cc -E <testcpp.c >testcpp.out 2>&1; \
3927 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3928 echo "Yup, it does."
3931 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3932 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3933 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3934 echo "Yup, it does."
3937 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3938 $cc -P <testcpp.c >testcpp.out 2>&1; \
3939 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3940 echo "Yipee, that works!"
3943 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3944 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3945 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3946 echo "At long last!"
3949 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3950 $cpp <testcpp.c >testcpp.out 2>&1; \
3951 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3955 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3956 $cpp - <testcpp.c >testcpp.out 2>&1; \
3957 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3958 echo "Hooray, it works! I was beginning to wonder."
3961 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3962 $wrapper <testcpp.c >testcpp.out 2>&1; \
3963 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3969 rp="No dice. I can't find a C preprocessor. Name one:"
3973 $x_cpp <testcpp.c >testcpp.out 2>&1
3974 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3975 echo "OK, that will do." >&4
3977 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3992 echo "Perhaps can we force $cc -E using a wrapper..."
3993 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3994 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4000 echo "Nope, we'll have to live without it..."
4014 "$wrapper"|'cppstdin') ;;
4015 *) $rm -f $wrapper;;
4017 $rm -f testcpp.c testcpp.out
4019 : Set private lib path
4022 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4027 '') dlist="$loclibpth $plibpth $glibpth";;
4028 *) dlist="$libpth";;
4031 : Now check and see which directories actually exist, avoiding duplicates
4035 if $test -d $xxx; then
4038 *) libpth="$libpth $xxx";;
4044 Some systems have incompatible or broken versions of libraries. Among
4045 the directories listed in the question below, please remove any you
4046 know not to be holding relevant libraries, and add any that are needed.
4047 Say "none" for none.
4058 rp="Directories to use for library searches?"
4065 : compute shared library extension
4068 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4078 On some systems, shared libraries may be available. Answer 'none' if
4079 you want to suppress searching of shared libraries for the remaining
4080 of this configuration.
4083 rp='What is the file extension used for shared libraries?'
4087 : Define several unixisms.
4088 : Hints files or command line option can be used to override them.
4089 : The convoluted testing is in case hints files set either the old
4092 '') case "$exe_ext" in
4094 *) _exe="$exe_ext" ;;
4099 '') case "$lib_ext" in
4106 '') case "$obj_ext" in
4113 '') case "$path_sep" in
4124 : Which makefile gets called first. This is used by make depend.
4125 case "$firstmakefile" in
4126 '') firstmakefile='makefile';;
4131 Perl can be built to use the SOCKS proxy protocol library. To do so,
4132 Configure must be run with -Dusesocks.
4134 Normally you do not need this and you should answer no.
4138 $define|true|[yY]*) dflt='y';;
4141 rp='Build Perl for SOCKS?'
4144 y|Y) val="$define" ;;
4150 : Looking for optional libraries
4152 echo "Checking for optional libraries..." >&4
4157 case "$libswanted" in
4158 '') libswanted='c_s';;
4162 libswanted="$libswanted socks5 socks5_sh"
4165 for thislib in $libswanted; do
4167 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4168 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4169 echo "Found -l$thislib (shared)."
4172 *) dflt="$dflt -l$thislib";;
4174 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4175 echo "Found -l$thislib (shared)."
4178 *) dflt="$dflt -l$thislib";;
4180 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4181 echo "Found -l$thislib."
4184 *) dflt="$dflt -l$thislib";;
4186 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4187 echo "Found -l$thislib."
4190 *) dflt="$dflt -l$thislib";;
4192 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4193 echo "Found -l${thislib}_s."
4196 *) dflt="$dflt -l${thislib}_s";;
4198 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4199 echo "Found -l$thislib."
4202 *) dflt="$dflt -l$thislib";;
4205 echo "No -l$thislib."
4216 ' '|'') dflt='none';;
4221 In order to compile $package on your machine, a number of libraries
4222 are usually needed. Include any other special libraries here as well.
4223 Say "none" for none. The default list is almost always right.
4227 rp="What libraries to use?"
4234 : determine optimization, if desired, or use for debug flag also
4236 ' '|$undef) dflt='none';;
4238 *) dflt="$optimize";;
4242 By default, $package compiles with the -O flag to use the optimizer.
4243 Alternately, you might want to use the symbolic debugger, which uses
4244 the -g flag (on traditional Unix systems). Either flag can be
4245 specified here. To use neither flag, specify the word "none".
4248 rp="What optimizer/debugger flag should be used?"
4252 'none') optimize=" ";;
4256 : We will not override a previous value, but we might want to
4257 : augment a hint file
4259 default|recommended)
4260 case "$gccversion" in
4261 1*) dflt='-fpcc-struct-return' ;;
4264 *-g*) dflt="$dflt -DDEBUGGING";;
4266 case "$gccversion" in
4267 2*) if test -d /etc/conf/kconfig.d &&
4268 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4274 case "$gccversion" in
4278 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4279 echo 'int main(void) { return 0; }' > gcctest.c
4280 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4281 echo "Yes, it does." 2>&1
4284 echo "Leaving current flags $ccflags alone." 2>&1
4286 *) dflt="$dflt -fno-strict-aliasing" ;;
4289 echo "Nope, it doesn't, but that's ok." 2>&1
4296 case "$mips_type" in
4297 *BSD*|'') inclwanted="$locincpth $usrinc";;
4298 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4300 for thisincl in $inclwanted; do
4301 if $test -d $thisincl; then
4302 if $test x$thisincl != x$usrinc; then
4305 *) dflt="$dflt -I$thisincl";;
4311 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4313 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4321 *) dflt="$dflt -D$2";;
4325 set signal.h LANGUAGE_C; eval $inctest
4329 ccflags="$ccflags -DSOCKS"
4334 default|recommended) dflt="$ccflags $dflt" ;;
4335 *) dflt="$ccflags";;
4343 Your C compiler may want other flags. For this question you should include
4344 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4345 but you should NOT include libraries or ld flags like -lwhatever. If you
4346 want $package to honor its debug switch, you should include -DDEBUGGING here.
4347 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4349 To use no flags, specify the word "none".
4355 rp="Any additional cc flags?"
4362 : the following weeds options from ccflags that are of no interest to cpp
4364 case "$gccversion" in
4365 1*) cppflags="$cppflags -D__GNUC__"
4367 case "$mips_type" in
4369 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4375 echo "Let me guess what the preprocessor flags are..." >&4
4389 *) ftry="$previous $flag";;
4391 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4392 >cpp1.out 2>/dev/null && \
4393 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4394 >cpp2.out 2>/dev/null && \
4395 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4396 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4398 cppflags="$cppflags $ftry"
4408 *-*) echo "They appear to be: $cppflags";;
4410 $rm -f cpp.c cpp?.out
4414 : flags used in final linking phase
4416 '') if ./venix; then
4422 *-posix*) dflt="$dflt -posix" ;;
4425 *) dflt="$ldflags";;
4428 : Try to guess additional flags to pick up local libraries.
4429 for thislibdir in $libpth; do
4430 case " $loclibpth " in
4433 *"-L$thislibdir "*) ;;
4434 *) dflt="$dflt -L$thislibdir" ;;
4446 Your C linker may need flags. For this question you should
4447 include -L/whatever and any other flags used by the C linker, but you
4448 should NOT include libraries like -lwhatever.
4450 Make sure you include the appropriate -L/path flags if your C linker
4451 does not normally search all of the directories you specified above,
4454 To use no flags, specify the word "none".
4458 rp="Any additional ld flags (NOT including libraries)?"
4464 rmlist="$rmlist pdp11"
4468 echo "Checking your choice of C compiler and flags for coherency..." >&4
4469 $cat > try.c <<'EOF'
4471 int main() { printf("Ok\n"); exit(0); }
4473 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4475 $cat >try.msg <<'EOM'
4476 I've tried to compile and run the following simple program:
4479 $cat try.c >> try.msg
4481 $cat >> try.msg <<EOM
4488 and I got the following output:
4492 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4493 if sh -c './try' >>try.msg 2>&1; then
4497 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4500 cat >> try.msg <<'EOQS'
4501 If $libs contains -lsfio, and sfio is mis-configured, then it
4502 sometimes (apparently) runs and exits with a 0 status, but with no
4503 output! It may have to do with sfio's use of _exit vs. exit.
4506 rp="You have a big problem. Shall I abort Configure"
4513 echo "The program compiled OK, but exited with status $?." >>try.msg
4514 rp="You have a problem. Shall I abort Configure"
4518 echo "I can't compile the test program." >>try.msg
4519 rp="You have a BIG problem. Shall I abort Configure"
4525 case "$knowitall" in
4527 echo "(The supplied flags or libraries might be incorrect.)"
4535 *) echo "Ok. Stopping Configure." >&4
4540 n) echo "OK, that should do.";;
4542 $rm -f try try.* core
4544 : determine filename position in cpp output
4546 echo "Computing filename position in cpp output for #include directives..." >&4
4547 echo '#include <stdio.h>' > foo.c
4550 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4551 $grep '^[ ]*#.*stdio\.h' | \
4552 while read cline; do
4555 while $test \$# -gt 0; do
4556 if $test -r \`echo \$1 | $tr -d '"'\`; then
4561 pos=\`expr \$pos + 1\`
4573 *) pos="${fieldn}th";;
4575 echo "Your cpp writes the filename in the $pos field of the line."
4577 : locate header file
4582 for usrincdir in $usrinc
4584 if test -f \$usrincdir/\$wanted; then
4585 echo "\$usrincdir/\$wanted"
4589 awkprg='{ print \$$fieldn }'
4590 echo "#include <\$wanted>" > foo\$\$.c
4591 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4592 $grep "^[ ]*#.*\$wanted" | \
4593 while read cline; do
4594 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4596 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4597 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4602 # status = 0: grep returned 0 lines, case statement not executed
4603 # status = 1: headerfile found
4604 # status = 2: while loop executed, no headerfile found
4608 if test \$status -eq 1; then
4615 : define an alternate in-header-list? function
4616 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4617 cont=true; xxf="echo \"<\$1> found.\" >&4";
4618 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4619 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4621 case $# in 4) instead=instead;; *) instead="at last";; esac;
4622 while $test "$cont"; do
4624 var=$2; eval "was=\$$2";
4625 if $test "$xxx" && $test -r "$xxx";
4627 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4630 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4631 set $yyy; shift; shift; yyy=$@;
4632 case $# in 0) cont="";;
4633 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4634 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4635 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4636 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4640 do set $yyy; var=$2; eval "was=\$$2";
4641 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4642 set $yyy; shift; shift; yyy=$@;
4645 : see if this is a malloc.h system
4646 set malloc.h i_malloc
4649 : see if stdlib is available
4650 set stdlib.h i_stdlib
4653 : determine which malloc to compile in
4655 case "$usemymalloc" in
4656 ''|[yY]*|true|$define) dflt='y' ;;
4659 rp="Do you wish to attempt to use the malloc that comes with $package?"
4665 mallocsrc='malloc.c'
4666 mallocobj="malloc$_o"
4667 d_mymalloc="$define"
4670 : Remove malloc from list of libraries to use
4671 echo "Removing unneeded -lmalloc from library list" >&4
4672 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4675 echo "libs = $libs" >&4
4687 : compute the return types of malloc and free
4689 $cat >malloc.c <<END
4693 #include <sys/types.h>
4707 case "$malloctype" in
4709 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4716 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4720 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4727 echo "Your system uses $freetype free(), it would seem." >&4
4731 The installation process will also create a directory for
4732 vendor-supplied add-ons. Vendors who supply perl with their system
4733 may find it convenient to place all vendor-supplied files in this
4734 directory rather than in the main distribution directory. This will
4735 ease upgrades between binary-compatible maintenance versions of perl.
4737 Of course you may also use these directories in whatever way you see
4738 fit. For example, you might use them to access modules shared over a
4739 company-wide network.
4741 The default answer should be fine for most people.
4742 This causes further questions about vendor add-ons to be skipped
4743 and no vendor-specific directories will be configured for perl.
4746 rp='Do you want to configure vendor-specific add-on directories?'
4747 case "$usevendorprefix" in
4748 define|true|[yY]*) dflt=y ;;
4754 rp='Installation prefix to use for vendor-supplied add-ons?'
4755 case "$vendorprefix" in
4757 *) dflt=$vendorprefix ;;
4761 case "$vendorprefix" in
4765 *) oldvendorprefix="$prefix";;
4769 usevendorprefix="$define"
4771 vendorprefixexp="$ansexp"
4773 *) usevendorprefix="$undef"
4779 case "$vendorprefix" in
4780 '') d_vendorlib="$undef"
4784 *) d_vendorlib="$define"
4785 : determine where vendor-supplied modules go.
4786 : Usual default is /usr/local/lib/perl5/vendor_perl
4787 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4788 case "$installstyle" in
4789 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4790 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4793 rp='Pathname for the vendor-supplied library files?'
4796 vendorlibexp="$ansexp"
4797 : Change installation prefix, if necessary.
4798 if $test X"$prefix" != X"$installprefix"; then
4799 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4801 installvendorlib="$vendorlibexp"
4806 : Cruising for prototypes
4808 echo "Checking out function prototypes..." >&4
4809 $cat >prototype.c <<'EOCP'
4810 int main(int argc, char *argv[]) {
4813 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4814 echo "Your C compiler appears to support function prototypes."
4817 echo "Your C compiler doesn't seem to understand function prototypes."
4824 case "$prototype" in
4826 *) ansi2knr='ansi2knr'
4831 This version of $package can only be compiled by a compiler that
4832 understands function prototypes. Unfortunately, your C compiler
4834 doesn't seem to understand them. Sorry about that.
4836 If GNU cc is available for your system, perhaps you could try that instead.
4838 Eventually, we hope to support building Perl with pre-ANSI compilers.
4839 If you would like to help in that effort, please contact <perlbug@perl.org>.
4841 Aborting Configure now.
4847 : determine where public executables go
4852 rp='Pathname where the public executables will reside?'
4854 if $test "X$ansexp" != "X$binexp"; then
4859 : Change installation prefix, if necessary.
4860 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4861 if $test X"$prefix" != X"$installprefix"; then
4862 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4864 installbin="$binexp"
4867 : determine whether to install perl also as /usr/bin/perl
4870 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4872 Many scripts expect to perl to be installed as /usr/bin/perl.
4873 I can install the perl you are about to compile also as /usr/bin/perl
4874 (in addition to $installbin/perl).
4876 case "$installusrbinperl" in
4877 "$undef"|[nN]*) dflt='n';;
4880 rp="Do you want to install perl as /usr/bin/perl?"
4883 [yY]*) val="$define";;
4889 set installusrbinperl
4892 : define a shorthand compile call
4896 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4897 : define a shorthand compile call for compilations that should be ok.
4901 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4904 echo "Checking for GNU C Library..." >&4
4905 cat >gnulibc.c <<EOM
4917 if eval $compile_ok && ./gnulibc; then
4919 echo "You are using the GNU C Library"
4922 echo "You are not using the GNU C Library"
4928 : see if nm is to be used to determine whether a symbol is defined or not
4932 case "$d_gnulibc" in
4935 echo "nm probably won't work on the GNU C Library." >&4
4941 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4943 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4944 echo "'nm' won't be sufficient on this sytem." >&4
4950 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4951 if $test $dflt -gt 20; then
4961 true|$define) dflt=y;;
4968 I can use $nm to extract the symbols from your C libraries. This
4969 is a time consuming task which may generate huge output on the disk (up
4970 to 3 megabytes) but that should make the symbols extraction faster. The
4971 alternative is to skip the 'nm' extraction part and to compile a small
4972 test program instead to determine whether each symbol is present. If
4973 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4974 this may be the best solution.
4976 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4979 rp="Shall I use $nm to extract C symbols from the libraries?"
4982 [Nn]*) usenm=false;;
4991 : nm options which may be necessary
4993 '') if $test -f /mach_boot; then
4995 elif $test -d /usr/ccs/lib; then
4996 nm_opt='-p' # Solaris (and SunOS?)
4997 elif $test -f /dgux; then
4999 elif $test -f /lib64/rld; then
5000 nm_opt='-p' # 64-bit Irix
5006 : nm options which may be necessary for shared libraries but illegal
5007 : for archive libraries. Thank you, Linux.
5008 case "$nm_so_opt" in
5009 '') case "$myuname" in
5011 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5012 nm_so_opt='--dynamic'
5021 : get list of predefined functions in a handy place
5026 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5033 *) for thislib in $libs; do
5036 : Handle C library specially below.
5039 thislib=`echo $thislib | $sed -e 's/^-l//'`
5040 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5042 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5044 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5046 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5048 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5050 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5052 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5057 libnames="$libnames $try"
5059 *) libnames="$libnames $thislib" ;;
5068 for xxx in $libpth; do
5069 $test -r $1 || set $xxx/libc.$so
5070 : The messy sed command sorts on library version numbers.
5072 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5073 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5075 s/[0-9][0-9]*/0000&/g
5076 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5079 sort | $sed -e 's/^.* //'`
5082 $test -r $1 || set /usr/ccs/lib/libc.$so
5083 $test -r $1 || set /lib/libsys_s$_a
5089 if $test -r "$1"; then
5090 echo "Your (shared) C library seems to be in $1."
5092 elif $test -r /lib/libc && $test -r /lib/clib; then
5093 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5095 libc='/lib/clib /lib/libc'
5096 if $test -r /lib/syslib; then
5097 echo "(Your math library is in /lib/syslib.)"
5098 libc="$libc /lib/syslib"
5100 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5101 echo "Your C library seems to be in $libc, as you said before."
5102 elif $test -r $incpath/usr/lib/libc$_a; then
5103 libc=$incpath/usr/lib/libc$_a;
5104 echo "Your C library seems to be in $libc. That's fine."
5105 elif $test -r /lib/libc$_a; then
5107 echo "Your C library seems to be in $libc. You're normal."
5109 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5111 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5112 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5113 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5115 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5117 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5120 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5122 if $test -r "$tans"; then
5123 echo "Your C library seems to be in $tans, of all places."
5129 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5133 If the guess above is wrong (which it might be if you're using a strange
5134 compiler, or your machine supports multiple models), you can override it here.
5139 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5141 I can't seem to find your C library. I've looked in the following places:
5144 $sed 's/^/ /' libpath
5147 None of these seems to contain your C library. I need to get its name...
5152 rp='Where is your C library?'
5157 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5158 set X `cat libnames`
5161 case $# in 1) xxx=file; esac
5162 echo "Extracting names from the following $xxx for later perusal:" >&4
5164 $sed 's/^/ /' libnames >&4
5166 $echo $n "This may take a while...$c" >&4
5170 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5171 *) $nm $nm_opt $file 2>/dev/null;;
5176 $grep fprintf libc.tmp > libc.ptf
5177 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5178 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5180 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5182 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5184 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5186 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5188 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5190 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5192 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5194 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5196 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5198 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5200 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5202 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5204 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5205 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5207 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5209 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5211 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5213 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5215 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5217 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5219 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5221 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5223 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5225 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5227 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5229 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5231 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5233 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5235 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5238 $nm -p $* 2>/dev/null >libc.tmp
5239 $grep fprintf libc.tmp > libc.ptf
5240 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5241 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5247 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5249 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5250 for thisname in $libnames $libc; do
5251 $ar t $thisname >>libc.tmp
5253 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5255 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5256 # Repeat libc to extract forwarders to DLL entries too
5257 for thisname in $libnames $libc; do
5258 $ar tv $thisname >>libc.tmp
5259 # Revision 50 of EMX has bug in $ar.
5260 # it will not extract forwarders to DLL entries
5261 # Use emximp which will extract exactly them.
5262 emximp -o tmp.imp $thisname \
5264 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5265 < tmp.imp >>libc.tmp
5268 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5271 echo "$ar didn't seem to work right." >&4
5272 echo "Maybe this is a Cray...trying bld instead..." >&4
5273 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5275 for thisname in $libnames; do
5277 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5278 $ar t $thisname >>libc.tmp
5282 echo "That didn't work either. Giving up." >&4
5289 if $test -f /lib/syscalls.exp; then
5291 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5292 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5296 $rm -f libnames libpath
5298 : see if dld is available
5302 : is a C symbol defined?
5305 -v) tf=libc.tmp; tc=""; tdc="";;
5306 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5307 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5310 case "$reuseval-$4" in
5312 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5318 if $contains $tlook $tf >/dev/null 2>&1;
5323 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5324 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5332 $define) tval=true;;
5338 : define an is-in-libc? function
5339 inlibc='echo " "; td=$define; tu=$undef;
5340 sym=$1; var=$2; eval "was=\$$2";
5342 case "$reuseval$was" in
5352 echo "$sym() found." >&4;
5353 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5355 echo "$sym() NOT found." >&4;
5356 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5360 $define) echo "$sym() found." >&4;;
5361 *) echo "$sym() NOT found." >&4;;
5365 : see if dlopen exists
5372 : determine which dynamic loading, if any, to compile in
5374 dldir="ext/DynaLoader"
5387 $define) dflt='y' ;;
5390 $define) dflt='y' ;;
5392 : Does a dl_xxx.xs file exist for this operating system
5393 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5396 rp="Do you wish to use dynamic loading?"
5403 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5404 dflt="$dldir/dl_${osname}.xs"
5405 elif $test "$d_dlopen" = "$define" ; then
5406 dflt="$dldir/dl_dlopen.xs"
5407 elif $test "$i_dld" = "$define" ; then
5408 dflt="$dldir/dl_dld.xs"
5413 *) dflt="$dldir/$dlsrc"
5416 echo "The following dynamic loading files are available:"
5417 : Can not go over to $dldir because getfile has path hard-coded in.
5418 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5419 rp="Source file to use for dynamic loading"
5425 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5429 Some systems may require passing special flags to $cc -c to
5430 compile modules that will be used to create a shared library.
5431 To use no flags, say "none".
5434 case "$cccdlflags" in
5435 '') case "$gccversion" in
5436 '') case "$osname" in
5438 next) dflt='none' ;;
5439 irix*) dflt='-KPIC' ;;
5440 svr4*|esix*|solaris) dflt='-KPIC' ;;
5441 sunos) dflt='-pic' ;;
5445 *) case "$osname" in
5446 svr4*|esix*|solaris) dflt='-fPIC' ;;
5451 *) dflt="$cccdlflags" ;;
5453 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5456 none) cccdlflags=' ' ;;
5457 *) cccdlflags="$ans" ;;
5462 Some systems use ld to create libraries that can be dynamically loaded,
5463 while other systems (such as those using ELF) use $cc.
5467 '') $cat >try.c <<'EOM'
5468 /* Test for whether ELF binaries are produced */
5473 int i = open("a.out",O_RDONLY);
5476 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5477 exit(0); /* succeed (yes, it's ELF) */
5482 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5484 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5488 echo "I'll use ld to build dynamic libraries."
5497 rp="What command should be used to create dynamic libraries?"
5503 Some systems may require passing special flags to $ld to create a
5504 library that can be dynamically loaded. If your ld flags include
5505 -L/other/path options to locate libraries outside your loader's normal
5506 search path, you may need to specify those -L options here as well. To
5507 use no flags, say "none".
5510 case "$lddlflags" in
5511 '') case "$osname" in
5512 beos) dflt='-nostart' ;;
5514 linux|irix*) dflt='-shared' ;;
5515 next) dflt='none' ;;
5516 solaris) dflt='-G' ;;
5517 sunos) dflt='-assert nodefinitions' ;;
5518 svr4*|esix*) dflt="-G $ldflags" ;;
5522 *) dflt="$lddlflags" ;;
5525 : Try to guess additional flags to pick up local libraries.
5526 : Be careful not to append to a plain 'none'
5530 for thisflag in $ldflags; do
5535 *) dflt="$dflt $thisflag" ;;
5542 ''|' ') dflt='none' ;;
5545 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5548 none) lddlflags=' ' ;;
5549 *) lddlflags="$ans" ;;
5554 Some systems may require passing special flags to $cc to indicate that
5555 the resulting executable will use dynamic linking. To use no flags,
5559 case "$ccdlflags" in
5560 '') case "$osname" in
5561 hpux) dflt='-Wl,-E' ;;
5562 linux) dflt='-rdynamic' ;;
5563 next) dflt='none' ;;
5564 sunos) dflt='none' ;;
5568 *) dflt="$ccdlflags" ;;
5570 rp="Any special flags to pass to $cc to use dynamic loading?"
5573 none) ccdlflags=' ' ;;
5574 *) ccdlflags="$ans" ;;
5588 # No dynamic loading being used, so don't bother even to prompt.
5591 *) case "$useshrplib" in
5592 '') case "$osname" in
5593 svr4*|dgux|dynixptx|esix|powerux|beos)
5595 also='Building a shared libperl is required for dynamic loading to work on your system.'
5600 also='Building a shared libperl is needed for MAB support.'
5618 The perl executable is normally obtained by linking perlmain.c with
5619 libperl${_a}, any static extensions (usually just DynaLoader), and
5620 any other libraries needed on this system (such as -lm, etc.). Since
5621 your system supports dynamic loading, it is probably possible to build
5622 a shared libperl.$so. If you will have more than one executable linked
5623 to libperl.$so, this will significantly reduce the size of each
5624 executable, but it may have a noticeable affect on performance. The
5625 default is probably sensible for your system.
5629 rp="Build a shared libperl.$so (y/n)"
5633 useshrplib='true' ;;
5634 *) useshrplib='false' ;;
5639 case "$useshrplib" in
5643 # Figure out a good name for libperl.so. Since it gets stored in
5644 # a version-specific architecture-dependent library, the version
5645 # number isn't really that important, except for making cc/ld happy.
5647 # A name such as libperl.so.3.1
5648 majmin="libperl.$so.$patchlevel.$subversion"
5649 # A name such as libperl.so.301
5650 majonly=`echo $patchlevel $subversion |
5651 $awk '{printf "%d%02d", $1, $2}'`
5652 majonly=libperl.$so.$majonly
5653 # I'd prefer to keep the os-specific stuff here to a minimum, and
5654 # rely on figuring it out from the naming of libc.
5655 case "${osname}${osvers}" in
5658 # XXX How handle the --version stuff for MAB?
5660 linux*) # ld won't link with a bare -lperl otherwise.
5663 *) # Try to guess based on whether libc has major.minor.
5665 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5666 *libc.$so.[0-9]*) dflt=$majonly ;;
5667 *) dflt=libperl.$so ;;
5677 I need to select a good name for the shared libperl. If your system uses
5678 library names with major and minor numbers, then you might want something
5679 like $majmin. Alternatively, if your system uses a single version
5680 number for shared libraries, then you might want to use $majonly.
5681 Or, your system might be quite happy with a simple libperl.$so.
5683 Since the shared libperl will get installed into a version-specific
5684 architecture-dependent directory, the version number of the shared perl
5685 library probably isn't important, so the default should be o.k.
5688 rp='What name do you want to give to the shared libperl?'
5691 echo "Ok, I'll use $libperl"
5694 libperl="libperl${_a}"
5698 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5702 WARNING: Use of the shrpdir variable for the installation location of
5703 the shared $libperl is not supported. It was never documented and
5704 will not work in this version. Let me (perlbug@perl.com)
5705 know of any problems this may cause.
5711 But your current setting of $shrpdir is
5712 the default anyway, so it's harmless.
5717 Further, your current attempted setting of $shrpdir
5718 conflicts with the value of $archlibexp/CORE
5719 that installperl will use.
5726 # How will the perl executable find the installed shared $libperl?
5727 # Add $xxx to ccdlflags.
5728 # If we can't figure out a command-line option, use $shrpenv to
5729 # set env LD_RUN_PATH. The main perl makefile uses this.
5730 shrpdir=$archlibexp/CORE
5733 if "$useshrplib"; then
5736 # We'll set it in Makefile.SH...
5742 xxx="-Wl,-R$shrpdir"
5744 linux|irix*|dec_osf)
5745 xxx="-Wl,-rpath,$shrpdir"
5748 # next doesn't like the default...
5751 # beos doesn't like the default, either.
5754 # hpux doesn't like the default, either.
5755 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5758 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5764 # Only add $xxx if it isn't already in ccdlflags.
5765 case " $ccdlflags " in
5767 *) ccdlflags="$ccdlflags $xxx"
5770 Adding $xxx to the flags
5771 passed to $ld so that the perl executable will find the
5772 installed shared $libperl.
5780 # Fix ccdlflags in AIX for building external extensions.
5781 # (For building Perl itself bare -bE:perl.exp is needed,
5782 # Makefile.SH takes care of this.)
5784 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5786 # Respect a hint or command-line value.
5788 '') shrpenv="$tmp_shrpenv" ;;
5790 case "$ldlibpthname" in
5791 '') ldlibpthname=LD_LIBRARY_PATH ;;
5792 none) ldlibpthname='' ;;
5795 : determine where manual pages go
5796 set man1dir man1dir none
5800 $spackage has manual pages available in source form.
5804 echo "However, you don't have nroff, so they're probably useless to you."
5806 '') man1dir="none";;
5809 echo "If you don't want the manual sources installed, answer 'none'."
5814 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5815 lookpath="$lookpath $prefixexp/man/p_man/man1"
5816 lookpath="$lookpath $prefixexp/man/u_man/man1"
5817 lookpath="$lookpath $prefixexp/man/man.1"
5819 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5820 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5830 rp="Where do the main $spackage manual pages (source) go?"
5832 if $test "X$man1direxp" != "X$ansexp"; then
5836 man1direxp="$ansexp"
5842 : Change installation prefix, if necessary.
5843 if $test X"$prefix" != X"$installprefix"; then
5844 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5846 installman1dir="$man1direxp"
5849 : What suffix to use on installed man pages
5856 rp="What suffix should be used for the main $spackage man pages?"
5858 '') case "$man1dir" in
5872 *) dflt="$man1ext";;
5879 : see if we can have long filenames
5881 rmlist="$rmlist /tmp/cf$$"
5882 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5883 first=123456789abcdef
5884 second=/tmp/cf$$/$first
5885 $rm -f $first $second
5886 if (echo hi >$first) 2>/dev/null; then
5887 if $test -f 123456789abcde; then
5888 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5891 if (echo hi >$second) 2>/dev/null; then
5892 if $test -f /tmp/cf$$/123456789abcde; then
5894 That's peculiar... You can have filenames longer than 14 characters, but only
5895 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5896 I shall consider your system cannot support long filenames at all.
5900 echo 'You can have filenames longer than 14 characters.' >&4
5905 How confusing! Some of your filesystems are sane enough to allow filenames
5906 longer than 14 characters but some others like /tmp can't even think about them.
5907 So, for now on, I shall assume your kernel does not allow them at all.
5914 You can't have filenames longer than 14 chars. You can't even think about them!
5920 $rm -rf /tmp/cf$$ 123456789abcde*
5922 : determine where library module manual pages go
5923 set man3dir man3dir none
5927 $spackage has manual pages for many of the library modules.
5933 However, you don't have nroff, so they're probably useless to you.
5936 '') man3dir="none";;
5940 case "$d_flexfnam" in
5943 However, your system can't handle the long file names like File::Basename.3.
5946 '') man3dir="none";;
5950 echo "If you don't want the manual sources installed, answer 'none'."
5951 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5953 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5954 if $test -d "$privlib/man/man3"; then
5957 WARNING: Previous versions of perl installed man3 pages into
5958 $privlib/man/man3. This version will suggest a
5959 new default of $dflt.
5963 rp='Do you wish to preserve the old behavior?(y/n)'
5966 y*) dflt="$privlib/man/man3" ;;
5972 *) dflt="$man3dir" ;;
5976 rp="Where do the $package library man pages (source) go?"
5979 man3direxp="$ansexp"
5985 : Change installation prefix, if necessary.
5986 if $test X"$prefix" != X"$installprefix"; then
5987 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
5989 installman3dir="$man3direxp"
5992 : What suffix to use on installed man pages
5998 rp="What suffix should be used for the $package library man pages?"
6000 '') case "$man3dir" in
6014 *) dflt="$man3ext";;
6021 : see if we have to deal with yellow pages, now NIS.
6022 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6023 if $test -f /usr/etc/nibindd; then
6025 echo "I'm fairly confident you're on a NeXT."
6027 rp='Do you get the hosts file via NetInfo?'
6036 y*) hostcat='nidump hosts .';;
6037 *) case "$hostcat" in
6038 nidump*) hostcat='';;
6048 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6056 rp='Are you getting the hosts file via yellow pages?'
6059 y*) hostcat='ypcat hosts';;
6060 *) hostcat='cat /etc/hosts';;
6066 '') hostcat='cat /etc/hosts';;
6069 '') groupcat='cat /etc/group';;
6072 '') passcat='cat /etc/passwd';;
6075 : now get the host name
6077 echo "Figuring out host name..." >&4
6078 case "$myhostname" in
6080 echo 'Maybe "hostname" will work...'
6081 if tans=`sh -c hostname 2>&1` ; then
6089 if $test "$cont"; then
6091 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6092 if tans=`cat /etc/systemid 2>&1` ; then
6094 phostname='cat /etc/systemid'
6095 echo "Whadyaknow. Xenix always was a bit strange..."
6098 elif $test -r /etc/systemid; then
6099 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6102 if $test "$cont"; then
6103 echo 'No, maybe "uuname -l" will work...'
6104 if tans=`sh -c 'uuname -l' 2>&1` ; then
6106 phostname='uuname -l'
6108 echo 'Strange. Maybe "uname -n" will work...'
6109 if tans=`sh -c 'uname -n' 2>&1` ; then
6111 phostname='uname -n'
6113 echo 'Oh well, maybe I can mine it out of whoami.h...'
6114 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6115 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6116 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6118 case "$myhostname" in
6119 '') echo "Does this machine have an identity crisis or something?"
6122 echo "Well, you said $myhostname before..."
6123 phostname='echo $myhostname';;
6129 : you do not want to know about this
6134 if $test "$myhostname" ; then
6136 rp='Your host name appears to be "'$myhostname'".'" Right?"
6144 : bad guess or no guess
6145 while $test "X$myhostname" = X ; do
6147 rp="Please type the (one word) name of your host:"
6152 : translate upper to lower if necessary
6153 case "$myhostname" in
6155 echo "(Normalizing case in your host name)"
6156 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6160 case "$myhostname" in
6162 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6163 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6164 echo "(Trimming domain name from host name--host name is now $myhostname)"
6166 *) case "$mydomain" in
6169 test "X$hostcat" = "Xypcat hosts" &&
6170 ypmatch "$myhostname" hosts 2>/dev/null |\
6171 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6174 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6175 /[ ]$myhostname[ . ]/p" > hosts
6178 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6179 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6180 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6181 hosts | $sort | $uniq | \
6182 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6183 case `$echo X$dflt` in
6184 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6187 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6192 tans=`./loc resolv.conf X /etc /usr/etc`
6193 if $test -f "$tans"; then
6194 echo "(Attempting domain name extraction from $tans)"
6195 dflt=.`$sed -n -e 's/ / /g' \
6196 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6197 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6199 .) dflt=.`$sed -n -e 's/ / /g' \
6200 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6201 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6208 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6209 dflt=.`sh -c domainname 2>/dev/null`
6212 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6217 .) echo "(Lost all hope -- silly guess then)"
6223 *) dflt="$mydomain";;
6227 rp="What is your domain name?"
6237 : translate upper to lower if necessary
6240 echo "(Normalizing case in your domain name)"
6241 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6245 : a little sanity check here
6246 case "$phostname" in
6249 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6250 $myhostname$mydomain|$myhostname) ;;
6252 case "$phostname" in
6254 echo "(That doesn't agree with your whoami.h file, by the way.)"
6257 echo "(That doesn't agree with your $phostname command, by the way.)"
6267 I need to get your e-mail address in Internet format if possible, i.e.
6268 something like user@host.domain. Please answer accurately since I have
6269 no easy means to double check it. The default value provided below
6270 is most probably close to the reality but may not be valid from outside
6271 your organization...
6275 while test "$cont"; do
6277 '') dflt="$cf_by@$myhostname$mydomain";;
6278 *) dflt="$cf_email";;
6280 rp='What is your e-mail address?'
6286 rp='Address does not look like an Internet one. Use it anyway?'
6302 If you or somebody else will be maintaining perl at your site, please
6303 fill in the correct e-mail address here so that they may be contacted
6304 if necessary. Currently, the "perlbug" program included with perl
6305 will send mail to this address in addition to perlbug@perl.com. You may
6306 enter "none" for no administrator.
6309 case "$perladmin" in
6310 '') dflt="$cf_email";;
6311 *) dflt="$perladmin";;
6313 rp='Perl administrator e-mail address'
6317 : figure out how to guarantee perl startup
6318 case "$startperl" in
6320 case "$sharpbang" in
6324 I can use the #! construct to start perl on your system. This will
6325 make startup of perl scripts faster, but may cause problems if you
6326 want to share those scripts and perl is not in a standard place
6327 ($binexp/perl) on all your platforms. The alternative is to force
6328 a shell by starting the script with a single ':' character.
6332 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6335 none) startperl=": # use perl";;
6336 *) startperl="#!$ans"
6337 if $test 30 -lt `echo "$ans" | wc -c`; then
6340 WARNING: Some systems limit the #! command to 32 characters.
6341 If you experience difficulty running Perl scripts with #!, try
6342 installing Perl in a directory with a shorter pathname.
6348 *) startperl=": # use perl"
6353 echo "I'll use $startperl to start perl scripts."
6355 : figure best path for perl in scripts
6358 perlpath="$binexp/perl"
6359 case "$startperl" in
6364 I will use the "eval 'exec'" idiom to start Perl on your system.
6365 I can use the full path of your Perl binary for this purpose, but
6366 doing so may cause problems if you want to share those scripts and
6367 Perl is not always in a standard place ($binexp/perl).
6371 rp="What path shall I use in \"eval 'exec'\"?"
6378 case "$startperl" in
6380 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6383 : determine where public executable scripts go
6384 set scriptdir scriptdir
6386 case "$scriptdir" in
6389 : guess some guesses
6390 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6391 $test -d /usr/share/bin && dflt=/usr/share/bin
6392 $test -d /usr/local/script && dflt=/usr/local/script
6393 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6394 $test -d $prefixexp/script && dflt=$prefixexp/script
6398 *) dflt="$scriptdir"
6403 Some installations have a separate directory just for executable scripts so
6404 that they can mount it across multiple architectures but keep the scripts in
6405 one spot. You might, for example, have a subdirectory of /usr/share for this.
6406 Or you might just lump your scripts in with all your other executables.
6410 rp='Where do you keep publicly executable scripts?'
6412 if $test "X$ansexp" != "X$scriptdirexp"; then
6416 scriptdirexp="$ansexp"
6417 : Change installation prefix, if necessary.
6418 if $test X"$prefix" != X"$installprefix"; then
6419 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6421 installscript="$scriptdirexp"
6426 After $package is installed, you may wish to install various
6427 add-on modules and utilities. Typically, these add-ons will
6428 be installed under $prefix with the rest
6429 of this package. However, you may wish to install such add-ons
6430 elsewhere under a different prefix.
6432 If you do not wish to put everything under a single prefix, that's
6433 ok. You will be prompted for the individual locations; this siteprefix
6434 is only used to suggest the defaults.
6436 The default should be fine for most people.
6440 rp='Installation prefix to use for add-on modules and utilities?'
6441 : XXX Here might be another good place for an installstyle setting.
6442 case "$siteprefix" in
6444 *) dflt=$siteprefix ;;
6448 case "$siteprefix" in
6453 *) oldsiteprefix="$prefix";;
6458 siteprefixexp="$ansexp"
6460 : determine where site specific libraries go.
6461 : Usual default is /usr/local/lib/perl5/site_perl
6462 : The default "style" setting is made in installstyle.U
6463 : XXX No longer works with Prefixit stuff.
6464 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6465 case "$installstyle" in
6466 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6467 *) dflt=$siteprefix/lib/site_$prog ;;
6471 The installation process will create a directory for
6472 site-specific extensions and modules. Most users find it convenient
6473 to place all site-specific files in this directory rather than in the
6474 main distribution directory.
6478 rp='Pathname for the site-specific library files?'
6481 sitelibexp="$ansexp"
6482 : Change installation prefix, if necessary.
6483 if $test X"$prefix" != X"$installprefix"; then
6484 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6486 installsitelib="$sitelibexp"
6489 : determine where site specific architecture-dependent libraries go.
6490 : sitelib default is /usr/local/lib/perl5/site_perl/
6491 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6492 : sitelib may have an optional trailing /share.
6493 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6494 tdflt="$tdflt/$apiversion/$archname"
6495 set sitearch sitearch none
6498 '') dflt="$tdflt" ;;
6499 *) dflt="$sitearch" ;;
6503 The installation process will also create a directory for
6504 architecture-dependent site-specific extensions and modules.
6508 rp='Pathname for the site-specific architecture-dependent library files?'
6511 sitearchexp="$ansexp"
6512 : Change installation prefix, if necessary.
6513 if $test X"$prefix" != X"$installprefix"; then
6514 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6516 installsitearch="$sitearchexp"
6521 "$define"|true|[yY]*)
6531 Perl can be built to take advantage of long doubles which
6532 (if available) may give more accuracy and range for floating point
6533 numbers. To do so, Configure must be run with -Duselongdouble.
6535 If this doesn't make any sense to you, just accept the default 'n'.
6537 case "$uselongdouble" in
6538 $define|true|[yY]*) dflt='y';;
6541 rp='Try to use long doubles if available?'
6544 y|Y) val="$define" ;;
6550 case "$uselongdouble" in
6551 "$define"|true|[yY]*)
6552 : Look for a hint-file generated 'call-back-unit'. If the
6553 : user has specified that long doubles should be used,
6554 : we may need to set or change some other defaults.
6555 if $test -f uselongdouble.cbu; then
6556 echo "Your platform has some specific hints for long doubles, using them..."
6557 . ./uselongdouble.cbu
6560 (Your platform doesn't have any specific hints for long doubles.)
6568 Previous version of $package used the standard IO mechanisms as defined
6569 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6570 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6571 the default. This abstraction layer can use AT&T's sfio (if you already
6572 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6573 problems with some extension modules. Using PerlIO with stdio is safe,
6574 but it is slower than plain stdio and therefore is not the default.
6576 If this doesn't make any sense to you, just accept the default 'n'.
6578 case "$useperlio" in
6579 $define|true|[yY]*) dflt='y';;
6582 rp='Use the experimental PerlIO abstraction layer?'
6589 echo "Ok, doing things the stdio way"
6596 : Check how to convert floats to strings.
6597 if test "X$d_Gconvert" = X; then
6599 echo "Checking for an efficient way to convert floats to strings."
6602 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6603 char *myname = "gconvert";
6606 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6607 char *myname = "gcvt";
6610 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6611 char *myname = "sprintf";
6617 checkit(expect, got)
6621 if (strcmp(expect, got)) {
6622 printf("%s oddity: Expected %s, got %s\n",
6623 myname, expect, got);
6633 /* This must be 1st test on (which?) platform */
6634 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6635 Gconvert(0.1, 8, 0, buf);
6636 checkit("0.1", buf);
6638 Gconvert(1.0, 8, 0, buf);
6641 Gconvert(0.0, 8, 0, buf);
6644 Gconvert(-1.0, 8, 0, buf);
6647 /* Some Linux gcvt's give 1.e+5 here. */
6648 Gconvert(100000.0, 8, 0, buf);
6649 checkit("100000", buf);
6651 /* Some Linux gcvt's give -1.e+5 here. */
6652 Gconvert(-100000.0, 8, 0, buf);
6653 checkit("-100000", buf);
6658 case "$d_Gconvert" in
6659 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6660 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6661 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6662 *) xxx_list='gconvert gcvt sprintf' ;;
6665 for xxx_convert in $xxx_list; do
6666 echo "Trying $xxx_convert"
6668 set try -DTRY_$xxx_convert
6669 if eval $compile; then
6670 echo "$xxx_convert" found. >&4
6672 echo "I'll use $xxx_convert to convert floats into a string." >&4
6675 echo "...But $xxx_convert didn't work as I expected."
6678 echo "$xxx_convert NOT found." >&4
6682 case "$xxx_convert" in
6683 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6684 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6685 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6689 : see if inttypes.h is available
6690 : we want a real compile instead of Inhdr because some systems
6691 : have an inttypes.h which includes non-existent headers
6694 #include <inttypes.h>
6696 static int32_t foo32 = 0x12345678;
6700 if eval $compile; then
6701 echo "<inttypes.h> found." >&4
6704 echo "<inttypes.h> NOT found." >&4
6712 case "$use64bits" in
6715 echo $n "Checking to see if your system supports int64_t...$c" >&4
6717 #include <sys/types.h>
6718 #$i_inttypes I_INTTYPES
6720 #include <inttypes.h>
6722 int64_t foo() { int64_t x; x = 7; return x; }
6724 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6726 echo " Yup, it does." >&4
6729 echo " Nope, it doesn't." >&4
6740 : check for lengths of integral types
6744 echo "Checking to see how big your integers are..." >&4
6745 $cat >intsize.c <<'EOCP'
6749 printf("intsize=%d;\n", sizeof(int));
6750 printf("longsize=%d;\n", sizeof(long));
6751 printf("shortsize=%d;\n", sizeof(short));
6756 if eval $compile_ok && ./intsize > /dev/null; then
6758 echo "Your integers are $intsize bytes long."
6759 echo "Your long integers are $longsize bytes long."
6760 echo "Your short integers are $shortsize bytes long."
6764 Help! I can't compile and run the intsize test program: please enlighten me!
6765 (This is probably a misconfiguration in your system or libraries, and
6766 you really ought to fix it. Still, I'll try anyway.)
6770 rp="What is the size of an integer (in bytes)?"
6774 rp="What is the size of a long integer (in bytes)?"
6778 rp="What is the size of a short integer (in bytes)?"
6784 $rm -f intsize intsize.*
6786 : check for long long
6788 echo $n "Checking to see if your system supports long long...$c" >&4
6789 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6790 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6792 echo " Yup, it does." >&4
6795 echo " Nope, it doesn't." >&4
6801 : check for length of long long
6802 case "${d_longlong}${longlongsize}" in
6805 $echo $n "Checking to see how big your long longs are...$c" >&4
6806 $cat >try.c <<'EOCP'
6810 printf("%d\n", sizeof(long long));
6814 if eval $compile_ok; then
6815 longlongsize=`./try`
6816 $echo " $longlongsize bytes." >&4
6820 echo "(I can't seem to compile the test program. Guessing...)"
6821 rp="What is the size of a long long (in bytes)?"
6825 if $test "X$longsize" = "X$longlongsize"; then
6826 echo "(That isn't any different from an ordinary long.)"
6834 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6836 echo "Checking how to print 64-bit integers..." >&4
6838 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6840 $cat >try.c <<'EOCP'
6841 #include <sys/types.h>
6844 int q = 12345678901;
6849 if eval $compile; then
6853 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6854 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6855 echo "We will use %d."
6861 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6863 $cat >try.c <<'EOCP'
6864 #include <sys/types.h>
6867 long q = 12345678901;
6872 if eval $compile; then
6876 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6877 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6878 echo "We will use %ld."
6884 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6886 $cat >try.c <<'EOCP'
6887 #include <sys/types.h>
6888 #include <inttypes.h>
6891 int64_t q = 12345678901;
6892 printf("%" PRId64 "\n", q);
6896 if eval $compile; then
6900 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6901 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6902 echo "We will use the C9X style."
6908 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6910 $cat >try.c <<'EOCP'
6911 #include <sys/types.h>
6914 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6915 printf("%lld\n", q);
6919 if eval $compile; then
6923 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6924 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6925 echo "We will use the %lld style."
6931 if $test X"$sPRId64" = X -a X"$quad" != X; then
6933 #include <sys/types.h>
6936 $quad q = 12345678901;
6941 if eval $compile; then
6945 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
6946 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
6947 echo "We will use %lld."
6953 if $test X"$sPRId64" = X -a X"$quad" != X; then
6955 #include <sys/types.h>
6958 $quad q = 12345678901;
6963 if eval $compile; then
6967 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
6968 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
6969 echo "We will use %qd."
6975 if $test X"$sPRId64" = X; then
6976 echo "Cannot figure out how to print 64-bit integers." >&4
6981 fi # intsize -o longsize -o d_int64t -o d_longlong
6984 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
6985 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
6987 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
6988 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
6992 : check for length of double
6994 case "$doublesize" in
6996 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
6997 $cat >try.c <<'EOCP'
7001 printf("%d\n", sizeof(double));
7005 if eval $compile_ok; then
7007 $echo " $doublesize bytes." >&4
7010 echo "(I can't seem to compile the test program. Guessing...)"
7011 rp="What is the size of a double precision number (in bytes)?"
7019 : check for long doubles
7021 echo $n "Checking to see if your system supports long double...$c" >&4
7022 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7023 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7025 echo " Yup, it does." >&4
7028 echo " Nope, it doesn't." >&4
7034 : check for length of long double
7035 case "${d_longdbl}${longdblsize}" in
7038 $echo $n "Checking to see how big your long doubles are...$c" >&4
7039 $cat >try.c <<'EOCP'
7043 printf("%d\n", sizeof(long double));
7047 if eval $compile; then
7049 $echo " $longdblsize bytes." >&4
7053 echo "(I can't seem to compile the test program. Guessing...)" >&4
7054 rp="What is the size of a long double (in bytes)?"
7058 if $test "X$doublesize" = "X$longdblsize"; then
7059 echo "(That isn't any different from an ordinary double.)"
7067 if $test X"$d_longdbl" = X"$define"; then
7069 echo "Checking how to print long doubles..." >&4
7071 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7072 $cat >try.c <<'EOCP'
7073 #include <sys/types.h>
7077 printf("%.3f\n", d);
7081 if eval $compile; then
7085 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7086 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7087 echo "We will use %f."
7093 if $test X"$sPRIfldbl" = X; then
7094 $cat >try.c <<'EOCP'
7095 #include <sys/types.h>
7098 long double d = 123.456;
7099 printf("%.3llf\n", d);
7103 if eval $compile; then
7107 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7108 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7109 echo "We will use %llf."
7115 if $test X"$sPRIfldbl" = X; then
7116 $cat >try.c <<'EOCP'
7117 #include <sys/types.h>
7120 long double d = 123.456;
7121 printf("%.3Lf\n", d);
7125 if eval $compile; then
7129 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7130 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7131 echo "We will use %Lf."
7137 if $test X"$sPRIfldbl" = X; then
7138 $cat >try.c <<'EOCP'
7139 #include <sys/types.h>
7142 long double d = 123.456;
7143 printf("%.3lf\n", d);
7147 if eval $compile; then
7151 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7152 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7153 echo "We will use %lf."
7159 if $test X"$sPRIfldbl" = X; then
7160 echo "Cannot figure out how to print long doubles." >&4
7167 case "$sPRIfldbl" in
7168 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7169 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7171 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7172 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7176 : Initialize h_fcntl
7179 : Initialize h_sysfile
7182 : access call always available on UNIX
7186 : locate the flags for 'access()'
7190 $cat >access.c <<'EOCP'
7191 #include <sys/types.h>
7196 #include <sys/file.h>
7205 : check sys/file.h first, no particular reason here
7206 if $test `./findhdr sys/file.h` && \
7207 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7209 echo "<sys/file.h> defines the *_OK access constants." >&4
7210 elif $test `./findhdr fcntl.h` && \
7211 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7213 echo "<fcntl.h> defines the *_OK access constants." >&4
7214 elif $test `./findhdr unistd.h` && \
7215 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7216 echo "<unistd.h> defines the *_OK access constants." >&4
7218 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7224 : see if accessx exists
7225 set accessx d_accessx
7228 : see if alarm exists
7232 : see if atolf exists
7236 : see if atoll exists
7240 : Look for GNU-cc style attribute checking
7242 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7243 $cat >attrib.c <<'EOCP'
7245 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7247 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7248 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7249 echo "Your C compiler doesn't fully support __attribute__."
7252 echo "Your C compiler supports __attribute__."
7256 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7263 : see if bcmp exists
7267 : see if bcopy exists
7271 : see if this is a unistd.h system
7272 set unistd.h i_unistd
7275 : see if getpgrp exists
7276 set getpgrp d_getpgrp
7279 case "$d_getpgrp" in
7282 echo "Checking to see which flavor of getpgrp is in use..."
7285 #include <sys/types.h>
7287 # include <unistd.h>
7291 if (getuid() == 0) {
7292 printf("(I see you are running Configure as super-user...)\n");
7296 if (getpgrp(1) == 0)
7305 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7306 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7308 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7309 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7312 echo "I can't seem to compile and run the test program."
7314 xxx="a USG one, i.e. you use getpgrp()."
7316 # SVR4 systems can appear rather BSD-ish.
7319 xxx="a BSD one, i.e. you use getpgrp(pid)."
7323 xxx="probably a USG one, i.e. you use getpgrp()."
7328 echo "Assuming your getpgrp is $xxx" >&4
7337 : see if setpgrp exists
7338 set setpgrp d_setpgrp
7341 case "$d_setpgrp" in
7344 echo "Checking to see which flavor of setpgrp 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 (-1 == setpgrp(1, 1))
7361 if (setpgrp() != -1)
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 setpgrp(pid,pgrp) instead of setpgrp().' >&4
7370 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7371 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7374 echo "(I can't seem to compile and run the test program.)"
7376 xxx="a USG one, i.e. you use setpgrp()."
7378 # SVR4 systems can appear rather BSD-ish.
7381 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7385 xxx="probably a USG one, i.e. you use setpgrp()."
7390 echo "Assuming your setpgrp is $xxx" >&4
7398 : see if bzero exists
7402 : see if signal is declared as pointer to function returning int or void
7404 xxx=`./findhdr signal.h`
7405 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7406 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7407 echo "You have int (*signal())() instead of void." >&4
7409 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7410 echo "You have void (*signal())()." >&4
7412 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7413 echo "You have int (*signal())() instead of void." >&4
7415 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7416 echo "You have void (*signal())()." >&4
7419 case "$d_voidsig" in
7421 echo "I can't determine whether signal handler returns void or int..." >&4
7423 rp="What type does your signal handler return?"
7430 echo "As you already told me, signal handler returns void." >&4
7433 *) echo "As you already told me, signal handler returns int." >&4
7440 case "$d_voidsig" in
7441 "$define") signal_t="void";;
7446 : check for ability to cast large floats to 32-bit ints.
7448 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7449 if $test "$intsize" -ge 4; then
7456 #include <sys/types.h>
7458 $signal_t blech(s) int s; { exit(3); }
7465 signal(SIGFPE, blech);
7467 /* Don't let compiler optimize the test away. Store the number
7468 in a writable string for gcc to pass to sscanf under HP/UX.
7470 sprintf(str, "2147483647");
7471 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7475 /* x86 processors will probably give 0x8000 0000, which is a
7476 sign change. We don't want that. We want to mimic SPARC
7477 behavior here, which is to preserve the sign and give
7480 if (i32 != ($xxx) f)
7486 if eval $compile_ok; then
7490 echo "(I can't seem to compile the test program--assuming it can't)"
7498 echo "Nope, it can't."
7505 : check for ability to cast negative floats to unsigned
7507 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7510 #include <sys/types.h>
7512 $signal_t blech(s) int s; { exit(7); }
7513 $signal_t blech_in_list(s) int s; { exit(4); }
7514 unsigned long dummy_long(p) unsigned long p; { return p; }
7515 unsigned int dummy_int(p) unsigned int p; { return p; }
7516 unsigned short dummy_short(p) unsigned short p; { return p; }
7520 unsigned long along;
7522 unsigned short ashort;
7526 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7527 a direct f = -123. assignment. gcc-2.8.0 reportedly
7528 optimized the whole file away
7530 /* Store the number in a writable string for gcc to pass to
7533 sprintf(str, "-123");
7534 sscanf(str, "%lf", &f); /* f = -123.; */
7536 signal(SIGFPE, blech);
7537 along = (unsigned long)f;
7538 aint = (unsigned int)f;
7539 ashort = (unsigned short)f;
7540 if (along != (unsigned long)-123)
7542 if (aint != (unsigned int)-123)
7544 if (ashort != (unsigned short)-123)
7546 sprintf(str, "1073741824.");
7547 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7550 along = (unsigned long)f;
7551 if (along != 0x80000000)
7555 along = (unsigned long)f;
7556 if (along != 0x7fffffff)
7560 along = (unsigned long)f;
7561 if (along != 0x80000001)
7565 signal(SIGFPE, blech_in_list);
7566 sprintf(str, "123.");
7567 sscanf(str, "%lf", &f); /* f = 123.; */
7568 along = dummy_long((unsigned long)f);
7569 aint = dummy_int((unsigned int)f);
7570 ashort = dummy_short((unsigned short)f);
7571 if (along != (unsigned long)123)
7573 if (aint != (unsigned int)123)
7575 if (ashort != (unsigned short)123)
7582 if eval $compile_ok; then
7586 echo "(I can't seem to compile the test program--assuming it can't)"
7589 case "$castflags" in
7594 echo "Nope, it can't."
7601 : see if vprintf exists
7603 if set vprintf val -f d_vprintf; eval $csym; $val; then
7604 echo 'vprintf() found.' >&4
7606 $cat >vprintf.c <<'EOF'
7607 #include <varargs.h>
7609 int main() { xxx("foo"); }
7618 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7622 if eval $compile && ./vprintf; then
7623 echo "Your vsprintf() returns (int)." >&4
7626 echo "Your vsprintf() returns (char*)." >&4
7630 echo 'vprintf() NOT found.' >&4
7640 : see if chown exists
7644 : see if chroot exists
7648 : see if chsize exists
7652 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7653 while $test $# -ge 2; do
7655 $define) echo "#include <$2>";;
7659 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
7660 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7669 : see if this is a sys/uio.h system
7670 set sys/uio.h i_sysuio
7673 echo "Checking to see if your system supports struct iovec..." >&4
7674 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7676 case "$d_iovec_s" in
7677 "$define") echo "Yup, it does." >&4
7679 *) echo "Nope, it doesn't." >&4
7685 : see whether socket exists
7687 $echo $n "Hmm... $c" >&4
7688 if set socket val -f d_socket; eval $csym; $val; then
7689 echo "Looks like you have Berkeley networking support." >&4
7691 if set setsockopt val -f; eval $csym; $val; then
7694 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7698 if $contains socklib libc.list >/dev/null 2>&1; then
7699 echo "Looks like you have Berkeley networking support." >&4
7701 : we will have to assume that it supports the 4.2 BSD interface
7704 echo "You don't have Berkeley networking in libc$_a..." >&4
7705 if test "X$d_socket" = "X$define"; then
7706 echo "...but you seem to believe that you have sockets." >&4
7708 for net in net socket
7710 if test -f /usr/lib/lib$net$_a; then
7711 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7712 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7713 if $contains socket libc.list >/dev/null 2>&1; then
7718 echo "...but the Wollongong group seems to have hacked it in." >&4
7719 sockethdr="-I/usr/netinclude"
7722 echo "Found Berkeley sockets interface in lib$net." >& 4
7723 if $contains setsockopt libc.list >/dev/null 2>&1; then
7726 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7733 if test "X$d_socket" != "X$define"; then
7734 echo "or anywhere else I see." >&4
7742 : see if socketpair exists
7743 set socketpair d_sockpair
7748 echo "Checking the availability of certain socket constants..." >& 4
7749 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7750 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7752 #include <sys/types.h>
7753 #include <sys/socket.h>
7759 set try; if eval $compile; then
7762 set d_${enum}; eval $setvar
7766 set sendmsg d_sendmsg
7769 set recvmsg d_recvmsg
7773 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7774 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7776 case "$d_msghdr_s" in
7777 "$define") echo "Yup, it does." >&4
7779 *) echo "Nope, it doesn't." >&4
7783 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7784 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7786 case "$d_cmsghdr_s" in
7787 "$define") echo "Yup, it does." >&4
7789 *) echo "Nope, it doesn't." >&4
7793 : check for const keyword
7795 echo 'Checking to see if your C compiler knows about "const"...' >&4
7796 $cat >const.c <<'EOCP'
7797 typedef struct spug { int drokk; } spug;
7804 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7806 echo "Yup, it does."
7809 echo "Nope, it doesn't."
7814 : see if crypt exists
7816 if set crypt val -f d_crypt; eval $csym; $val; then
7817 echo 'crypt() found.' >&4
7821 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7822 if $test -z "$cryptlib"; then
7823 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7827 if $test -z "$cryptlib"; then
7828 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7832 if $test -z "$cryptlib"; then
7833 cryptlib=`./loc libcrypt$_a "" $libpth`
7837 if $test -z "$cryptlib"; then
7838 echo 'crypt() NOT found.' >&4
7847 : get csh whereabouts
7849 'csh') val="$undef" ;;
7854 : Respect a hint or command line value for full_csh.
7856 '') full_csh=$csh ;;
7859 : see if cuserid exists
7860 set cuserid d_cuserid
7863 : see if this is a limits.h system
7864 set limits.h i_limits
7867 : see if this is a float.h system
7871 : See if number of significant digits in a double precision number is known
7873 $cat >dbl_dig.c <<EOM
7883 printf("Contains DBL_DIG");
7886 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7887 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7888 echo "DBL_DIG found." >&4
7891 echo "DBL_DIG NOT found." >&4
7898 : see if difftime exists
7899 set difftime d_difftime
7902 : see if this is a dirent system
7904 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7906 echo "<dirent.h> found." >&4
7909 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7910 echo "<sys/dir.h> found." >&4
7913 xinc=`./findhdr sys/ndir.h`
7915 echo "<dirent.h> NOT found." >&4
7920 : Look for type of directory structure.
7922 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7924 case "$direntrytype" in
7927 $define) guess1='struct dirent' ;;
7928 *) guess1='struct direct' ;;
7931 *) guess1="$direntrytype"
7936 'struct dirent') guess2='struct direct' ;;
7937 *) guess2='struct dirent' ;;
7940 if $contains "$guess1" try.c >/dev/null 2>&1; then
7941 direntrytype="$guess1"
7942 echo "Your directory entries are $direntrytype." >&4
7943 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7944 direntrytype="$guess2"
7945 echo "Your directory entries seem to be $direntrytype." >&4
7947 echo "I don't recognize your system's directory entries." >&4
7948 rp="What type is used for directory entries on this system?"
7956 : see if the directory entry stores field length
7958 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7959 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7960 echo "Good, your directory entry keeps length information in d_namlen." >&4
7963 echo "Your directory entry does not know about the d_namlen field." >&4
7970 : see if dlerror exists
7973 set dlerror d_dlerror
7977 : see if dlfcn is available
7985 On a few systems, the dynamically loaded modules that perl generates and uses
7986 will need a different extension than shared libs. The default will probably
7994 rp='What is the extension of dynamically loaded modules'
8003 : Check if dlsym need a leading underscore
8009 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8010 $cat >dyna.c <<'EOM'
8019 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8021 #include <sys/types.h>
8035 int mode = RTLD_LAZY ;
8037 handle = dlopen("./dyna.$dlext", mode) ;
8038 if (handle == NULL) {
8043 symbol = dlsym(handle, "fred") ;
8044 if (symbol == NULL) {
8045 /* try putting a leading underscore */
8046 symbol = dlsym(handle, "_fred") ;
8047 if (symbol == NULL) {
8060 : Call the object file tmp-dyna.o in case dlext=o.
8061 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8062 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8063 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8064 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8067 1) echo "Test program failed using dlopen." >&4
8068 echo "Perhaps you should not use dynamic loading." >&4;;
8069 2) echo "Test program failed using dlsym." >&4
8070 echo "Perhaps you should not use dynamic loading." >&4;;
8071 3) echo "dlsym needs a leading underscore" >&4
8073 4) echo "dlsym doesn't need a leading underscore." >&4;;
8076 echo "I can't compile and run the test program." >&4
8077 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8082 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8087 hasproto='varname=$1; func=$2; shift; shift;
8088 while $test $# -ge 2; do
8090 $define) echo "#include <$2>";;
8094 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8095 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8096 echo "$func() prototype found.";
8099 echo "$func() prototype NOT found.";
8104 $rm -f try.c tryout.c'
8106 : see if prototype for drand48 is available
8108 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8111 : see if dup2 exists
8115 : see if eaccess exists
8116 set eaccess d_eaccess
8119 : see if endgrent exists
8120 set endgrent d_endgrent
8123 : see if endhostent exists
8124 set endhostent d_endhent
8127 : see if endnetent exists
8128 set endnetent d_endnent
8131 : see if endprotoent exists
8132 set endprotoent d_endpent
8135 : see if endpwent exists
8136 set endpwent d_endpwent
8139 : see if endservent exists
8140 set endservent d_endsent
8143 : see if endspent exists
8144 set endspent d_endspent
8147 : Locate the flags for 'open()'
8149 $cat >open3.c <<'EOCP'
8150 #include <sys/types.h>
8155 #include <sys/file.h>
8166 : check sys/file.h first to get FREAD on Sun
8167 if $test `./findhdr sys/file.h` && \
8168 set open3 -DI_SYS_FILE && eval $compile; then
8170 echo "<sys/file.h> defines the O_* constants..." >&4
8172 echo "and you have the 3 argument form of open()." >&4
8175 echo "but not the 3 argument form of open(). Oh, well." >&4
8178 elif $test `./findhdr fcntl.h` && \
8179 set open3 -DI_FCNTL && eval $compile; then
8181 echo "<fcntl.h> defines the O_* constants..." >&4
8183 echo "and you have the 3 argument form of open()." >&4
8186 echo "but not the 3 argument form of open(). Oh, well." >&4
8191 echo "I can't find the O_* constant definitions! You got problems." >&4
8197 : check for non-blocking I/O stuff
8198 case "$h_sysfile" in
8199 true) echo "#include <sys/file.h>" > head.c;;
8202 true) echo "#include <fcntl.h>" > head.c;;
8203 *) echo "#include <sys/fcntl.h>" > head.c;;
8208 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8209 case "$o_nonblock" in
8212 $cat >>try.c <<'EOCP'
8215 printf("O_NONBLOCK\n");
8219 printf("O_NDELAY\n");
8223 printf("FNDELAY\n");
8230 if eval $compile_ok; then
8232 case "$o_nonblock" in
8233 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8234 *) echo "Seems like we can use $o_nonblock.";;
8237 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8240 *) echo "Using $hint value $o_nonblock.";;
8242 $rm -f try try.* .out core
8245 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8251 #include <sys/types.h>
8253 #define MY_O_NONBLOCK $o_nonblock
8254 #ifndef errno /* XXX need better Configure test */
8257 $signal_t blech(x) int x; { exit(3); }
8259 $cat >> try.c <<'EOCP'
8267 pipe(pd); /* Down: child -> parent */
8268 pipe(pu); /* Up: parent -> child */
8271 close(pd[1]); /* Parent reads from pd[0] */
8272 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8273 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8275 signal(SIGALRM, blech);
8277 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8279 sprintf(string, "%d\n", ret);
8280 write(2, string, strlen(string));
8283 if (errno == EAGAIN) {
8289 if (errno == EWOULDBLOCK)
8290 printf("EWOULDBLOCK\n");
8293 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8294 sleep(2); /* Give it time to close our pipe */
8296 ret = read(pd[0], buf, 1); /* Should read EOF */
8298 sprintf(string, "%d\n", ret);
8299 write(3, string, strlen(string));
8303 close(pd[0]); /* We write to pd[1] */
8304 close(pu[1]); /* We read from pu[0] */
8305 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8306 close(pd[1]); /* Pipe pd is now fully closed! */
8307 exit(0); /* Bye bye, thank you for playing! */
8311 if eval $compile_ok; then
8312 echo "$startsh" >mtry
8313 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8315 ./mtry >/dev/null 2>&1
8317 0) eagain=`$cat try.out`;;
8318 1) echo "Could not perform non-blocking setting!";;
8319 2) echo "I did a successful read() for something that was not there!";;
8320 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8321 *) echo "Something terribly wrong happened during testing.";;
8323 rd_nodata=`$cat try.ret`
8324 echo "A read() system call with no data present returns $rd_nodata."
8325 case "$rd_nodata" in
8328 echo "(That's peculiar, fixing that to be -1.)"
8334 echo "Forcing errno EAGAIN on read() with no data available."
8338 echo "Your read() sets errno to $eagain when no data is available."
8341 status=`$cat try.err`
8343 0) echo "And it correctly returns 0 to signal EOF.";;
8344 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8345 *) echo "However, your read() returns '$status' on EOF??";;
8348 if test "$status" = "$rd_nodata"; then
8349 echo "WARNING: you can't distinguish between EOF and no data!"
8353 echo "I can't compile the test program--assuming errno EAGAIN will do."
8360 echo "Using $hint value $eagain."
8361 echo "Your read() returns $rd_nodata when no data is present."
8362 case "$d_eofnblk" in
8363 "$define") echo "And you can see EOF because read() returns 0.";;
8364 "$undef") echo "But you can't see EOF status from read() returned value.";;
8366 echo "(Assuming you can't see EOF status from read anyway.)"
8372 $rm -f try try.* .out core head.c mtry
8374 : see if fchmod exists
8378 : see if fchown exists
8382 : see if this is an fcntl system
8386 : see if sys/select.h has to be included
8387 set sys/select.h i_sysselct
8390 : see if we should include time.h, sys/time.h, or both
8392 if test "X$timeincl" = X; then
8393 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8394 $echo $n "I'm now running the test program...$c"
8395 $cat >try.c <<'EOCP'
8396 #include <sys/types.h>
8401 #ifdef SYSTIMEKERNEL
8404 #include <sys/time.h>
8407 #include <sys/select.h>
8416 struct timezone tzp;
8418 if (foo.tm_sec == foo.tm_sec)
8421 if (bar.tv_sec == bar.tv_sec)
8428 for s_timezone in '-DS_TIMEZONE' ''; do
8430 for s_timeval in '-DS_TIMEVAL' ''; do
8431 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8432 for i_time in '' '-DI_TIME'; do
8433 for i_systime in '-DI_SYSTIME' ''; do
8436 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8437 if eval $compile; then
8438 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8442 $echo $n "Succeeded with $flags$c"
8454 *SYSTIMEKERNEL*) i_systimek="$define"
8455 timeincl=`./findhdr sys/time.h`
8456 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8457 *) i_systimek="$undef";;
8460 *I_TIME*) i_time="$define"
8461 timeincl=`./findhdr time.h`" $timeincl"
8462 echo "We'll include <time.h>." >&4;;
8463 *) i_time="$undef";;
8466 *I_SYSTIME*) i_systime="$define"
8467 timeincl=`./findhdr sys/time.h`" $timeincl"
8468 echo "We'll include <sys/time.h>." >&4;;
8469 *) i_systime="$undef";;
8474 : check for fd_set items
8477 Checking to see how well your C compiler handles fd_set and friends ...
8479 $cat >fd_set.c <<EOCP
8480 #$i_systime I_SYS_TIME
8481 #$i_sysselct I_SYS_SELECT
8482 #$d_socket HAS_SOCKET
8483 #include <sys/types.h>
8485 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8488 #include <sys/time.h>
8491 #include <sys/select.h>
8500 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8507 set fd_set -DTRYBITS
8508 if eval $compile; then
8509 d_fds_bits="$define"
8511 echo "Well, your system knows about the normal fd_set typedef..." >&4
8513 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8514 d_fd_macros="$define"
8517 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8519 d_fd_macros="$undef"
8523 Hmm, your compiler has some difficulty with fd_set. Checking further...
8526 if eval $compile; then
8529 echo "Well, your system has some sort of fd_set available..." >&4
8531 echo "and you have the normal fd_set macros." >&4
8532 d_fd_macros="$define"
8535 but not the normal fd_set macros! Gross! More work for me...
8537 d_fd_macros="$undef"
8540 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8543 d_fd_macros="$undef"
8548 : see if fgetpos exists
8549 set fgetpos d_fgetpos
8552 : see if flock exists
8556 : see if fork exists
8560 : see if pathconf exists
8561 set pathconf d_pathconf
8564 : see if fpathconf exists
8565 set fpathconf d_fpathconf
8569 : see if llseek exists
8575 echo $n "Checking to see if your system supports off64_t...$c" >&4
8577 #include <sys/types.h>
8579 off64_t foo() { off64_t x; x = 7; return x; }'
8581 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8583 echo " Yup, it does." >&4
8586 echo " Nope, it doesn't." >&4
8592 : check for fpos64_t
8594 echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8596 #include <sys/stdio.h>
8597 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8599 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8601 echo " Yup, it does." >&4
8604 echo " Nope, it doesn't." >&4
8610 : see if fseeko exists
8614 : see if fsetpos exists
8615 set fsetpos d_fsetpos
8618 : see if this is a sys/param system
8619 set sys/param.h i_sysparam
8622 : see if this is a sys/mount.h system
8623 set sys/mount.h i_sysmount
8627 : see if statfs exists
8631 : see if fstatfs exists
8632 set fstatfs d_fstatfs
8635 : see if statfs knows about mount flags
8636 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8640 : see if statvfs exists
8641 set statvfs d_statvfs
8644 : see if fstatvfs exists
8645 set fstatvfs d_fstatvfs
8649 : see if ftello exists
8653 : see if getgrent exists
8654 set getgrent d_getgrent
8657 : see if gethostbyaddr exists
8658 set gethostbyaddr d_gethbyaddr
8661 : see if gethostbyname exists
8662 set gethostbyname d_gethbyname
8665 : see if gethostent exists
8666 set gethostent d_gethent
8669 : see how we will look up host name
8672 if set gethostname val -f d_gethname; eval $csym; $val; then
8673 echo 'gethostname() found.' >&4
8674 d_gethname="$define"
8677 if set uname val -f d_uname; eval $csym; $val; then
8680 uname() was found, but you're running xenix, and older versions of xenix
8681 have a broken uname(). If you don't really know whether your xenix is old
8682 enough to have a broken system call, use the default answer.
8689 rp='Is your uname() broken?'
8692 n*) d_uname="$define"; call=uname;;
8695 echo 'uname() found.' >&4
8702 case "$d_gethname" in
8703 '') d_gethname="$undef";;
8706 '') d_uname="$undef";;
8708 case "$d_uname$d_gethname" in
8713 Every now and then someone has a $call() that lies about the hostname
8714 but can't be fixed for political or economic reasons. If you wish, I can
8715 pretend $call() isn't there and maybe compute hostname at run-time
8716 thanks to the '$phostname' command.
8719 rp="Shall I ignore $call() from now on?"
8722 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8725 case "$phostname" in
8727 *) case "$aphostname" in
8733 file=`./loc $file $file $pth`
8734 aphostname=`echo $file $*`
8739 case "$d_uname$d_gethname" in
8742 case "$phostname" in
8744 echo "There will be no way for $package to get your hostname." >&4;;
8746 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8750 case "$d_phostname" in
8751 '') d_phostname="$undef";;
8754 : see if this is a netdb.h system
8758 : see if prototypes for various gethostxxx netdb.h functions are available
8760 set d_gethostprotos gethostent $i_netdb netdb.h
8763 : see if getlogin exists
8764 set getlogin d_getlogin
8767 : see if getmntent exists
8768 set getmntent d_getmntent
8771 : see if getnetbyaddr exists
8772 set getnetbyaddr d_getnbyaddr
8775 : see if getnetbyname exists
8776 set getnetbyname d_getnbyname
8779 : see if getnetent exists
8780 set getnetent d_getnent
8783 : see if prototypes for various getnetxxx netdb.h functions are available
8785 set d_getnetprotos getnetent $i_netdb netdb.h
8789 : see if getprotobyname exists
8790 set getprotobyname d_getpbyname
8793 : see if getprotobynumber exists
8794 set getprotobynumber d_getpbynumber
8797 : see if getprotoent exists
8798 set getprotoent d_getpent
8801 : see if getpgid exists
8802 set getpgid d_getpgid
8805 : see if getpgrp2 exists
8806 set getpgrp2 d_getpgrp2
8809 : see if getppid exists
8810 set getppid d_getppid
8813 : see if getpriority exists
8814 set getpriority d_getprior
8817 : see if prototypes for various getprotoxxx netdb.h functions are available
8819 set d_getprotoprotos getprotoent $i_netdb netdb.h
8822 : see if getpwent exists
8823 set getpwent d_getpwent
8827 : see if getservbyname exists
8828 set getservbyname d_getsbyname
8831 : see if getservbyport exists
8832 set getservbyport d_getsbyport
8835 : see if getservent exists
8836 set getservent d_getsent
8839 : see if prototypes for various getservxxx netdb.h functions are available
8841 set d_getservprotos getservent $i_netdb netdb.h
8844 : see if getspent exists
8845 set getspent d_getspent
8848 : see if getspnam exists
8849 set getspnam d_getspnam
8852 : see if gettimeofday or ftime exists
8853 set gettimeofday d_gettimeod
8855 case "$d_gettimeod" in
8861 val="$undef"; set d_ftime; eval $setvar
8864 case "$d_gettimeod$d_ftime" in
8867 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8871 : see if this is an grp system
8877 xxx=`./findhdr grp.h`
8878 $cppstdin $cppflags $cppminus < $xxx >$$.h
8880 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8892 set d_grpasswd; eval $setvar
8896 : see if hasmntopt exists
8897 set hasmntopt d_hasmntopt
8900 : see if this is a netinet/in.h or sys/in.h system
8901 set netinet/in.h i_niin sys/in.h i_sysin
8904 : see if arpa/inet.h has to be included
8905 set arpa/inet.h i_arpainet
8908 : see if htonl --and friends-- exists
8913 : Maybe they are macros.
8918 #include <sys/types.h>
8919 #$i_niin I_NETINET_IN
8921 #$i_arpainet I_ARPA_INET
8923 #include <netinet/in.h>
8929 #include <arpa/inet.h>
8932 printf("Defined as a macro.");
8935 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8936 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8938 echo "But it seems to be defined as a macro." >&4
8946 : see which of string.h or strings.h is needed
8948 strings=`./findhdr string.h`
8949 if $test "$strings" && $test -r "$strings"; then
8950 echo "Using <string.h> instead of <strings.h>." >&4
8954 strings=`./findhdr strings.h`
8955 if $test "$strings" && $test -r "$strings"; then
8956 echo "Using <strings.h> instead of <string.h>." >&4
8958 echo "No string header found -- You'll surely have problems." >&4
8964 "$undef") strings=`./findhdr strings.h`;;
8965 *) strings=`./findhdr string.h`;;
8970 if set index val -f; eval $csym; $val; then
8971 if set strchr val -f d_strchr; eval $csym; $val; then
8972 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8975 echo "strchr() found." >&4
8979 echo "index() found." >&4
8984 echo "index() found." >&4
8987 if set strchr val -f d_strchr; eval $csym; $val; then
8990 echo "strchr() found." >&4
8992 echo "No index() or strchr() found!" >&4
8997 set d_strchr; eval $setvar
8999 set d_index; eval $setvar
9001 : check whether inet_aton exists
9002 set inet_aton d_inetaton
9007 $cat >isascii.c <<'EOCP'
9019 if eval $compile; then
9020 echo "isascii() found." >&4
9023 echo "isascii() NOT found." >&4
9030 : see if killpg exists
9034 : see if lchown exists
9036 $cat > try.c <<'EOCP'
9037 /* System header to define __stub macros and hopefully few prototypes,
9038 which can conflict with char lchown(); below. */
9040 /* Override any gcc2 internal prototype to avoid an error. */
9041 /* We use char because int might match the return type of a gcc2
9042 builtin and then its argument prototype would still apply. */
9045 /* The GNU C library defines this for functions which it implements
9046 to always fail with ENOSYS. Some functions are actually named
9047 something starting with __ and the normal name is an alias. */
9048 #if defined (__stub_lchown) || defined (__stub___lchown)
9056 if eval $compile; then
9057 $echo "lchown() found." >&4
9060 $echo "lchown() NOT found." >&4
9066 : See if number of significant digits in a double precision number is known
9068 $cat >ldbl_dig.c <<EOM
9078 printf("Contains LDBL_DIG");
9081 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9082 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9083 echo "LDBL_DIG found." >&4
9086 echo "LDBL_DIG NOT found." >&4
9093 : see if link exists
9097 : see if localeconv exists
9098 set localeconv d_locconv
9101 : see if lockf exists
9105 : see if lstat exists
9109 : see if madvise exists
9110 set madvise d_madvise
9113 : see if mblen exists
9117 : see if mbstowcs exists
9118 set mbstowcs d_mbstowcs
9121 : see if mbtowc exists
9125 : see if memchr exists
9129 : see if memcmp exists
9133 : see if memcpy exists
9137 : see if memmove exists
9138 set memmove d_memmove
9141 : see if memset exists
9145 : see if mkdir exists
9149 : see if mkfifo exists
9153 : see if mktime exists
9157 : see if this is a sys/mman.h system
9158 set sys/mman.h i_sysmman
9161 : see if mmap exists
9164 : see what shmat returns
9165 : default to something harmless
9167 case "$i_sysmman$d_mmap" in
9169 $cat >mmap.c <<'END'
9170 #include <sys/mman.h>
9173 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9178 echo "and it returns ($mmaptype)." >&4
9184 : see if mprotect exists
9185 set mprotect d_mprotect
9188 : see if msgctl exists
9192 : see if msgget exists
9196 : see if msgsnd exists
9200 : see if msgrcv exists
9204 : see how much of the 'msg*(2)' library is present.
9207 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9208 *"$undef"*) h_msg=false;;
9212 case "`ipcs 2>&1`" in
9213 "SVID messages"*"not configured"*)
9214 echo "Your $osname does not have the msg*(2) configured." >&4
9229 : we could also check for sys/ipc.h ...
9230 if $h_msg && $test `./findhdr sys/msg.h`; then
9231 echo "You have the full msg*(2) library." >&4
9234 echo "You don't have the full msg*(2) library." >&4
9240 : see if msync exists
9244 : see if munmap exists
9248 : see if nice exists
9252 : see if POSIX threads are available
9253 set pthread.h i_pthread
9259 : how to create joinable pthreads
9260 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9262 echo "Checking what constant to use for creating joinable pthreads..." >&4
9263 $cat >try.c <<'EOCP'
9264 #include <pthread.h>
9266 int detachstate = JOINABLE;
9269 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9270 if eval $compile; then
9271 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9272 val="$undef" # Yes, undef.
9273 set d_old_pthread_create_joinable
9276 set old_pthread_create_joinable
9279 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9280 if eval $compile; then
9281 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9283 set d_old_pthread_create_joinable
9285 val=PTHREAD_CREATE_UNDETACHED
9286 set old_pthread_create_joinable
9289 set try -DJOINABLE=__UNDETACHED
9290 if eval $compile; then
9291 echo "You seem to use __UNDETACHED." >&4
9293 set d_old_pthread_create_joinable
9296 set old_pthread_create_joinable
9299 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9301 set d_old_pthread_create_joinable
9304 set old_pthread_create_joinable
9311 d_old_pthread_create_joinable="$undef"
9312 old_pthread_create_joinable=""
9315 : see if pause exists
9319 : see if pipe exists
9323 : see if poll exists
9328 : see whether the various POSIXish _yields exist
9330 #include <pthread.h>
9336 #ifdef PTHREAD_YIELD
9339 #ifdef PTHREAD_YIELD_NULL
9340 pthread_yield(NULL);
9346 : see if sched_yield exists
9347 set try -DSCHED_YIELD
9348 if eval $compile; then
9350 sched_yield='sched_yield()'
9354 case "$usethreads" in
9357 $define) echo 'sched_yield() found.' >&4 ;;
9358 *) echo 'sched_yield() NOT found.' >&4 ;;
9364 : see if pthread_yield exists
9365 set try -DPTHREAD_YIELD
9366 if eval $compile; then
9368 case "$sched_yield" in
9369 '') sched_yield='pthread_yield()' ;;
9372 set try -DPTHREAD_YIELD_NULL
9373 if eval $compile; then
9375 case "$sched_yield" in
9376 '') sched_yield='pthread_yield(NULL)' ;;
9382 case "$usethreads" in
9385 $define) echo 'pthread_yield() found.' >&4 ;;
9386 *) echo 'pthread_yield() NOT found.' >&4 ;;
9393 case "$sched_yield" in
9394 '') sched_yield=undef ;;
9399 : see if this is a pwd.h system
9405 xxx=`./findhdr pwd.h`
9406 $cppstdin $cppflags $cppminus < $xxx >$$.h
9408 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9416 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9424 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9432 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9440 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9448 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9456 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9464 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9476 set d_pwquota; eval $setvar
9477 set d_pwage; eval $setvar
9478 set d_pwchange; eval $setvar
9479 set d_pwclass; eval $setvar
9480 set d_pwexpire; eval $setvar
9481 set d_pwcomment; eval $setvar
9482 set d_pwgecos; eval $setvar
9483 set d_pwpasswd; eval $setvar
9487 : see if readdir and friends exist
9488 set readdir d_readdir
9490 set seekdir d_seekdir
9492 set telldir d_telldir
9494 set rewinddir d_rewinddir
9497 : see if readlink exists
9498 set readlink d_readlink
9501 : see if readv exists
9505 : see if rename exists
9509 : see if rmdir exists
9513 : see if memory.h is available.
9518 : See if it conflicts with string.h
9524 $cppstdin $cppflags $cppminus < $strings > mem.h
9525 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9527 echo "We won't be including <memory.h>."
9537 : can bcopy handle overlapping blocks?
9542 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9549 $cat >>try.c <<'EOCP'
9552 # include <memory.h>
9555 # include <stdlib.h>
9558 # include <string.h>
9560 # include <strings.h>
9563 # include <unistd.h> /* Needed for NetBSD */
9567 char buf[128], abc[128];
9573 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9575 for (align = 7; align >= 0; align--) {
9576 for (len = 36; len; len--) {
9579 for (off = 1; off <= len; off++) {
9580 bcopy(b, b+off, len);
9581 bcopy(b+off, b, len);
9582 if (bcmp(b, abc, len))
9591 if eval $compile_ok; then
9592 if ./try 2>/dev/null; then
9596 echo "It can't, sorry."
9597 case "$d_memmove" in
9598 "$define") echo "But that's Ok since you have memmove()." ;;
9602 echo "(I can't compile the test program, so we'll assume not...)"
9603 case "$d_memmove" in
9604 "$define") echo "But that's Ok since you have memmove()." ;;
9609 $rm -f try.* try core
9613 : can memcpy handle overlapping blocks?
9618 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9625 $cat >>try.c <<'EOCP'
9628 # include <memory.h>
9631 # include <stdlib.h>
9634 # include <string.h>
9636 # include <strings.h>
9639 # include <unistd.h> /* Needed for NetBSD */
9643 char buf[128], abc[128];
9649 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9650 try to store the string in read-only memory. */
9651 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9653 for (align = 7; align >= 0; align--) {
9654 for (len = 36; len; len--) {
9656 memcpy(b, abc, len);
9657 for (off = 1; off <= len; off++) {
9658 memcpy(b+off, b, len);
9659 memcpy(b, b+off, len);
9660 if (memcmp(b, abc, len))
9669 if eval $compile_ok; then
9670 if ./try 2>/dev/null; then
9674 echo "It can't, sorry."
9675 case "$d_memmove" in
9676 "$define") echo "But that's Ok since you have memmove()." ;;
9680 echo "(I can't compile the test program, so we'll assume not...)"
9681 case "$d_memmove" in
9682 "$define") echo "But that's Ok since you have memmove()." ;;
9687 $rm -f try.* try core
9691 : can memcmp be trusted to compare relative magnitude?
9696 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9703 $cat >>try.c <<'EOCP'
9706 # include <memory.h>
9709 # include <stdlib.h>
9712 # include <string.h>
9714 # include <strings.h>
9717 # include <unistd.h> /* Needed for NetBSD */
9723 if ((a < b) && memcmp(&a, &b, 1) < 0)
9729 if eval $compile_ok; then
9730 if ./try 2>/dev/null; then
9734 echo "No, it can't (it uses signed chars)."
9737 echo "(I can't compile the test program, so we'll assume not...)"
9741 $rm -f try.* try core
9745 : see if select exists
9749 : see if semctl exists
9753 : see if semget exists
9757 : see if semop exists
9761 : see how much of the 'sem*(2)' library is present.
9764 case "$d_semctl$d_semget$d_semop" in
9765 *"$undef"*) h_sem=false;;
9769 case "`ipcs 2>&1`" in
9770 "SVID messages"*"not configured"*)
9771 echo "Your $osname does not have the sem*(2) configured." >&4
9784 : we could also check for sys/ipc.h ...
9785 if $h_sem && $test `./findhdr sys/sem.h`; then
9786 echo "You have the full sem*(2) library." >&4
9789 echo "You don't have the full sem*(2) library." >&4
9795 : see whether sys/sem.h defines union semun
9797 $cat > try.c <<'END'
9798 #include <sys/types.h>
9799 #include <sys/ipc.h>
9800 #include <sys/sem.h>
9801 int main () { union semun semun; semun.buf = 0; }
9804 if eval $compile; then
9805 echo "You have union semun in <sys/sem.h>." >&4
9808 echo "You do not have union semun in <sys/sem.h>." >&4
9811 $rm -f try try.c try.h
9815 : see how to do semctl IPC_STAT
9818 : see whether semctl IPC_STAT can use union semun
9823 # define S_IRUSR S_IREAD
9824 # define S_IWUSR S_IWRITE
9825 # define S_IXUSR S_IEXEC
9827 # define S_IRUSR 0400
9828 # define S_IWUSR 0200
9829 # define S_IXUSR 0100
9831 # define S_IRGRP (S_IRUSR>>3)
9832 # define S_IWGRP (S_IWUSR>>3)
9833 # define S_IXGRP (S_IXUSR>>3)
9834 # define S_IROTH (S_IRUSR>>6)
9835 # define S_IWOTH (S_IWUSR>>6)
9836 # define S_IXOTH (S_IXUSR>>6)
9839 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9840 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9841 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9846 #include <sys/types.h>
9847 #include <sys/ipc.h>
9848 #include <sys/sem.h>
9849 #include <sys/stat.h>
9856 #$d_union_semun HAS_UNION_SEMUN
9859 #ifndef HAS_UNION_SEMUN
9862 struct semid_ds *buf;
9863 unsigned short *array;
9869 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9870 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9872 struct semid_ds argbuf;
9875 st = semctl(sem, 0, IPC_STAT, arg);
9879 # endif /* IPC_STAT */
9880 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9882 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9883 # endif /* IPC_RMID */
9884 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9886 #endif /* IPC_PRIVATE && ... */
9887 printf("semget failed: errno = %d\n", errno);
9893 if eval $compile; then
9896 semun) val="$define" ;;
9902 case "$d_semctl_semun" in
9904 echo "You can use union semun for semctl IPC_STAT." >&4
9907 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9912 : see whether semctl IPC_STAT can use struct semid_ds pointer
9913 $cat > try.c <<'END'
9914 #include <sys/types.h>
9915 #include <sys/ipc.h>
9916 #include <sys/sem.h>
9917 #include <sys/stat.h>
9925 struct semid_ds arg;
9928 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9929 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9932 st = semctl(sem, 0, IPC_STAT, &arg);
9934 printf("semid_ds\n");
9936 # endif /* IPC_STAT */
9937 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9939 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9940 # endif /* IPC_RMID */
9941 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9943 #endif /* IPC_PRIVATE && ... */
9944 printf("semget failed: errno = %d\n", errno);
9951 if eval $compile; then
9954 semid_ds) val="$define" ;;
9958 set d_semctl_semid_ds
9960 case "$d_semctl_semid_ds" in
9962 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9964 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9971 # We do not have the full sem*(2) library, so assume we can not
9977 set d_semctl_semid_ds
9982 : see if setegid exists
9983 set setegid d_setegid
9986 : see if seteuid exists
9987 set seteuid d_seteuid
9990 : see if setgrent exists
9991 set setgrent d_setgrent
9994 : see if sethostent exists
9995 set sethostent d_sethent
9998 : see if setlinebuf exists
9999 set setlinebuf d_setlinebuf
10002 : see if setlocale exists
10003 set setlocale d_setlocale
10006 : see if setnetent exists
10007 set setnetent d_setnent
10010 : see if setprotoent exists
10011 set setprotoent d_setpent
10014 : see if setpgid exists
10015 set setpgid d_setpgid
10018 : see if setpgrp2 exists
10019 set setpgrp2 d_setpgrp2
10022 : see if setpriority exists
10023 set setpriority d_setprior
10026 : see if setpwent exists
10027 set setpwent d_setpwent
10030 : see if setregid exists
10031 set setregid d_setregid
10033 set setresgid d_setresgid
10036 : see if setreuid exists
10037 set setreuid d_setreuid
10039 set setresuid d_setresuid
10042 : see if setrgid exists
10043 set setrgid d_setrgid
10046 : see if setruid exists
10047 set setruid d_setruid
10050 : see if setservent exists
10051 set setservent d_setsent
10054 : see if setsid exists
10055 set setsid d_setsid
10058 : see if setspent exists
10059 set setspent d_setspent
10062 : see if setvbuf exists
10063 set setvbuf d_setvbuf
10066 : see if sfio.h is available
10071 : see if sfio library is available
10082 : Ok, but do we want to use it.
10086 true|$define|[yY]*) dflt='y';;
10089 echo "$package can use the sfio library, but it is experimental."
10090 rp="You seem to have sfio available, do you want to try using it?"
10094 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10096 : Remove sfio from list of libraries to use
10097 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10100 echo "libs = $libs" >&4
10104 *) case "$usesfio" in
10105 true|$define|[yY]*)
10106 echo "Sorry, cannot find sfio on this machine" >&4
10107 echo "Ignoring your setting of usesfio=$usesfio" >&4
10115 $define) usesfio='true';;
10116 *) usesfio='false';;
10119 : see if shmctl exists
10120 set shmctl d_shmctl
10123 : see if shmget exists
10124 set shmget d_shmget
10127 : see if shmat exists
10130 : see what shmat returns
10133 $cat >shmat.c <<'END'
10134 #include <sys/shm.h>
10137 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10142 echo "and it returns ($shmattype)." >&4
10143 : see if a prototype for shmat is available
10144 xxx=`./findhdr sys/shm.h`
10145 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10146 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10157 set d_shmatprototype
10160 : see if shmdt exists
10164 : see how much of the 'shm*(2)' library is present.
10167 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10168 *"$undef"*) h_shm=false;;
10172 case "`ipcs 2>&1`" in
10173 "SVID shared memory"*"not configured"*)
10174 echo "Your $osname does not have the shm*(2) configured." >&4
10177 set shmctl d_shmctl
10179 set shmget d_shmget
10189 : we could also check for sys/ipc.h ...
10190 if $h_shm && $test `./findhdr sys/shm.h`; then
10191 echo "You have the full shm*(2) library." >&4
10194 echo "You don't have the full shm*(2) library." >&4
10201 : see if we have sigaction
10202 if set sigaction val -f d_sigaction; eval $csym; $val; then
10203 echo 'sigaction() found.' >&4
10204 $cat > try.c <<'EOP'
10206 #include <sys/types.h>
10207 #include <signal.h>
10210 struct sigaction act, oact;
10212 oact.sa_handler = 0;
10216 if eval $compile_ok; then
10219 echo "But you don't seem to have a useable struct sigaction." >&4
10223 echo 'sigaction NOT found.' >&4
10226 set d_sigaction; eval $setvar
10227 $rm -f try try$_o try.c
10229 : see if sigsetjmp exists
10231 case "$d_sigsetjmp" in
10233 $cat >try.c <<'EOP'
10234 #include <setjmp.h>
10239 if (sigsetjmp(env,1))
10242 siglongjmp(env, 1);
10247 if eval $compile; then
10248 if ./try >/dev/null 2>&1; then
10249 echo "POSIX sigsetjmp found." >&4
10253 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10259 echo "sigsetjmp not found." >&4
10263 *) val="$d_sigsetjmp"
10264 case "$d_sigsetjmp" in
10265 $define) echo "POSIX sigsetjmp found." >&4;;
10266 $undef) echo "sigsetjmp not found." >&4;;
10274 : see if sys/stat.h is available
10275 set sys/stat.h i_sysstat
10278 : see if stat knows about block sizes
10280 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10283 : see if _ptr and _cnt from stdio act std
10285 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10286 echo "(Looks like you have stdio.h from Linux.)"
10287 case "$stdio_ptr" in
10288 '') stdio_ptr='((fp)->_IO_read_ptr)'
10291 *) ptr_lval=$d_stdio_ptr_lval;;
10293 case "$stdio_cnt" in
10294 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10297 *) cnt_lval=$d_stdio_cnt_lval;;
10299 case "$stdio_base" in
10300 '') stdio_base='((fp)->_IO_read_base)';;
10302 case "$stdio_bufsiz" in
10303 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10306 case "$stdio_ptr" in
10307 '') stdio_ptr='((fp)->_ptr)'
10310 *) ptr_lval=$d_stdio_ptr_lval;;
10312 case "$stdio_cnt" in
10313 '') stdio_cnt='((fp)->_cnt)'
10316 *) cnt_lval=$d_stdio_cnt_lval;;
10318 case "$stdio_base" in
10319 '') stdio_base='((fp)->_base)';;
10321 case "$stdio_bufsiz" in
10322 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10325 : test whether _ptr and _cnt really work
10326 echo "Checking how std your stdio is..." >&4
10329 #define FILE_ptr(fp) $stdio_ptr
10330 #define FILE_cnt(fp) $stdio_cnt
10332 FILE *fp = fopen("try.c", "r");
10335 18 <= FILE_cnt(fp) &&
10336 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10344 if eval $compile; then
10346 echo "Your stdio acts pretty std."
10349 echo "Your stdio isn't very std."
10352 echo "Your stdio doesn't appear very std."
10358 : Can _ptr be used as an lvalue?
10359 case "$d_stdstdio$ptr_lval" in
10360 $define$define) val=$define ;;
10363 set d_stdio_ptr_lval
10366 : Can _cnt be used as an lvalue?
10367 case "$d_stdstdio$cnt_lval" in
10368 $define$define) val=$define ;;
10371 set d_stdio_cnt_lval
10374 : see if _base is also standard
10376 case "$d_stdstdio" in
10380 #define FILE_base(fp) $stdio_base
10381 #define FILE_bufsiz(fp) $stdio_bufsiz
10383 FILE *fp = fopen("try.c", "r");
10386 19 <= FILE_bufsiz(fp) &&
10387 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10394 if eval $compile; then
10396 echo "And its _base field acts std."
10399 echo "But its _base field isn't std."
10402 echo "However, it seems to be lacking the _base field."
10411 Checking how to access stdio streams by file descriptor number...
10413 case "$stdio_stream_array" in
10414 '') $cat >try.c <<EOCP
10417 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10421 for s in _iob __iob __sF
10423 set try -DSTDIO_STREAM_ARRAY=$s
10424 if eval $compile; then
10425 case "`./try$exe_ext`" in
10426 yes) stdio_stream_array=$s; break ;;
10430 $rm -f try.* try$exe_ext
10432 case "$stdio_stream_array" in
10434 I can't figure out how to access stdio streams by file descriptor number.
10436 d_stdio_stream_array="$undef"
10439 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10441 d_stdio_stream_array="$define"
10445 : see if strcoll exists
10446 set strcoll d_strcoll
10449 : check for structure copying
10451 echo "Checking to see if your C compiler can copy structs..." >&4
10452 $cat >try.c <<'EOCP'
10462 if $cc -c try.c >/dev/null 2>&1 ; then
10464 echo "Yup, it can."
10467 echo "Nope, it can't."
10473 : see if strerror and/or sys_errlist[] exist
10475 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10476 if set strerror val -f d_strerror; eval $csym; $val; then
10477 echo 'strerror() found.' >&4
10478 d_strerror="$define"
10479 d_strerrm='strerror(e)'
10480 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10481 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10482 d_syserrlst="$define"
10484 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10485 d_syserrlst="$undef"
10487 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10488 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10489 echo 'strerror() found in string header.' >&4
10490 d_strerror="$define"
10491 d_strerrm='strerror(e)'
10492 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10493 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10494 d_syserrlst="$define"
10496 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10497 d_syserrlst="$undef"
10499 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10500 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10501 d_strerror="$undef"
10502 d_syserrlst="$define"
10503 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10505 echo 'strerror() and sys_errlist[] NOT found.' >&4
10506 d_strerror="$undef"
10507 d_syserrlst="$undef"
10508 d_strerrm='"unknown"'
10512 : see if strtod exists
10513 set strtod d_strtod
10516 : see if strtol exists
10517 set strtol d_strtol
10520 : see if strtoul exists
10521 set strtoul d_strtoul
10524 : see if strtoull exists
10525 set strtoull d_strtoull
10528 : see if strxfrm exists
10529 set strxfrm d_strxfrm
10532 : see if symlink exists
10533 set symlink d_symlink
10536 : see if syscall exists
10537 set syscall d_syscall
10540 : see if sysconf exists
10541 set sysconf d_sysconf
10544 : see if system exists
10545 set system d_system
10548 : see if tcgetpgrp exists
10549 set tcgetpgrp d_tcgetpgrp
10552 : see if tcsetpgrp exists
10553 set tcsetpgrp d_tcsetpgrp
10556 : see if sys/types.h has to be included
10557 set sys/types.h i_systypes
10560 : see if prototype for telldir is available
10562 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10565 : define an is-a-typedef? function
10566 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10568 "") inclist="sys/types.h";;
10570 eval "varval=\$$var";
10574 for inc in $inclist; do
10575 echo "#include <$inc>" >>temp.c;
10577 echo "#ifdef $type" >> temp.c;
10578 echo "printf(\"We have $type\");" >> temp.c;
10579 echo "#endif" >> temp.c;
10580 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10581 if $contains $type temp.E >/dev/null 2>&1; then
10582 eval "$var=\$type";
10587 *) eval "$var=\$varval";;
10590 : define an is-a-typedef? function that prompts if the type is not available.
10591 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10593 "") inclist="sys/types.h";;
10595 eval "varval=\$$var";
10599 for inc in $inclist; do
10600 echo "#include <$inc>" >>temp.c;
10602 echo "#ifdef $type" >> temp.c;
10603 echo "printf(\"We have $type\");" >> temp.c;
10604 echo "#endif" >> temp.c;
10605 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10607 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10608 if $contains $type temp.E >/dev/null 2>&1; then
10609 echo "$type found." >&4;
10610 eval "$var=\$type";
10612 echo "$type NOT found." >&4;
10618 *) eval "$var=\$varval";;
10621 : see if this is a sys/times.h system
10622 set sys/times.h i_systimes
10625 : see if times exists
10627 if set times val -f d_times; eval $csym; $val; then
10628 echo 'times() found.' >&4
10631 case "$i_systimes" in
10632 "$define") inc='sys/times.h';;
10634 rp="What is the type returned by times() on this system?"
10635 set clock_t clocktype long stdio.h sys/types.h $inc
10638 echo 'times() NOT found, hope that will do.' >&4
10643 : see if truncate exists
10644 set truncate d_truncate
10647 : see if tzname[] exists
10649 if set tzname val -a d_tzname; eval $csym; $val; then
10651 echo 'tzname[] found.' >&4
10654 echo 'tzname[] NOT found.' >&4
10659 : see if umask exists
10663 : backward compatibility for d_hvfork
10664 if test X$d_hvfork != X; then
10665 d_vfork="$d_hvfork"
10668 : see if there is a vfork
10673 : Ok, but do we want to use it. vfork is reportedly unreliable in
10674 : perl on Solaris 2.x, and probably elsewhere.
10678 case "$usevfork" in
10684 Perl can only use a vfork() that doesn't suffer from strict
10685 restrictions on calling functions or modifying global data in
10686 the child. For example, glibc-2.1 contains such a vfork()
10687 that is unsuitable. If your system provides a proper fork()
10688 call, chances are that you do NOT want perl to use vfork().
10691 rp="Do you still want to use vfork()?"
10696 echo "Ok, we won't use vfork()."
10705 $define) usevfork='true';;
10706 *) usevfork='false';;
10709 : see if this is an sysdir system
10710 set sys/dir.h i_sysdir
10713 : see if this is an sysndir system
10714 set sys/ndir.h i_sysndir
10717 : see if closedir exists
10718 set closedir d_closedir
10721 case "$d_closedir" in
10724 echo "Checking whether closedir() returns a status..." >&4
10725 cat > closedir.c <<EOM
10726 #$i_dirent I_DIRENT /**/
10727 #$i_sysdir I_SYS_DIR /**/
10728 #$i_sysndir I_SYS_NDIR /**/
10729 #$i_systypes I_SYS_TYPES /**/
10731 #if defined(I_SYS_TYPES)
10732 #include <sys/types.h>
10734 #if defined(I_DIRENT)
10735 #include <dirent.h>
10736 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10737 #include <sys/dir.h>
10741 #include <sys/ndir.h>
10745 #include <ndir.h> /* may be wrong in the future */
10747 #include <sys/dir.h>
10752 int main() { return closedir(opendir(".")); }
10755 if eval $compile_ok; then
10756 if ./closedir > /dev/null 2>&1 ; then
10757 echo "Yes, it does."
10760 echo "No, it doesn't."
10764 echo "(I can't seem to compile the test program--assuming it doesn't)"
10772 set d_void_closedir
10775 : check for volatile keyword
10777 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10778 $cat >try.c <<'EOCP'
10781 typedef struct _goo_struct goo_struct;
10782 goo_struct * volatile goo = ((goo_struct *)0);
10783 struct _goo_struct {
10788 typedef unsigned short foo_t;
10789 char *volatile foo;
10791 volatile foo_t blech;
10795 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10797 echo "Yup, it does."
10800 echo "Nope, it doesn't."
10806 : see if there is a wait4
10810 : see if waitpid exists
10811 set waitpid d_waitpid
10814 : see if wcstombs exists
10815 set wcstombs d_wcstombs
10818 : see if wctomb exists
10819 set wctomb d_wctomb
10822 : see if writev exists
10823 set writev d_writev
10826 : preserve RCS keywords in files with variable substitution, grrr
10831 Revision='$Revision'
10833 case "$crosscompile" in
10834 ''|[nN]*) crosscompile="$undef" ;;
10838 next|rhapsody) multiarch="$define" ;;
10840 case "$multiarch" in
10841 ''|[nN]*) multiarch="$undef" ;;
10844 : check for alignment requirements
10846 case "$crosscompile$multiarch" in
10849 You seem to be either cross-compiling or doing a multiarchitecture build,
10850 skipping the memory alignment check.
10853 case "$alignbytes" in
10854 '') alignbytes=8 ;;
10858 case "$alignbytes" in
10859 '') echo "Checking alignment constraints..." >&4
10860 $cat >try.c <<'EOCP'
10867 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10871 if eval $compile_ok; then
10875 echo "(I can't seem to compile the test program...)"
10878 *) dflt="$alignbytes"
10881 rp="Doubles must be aligned on a how-many-byte boundary?"
10889 : check for ordering of bytes in a long
10891 case "$crosscompile$multiarch" in
10894 You seem to be either cross-compiling or doing a multiarchitecture build,
10895 skipping the byteorder check.
10901 case "$byteorder" in
10904 In the following, larger digits indicate more significance. A big-endian
10905 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10906 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10907 machines may have weird orders like 3412. A Cray will report 87654321,
10908 an Alpha will report 12345678. If the test program works the default is
10910 I'm now running the test program...
10912 $cat >try.c <<'EOCP'
10919 char c[sizeof(long)];
10922 if (sizeof(long) > 4)
10923 u.l = (0x08070605L << 32) | 0x04030201L;
10926 for (i = 0; i < sizeof(long); i++)
10927 printf("%c", u.c[i]+'0');
10934 if eval $compile && ./try > /dev/null; then
10937 [1-4][1-4][1-4][1-4]|12345678|87654321)
10938 echo "(The test program ran ok.)"
10939 echo "byteorder=$dflt"
10942 ????|????????) echo "(The test program ran ok.)" ;;
10943 *) echo "(The test program didn't run right for some reason.)" ;;
10948 (I can't seem to compile the test program. Guessing big-endian...)
10951 case "$xxx_prompt" in
10953 rp="What is the order of bytes in a long?"
10967 : how do we catenate cpp tokens here?
10969 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10970 $cat >cpp_stuff.c <<'EOCP'
10971 #define RCAT(a,b)a/**/b
10972 #define ACAT(a,b)a ## b
10976 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10977 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10978 echo "Oh! Smells like ANSI's been here." >&4
10979 echo "We can catify or stringify, separately or together!"
10981 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10982 echo "Ah, yes! The good old days!" >&4
10983 echo "However, in the good old days we don't know how to stringify and"
10984 echo "catify at the same time."
10988 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
10989 to have to edit the values of CAT[2-5] in config.h...
10991 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
10995 : see if this is a db.h system
11001 : Check db version.
11003 echo "Checking Berkeley DB version ..." >&4
11009 #include <sys/types.h>
11014 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11015 int Major, Minor, Patch ;
11016 unsigned long Version ;
11017 (void)db_version(&Major, &Minor, &Patch) ;
11018 printf("You have Berkeley DB Version 2 or greater\n");
11020 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11021 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11022 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11023 Major, Minor, Patch) ;
11025 /* check that db.h & libdb are compatible */
11026 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11027 printf("db.h and libdb are incompatible\n") ;
11031 printf("db.h and libdb are compatible\n") ;
11033 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11034 + DB_VERSION_PATCH ;
11036 /* needs to be >= 2.3.4 */
11037 if (Version < 2003004) {
11038 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11039 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11045 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11046 printf("You have Berkeley DB Version 1\n");
11047 exit(0); /* DB version < 2: the coast is clear. */
11049 exit(1); /* <db.h> not Berkeley DB? */
11055 if eval $compile && ./try; then
11056 echo 'Looks OK.' >&4
11058 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11062 : Remove db from list of libraries to use
11063 echo "Removing unusable -ldb from library list" >&4
11064 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11067 echo "libs = $libs" >&4
11077 : Check the return type needed for hash
11079 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11085 #include <sys/types.h>
11088 #ifndef DB_VERSION_MAJOR
11089 u_int32_t hash_cb (ptr, size)
11097 info.hash = hash_cb;
11101 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11102 if $contains warning try.out >>/dev/null 2>&1 ; then
11105 db_hashtype='u_int32_t'
11108 : XXX Maybe we should just give up here.
11109 db_hashtype=u_int32_t
11111 echo "Help: I can't seem to compile the db test program." >&4
11112 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11115 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11117 *) db_hashtype=u_int32_t
11122 : Check the return type needed for prefix
11124 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11130 #include <sys/types.h>
11133 #ifndef DB_VERSION_MAJOR
11134 size_t prefix_cb (key1, key2)
11142 info.prefix = prefix_cb;
11146 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11147 if $contains warning try.out >>/dev/null 2>&1 ; then
11148 db_prefixtype='int'
11150 db_prefixtype='size_t'
11153 db_prefixtype='size_t'
11154 : XXX Maybe we should just give up here.
11156 echo "Help: I can't seem to compile the db test program." >&4
11157 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11160 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11162 *) db_prefixtype='size_t'
11166 : check for void type
11168 echo "Checking to see how well your C compiler groks the void type..." >&4
11169 case "$voidflags" in
11171 $cat >try.c <<'EOCP'
11177 extern void moo(); /* function returning void */
11178 void (*goo)(); /* ptr to func returning void */
11180 void *hue; /* generic ptr */
11193 int main() { sub(); }
11195 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11196 voidflags=$defvoidused
11197 echo "Good. It appears to support void to the level $package wants.">&4
11198 if $contains warning .out >/dev/null 2>&1; then
11199 echo "However, you might get some warnings that look like this:"
11203 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11204 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11205 echo "It supports 1..."
11206 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11207 echo "It also supports 2..."
11208 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11210 echo "And it supports 4 but not 8 definitely."
11212 echo "It doesn't support 4..."
11213 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11215 echo "But it supports 8."
11218 echo "Neither does it support 8."
11222 echo "It does not support 2..."
11223 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11225 echo "But it supports 4 and 8."
11227 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11229 echo "And it supports 4 but has not heard about 8."
11231 echo "However it supports 8 but not 4."
11236 echo "There is no support at all for void."
11241 case "$voidflags" in
11243 *) $cat >&4 <<'EOM'
11244 Support flag bits are:
11245 1: basic void declarations.
11246 2: arrays of pointers to functions returning void.
11247 4: operations between pointers to and addresses of void functions.
11248 8: generic void pointers.
11251 rp="Your void support flags add up to what?"
11259 : How can we generate normalized random numbers ?
11261 echo "Looking for a random number function..." >&4
11262 case "$randfunc" in
11264 if set drand48 val -f; eval $csym; $val; then
11266 echo "Good, found drand48()." >&4
11267 elif set random val -f; eval $csym; $val; then
11269 echo "OK, found random()." >&4
11272 echo "Yick, looks like I have to use rand()." >&4
11283 *-Dmy_rand=*|*-Dmy_srand=*)
11284 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11285 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11286 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11287 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11291 while $test "$cont"; do
11292 rp="Use which function to generate random numbers?"
11294 if $test "$ans" = "$dflt"; then
11300 if set $ans val -f; eval $csym; $val; then
11304 rp="I cannot find function $ans. Use that name anyway?"
11313 case "$randfunc" in
11315 drand01="drand48()"
11321 case "$randbits" in
11323 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11325 #$i_unistd I_UNISTD
11326 #$i_stdlib I_STDLIB
11329 # include <unistd.h>
11332 # include <stdlib.h>
11337 register unsigned long tmp;
11338 register unsigned long max = 0L;
11340 for (i = 1000; i; i--) {
11341 tmp = (unsigned long) $randfunc();
11342 if (tmp > max) max = tmp;
11344 for (i = 0; max; i++)
11350 if eval $compile_ok; then
11354 echo "(I can't seem to compile the test program...)"
11361 rp="How many bits does your $randfunc() function produce?"
11365 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11366 seedfunc="s$randfunc"
11367 randseedtype=unsigned
11371 rp="How many bits does your $randfunc() function produce?"
11374 seedfunc="s$randfunc"
11375 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11376 if set $seedfunc val -f; eval $csym; $val; then
11377 echo "(Using $seedfunc() to seed random generator)"
11379 echo "(Warning: no $seedfunc() to seed random generator)"
11382 randseedtype=unsigned
11390 echo "Determining whether or not we are on an EBCDIC system..." >&4
11391 $cat >tebcdic.c <<'EOM'
11394 if ('M'==0xd4) return 0;
11401 if eval $compile_ok; then
11403 echo "You have EBCDIC." >&4
11406 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
11409 echo "I'm unable to compile the test program." >&4
11410 echo "I'll assume ASCII or some ISO Latin." >&4
11412 $rm -f tebcdic.c tebcdic
11418 Checking how to flush all pending stdio output...
11420 # I only know how to find the first 32 possibly open files on SunOS.
11421 # See also hints/sunos_4_1.sh and util.c --AD
11423 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11425 $cat >>try.c <<EOCP
11427 #$i_unistd I_UNISTD
11429 # include <unistd.h>
11431 #$d_sysconf HAS_SYSCONF
11432 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11433 #ifdef HAS_STDIO_STREAM_ARRAY
11434 # define STDIO_STREAM_ARRAY $stdio_stream_array
11437 FILE* p = fopen("try.out", "w");
11441 # ifdef TRY_FPRINTF
11445 #ifdef TRY_FFLUSH_NULL
11448 #ifdef TRY_FFLUSH_ALL
11450 long open_max = -1;
11451 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11452 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11454 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11455 open_max = sysconf(_SC_OPEN_MAX);
11458 open_max = FOPEN_MAX;
11461 open_max = OPEN_MAX;
11470 # ifdef HAS_STDIO_STREAM_ARRAY
11471 if (open_max > 0) {
11473 for (i = 0; i < open_max; i++)
11474 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11475 STDIO_STREAM_ARRAY[i]._file < open_max &&
11476 STDIO_STREAM_ARRAY[i]._flag)
11477 fflush(&STDIO_STREAM_ARRAY[i]);
11485 : first we have to find out how _not_ to flush
11486 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11488 set try -DTRY_FPUTC
11489 if eval $compile; then
11491 ./try$exe_ext 2>/dev/null
11492 if $test ! -s try.out -a "X$?" = X42; then
11498 set try -DTRY_FPRINTF
11500 if eval $compile; then
11502 ./try$exe_ext 2>/dev/null
11503 if $test ! -s try.out -a "X$?" = X42; then
11504 output=-DTRY_FPRINTF
11510 : check for fflush NULL behaviour
11511 case "$fflushNULL" in
11512 '') set try -DTRY_FFLUSH_NULL $output
11513 if eval $compile; then
11515 ./try$exe_ext 2>/dev/null
11517 if $test -s try.out -a "X$code" = X42; then
11518 fflushNULL="`$cat try.out`"
11520 if $test "X$code" != X42; then
11522 (If this test failed, don't worry, we'll try another method shortly.)
11527 $rm -f core try.core core.try.*
11528 case "$fflushNULL" in
11530 Your fflush(NULL) works okay.
11532 fflushNULL="$define"
11535 Your fflush(NULL) isn't working (contrary to ANSI C).
11537 fflushNULL="$undef"
11540 Cannot figure out whether your fflush(NULL) works or not.
11541 I'm assuming it doesn't (contrary to ANSI C).
11543 fflushNULL="$undef"
11547 $define|true|[yY]*)
11548 fflushNULL="$define"
11551 fflushNULL="$undef"
11554 : check explicit looping only if NULL did not work
11555 case "$fflushNULL" in
11557 : check for fflush all behaviour
11558 case "$fflushall" in
11559 '') set try -DTRY_FFLUSH_ALL $output
11560 if eval $compile; then
11562 (Now testing the other method--but note that also this may fail.)
11565 ./try$exe_ext 2>/dev/null
11566 if $test -s try.out -a "X$?" = X42; then
11567 fflushall="`$cat try.out`"
11570 $rm -f core try.core core.try.*
11571 case "$fflushall" in
11573 Whew. Flushing explicitly all the stdio streams works.
11575 fflushall="$define"
11578 Sigh. Flushing explicitly all the stdio streams doesn't work.
11583 Cannot figure out whether flushing stdio streams explicitly works or not.
11584 I'm assuming it doesn't.
11590 "$define"|true|[yY]*)
11591 fflushall="$define"
11598 *) fflushall="$undef"
11601 case "$fflushNULL$fflushall" in
11604 I cannot figure out how to flush pending stdio output.
11608 $rm -f try.* try$exe_ext
11610 : see what type file positions are declared as in the library
11611 rp="What is the type for file position used by fsetpos()?"
11612 set fpos_t fpostype long stdio.h sys/types.h
11615 : Store the full pathname to the ar program for use in the C program
11616 : Respect a hint or command line value for full_ar.
11621 : Store the full pathname to the sed program for use in the C program
11624 : see what type gids are declared as in the kernel
11626 echo "Looking for the type for group ids returned by getgid()."
11627 set gid_t gidtype xxx stdio.h sys/types.h
11631 xxx=`./findhdr sys/user.h`
11632 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11634 unsigned) dflt="$1 $2" ;;
11638 *) dflt="$gidtype";;
11641 gid_t) echo "gid_t found." ;;
11642 *) rp="What is the type for group ids returned by getgid()?"
11648 : see if getgroups exists
11649 set getgroups d_getgrps
11652 : see if setgroups exists
11653 set setgroups d_setgrps
11657 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11659 case "$d_getgrps$d_setgrps" in
11661 case "$groupstype" in
11662 '') dflt="$gidtype" ;;
11663 *) dflt="$groupstype" ;;
11666 What type of pointer is the second argument to getgroups() and setgroups()?
11667 Usually this is the same as group ids, $gidtype, but not always.
11670 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11674 *) groupstype="$gidtype";;
11677 : see what type lseek is declared as in the kernel
11678 rp="What is the type used for lseek's offset on this system?"
11679 set off_t lseektype long stdio.h sys/types.h
11683 $echo $n "Checking to see how big your file offsets are...$c" >&4
11685 #include <sys/types.h>
11689 printf("%d\n", sizeof($lseektype));
11693 if eval $compile_ok; then
11695 $echo " $lseeksize bytes." >&4
11699 echo "(I can't seem to compile the test program. Guessing...)"
11700 rp="What is the size of your file offsets (in bytes)?"
11707 echo "Checking if your $make program sets \$(MAKE)..." >&4
11708 case "$make_set_make" in
11710 $sed 's/^X //' > testmake.mak << 'EOF'
11712 X @echo 'maketemp="$(MAKE)"'
11714 case "`$make -f testmake.mak 2>/dev/null`" in
11715 *maketemp=*) make_set_make='#' ;;
11716 *) make_set_make="MAKE=$make" ;;
11718 $rm -f testmake.mak
11721 case "$make_set_make" in
11722 '#') echo "Yup, it does.";;
11723 *) echo "Nope, it doesn't.";;
11726 : see what type is used for mode_t
11727 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11728 set mode_t modetype int stdio.h sys/types.h
11731 : define a fucntion to check prototypes
11732 $cat > protochk <<EOSH
11735 optimize="$optimize"
11737 prototype="$prototype"
11742 $cat >> protochk <<'EOSH'
11747 while test $# -ge 2; do
11749 $define) echo "#include <$2>" >> try.c ;;
11750 literal) echo "$2" >> try.c ;;
11754 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11755 cat >> try.c <<'EOCP'
11756 #ifdef CAN_PROTOTYPE
11757 #define _(args) args
11762 echo "$foo" >> try.c
11763 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11764 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11770 $eunicefix protochk
11772 : see what type is used for size_t
11773 rp="What is the type used for the length parameter for string functions?"
11774 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11777 : check for type of arguments to gethostbyaddr.
11778 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11779 case "$d_gethbyaddr" in
11783 Checking to see what type of arguments are accepted by gethostbyaddr().
11785 hdrs="$define sys/types.h
11786 $d_socket sys/socket.h
11787 $i_niin netinet/in.h
11789 $i_unistd unistd.h"
11790 : The first arg can 'char *' or 'void *'
11791 : The second arg is some of integral type
11792 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11793 for yyy in size_t long int; do
11794 case "$netdb_host_type" in
11795 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11796 if ./protochk "$try" $hdrs; then
11797 echo "Your system accepts $xxx for the first arg."
11798 echo "...and $yyy for the second arg."
11799 netdb_host_type="$xxx"
11800 netdb_hlen_type="$yyy"
11806 : In case none of those worked, prompt the user.
11807 case "$netdb_host_type" in
11808 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11811 netdb_host_type=$ans
11812 rp='What is the type for the 2nd argument to gethostbyaddr?'
11815 netdb_hlen_type=$ans
11819 *) : no gethostbyaddr, so pick harmless defaults
11820 netdb_host_type='char *'
11821 netdb_hlen_type="$sizetype"
11824 # Remove the "const" if needed. -- but then we'll have a
11826 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11829 : check for type of argument to gethostbyname.
11830 if test "X$netdb_name_type" = X ; then
11831 case "$d_gethbyname" in
11835 Checking to see what type of argument is accepted by gethostbyname().
11837 hdrs="$define sys/types.h
11838 $d_socket sys/socket.h
11839 $i_niin netinet/in.h
11841 $i_unistd unistd.h"
11842 for xxx in "const char *" "char *"; do
11843 case "$netdb_name_type" in
11844 '') try="extern struct hostent *gethostbyname($xxx);"
11845 if ./protochk "$try" $hdrs; then
11846 echo "Your system accepts $xxx."
11847 netdb_name_type="$xxx"
11852 : In case none of those worked, prompt the user.
11853 case "$netdb_name_type" in
11854 '') rp='What is the type for the 1st argument to gethostbyname?'
11857 netdb_name_type=$ans
11861 *) : no gethostbyname, so pick harmless default
11862 netdb_name_type='char *'
11867 : check for type of 1st argument to getnetbyaddr.
11868 if test "X$netdb_net_type" = X ; then
11869 case "$d_getnbyaddr" in
11873 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11875 hdrs="$define sys/types.h
11876 $d_socket sys/socket.h
11877 $i_niin netinet/in.h
11879 $i_unistd unistd.h"
11880 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11881 case "$netdb_net_type" in
11882 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11883 if ./protochk "$try" $hdrs; then
11884 echo "Your system accepts $xxx."
11885 netdb_net_type="$xxx"
11890 : In case none of those worked, prompt the user.
11891 case "$netdb_net_type" in
11892 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11895 netdb_net_type=$ans
11899 *) : no getnetbyaddr, so pick harmless default
11900 netdb_net_type='long'
11904 : locate the preferred pager for this system
11918 '') dflt=/usr/ucb/more;;
11925 rp='What pager is used on your system?'
11929 : see what type pids are declared as in the kernel
11930 rp="What is the type of process ids on this system?"
11931 set pid_t pidtype int stdio.h sys/types.h
11934 : check for length of pointer
11938 $echo $n "Checking to see how big your pointers are...$c" >&4
11939 if test "$voidflags" -gt 7; then
11940 echo '#define VOID_PTR char *' > try.c
11942 echo '#define VOID_PTR void *' > try.c
11944 $cat >>try.c <<'EOCP'
11948 printf("%d\n", sizeof(VOID_PTR));
11953 if eval $compile_ok; then
11955 $echo " $ptrsize bytes." >&4
11958 echo "(I can't seem to compile the test program. Guessing...)" >&4
11959 rp="What is the size of a pointer (in bytes)?"
11967 : see if ar generates random libraries by itself
11969 echo "Checking how to generate random libraries on your machine..." >&4
11970 echo 'int bar1() { return bar2(); }' > bar1.c
11971 echo 'int bar2() { return 2; }' > bar2.c
11972 $cat > foo.c <<'EOP'
11973 int main() { printf("%d\n", bar1()); exit(0); }
11975 $cc $ccflags -c bar1.c >/dev/null 2>&1
11976 $cc $ccflags -c bar2.c >/dev/null 2>&1
11977 $cc $ccflags -c foo.c >/dev/null 2>&1
11978 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
11979 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11980 ./foobar >/dev/null 2>&1; then
11981 echo "$ar appears to generate random libraries itself."
11984 elif $ar ts bar$_a >/dev/null 2>&1 &&
11985 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11986 ./foobar >/dev/null 2>&1; then
11987 echo "a table of contents needs to be added with '$ar ts'."
11994 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
11995 $test -f $ranlib || ranlib=''
11998 if $test -n "$ranlib"; then
11999 echo "your system has '$ranlib'; we'll use that."
12002 echo "your system doesn't seem to support random libraries"
12003 echo "so we'll use lorder and tsort to order the libraries."
12010 : check for type of arguments to select.
12011 case "$selecttype" in
12012 '') case "$d_select" in
12015 Checking to see what type of arguments are accepted by select().
12017 hdrs="$define sys/types.h
12018 $i_systime sys/time.h
12019 $i_sysselct sys/select.h
12020 $d_socket sys/socket.h"
12021 : The first arg can be int, unsigned, or size_t
12022 : The last arg may or may not be 'const'
12024 : void pointer has been seen but using that
12025 : breaks the selectminbits test
12026 for xxx in 'fd_set *' 'int *'; do
12027 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12028 for tmo in 'struct timeval *' 'const struct timeval *'; do
12030 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12031 if ./protochk "$try" $hdrs; then
12032 echo "Your system accepts $xxx."
12041 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12042 case "$d_fd_set" in
12043 $define) dflt="fd_set *" ;;
12052 *) : no select, so pick a harmless default
12059 : check for the select 'width'
12060 case "$selectminbits" in
12061 '') case "$d_select" in
12065 Checking to see on how many bits at a time your select() operates...
12068 #include <sys/types.h>
12070 #$i_systime I_SYS_TIME
12071 #$i_systimek I_SYS_TIME_KERNEL
12076 # ifdef I_SYS_TIME_KERNEL
12079 # include <sys/time.h>
12080 # ifdef I_SYS_TIME_KERNEL
12084 #$i_sysselct I_SYS_SELECT
12085 #ifdef I_SYS_SELECT
12086 #include <sys/select.h>
12088 #$d_socket HAS_SOCKET
12090 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12094 #define S sizeof(*(b))
12096 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12097 #define NBITS (NBYTES * 8)
12106 fp = fopen("try.c", "r");
12112 b = ($selecttype)s;
12113 for (i = 0; i < NBITS; i++)
12117 select(fd + 1, b, 0, 0, &t);
12118 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12119 printf("%d\n", i + 1);
12124 if eval $compile_ok; then
12125 selectminbits=`./try`
12126 case "$selectminbits" in
12128 Cannot figure out on how many bits at a time your select() operates.
12129 I'll play safe and guess it is 32 bits.
12135 *) bits="$selectminbits bits" ;;
12137 echo "Your select() operates on $bits at a time." >&4
12139 rp='What is the minimum number of bits your select() operates on?'
12140 case "$byteorder" in
12141 1234|12345678) dflt=32 ;;
12146 selectminbits="$val"
12150 *) : no select, so pick a harmless default
12157 : Trace out the files included by signal.h, then look for SIGxxx names.
12158 : Remove SIGARRAYSIZE used by HPUX.
12159 : Remove SIGSTKSIZE used by Linux.
12160 : Remove SIGSTKSZ used by Posix.
12161 : Remove SIGTYP void lines used by OS2.
12162 xxx=`echo '#include <signal.h>' |
12163 $cppstdin $cppminus $cppflags 2>/dev/null |
12164 $grep '^[ ]*#.*include' |
12165 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12166 : Check this list of files to be sure we have parsed the cpp output ok.
12167 : This will also avoid potentially non-existent files, such
12170 for xx in $xxx /dev/null ; do
12171 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12173 : If we have found no files, at least try signal.h
12174 case "$xxxfiles" in
12175 '') xxxfiles=`./findhdr signal.h` ;;
12178 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12179 print substr($2, 4, 20)
12181 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12182 print substr($3, 4, 20)
12184 : Append some common names just in case the awk scan failed.
12185 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12186 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12187 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12188 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12189 : generate a few handy files for later
12190 $cat > signal.c <<'EOCP'
12191 #include <sys/types.h>
12192 #include <signal.h>
12196 /* Strange style to avoid deeply-nested #if/#else/#endif */
12199 # define NSIG (_NSIG)
12205 # define NSIG (SIGMAX+1)
12211 # define NSIG (SIG_MAX+1)
12217 # define NSIG (MAXSIG+1)
12223 # define NSIG (MAX_SIG+1)
12228 # ifdef SIGARRAYSIZE
12229 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12235 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12239 /* Default to some arbitrary number that's big enough to get most
12240 of the common signals.
12246 printf("NSIG %d\n", NSIG);
12252 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12254 printf "#ifdef SIG"; printf $1; printf "\n"
12255 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12256 printf $1; printf ");\n"
12260 printf "#endif /* JUST_NSIG */\n";
12264 $cat >signal.awk <<'EOP'
12265 BEGIN { ndups = 0 }
12266 $1 ~ /^NSIG$/ { nsig = $2 }
12267 ($1 !~ /^NSIG$/) && (NF == 2) {
12268 if ($2 > maxsig) { maxsig = $2 }
12269 if (sig_name[$2]) {
12270 dup_name[ndups] = $1
12271 dup_num[ndups] = $2
12283 printf("NSIG %d\n", nsig);
12284 for (n = 1; n < nsig; n++) {
12286 printf("%s %d\n", sig_name[n], sig_num[n])
12289 printf("NUM%d %d\n", n, n)
12292 for (n = 0; n < ndups; n++) {
12293 printf("%s %d\n", dup_name[n], dup_num[n])
12297 $cat >signal_cmd <<EOS
12299 if $test -s signal.lst; then
12300 echo "Using your existing signal.lst file"
12305 $cat >>signal_cmd <<'EOS'
12308 if eval $compile_ok; then
12309 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12311 echo "(I can't seem be able to compile the whole test program)" >&4
12312 echo "(I'll try it in little pieces.)" >&4
12313 set signal -DJUST_NSIG
12314 if eval $compile_ok; then
12315 ./signal$_exe > signal.nsg
12318 echo "I can't seem to figure out how many signals you have." >&4
12319 echo "Guessing 50." >&4
12320 echo 'NSIG 50' > signal.nsg
12322 : Now look at all the signal names, one at a time.
12323 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12324 $cat > signal.c <<EOCP
12325 #include <sys/types.h>
12326 #include <signal.h>
12329 printf("$xx %d\n", SIG${xx});
12334 if eval $compile; then
12335 echo "SIG${xx} found."
12336 ./signal$_exe >> signal.ls1
12338 echo "SIG${xx} NOT found."
12341 if $test -s signal.ls1; then
12342 $cat signal.nsg signal.ls1 |
12343 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12347 if $test -s signal.lst; then
12350 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12351 echo 'kill -l' >signal
12352 set X `csh -f <signal`
12356 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12358 echo $@ | $tr ' ' $trnl | \
12359 $awk '{ printf "%s %d\n", $1, ++s; }
12360 END { printf "NSIG %d\n", ++s }' >signal.lst
12362 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12364 chmod a+x signal_cmd
12365 $eunicefix signal_cmd
12367 : generate list of signal names
12369 case "$sig_name_init" in
12371 *) case "$sig_num_init" in
12372 ''|*,*) doinit=yes ;;
12377 echo "Generating a list of signal names and numbers..." >&4
12379 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12380 sig_name=`$awk 'BEGIN { printf "ZERO " }
12381 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12382 sig_num=`$awk 'BEGIN { printf "0 " }
12383 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12384 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12385 !/^NSIG/ { printf "\"%s\", ", $1 }
12386 END { printf "0\n" }' signal.lst`
12387 sig_num_init=`$awk 'BEGIN { printf "0, " }
12388 !/^NSIG/ { printf "%d, ", $2}
12389 END { printf "0\n"}' signal.lst`
12392 echo "The following $sig_count signals are available:"
12394 echo $sig_name | $awk \
12395 'BEGIN { linelen = 0 }
12397 for (i = 1; i <= NF; i++) {
12398 name = "SIG" $i " "
12399 linelen = linelen + length(name)
12400 if (linelen > 70) {
12402 linelen = length(name)
12408 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12410 : see what type is used for signed size_t
12411 set ssize_t ssizetype int stdio.h sys/types.h
12414 $cat > ssize.c <<EOM
12416 #include <sys/types.h>
12417 #define Size_t $sizetype
12418 #define SSize_t $dflt
12421 if (sizeof(Size_t) == sizeof(SSize_t))
12423 else if (sizeof(Size_t) == sizeof(int))
12432 if eval $compile_ok && ./ssize > /dev/null; then
12433 ssizetype=`./ssize`
12434 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12437 Help! I can't compile and run the ssize_t test program: please enlighten me!
12438 (This is probably a misconfiguration in your system or libraries, and
12439 you really ought to fix it. Still, I'll try anyway.)
12441 I need a type that is the same size as $sizetype, but is guaranteed to
12442 be signed. Common values are ssize_t, int and long.
12445 rp="What signed type is the same size as $sizetype?"
12449 $rm -f ssize ssize.*
12451 : see what type of char stdio uses.
12453 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12454 echo "Your stdio uses unsigned chars." >&4
12455 stdchar="unsigned char"
12457 echo "Your stdio uses signed chars." >&4
12461 : see if time exists
12463 if test "X$d_time" = X -o X"$timetype" = X; then
12464 if set time val -f d_time; eval $csym; $val; then
12465 echo 'time() found.' >&4
12467 rp="What is the type returned by time() on this system?"
12468 set time_t timetype long stdio.h sys/types.h
12471 echo 'time() not found, hope that will do.' >&4
12479 : see what type uids are declared as in the kernel
12481 echo "Looking for the type for user ids returned by getuid()."
12482 set uid_t uidtype xxx stdio.h sys/types.h
12486 xxx=`./findhdr sys/user.h`
12487 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12489 unsigned) dflt="$1 $2" ;;
12493 *) dflt="$uidtype";;
12496 uid_t) echo "uid_t found." ;;
12497 *) rp="What is the type for user ids returned by getuid()?"
12503 : see if dbm.h is available
12504 : see if dbmclose exists
12505 set dbmclose d_dbmclose
12508 case "$d_dbmclose" in
12518 *) set rpcsvc/dbm.h i_rpcsvcdbm
12523 *) echo "We won't be including <dbm.h>"
12533 : see if this is a sys/file.h system
12538 : do we need to include sys/file.h ?
12542 if $h_sysfile; then
12544 echo "We'll be including <sys/file.h>." >&4
12547 echo "We won't be including <sys/file.h>." >&4
12557 : see if fcntl.h is there
12562 : see if we can include fcntl.h
12568 echo "We'll be including <fcntl.h>." >&4
12571 if $h_sysfile; then
12572 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12574 echo "We won't be including <fcntl.h>." >&4
12586 : see if locale.h is available
12587 set locale.h i_locale
12590 : see if mach cthreads are available
12591 if test "X$usethreads" = "X$define"; then
12592 set mach/cthreads.h i_machcthr
12595 i_machcthr="$undef"
12600 : see if this is a math.h system
12604 : see if this is a mntent.h system
12605 set mntent.h i_mntent
12608 : see if ndbm.h is available
12613 : see if dbm_open exists
12614 set dbm_open d_dbm_open
12616 case "$d_dbm_open" in
12619 echo "We won't be including <ndbm.h>"
12628 : see if net/errno.h is available
12630 set net/errno.h val
12633 : Unfortunately, it causes problems on some systems. Arrgh.
12636 cat > try.c <<'EOM'
12639 #include <net/errno.h>
12645 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12646 echo "We'll be including <net/errno.h>." >&4
12648 echo "We won't be including <net/errno.h>." >&4
12657 : see if netinet/tcp.h is available
12658 set netinet/tcp.h i_netinettcp
12661 : see if this is a poll.h system
12665 : get C preprocessor symbols handy
12667 $echo $n "Hmm... $c"
12668 echo $al | $tr ' ' $trnl >Cppsym.know
12669 $cat <<EOSS >Cppsym
12677 case "\$list\$#" in
12680 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12682 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12685 unknown="\$unknown \$sym"
12695 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12697 exit 0; _ _ _ _\1\\ \1\\
12700 echo "exit 1; _ _ _" >>Cppsym\$\$
12701 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12703 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12709 $rm -f Cppsym\$\$ Cppsym2\$\$
12714 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12716 : now check the C compiler for additional symbols
12717 postprocess_cc_v=''
12719 aix) postprocess_cc_v="|$tr , ' '" ;;
12726 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12729 -D*) echo "\$i" | $sed 's/^-D//';;
12730 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12735 postprocess_cc_v=''
12738 ./ccsym > ccsym1.raw
12739 if $test -s ccsym1.raw; then
12740 $sort ccsym1.raw | $uniq >ccsym.raw
12742 mv ccsym1.raw ccsym.raw
12745 $awk '/\=/ { print $0; next }
12746 { print $0"=1" }' ccsym.raw >ccsym.list
12747 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12748 $comm -13 ccsym.true ccsym.list >ccsym.own
12749 $comm -12 ccsym.true ccsym.list >ccsym.com
12750 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12752 if $test -z ccsym.raw; then
12753 echo "Your C compiler doesn't seem to define any symbols!" >&4
12755 echo "However, your C preprocessor defines the following symbols:"
12758 cppsymbols=`$cat Cppsym.true`
12759 cppsymbols=`echo $cppsymbols`
12760 cppccsymbols="$cppsymbols"
12762 if $test -s ccsym.com; then
12763 echo "Your C compiler and pre-processor define these symbols:"
12764 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12767 cppccsymbols=`$cat ccsym.com`
12768 cppccsymbols=`echo $cppccsymbols`
12769 $test "$silent" || sleep 1
12771 if $test -s ccsym.cpp; then
12772 $test "$also" && echo " "
12773 echo "Your C pre-processor ${also}defines the following symbols:"
12774 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12776 cppsymbols=`$cat ccsym.cpp`
12777 cppsymbols=`echo $cppsymbols`
12778 $test "$silent" || sleep 1
12780 if $test -s ccsym.own; then
12781 $test "$also" && echo " "
12782 echo "Your C compiler ${also}defines the following cpp symbols:"
12783 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12784 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12785 ccsymbols=`$cat ccsym.own`
12786 ccsymbols=`echo $ccsymbols`
12787 $test "$silent" || sleep 1
12792 : see if this is a termio system
12796 if $test `./findhdr termios.h`; then
12797 set tcsetattr i_termios
12803 "$define") echo "You have POSIX termios.h... good!" >&4;;
12804 *) if ./Cppsym pyr; then
12805 case "`/bin/universe`" in
12806 ucb) if $test `./findhdr sgtty.h`; then
12808 echo "<sgtty.h> found." >&4
12810 echo "System is pyramid with BSD universe."
12811 echo "<sgtty.h> not found--you could have problems." >&4
12813 *) if $test `./findhdr termio.h`; then
12815 echo "<termio.h> found." >&4
12817 echo "System is pyramid with USG universe."
12818 echo "<termio.h> not found--you could have problems." >&4
12822 if $test `./findhdr termio.h`; then
12823 echo "<termio.h> found." >&4
12825 elif $test `./findhdr sgtty.h`; then
12826 echo "<sgtty.h> found." >&4
12829 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12832 if $test `./findhdr sgtty.h`; then
12833 echo "<sgtty.h> found." >&4
12835 elif $test `./findhdr termio.h`; then
12836 echo "<termio.h> found." >&4
12839 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12843 set i_termio; eval $setvar
12844 val=$val2; set i_sgtty; eval $setvar
12845 val=$val3; set i_termios; eval $setvar
12847 : see if this is a shadow.h system
12848 set shadow.h i_shadow
12851 : see if this is a socks.h system
12852 set socks.h i_socks
12855 : see if stdarg is available
12857 if $test `./findhdr stdarg.h`; then
12858 echo "<stdarg.h> found." >&4
12861 echo "<stdarg.h> NOT found." >&4
12865 : see if varags is available
12867 if $test `./findhdr varargs.h`; then
12868 echo "<varargs.h> found." >&4
12870 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12873 : set up the varargs testing programs
12874 $cat > varargs.c <<EOP
12876 #include <stdarg.h>
12879 #include <varargs.h>
12883 int f(char *p, ...)
12897 p = va_arg(ap, char *);
12902 $cat > varargs <<EOP
12904 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12913 : now check which varargs header should be included
12918 if `./varargs I_STDARG`; then
12920 elif `./varargs I_VARARGS`; then
12925 if `./varargs I_VARARGS`; then
12932 echo "I could not find the definition for va_dcl... You have problems..." >&4
12933 val="$undef"; set i_stdarg; eval $setvar
12934 val="$undef"; set i_varargs; eval $setvar
12939 case "$i_varhdr" in
12941 val="$define"; set i_stdarg; eval $setvar
12942 val="$undef"; set i_varargs; eval $setvar
12945 val="$undef"; set i_stdarg; eval $setvar
12946 val="$define"; set i_varargs; eval $setvar
12949 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
12953 : see if stddef is available
12954 set stddef.h i_stddef
12957 : see if sys/access.h is available
12958 set sys/access.h i_sysaccess
12961 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
12962 set sys/filio.h i_sysfilio
12965 if $test `./findhdr sys/ioctl.h`; then
12967 echo '<sys/ioctl.h> found.' >&4
12970 if $test $i_sysfilio = "$define"; then
12971 echo '<sys/ioctl.h> NOT found.' >&4
12973 $test $i_sgtty = "$define" && xxx="sgtty.h"
12974 $test $i_termio = "$define" && xxx="termio.h"
12975 $test $i_termios = "$define" && xxx="termios.h"
12976 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
12982 : see if sys/resource.h has to be included
12983 set sys/resource.h i_sysresrc
12986 : see if sys/security.h is available
12987 set sys/security.h i_syssecrt
12990 : see if this is a sys/statvfs.h system
12991 set sys/statvfs.h i_sysstatvfs
12994 : see if this is a sys/un.h system
12995 set sys/un.h i_sysun
12998 : see if this is a syswait system
12999 set sys/wait.h i_syswait
13002 : see if this is an utime system
13003 set utime.h i_utime
13006 : see if this is a values.h system
13007 set values.h i_values
13010 : see if this is a vfork system
13013 set vfork.h i_vfork
13021 : see if gdbm.h is available
13026 : see if gdbm_open exists
13027 set gdbm_open d_gdbm_open
13029 case "$d_gdbm_open" in
13032 echo "We won't be including <gdbm.h>"
13042 echo "Looking for extensions..." >&4
13043 : If we are using the old config.sh, known_extensions may contain
13044 : old or inaccurate or duplicate values.
13045 known_extensions=''
13046 nonxs_extensions=''
13047 : We do not use find because it might not be available.
13048 : We do not just use MANIFEST because the user may have dropped
13049 : some additional extensions into the source tree and expect them
13052 : Function to recursively find available extensions, ignoring DynaLoader
13053 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13057 DynaLoader|dynaload) ;;
13059 if $test -f $xxx/$xxx.xs; then
13060 known_extensions="$known_extensions $1$xxx";
13061 elif $test -f $xxx/Makefile.PL; then
13062 nonxs_extensions="$nonxs_extensions $1$xxx";
13064 if $test -d $xxx -a $# -lt 10; then
13067 eval $find_extensions;
13079 eval $find_extensions
13080 set X $nonxs_extensions
13082 nonxs_extensions="$*"
13083 set X $known_extensions
13085 known_extensions="$*"
13088 : Now see which are supported on this system.
13090 for xxx in $known_extensions ; do
13094 $define) avail_ext="$avail_ext $xxx" ;;
13097 GDBM_File|gdbm_fil)
13099 $define) avail_ext="$avail_ext $xxx" ;;
13102 NDBM_File|ndbm_fil)
13104 $define) avail_ext="$avail_ext $xxx" ;;
13107 ODBM_File|odbm_fil)
13108 case "${i_dbm}${i_rpcsvcdbm}" in
13109 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13113 case "$useposix" in
13114 true|define|y) avail_ext="$avail_ext $xxx" ;;
13118 case "$useopcode" in
13119 true|define|y) avail_ext="$avail_ext $xxx" ;;
13123 case "$d_socket" in
13124 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13128 case "$usethreads" in
13129 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13133 : XXX Do we need a useipcsysv variable here
13134 case "${d_msg}${d_sem}${d_shm}" in
13135 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13138 *) avail_ext="$avail_ext $xxx"
13147 : Now see which nonxs extensions are supported on this system.
13148 : For now assume all are.
13150 for xxx in $nonxs_extensions ; do
13152 *) nonxs_ext="$nonxs_ext $xxx"
13164 A number of extensions are supplied with $package. You may choose to
13165 compile these extensions for dynamic loading (the default), compile
13166 them into the $package executable (static loading), or not include
13167 them at all. Answer "none" to include no extensions.
13168 Note that DynaLoader is always built and need not be mentioned here.
13171 case "$dynamic_ext" in
13172 '') dflt="$avail_ext" ;;
13173 *) dflt="$dynamic_ext"
13174 # Perhaps we are reusing an old out-of-date config.sh.
13177 if test X"$dynamic_ext" != X"$avail_ext"; then
13179 NOTICE: Your previous config.sh list may be incorrect.
13180 The extensions now available to you are
13182 but the default list from your previous config.sh is
13194 rp="What extensions do you wish to load dynamically?"
13197 none) dynamic_ext=' ' ;;
13198 *) dynamic_ext="$ans" ;;
13201 case "$static_ext" in
13203 : Exclude those already listed in dynamic linking
13205 for xxx in $avail_ext; do
13206 case " $dynamic_ext " in
13208 *) dflt="$dflt $xxx" ;;
13215 *) dflt="$static_ext"
13222 rp="What extensions do you wish to load statically?"
13225 none) static_ext=' ' ;;
13226 *) static_ext="$ans" ;;
13231 A number of extensions are supplied with $package. Answer "none"
13232 to include no extensions.
13233 Note that DynaLoader is always built and need not be mentioned here.
13236 case "$static_ext" in
13237 '') dflt="$avail_ext" ;;
13238 *) dflt="$static_ext"
13239 # Perhaps we are reusing an old out-of-date config.sh.
13242 if test X"$static_ext" != X"$avail_ext"; then
13244 NOTICE: Your previous config.sh list may be incorrect.
13245 The extensions now available to you are
13247 but the default list from your previous config.sh is
13256 : Exclude those that are not xs extensions
13260 rp="What extensions do you wish to include?"
13263 none) static_ext=' ' ;;
13264 *) static_ext="$ans" ;;
13269 set X $dynamic_ext $static_ext $nonxs_ext
13273 : Remove build directory name from cppstdin so it can be used from
13274 : either the present location or the final installed location.
13276 : Get out of the UU directory to get correct path name.
13278 case "$cppstdin" in
13280 echo "Stripping down cppstdin path name"
13286 : end of configuration questions
13288 echo "End of configuration questions."
13291 : back to where it started
13292 if test -d ../UU; then
13296 : configuration may be patched via a 'config.over' file
13297 if $test -f config.over; then
13300 rp='I see a config.over file. Do you wish to load it?'
13303 n*) echo "OK, I'll ignore it.";;
13305 echo "Configuration override changes have been loaded."
13310 : in case they want portability, strip down executable paths
13311 case "$d_portable" in
13314 echo "Stripping down executable paths..." >&4
13315 for file in $loclist $trylist; do
13317 eval $file=`basename $temp`
13322 : create config.sh file
13324 echo "Creating config.sh..." >&4
13325 $spitshell <<EOT >config.sh
13328 # This file was produced by running the Configure script. It holds all the
13329 # definitions figured out by Configure. Should you modify one of these values,
13330 # do not forget to propagate your changes by running "Configure -der". You may
13331 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13334 # Package name : $package
13335 # Source directory : $src
13336 # Configuration time: $cf_time
13337 # Configured by : $cf_by
13338 # Target system : $myuname
13348 Revision='$Revision'
13355 alignbytes='$alignbytes'
13356 ansi2knr='$ansi2knr'
13357 aphostname='$aphostname'
13358 apiversion='$apiversion'
13361 archlibexp='$archlibexp'
13362 archname64='$archname64'
13363 archname='$archname'
13364 archobjs='$archobjs'
13369 bincompat5005='$bincompat5005'
13373 byteorder='$byteorder'
13375 castflags='$castflags'
13378 cccdlflags='$cccdlflags'
13379 ccdlflags='$ccdlflags'
13381 ccsymbols='$ccsymbols'
13383 cf_email='$cf_email'
13388 clocktype='$clocktype'
13390 compress='$compress'
13391 contains='$contains'
13395 cpp_stuff='$cpp_stuff'
13396 cppccsymbols='$cppccsymbols'
13397 cppflags='$cppflags'
13399 cppminus='$cppminus'
13401 cppstdin='$cppstdin'
13402 cppsymbols='$cppsymbols'
13403 crosscompile='$crosscompile'
13404 cryptlib='$cryptlib'
13406 d_Gconvert='$d_Gconvert'
13407 d_PRIEldbl='$d_PRIEldbl'
13408 d_PRIFldbl='$d_PRIFldbl'
13409 d_PRIGldbl='$d_PRIGldbl'
13410 d_PRIX64='$d_PRIX64'
13411 d_PRId64='$d_PRId64'
13412 d_PRIeldbl='$d_PRIeldbl'
13413 d_PRIfldbl='$d_PRIfldbl'
13414 d_PRIgldbl='$d_PRIgldbl'
13415 d_PRIi64='$d_PRIi64'
13416 d_PRIo64='$d_PRIo64'
13417 d_PRIu64='$d_PRIu64'
13418 d_PRIx64='$d_PRIx64'
13419 d_access='$d_access'
13420 d_accessx='$d_accessx'
13422 d_archlib='$d_archlib'
13425 d_attribut='$d_attribut'
13428 d_bincompat5005='$d_bincompat5005'
13430 d_bsdgetpgrp='$d_bsdgetpgrp'
13431 d_bsdsetpgrp='$d_bsdsetpgrp'
13433 d_casti32='$d_casti32'
13434 d_castneg='$d_castneg'
13435 d_charvspr='$d_charvspr'
13437 d_chroot='$d_chroot'
13438 d_chsize='$d_chsize'
13439 d_closedir='$d_closedir'
13440 d_cmsghdr_s='$d_cmsghdr_s'
13444 d_cuserid='$d_cuserid'
13445 d_dbl_dig='$d_dbl_dig'
13446 d_difftime='$d_difftime'
13447 d_dirnamlen='$d_dirnamlen'
13448 d_dlerror='$d_dlerror'
13449 d_dlopen='$d_dlopen'
13450 d_dlsymun='$d_dlsymun'
13451 d_dosuid='$d_dosuid'
13452 d_drand48proto='$d_drand48proto'
13454 d_eaccess='$d_eaccess'
13455 d_endgrent='$d_endgrent'
13456 d_endhent='$d_endhent'
13457 d_endnent='$d_endnent'
13458 d_endpent='$d_endpent'
13459 d_endpwent='$d_endpwent'
13460 d_endsent='$d_endsent'
13461 d_endspent='$d_endspent'
13462 d_eofnblk='$d_eofnblk'
13463 d_eunice='$d_eunice'
13464 d_fchmod='$d_fchmod'
13465 d_fchown='$d_fchown'
13467 d_fd_macros='$d_fd_macros'
13468 d_fd_set='$d_fd_set'
13469 d_fds_bits='$d_fds_bits'
13470 d_fgetpos='$d_fgetpos'
13471 d_flexfnam='$d_flexfnam'
13474 d_fpathconf='$d_fpathconf'
13475 d_fpos64_t='$d_fpos64_t'
13476 d_fseeko='$d_fseeko'
13477 d_fsetpos='$d_fsetpos'
13478 d_fstatfs='$d_fstatfs'
13479 d_fstatvfs='$d_fstatvfs'
13480 d_ftello='$d_ftello'
13482 d_getgrent='$d_getgrent'
13483 d_getgrps='$d_getgrps'
13484 d_gethbyaddr='$d_gethbyaddr'
13485 d_gethbyname='$d_gethbyname'
13486 d_gethent='$d_gethent'
13487 d_gethname='$d_gethname'
13488 d_gethostprotos='$d_gethostprotos'
13489 d_getlogin='$d_getlogin'
13490 d_getmntent='$d_getmntent'
13491 d_getnbyaddr='$d_getnbyaddr'
13492 d_getnbyname='$d_getnbyname'
13493 d_getnent='$d_getnent'
13494 d_getnetprotos='$d_getnetprotos'
13495 d_getpbyname='$d_getpbyname'
13496 d_getpbynumber='$d_getpbynumber'
13497 d_getpent='$d_getpent'
13498 d_getpgid='$d_getpgid'
13499 d_getpgrp2='$d_getpgrp2'
13500 d_getpgrp='$d_getpgrp'
13501 d_getppid='$d_getppid'
13502 d_getprior='$d_getprior'
13503 d_getprotoprotos='$d_getprotoprotos'
13504 d_getpwent='$d_getpwent'
13505 d_getsbyname='$d_getsbyname'
13506 d_getsbyport='$d_getsbyport'
13507 d_getsent='$d_getsent'
13508 d_getservprotos='$d_getservprotos'
13509 d_getspent='$d_getspent'
13510 d_getspnam='$d_getspnam'
13511 d_gettimeod='$d_gettimeod'
13512 d_gnulibc='$d_gnulibc'
13513 d_grpasswd='$d_grpasswd'
13514 d_hasmntopt='$d_hasmntopt'
13517 d_inetaton='$d_inetaton'
13518 d_int64t='$d_int64t'
13519 d_iovec_s='$d_iovec_s'
13520 d_isascii='$d_isascii'
13521 d_killpg='$d_killpg'
13522 d_lchown='$d_lchown'
13523 d_ldbl_dig='$d_ldbl_dig'
13525 d_llseek='$d_llseek'
13526 d_locconv='$d_locconv'
13528 d_longdbl='$d_longdbl'
13529 d_longlong='$d_longlong'
13531 d_madvise='$d_madvise'
13533 d_mbstowcs='$d_mbstowcs'
13534 d_mbtowc='$d_mbtowc'
13535 d_memchr='$d_memchr'
13536 d_memcmp='$d_memcmp'
13537 d_memcpy='$d_memcpy'
13538 d_memmove='$d_memmove'
13539 d_memset='$d_memset'
13541 d_mkfifo='$d_mkfifo'
13542 d_mktime='$d_mktime'
13544 d_mprotect='$d_mprotect'
13546 d_msg_ctrunc='$d_msg_ctrunc'
13547 d_msg_dontroute='$d_msg_dontroute'
13548 d_msg_oob='$d_msg_oob'
13549 d_msg_peek='$d_msg_peek'
13550 d_msg_proxy='$d_msg_proxy'
13551 d_msgctl='$d_msgctl'
13552 d_msgget='$d_msgget'
13553 d_msghdr_s='$d_msghdr_s'
13554 d_msgrcv='$d_msgrcv'
13555 d_msgsnd='$d_msgsnd'
13557 d_munmap='$d_munmap'
13558 d_mymalloc='$d_mymalloc'
13560 d_off64_t='$d_off64_t'
13561 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13562 d_oldpthreads='$d_oldpthreads'
13563 d_oldsock='$d_oldsock'
13565 d_pathconf='$d_pathconf'
13567 d_phostname='$d_phostname'
13570 d_portable='$d_portable'
13571 d_pthread_yield='$d_pthread_yield'
13573 d_pwchange='$d_pwchange'
13574 d_pwclass='$d_pwclass'
13575 d_pwcomment='$d_pwcomment'
13576 d_pwexpire='$d_pwexpire'
13577 d_pwgecos='$d_pwgecos'
13578 d_pwpasswd='$d_pwpasswd'
13579 d_pwquota='$d_pwquota'
13580 d_readdir='$d_readdir'
13581 d_readlink='$d_readlink'
13583 d_recvmsg='$d_recvmsg'
13584 d_rename='$d_rename'
13585 d_rewinddir='$d_rewinddir'
13587 d_safebcpy='$d_safebcpy'
13588 d_safemcpy='$d_safemcpy'
13589 d_sanemcmp='$d_sanemcmp'
13590 d_sched_yield='$d_sched_yield'
13591 d_scm_rights='$d_scm_rights'
13592 d_seekdir='$d_seekdir'
13593 d_select='$d_select'
13595 d_semctl='$d_semctl'
13596 d_semctl_semid_ds='$d_semctl_semid_ds'
13597 d_semctl_semun='$d_semctl_semun'
13598 d_semget='$d_semget'
13600 d_sendmsg='$d_sendmsg'
13601 d_setegid='$d_setegid'
13602 d_seteuid='$d_seteuid'
13603 d_setgrent='$d_setgrent'
13604 d_setgrps='$d_setgrps'
13605 d_sethent='$d_sethent'
13606 d_setlinebuf='$d_setlinebuf'
13607 d_setlocale='$d_setlocale'
13608 d_setnent='$d_setnent'
13609 d_setpent='$d_setpent'
13610 d_setpgid='$d_setpgid'
13611 d_setpgrp2='$d_setpgrp2'
13612 d_setpgrp='$d_setpgrp'
13613 d_setprior='$d_setprior'
13614 d_setpwent='$d_setpwent'
13615 d_setregid='$d_setregid'
13616 d_setresgid='$d_setresgid'
13617 d_setresuid='$d_setresuid'
13618 d_setreuid='$d_setreuid'
13619 d_setrgid='$d_setrgid'
13620 d_setruid='$d_setruid'
13621 d_setsent='$d_setsent'
13622 d_setsid='$d_setsid'
13623 d_setspent='$d_setspent'
13624 d_setvbuf='$d_setvbuf'
13628 d_shmatprototype='$d_shmatprototype'
13629 d_shmctl='$d_shmctl'
13631 d_shmget='$d_shmget'
13632 d_sigaction='$d_sigaction'
13633 d_sigsetjmp='$d_sigsetjmp'
13634 d_socket='$d_socket'
13635 d_sockpair='$d_sockpair'
13636 d_statblks='$d_statblks'
13637 d_statfs='$d_statfs'
13638 d_statfsflags='$d_statfsflags'
13639 d_statvfs='$d_statvfs'
13640 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13641 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13642 d_stdio_stream_array='$d_stdio_stream_array'
13643 d_stdiobase='$d_stdiobase'
13644 d_stdstdio='$d_stdstdio'
13645 d_strchr='$d_strchr'
13646 d_strcoll='$d_strcoll'
13647 d_strctcpy='$d_strctcpy'
13648 d_strerrm='$d_strerrm'
13649 d_strerror='$d_strerror'
13650 d_strtod='$d_strtod'
13651 d_strtol='$d_strtol'
13652 d_strtoul='$d_strtoul'
13653 d_strtoull='$d_strtoull'
13654 d_strxfrm='$d_strxfrm'
13655 d_suidsafe='$d_suidsafe'
13656 d_symlink='$d_symlink'
13657 d_syscall='$d_syscall'
13658 d_sysconf='$d_sysconf'
13659 d_sysernlst='$d_sysernlst'
13660 d_syserrlst='$d_syserrlst'
13661 d_system='$d_system'
13662 d_tcgetpgrp='$d_tcgetpgrp'
13663 d_tcsetpgrp='$d_tcsetpgrp'
13664 d_telldir='$d_telldir'
13665 d_telldirproto='$d_telldirproto'
13668 d_truncate='$d_truncate'
13669 d_tzname='$d_tzname'
13672 d_union_semun='$d_union_semun'
13673 d_vendorlib='$d_vendorlib'
13675 d_void_closedir='$d_void_closedir'
13676 d_voidsig='$d_voidsig'
13677 d_voidtty='$d_voidtty'
13678 d_volatile='$d_volatile'
13679 d_vprintf='$d_vprintf'
13681 d_waitpid='$d_waitpid'
13682 d_wcstombs='$d_wcstombs'
13683 d_wctomb='$d_wctomb'
13684 d_writev='$d_writev'
13687 db_hashtype='$db_hashtype'
13688 db_prefixtype='$db_prefixtype'
13689 defvoidused='$defvoidused'
13690 direntrytype='$direntrytype'
13693 doublesize='$doublesize'
13695 dynamic_ext='$dynamic_ext'
13701 eunicefix='$eunicefix'
13704 extensions='$extensions'
13705 fflushNULL='$fflushNULL'
13706 fflushall='$fflushall'
13708 firstmakefile='$firstmakefile'
13710 fpostype='$fpostype'
13711 freetype='$freetype'
13713 full_csh='$full_csh'
13714 full_sed='$full_sed'
13715 gccversion='$gccversion'
13719 groupcat='$groupcat'
13720 groupstype='$groupstype'
13723 h_sysfile='$h_sysfile'
13727 i_arpainet='$i_arpainet'
13728 i_bsdioctl='$i_bsdioctl'
13731 i_dirent='$i_dirent'
13738 i_inttypes='$i_inttypes'
13739 i_limits='$i_limits'
13740 i_locale='$i_locale'
13741 i_machcthr='$i_machcthr'
13742 i_malloc='$i_malloc'
13744 i_memory='$i_memory'
13745 i_mntent='$i_mntent'
13748 i_neterrno='$i_neterrno'
13749 i_netinettcp='$i_netinettcp'
13752 i_pthread='$i_pthread'
13754 i_rpcsvcdbm='$i_rpcsvcdbm'
13757 i_shadow='$i_shadow'
13759 i_stdarg='$i_stdarg'
13760 i_stddef='$i_stddef'
13761 i_stdlib='$i_stdlib'
13762 i_string='$i_string'
13763 i_sysaccess='$i_sysaccess'
13764 i_sysdir='$i_sysdir'
13765 i_sysfile='$i_sysfile'
13766 i_sysfilio='$i_sysfilio'
13768 i_sysioctl='$i_sysioctl'
13769 i_sysmman='$i_sysmman'
13770 i_sysmount='$i_sysmount'
13771 i_sysndir='$i_sysndir'
13772 i_sysparam='$i_sysparam'
13773 i_sysresrc='$i_sysresrc'
13774 i_syssecrt='$i_syssecrt'
13775 i_sysselct='$i_sysselct'
13776 i_syssockio='$i_syssockio'
13777 i_sysstat='$i_sysstat'
13778 i_sysstatvfs='$i_sysstatvfs'
13779 i_systime='$i_systime'
13780 i_systimek='$i_systimek'
13781 i_systimes='$i_systimes'
13782 i_systypes='$i_systypes'
13783 i_sysuio='$i_sysuio'
13785 i_syswait='$i_syswait'
13786 i_termio='$i_termio'
13787 i_termios='$i_termios'
13789 i_unistd='$i_unistd'
13791 i_values='$i_values'
13792 i_varargs='$i_varargs'
13793 i_varhdr='$i_varhdr'
13795 ignore_versioned_solibs='$ignore_versioned_solibs'
13798 installarchlib='$installarchlib'
13799 installbin='$installbin'
13800 installman1dir='$installman1dir'
13801 installman3dir='$installman3dir'
13802 installprefix='$installprefix'
13803 installprefixexp='$installprefixexp'
13804 installprivlib='$installprivlib'
13805 installscript='$installscript'
13806 installsitearch='$installsitearch'
13807 installsitelib='$installsitelib'
13808 installstyle='$installstyle'
13809 installusrbinperl='$installusrbinperl'
13810 installvendorlib='$installvendorlib'
13812 known_extensions='$known_extensions'
13816 lddlflags='$lddlflags'
13818 ldlibpthname='$ldlibpthname'
13825 libswanted='$libswanted'
13831 locincpth='$locincpth'
13832 loclibpth='$loclibpth'
13833 longdblsize='$longdblsize'
13834 longlongsize='$longlongsize'
13835 longsize='$longsize'
13839 lseeksize='$lseeksize'
13840 lseektype='$lseektype'
13844 make_set_make='$make_set_make'
13845 mallocobj='$mallocobj'
13846 mallocsrc='$mallocsrc'
13847 malloctype='$malloctype'
13849 man1direxp='$man1direxp'
13852 man3direxp='$man3direxp'
13856 mips_type='$mips_type'
13858 mmaptype='$mmaptype'
13860 modetype='$modetype'
13862 multiarch='$multiarch'
13864 myarchname='$myarchname'
13865 mydomain='$mydomain'
13866 myhostname='$myhostname'
13869 netdb_hlen_type='$netdb_hlen_type'
13870 netdb_host_type='$netdb_host_type'
13871 netdb_name_type='$netdb_name_type'
13872 netdb_net_type='$netdb_net_type'
13875 nm_so_opt='$nm_so_opt'
13876 nonxs_ext='$nonxs_ext'
13878 o_nonblock='$o_nonblock'
13880 old_pthread_create_joinable='$old_pthread_create_joinable'
13881 optimize='$optimize'
13882 orderlib='$orderlib'
13888 patchlevel='$patchlevel'
13889 path_sep='$path_sep'
13891 perladmin='$perladmin'
13892 perlpath='$perlpath'
13894 phostname='$phostname'
13900 prefixexp='$prefixexp'
13902 privlibexp='$privlibexp'
13903 prototype='$prototype'
13905 randbits='$randbits'
13906 randfunc='$randfunc'
13907 randseedtype='$randseedtype'
13909 rd_nodata='$rd_nodata'
13913 sPRIEldbl='$sPRIEldbl'
13914 sPRIFldbl='$sPRIFldbl'
13915 sPRIGldbl='$sPRIGldbl'
13918 sPRIeldbl='$sPRIeldbl'
13919 sPRIfldbl='$sPRIfldbl'
13920 sPRIgldbl='$sPRIgldbl'
13925 sched_yield='$sched_yield'
13926 scriptdir='$scriptdir'
13927 scriptdirexp='$scriptdirexp'
13929 seedfunc='$seedfunc'
13930 selectminbits='$selectminbits'
13931 selecttype='$selecttype'
13932 sendmail='$sendmail'
13935 sharpbang='$sharpbang'
13936 shmattype='$shmattype'
13937 shortsize='$shortsize'
13940 sig_count='$sig_count'
13941 sig_name='$sig_name'
13942 sig_name_init='$sig_name_init'
13944 sig_num_init='$sig_num_init'
13945 signal_t='$signal_t'
13946 sitearch='$sitearch'
13947 sitearchexp='$sitearchexp'
13949 sitelibexp='$sitelibexp'
13950 siteprefix='$siteprefix'
13951 siteprefixexp='$siteprefixexp'
13952 sizetype='$sizetype'
13957 sockethdr='$sockethdr'
13958 socketlib='$socketlib'
13960 spackage='$spackage'
13961 spitshell='$spitshell'
13964 ssizetype='$ssizetype'
13965 startperl='$startperl'
13967 static_ext='$static_ext'
13969 stdio_base='$stdio_base'
13970 stdio_bufsiz='$stdio_bufsiz'
13971 stdio_cnt='$stdio_cnt'
13972 stdio_filbuf='$stdio_filbuf'
13973 stdio_ptr='$stdio_ptr'
13974 stdio_stream_array='$stdio_stream_array'
13977 subversion='$subversion'
13984 timeincl='$timeincl'
13985 timetype='$timetype'
13993 use64bits='$use64bits'
13996 uselongdouble='$uselongdouble'
13997 usemorebits='$usemorebits'
13998 usemultiplicity='$usemultiplicity'
13999 usemymalloc='$usemymalloc'
14001 useopcode='$useopcode'
14002 useperlio='$useperlio'
14003 useposix='$useposix'
14005 useshrplib='$useshrplib'
14006 usesocks='$usesocks'
14007 usethreads='$usethreads'
14008 usevendorprefix='$usevendorprefix'
14009 usevfork='$usevfork'
14012 vendorlib='$vendorlib'
14013 vendorlibexp='$vendorlibexp'
14014 vendorprefix='$vendorprefix'
14015 vendorprefixexp='$vendorprefixexp'
14018 voidflags='$voidflags'
14024 : Add in command line options if available
14025 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14027 : add special variables
14028 $test -f $src/patchlevel.h && \
14029 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14030 echo "CONFIGDOTSH=true" >>config.sh
14032 : propagate old symbols
14033 if $test -f UU/config.sh; then
14034 <UU/config.sh sort | uniq >UU/oldconfig.sh
14035 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14036 sort | uniq -u >UU/oldsyms
14037 set X `cat UU/oldsyms`
14043 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14045 echo "# Variables propagated from previous config.sh file." >>config.sh
14046 for sym in `cat UU/oldsyms`; do
14047 echo " Propagating $hint variable "'$'"$sym..."
14048 eval 'tmp="$'"${sym}"'"'
14050 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14056 : Finish up by extracting the .SH files
14070 If you'd like to make any changes to the config.sh file before I begin
14071 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14074 rp="Press return or use a shell escape to edit config.sh:"
14079 *) : in case they cannot read
14080 sh 1>&4 -c "$ans";;
14085 : if this fails, just run all the .SH files by hand
14092 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14099 Now you need to generate make dependencies by running "$make depend".
14100 You might prefer to run it in background: "$make depend > makedepend.out &"
14101 It can take a while, so you might not want to run it right now.
14106 rp="Run $make depend now?"
14110 $make depend && echo "Now you must run a $make."
14113 echo "You must run '$make depend' then '$make'."
14116 elif test -f [Mm]akefile; then
14118 echo "Now you must run a $make."
14123 if $test -f Policy.sh; then
14126 If you compile $package on a different machine or from a different object
14127 directory, copy the Policy.sh file from this object directory to the
14128 new one before you run Configure -- this will help you with most of
14129 the policy defaults.
14133 if $test -f config.msg; then
14134 echo "Hmm. I also noted the following information while running:"
14136 $cat config.msg >&4
14139 $rm -f kit*isdone ark*isdone