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 Tue Oct 26 16:44:39 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=''
692 ignore_versioned_solibs=''
816 d_stdio_stream_array=''
817 stdio_stream_array=''
860 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
863 : We must find out about Eunice early
865 if test -f /etc/unixtovms; then
866 eunicefix=/etc/unixtovms
868 if test -f /etc/unixtovms.exe; then
869 eunicefix=/etc/unixtovms.exe
873 : Possible local include directories to search.
874 : Set locincpth to "" in a hint file to defeat local include searches.
875 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
876 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
878 : no include file wanted by default
881 : list of known cpp symbols, sorted alphabetically
882 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
883 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
884 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
885 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
886 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
887 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
888 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
889 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
890 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
891 al="$al VMS Xenix286"
892 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
893 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
894 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
895 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
896 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
897 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
898 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
899 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
900 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
901 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
902 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
903 al="$al __SVR4_2__ __UMAXV__"
904 al="$al ____386BSD____ __alpha __alpha__ __amiga"
905 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
906 al="$al __host_mips__"
907 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
908 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
909 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
910 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
911 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
912 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
913 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
914 al="$al __mc88100 __mc88100__ __mips __mips__"
915 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
916 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
917 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
918 al="$al _host_mips _mips _unix"
919 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
920 al="$al apollo ardent att386 att3b"
921 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
922 al="$al cadmus clipper concurrent convex cray ctix"
923 al="$al dmert encore gcos gcx gimpel gould"
924 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
925 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
926 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
927 al="$al i186 i286 i386 i486 i8086"
928 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
929 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
930 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
931 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
932 al="$al mc88000 mc88100 merlin mert mips mvs n16"
933 al="$al ncl_el ncl_mr"
934 al="$al news1500 news1700 news1800 news1900 news3700"
935 al="$al news700 news800 news900 ns16000 ns32000"
936 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
937 al="$al parisc pc532 pdp11 plexus posix pyr"
938 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
939 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
940 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
941 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
942 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
943 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
946 : Trailing extension. Override this in a hint file, if needed.
948 : Extra object files, if any, needed on this platform.
951 : change the next line if compiling for Xenix/286 on Xenix/386
952 xlibpth='/usr/lib/386 /lib/386'
954 : Possible local library directories to search.
955 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
956 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
958 : general looking path for locating libraries
959 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
960 glibpth="$glibpth /lib /usr/lib $xlibpth"
961 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
962 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
964 : Private path used by Configure to find libraries. Its value
965 : is prepended to libpth. This variable takes care of special
966 : machines, like the mips. Usually, it should be empty.
969 : default library list
971 : some systems want to use only the non-versioned libso:s
972 ignore_versioned_solibs=''
973 : full support for void wanted by default
976 : set useposix=false in your hint file to disable the POSIX extension.
978 : set useopcode=false in your hint file to disable the Opcode extension.
980 : set usemultiplicity on the Configure command line to enable multiplicity.
981 : set usesocks on the Configure command line to enable socks.
982 : set usethreads on the Configure command line to enable threads.
983 : List of libraries we want.
984 : If anyone needs -lnet, put it in a hint file.
985 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
986 libswanted="$libswanted dld ld sun m c cposix posix"
987 libswanted="$libswanted ndir dir crypt sec"
988 libswanted="$libswanted ucb bsd BSD PW x"
989 : We probably want to search /usr/shlib before most other libraries.
990 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
991 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
992 glibpth="/usr/shlib $glibpth"
993 : Do not use vfork unless overridden by a hint file.
996 : Find the basic shell for Bourne shell scripts
1000 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1003 if test -f "$xxx"; then
1006 : Build up a list and do a single loop so we can 'break' out.
1007 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1008 for xxx in sh bash ksh pdksh ash; do
1010 try="$try ${p}/${xxx}"
1014 if test -f "$xxx"; then
1017 elif test -f "$xxx.exe"; then
1028 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1030 Usually it's in /bin/sh. How did you even get this far?
1031 Please contact me (Perl Maintainers) at perlbug@perl.com and
1032 we'll try to straighten this all out.
1038 : see if sh knows # comments
1039 if `$sh -c '#' >/dev/null 2>&1`; then
1043 test -f $xcat || xcat=/usr/bin/cat
1048 if test -s today; then
1051 echo "#! $xcat" > try
1055 if test -s today; then
1063 echo "Your $sh doesn't grok # comments--I will strip them later on."
1066 echo "exec grep -v '^[ ]*#'" >spitshell
1068 $eunicefix spitshell
1069 spitshell=`pwd`/spitshell
1071 echo "I presume that if # doesn't work, #! won't work either!"
1076 : figure out how to guarantee sh startup
1078 '') startsh=${sharpbang}${sh} ;;
1090 : echo "Yup, it does."
1092 echo "Hmm... '$startsh' does not guarantee sh startup..."
1093 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1098 : Save command line options in file UU/cmdline.opt for later use in
1099 : generating config.sh.
1100 cat > cmdline.opt <<EOSH
1101 # Configure command line arguments.
1108 cat >>cmdline.opt <<EOSH
1109 config_arg$argn='$arg'
1111 argn=`expr $argn + 1`
1114 : produce awk script to parse command line options
1115 cat >options.awk <<'EOF'
1117 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1119 len = length(optstr);
1120 for (i = 1; i <= len; i++) {
1121 c = substr(optstr, i, 1);
1122 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1133 if (substr(str, 1, 1) != "-") {
1134 printf("'%s'\n", str);
1138 for (i = 2; i <= len; i++) {
1139 c = substr(str, i, 1);
1141 printf("-%s\n", substr(str, i));
1147 printf("'%s'\n", substr(str, i + 1));
1160 : process the command line options
1161 set X `for arg in "$@"; do echo "X$arg"; done |
1162 sed -e s/X// | awk -f options.awk`
1167 : set up default values
1177 rm -f optdef.sh posthint.sh
1178 cat >optdef.sh <<EOS
1184 while test $# -gt 0; do
1186 -d) shift; fastread=yes;;
1187 -e) shift; alldone=cont;;
1191 if test -r "$1"; then
1194 echo "$me: cannot read config file $1." >&2
1199 -h) shift; error=true;;
1200 -r) shift; reuseval=true;;
1201 -s) shift; silent=true; realsilent=true;;
1202 -E) shift; alldone=exit;;
1203 -K) shift; knowitall=true;;
1204 -O) shift; override=true;;
1205 -S) shift; silent=true; extractsh=true;;
1210 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1211 echo "$me: ignoring -D $1" >&2
1214 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1215 *) echo "$1='define'" >> optdef.sh;;
1222 *=) echo "$1" >> optdef.sh;;
1224 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1225 echo "$me: ignoring -U $1" >&2
1227 *) echo "$1='undef'" >> optdef.sh;;
1238 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1242 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1243 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1249 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1250 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1251 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1252 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1253 *) xxx=`echo $yyy|sed 's!:.*!!'`
1254 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1260 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1262 echo "$yyy=''" >> posthint.sh ;;
1267 echo "$yyy='$zzz'" >> posthint.sh ;;
1269 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1271 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1276 echo "$yyy=$zzz" >> posthint.sh ;;
1277 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1280 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1283 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1291 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1292 [-U symbol] [-U symbol=] [-A command:symbol...]
1293 -d : use defaults for all answers.
1294 -e : go on without questioning past the production of config.sh.
1295 -f : specify an alternate default configuration file.
1296 -h : print this help message and exit (with an error status).
1297 -r : reuse C symbols value if possible (skips costly nm extraction).
1298 -s : silent mode, only echoes questions and essential information.
1299 -D : define symbol to have some value:
1300 -D symbol symbol gets the value 'define'
1301 -D symbol=value symbol gets the value 'value'
1302 -E : stop at the end of questions, after having produced config.sh.
1303 -K : do not use unless you know what you are doing.
1304 -O : let -D and -U override definitions from loaded configuration file.
1305 -S : perform variable substitutions on all .SH files (can mix with -f)
1306 -U : undefine symbol:
1307 -U symbol symbol gets the value 'undef'
1308 -U symbol= symbol gets completely empty
1309 -A : manipulate symbol after the platform specific hints have been applied:
1310 -A symbol=value append " "value to symbol
1311 -A append:symbol=value append value to symbol
1312 -A define:symbol=value define symbol to have value
1313 -A clear:symbol define symbol to be ''
1314 -A define:symbol define symbol to be 'define'
1315 -A eval:symbol=value define symbol to be eval of value
1316 -A prepend:symbol=value prepend value to symbol
1317 -A undef:symbol define symbol to be 'undef'
1318 -A undef:symbol= define symbol to be ''
1319 -V : print version number and exit (with a zero status).
1326 case "$fastread$alldone" in
1329 if test ! -t 0; then
1330 echo "Say 'sh Configure', not 'sh <Configure'"
1338 true) exec 1>/dev/null;;
1341 : run the defines and the undefines, if any, but leave the file out there...
1344 : create the posthint manipulation script and leave the file out there...
1349 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1350 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1351 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1352 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1353 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1356 : Some greps do not return status, grrr.
1357 echo "grimblepritz" >grimble
1358 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1360 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1366 : the following should work in any shell
1370 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1371 cat >contains <<'EOSS'
1372 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1377 : Find the path to the source tree
1380 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1383 *) src=`cd ../$src && pwd` ;;
1396 if test -f $rsrc/Configure && \
1397 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1399 : found it, so we are ok.
1402 for src in . .. ../.. ../../.. ../../../..; do
1403 if test -f ../$src/Configure && \
1404 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1415 Sorry, I can't seem to locate the source dir for $package. Please start
1416 Configure with an explicit path -- i.e. /some/path/Configure.
1424 echo "Sources for $package found in \"$src\"." >&4
1428 : script used to extract .SH files with variable substitutions
1429 cat >extract <<'EOS'
1431 echo "Doing variable substitutions on .SH files..."
1432 if test -f $src/MANIFEST; then
1433 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1435 echo "(Looking for .SH files under the source directory.)"
1436 set x `(cd $src; find . -name "*.SH" -print)`
1440 0) set x `(cd $src; echo *.SH)`; shift;;
1442 if test ! -f $src/$1; then
1448 while test $name; do
1449 if test ! -d "$name"; then
1450 create="$name $create";
1451 name=`echo $name | sed -e "s|^[^/]*$||"`;
1452 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1457 for file in $create; do
1466 dir=`expr X$file : 'X\(.*\)/'`
1467 file=`expr X$file : 'X.*/\(.*\)'`
1468 (cd $dir && . ./$file)
1478 dir=`expr X$file : 'X\(.*\)/'`
1479 file=`expr X$file : 'X.*/\(.*\)'`
1480 (set x $dir; shift; eval $mkdir_p)
1490 if test -f $src/config_h.SH; then
1491 if test ! -f config.h; then
1492 : oops, they left it out of MANIFEST, probably, so do it anyway.
1498 : extract files and exit if asked to do so
1499 case "$extractsh" in
1501 case "$realsilent" in
1505 case "$config_sh" in
1506 '') config_sh='config.sh';;
1509 echo "Fetching answers from $config_sh..."
1512 test "$override" && . ./optdef.sh
1521 : Eunice requires " " instead of "", can you believe it
1524 echo "Beginning of configuration questions for $package."
1526 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1528 : first determine how to suppress newline on echo command
1530 echo "Checking echo to see how to suppress newlines..."
1531 (echo "hi there\c" ; echo " ") >.echotmp
1532 if $contains c .echotmp >/dev/null 2>&1 ; then
1543 echo $n "The star should be here-->$c"
1547 : Now test for existence of everything in MANIFEST
1549 if test -f $rsrc/MANIFEST; then
1550 echo "First let's make sure your kit is complete. Checking..." >&4
1551 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1554 for filelist in x??; do
1555 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1557 if test -s missing; then
1561 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1563 You have the option of continuing the configuration process, despite the
1564 distinct possibility that your kit is damaged, by typing 'y'es. If you
1565 do, don't blame me if something goes wrong. I advise you to type 'n'o
1566 and contact the author (perlbug@perl.com).
1569 echo $n "Continue? [n] $c" >&4
1573 echo "Continuing..." >&4
1577 echo "ABORTING..." >&4
1582 echo "Looks good..."
1585 echo "There is no MANIFEST file. I hope your kit is complete !"
1590 : Find the appropriate value for a newline for tr
1591 if test -n "$DJGPP"; then
1594 if test X"$trnl" = X; then
1595 case "`echo foo|tr '\n' x 2>/dev/null`" in
1599 if test X"$trnl" = X; then
1600 case "`echo foo|tr '\012' x 2>/dev/null`" in
1601 foox) trnl='\012' ;;
1604 if test X"$trnl" = X; then
1607 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1613 : compute the number of columns on the terminal for proper question formatting
1618 : set up the echo used in my read
1619 myecho="case \"\$xxxm\" in
1620 '') echo $n \"\$rp $c\" >&4;;
1622 '') echo $n \"[\$xxxm] $c\";;
1624 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1626 echo $n \"[\$xxxm] $c\" >&4
1628 echo $n \"\$rp [\$xxxm] $c\" >&4
1634 : now set up to do reads with possible shell escape and default assignment
1640 case "\$fastread" in
1641 yes) case "\$dflt" in
1644 case "\$silent-\$rp" in
1649 *) case "\$silent" in
1650 true) case "\$rp" in
1655 while expr "X\$ans" : "X!" >/dev/null; do
1659 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1667 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1676 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1681 echo "(OK, I'll run with -d after this question.)" >&4
1684 echo "*** Sorry, \$1 not supported yet." >&4
1694 echo "*** Substitution done -- please confirm."
1696 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1701 echo "*** Error -- try again."
1708 case "\$ans\$xxxm\$nostick" in
1720 : create .config dir to save info across Configure sessions
1721 test -d ../.config || mkdir ../.config
1722 cat >../.config/README <<EOF
1723 This directory created by Configure to save information that should
1724 persist across sessions for $package.
1726 You may safely delete it if you wish.
1729 : general instructions
1732 user=`(logname) 2>/dev/null`
1734 '') user=`whoami 2>&1`;;
1736 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1739 rp='Would you like to see the instructions?'
1750 This installation shell script will examine your system and ask you questions
1751 to determine how the perl5 package should be installed. If you get
1752 stuck on a question, you may use a ! shell escape to start a subshell or
1753 execute a command. Many of the questions will have default answers in square
1754 brackets; typing carriage return will give you the default.
1756 On some of the questions which ask for file or directory names you are allowed
1757 to use the ~name construct to specify the login directory belonging to "name",
1758 even if you don't have a shell which knows about that. Questions where this is
1759 allowed will be marked "(~name ok)".
1763 dflt='Type carriage return to continue'
1767 The prompter used in this script allows you to use shell variables and
1768 backticks in your answers. You may use $1, $2, etc... to refer to the words
1769 in the default answer, as if the default line was a set of arguments given to a
1770 script shell. This means you may also use $* to repeat the whole default line,
1771 so you do not have to re-type everything to add something to the default.
1773 Everytime there is a substitution, you will have to confirm. If there is an
1774 error (e.g. an unmatched backtick), the default answer will remain unchanged
1775 and you will be prompted again.
1777 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1778 the questions and use the computed defaults (or the previous answers if there
1779 was already a config.sh file). Type 'Configure -h' for a list of options.
1780 You may also start interactively and then answer '& -d' at any prompt to turn
1781 on the non-interactive behaviour for the remainder of the execution.
1787 Much effort has been expended to ensure that this shell script will run on any
1788 Unix system. If despite that it blows up on yours, your best bet is to edit
1789 Configure and run it again. If you can't run Configure for some reason,
1790 you'll have to generate a config.sh file by hand. Whatever problems you
1791 have, let me (perlbug@perl.com) know how I blew it.
1793 This installation script affects things in two ways:
1795 1) it may do direct variable substitutions on some of the files included
1797 2) it builds a config.h file for inclusion in C programs. You may edit
1798 any of these files as the need arises after running this script.
1800 If you make a mistake on a question, there is no easy way to back up to it
1801 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1802 files. Configure will offer to let you do this before it runs the SH files.
1805 dflt='Type carriage return to continue'
1807 case "$firsttime" in
1808 true) echo $user >>../.config/instruct;;
1812 : find out where common programs are
1814 echo "Locating common programs..." >&4
1827 if test -d \$dir/\$thing; then
1833 for thisthing in \$dir/\$thing; do
1834 : just loop through to pick last item
1836 if test -f \$thisthing; then
1839 elif test -f \$dir/\$thing.exe; then
1840 if test -n "$DJGPP"; then
1841 echo \$dir/\$thing.exe
1843 : on Eunice apparently
1893 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1894 pth="$pth /lib /usr/lib"
1895 for file in $loclist; do
1899 if test -f "$xxx"; then
1902 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1903 xxx=`./loc $file $file $pth`
1906 '') xxx=`./loc $file $file $pth`;;
1907 *) xxx=`./loc $xxx $xxx $pth`;;
1913 echo $file is in $xxx.
1916 echo $file is in $xxx.
1919 echo "I don't know where '$file' is, and my life depends on it." >&4
1920 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1926 echo "Don't worry if any of the following aren't found..."
1928 for file in $trylist; do
1932 if test -f "$xxx"; then
1935 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1936 xxx=`./loc $file $file $pth`
1939 '') xxx=`./loc $file $file $pth`;;
1940 *) xxx=`./loc $xxx $xxx $pth`;;
1946 echo $file is in $xxx.
1949 echo $file is in $xxx.
1952 echo "I don't see $file out there, $say."
1959 echo "Substituting grep for egrep."
1965 echo "Substituting cp for ln."
1971 echo "Hopefully test is built into your sh."
1974 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1975 echo "Using the test built into your sh."
1983 echo "Hopefully echo is built into your sh."
1988 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1989 $echo $n "hi there$c" >foo1
1990 echo $n "hi there$c" >foo2
1991 if cmp foo1 foo2 >/dev/null 2>&1; then
1992 echo "They are compatible. In fact, they may be identical."
1999 They are not compatible! You are probably running ksh on a non-USG system.
2000 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2001 have echo built in and we may have to run some Bourne shell scripts. That
2002 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2005 $echo $n "The star should be here-->$c"
2012 : determine whether symbolic links are supported
2015 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2016 echo "Symbolic links are supported." >&4
2019 echo "Symbolic links are NOT supported." >&4
2024 : see whether [:lower:] and [:upper:] are supported character classes
2026 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2028 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2032 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2033 # (0xc9 and 0xd1), therefore that is a nice testing point.
2034 if test "X$up" = X -o "X$low" = X; then
2035 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2041 if test "X$up" = X -o "X$low" = X; then
2042 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2048 if test "X$up" = X -o "X$low" = X; then
2049 case "`echo IJ | od -x 2>/dev/null`" in
2051 echo "Hey, this might be EBCDIC." >&4
2052 if test "X$up" = X -o "X$low" = X; then
2053 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2054 ij) up='[A-IJ-RS-Z]'
2059 if test "X$up" = X -o "X$low" = X; then
2060 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2070 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2072 echo "Using $up and $low to convert case." >&4
2075 echo "I don't know how to translate letters from upper to lower case." >&4
2076 echo "Your tr is not acting any way I know of." >&4
2080 : set up the translation script tr, must be called with ./tr of course
2084 '[A-Z][a-z]') exec $tr '$up' '$low';;
2085 '[a-z][A-Z]') exec $tr '$low' '$up';;
2092 : Try to determine whether config.sh was made on this system
2093 case "$config_sh" in
2095 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2096 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2097 # because the A-Z/a-z are not consecutive.
2098 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2099 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2100 newmyuname="$myuname"
2102 case "$knowitall" in
2104 if test -f ../config.sh; then
2105 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2106 eval "`grep myuname= ../config.sh`"
2108 if test "X$myuname" = "X$newmyuname"; then
2116 : Get old answers from old config file if Configure was run on the
2117 : same system, otherwise use the hints.
2120 if test -f config.sh; then
2122 rp="I see a config.sh file. Shall I use it to set the defaults?"
2125 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2126 *) echo "Fetching default answers from your old config.sh file..." >&4
2134 : Older versions did not always set $sh. Catch re-use of such
2143 if test ! -f config.sh; then
2146 First time through, eh? I have some defaults handy for some systems
2147 that need some extra help getting the Configure answers right:
2150 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2152 : Half the following guesses are probably wrong... If you have better
2153 : tests or hints, please send them to perlbug@perl.com
2154 : The metaconfig authors would also appreciate a copy...
2155 $test -f /irix && osname=irix
2156 $test -f /xenix && osname=sco_xenix
2157 $test -f /dynix && osname=dynix
2158 $test -f /dnix && osname=dnix
2159 $test -f /lynx.os && osname=lynxos
2160 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2161 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2162 $test -f /bin/mips && /bin/mips && osname=mips
2163 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2164 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2165 $test -d /usr/apollo/bin && osname=apollo
2166 $test -f /etc/saf/_sactab && osname=svr4
2167 $test -d /usr/include/minix && osname=minix
2168 if $test -d /MachTen -o -d /MachTen_Folder; then
2170 if $test -x /sbin/version; then
2171 osvers=`/sbin/version | $awk '{print $2}' |
2172 $sed -e 's/[A-Za-z]$//'`
2173 elif $test -x /usr/etc/version; then
2174 osvers=`/usr/etc/version | $awk '{print $2}' |
2175 $sed -e 's/[A-Za-z]$//'`
2180 $test -f /sys/posix.dll &&
2181 $test -f /usr/bin/what &&
2182 set X `/usr/bin/what /sys/posix.dll` &&
2183 $test "$3" = UWIN &&
2186 if $test -f $uname; then
2194 umips) osname=umips ;;
2197 [23]100) osname=mips ;;
2198 next*) osname=next ;;
2200 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2201 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2204 elif $test -f /etc/kconfig; then
2206 if test "$lns" = "$ln -s"; then
2208 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2210 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2217 if test -n "$DJGPP"; then
2226 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2228 'not found') osvers="$4"."$3" ;;
2229 '<3240'|'<>3240') osvers=3.2.0 ;;
2230 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2231 '=3250'|'>3250') osvers=3.2.5 ;;
2235 *dc.osx) osname=dcosx
2241 domainos) osname=apollo
2247 dynixptx*) osname=dynixptx
2248 osvers=`echo "$4"|sed 's/^v//'`
2250 freebsd) osname=freebsd
2252 genix) osname=genix ;;
2254 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2270 netbsd*) osname=netbsd
2273 news-os) osvers="$3"
2275 4*) osname=newsos4 ;;
2279 bsd386) osname=bsd386
2282 POSIX-BC | posix-bc ) osname=posix-bc
2285 powerux | power_ux | powermax_os | powermaxos | \
2286 powerunix | power_unix) osname=powerux
2289 next*) osname=next ;;
2290 solaris) osname=solaris
2292 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2299 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2303 titanos) osname=titanos
2312 ultrix) osname=ultrix
2315 osf1|mls+) case "$5" in
2318 osvers=`echo "$3" | sed 's/^[xvt]//'`
2320 hp*) osname=hp_osf1 ;;
2321 mips) osname=mips_osf1 ;;
2324 unixware) osname=svr5
2333 $2) case "$osname" in
2337 : svr4.x or possibly later
2347 if test -f /stand/boot ; then
2348 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2349 if test -n "$INITPROG" -a -f "$INITPROG"; then
2350 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2351 if test -n "$isesix"; then
2359 *) if test -f /etc/systemid; then
2361 set `echo $3 | $sed 's/\./ /g'` $4
2362 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2364 elif $test -f $src/hints/sco_$1_$2.sh; then
2366 elif $test -f $src/hints/sco_$1.sh; then
2371 '') : Still unknown. Probably a generic Sys V.
2380 *) case "$osname" in
2381 '') : Still unknown. Probably a generic BSD.
2389 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2390 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2391 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2394 $rm -f UU/kernel.what
2395 elif test -d c:/.; then
2402 : Now look for a hint file osname_osvers, unless one has been
2403 : specified already.
2406 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2407 : Also try without trailing minor version numbers.
2408 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2409 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2410 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2411 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2414 *) case "$osvers" in
2417 *) if $test -f $src/hints/$file.sh ; then
2419 elif $test -f $src/hints/$xfile.sh ; then
2421 elif $test -f $src/hints/$xxfile.sh ; then
2423 elif $test -f $src/hints/$xxxfile.sh ; then
2425 elif $test -f $src/hints/$xxxxfile.sh ; then
2427 elif $test -f "$src/hints/${osname}.sh" ; then
2436 if $test -f Policy.sh ; then
2439 none) dflt="Policy" ;;
2440 *) dflt="Policy $dflt" ;;
2445 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2449 if $test -f Policy.sh ; then
2452 There's also a Policy hint file available, which should make the
2453 site-specific (policy) questions easier to answer.
2460 You may give one or more space-separated answers, or "none" if appropriate.
2461 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2462 is a good thing. DO NOT give a wrong version or a wrong OS.
2466 rp="Which of these apply, if any?"
2469 for file in $tans; do
2470 if $test X$file = XPolicy -a -f Policy.sh; then
2472 $cat Policy.sh >> UU/config.sh
2473 elif $test -f $src/hints/$file.sh; then
2474 . $src/hints/$file.sh
2475 $cat $src/hints/$file.sh >> UU/config.sh
2476 elif $test X$tans = X -o X$tans = Xnone ; then
2479 : Give one chance to correct a possible typo.
2480 echo "$file.sh does not exist"
2482 rp="hint to use instead?"
2484 for file in $ans; do
2485 if $test -f "$src/hints/$file.sh"; then
2486 . $src/hints/$file.sh
2487 $cat $src/hints/$file.sh >> UU/config.sh
2488 elif $test X$ans = X -o X$ans = Xnone ; then
2491 echo "$file.sh does not exist -- ignored."
2498 : Remember our hint file for later.
2499 if $test -f "$src/hints/$file.sh" ; then
2509 echo "Fetching default answers from $config_sh..." >&4
2513 cp $config_sh config.sh 2>/dev/null
2523 test "$override" && . ./optdef.sh
2524 myuname="$newmyuname"
2526 : Restore computed paths
2527 for file in $loclist $trylist; do
2528 eval $file="\$_$file"
2533 Configure uses the operating system name and version to set some defaults.
2534 The default value is probably right if the name rings a bell. Otherwise,
2535 since spelling matters for me, either accept the default or answer "none"
2542 ''|' '|none) dflt=none ;;
2543 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2546 *) dflt="$osname" ;;
2548 rp="Operating system name?"
2552 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2558 ''|' '|none) dflt=none ;;
2559 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2560 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2562 ''|' ') dflt=none ;;
2567 *) dflt="$osvers" ;;
2569 rp="Operating system version?"
2579 : who configured the system
2580 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2581 cf_by=`(logname) 2>/dev/null`
2584 cf_by=`(whoami) 2>/dev/null`
2586 "") cf_by=unknown ;;
2590 : set up the script used to warn in case of inconsistency
2597 echo "*** WHOA THERE!!! ***" >&4
2598 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2599 rp=" Keep the $hint value?"
2602 y) td=$was; tu=$was;;
2606 : function used to set $1 to $val
2607 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2609 $define$undef) . ./whoa; eval "$var=\$td";;
2610 $undef$define) . ./whoa; eval "$var=\$tu";;
2611 *) eval "$var=$val";;
2616 Perl can be built to take advantage of threads, on some systems.
2617 To do so, Configure must be run with -Dusethreads.
2619 Note that threading is a highly experimental feature, and
2620 some known race conditions still remain. If you choose to try
2621 it, be very sure to not actually deploy it for production
2622 purposes. README.threads has more details, and is required
2623 reading if you enable threads.
2625 case "$usethreads" in
2626 $define|true|[yY]*) dflt='y';;
2629 rp='Build a threading Perl?'
2632 y|Y) val="$define" ;;
2638 case "$d_oldpthreads" in
2639 '') : Configure tests would be welcome here. For now, assume undef.
2641 *) val="$d_oldpthreads" ;;
2647 case "$usethreads" in
2648 "$define"|true|[yY]*)
2649 : Look for a hint-file generated 'call-back-unit'. If the
2650 : user has specified that a threading perl is to be built,
2651 : we may need to set or change some other defaults.
2652 if $test -f usethreads.cbu; then
2653 echo "Your platform has some specific hints for threaded builds, using them..."
2657 (Your platform doesn't have any specific hints for threaded builds.
2658 Assuming POSIX threads, then.)
2666 Perl can be built so that multiple Perl interpreters can coexist
2667 within the same Perl executable. To do so, Configure must be run with
2670 Normally you do not need this and you should answer no.
2673 case "$usemultiplicity" in
2674 $define|true|[yY]*) dflt='y';;
2677 rp='Build Perl for multiplicity?'
2680 y|Y) val="$define" ;;
2686 : determine where manual pages are on this system
2690 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2691 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2692 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2693 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2694 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2695 sysman=`./loc . /usr/man/man1 $syspath`
2698 if $test -d "$sysman"; then
2699 echo "System manual is in $sysman." >&4
2701 echo "Could not find manual pages in source form." >&4
2704 : see what memory models we can support
2707 $cat >pdp11.c <<'EOP'
2716 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2717 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2718 dflt='unsplit split'
2720 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2723 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2728 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2731 if $test -d /lib/large || $test -d /usr/lib/large; then
2734 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2743 Some systems have different model sizes. On most systems they are called
2744 small, medium, large, and huge. On the PDP11 they are called unsplit and
2745 split. If your system doesn't support different memory models, say "none".
2746 If you wish to force everything to one memory model, say "none" here and
2747 put the appropriate flags later when it asks you for other cc and ld flags.
2748 Venix systems may wish to put "none" and let the compiler figure things out.
2749 (In the following question multiple model names should be space separated.)
2751 The default for most systems is "none".
2754 rp="Which memory models are supported?"
2769 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2770 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2777 rp="What flag indicates separate I and D space?"
2785 *large*|*small*|*medium*|*huge*)
2792 rp="What flag indicates large model?"
2802 *huge*) case "$huge" in
2806 rp="What flag indicates huge model?"
2816 *medium*) case "$medium" in
2820 rp="What flag indicates medium model?"
2827 *) medium="$large";;
2830 *small*) case "$small" in
2834 rp="What flag indicates small model?"
2845 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2848 $rm -f pdp11.* pdp11
2850 : make some quick guesses about what we are up against
2852 $echo $n "Hmm... $c"
2862 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2863 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2865 echo "Looks kind of like an OSF/1 system, but we'll see..."
2867 elif test `echo abc | tr a-z A-Z` = Abc ; then
2868 xxx=`./loc addbib blurfl $pth`
2869 if $test -f $xxx; then
2870 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2874 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2875 echo "Looks kind of like an extended USG system, but we'll see..."
2877 echo "Looks kind of like a USG system, but we'll see..."
2881 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2882 echo "Looks kind of like a BSD system, but we'll see..."
2886 echo "Looks kind of like a Version 7 system, but we'll see..."
2889 case "$eunicefix" in
2892 There is, however, a strange, musty smell in the air that reminds me of
2893 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2897 : it so happens the Eunice I know will not run shell scripts in Unix format
2901 echo "Congratulations. You aren't running Eunice."
2905 : Detect OS2. The p_ variable is set above in the Head.U unit.
2910 I have the feeling something is not exactly right, however...don't tell me...
2911 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2916 if test -f /xenix; then
2917 echo "Actually, this looks more like a XENIX system..."
2922 echo "It's not Xenix..."
2927 if test -f /venix; then
2928 echo "Actually, this looks more like a VENIX system..."
2935 echo "Nor is it Venix..."
2938 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2939 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2942 : see if we need a special compiler
2950 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2951 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2965 On some older systems the default C compiler will not resolve multiple global
2966 references that happen to have the same name. On some such systems the "Mcc"
2967 command may be used to force these to be resolved. On other systems a "cc -M"
2968 command is required. (Note that the -M flag on other systems indicates a
2969 memory model to use!) If you have the Gnu C compiler, you might wish to use
2975 rp="Use which C compiler?"
2983 rp="Use which C compiler?"
2987 : Look for a hint-file generated 'call-back-unit'. Now that the
2988 : user has specified the compiler, we may need to set or change some
2990 if $test -f cc.cbu; then
2994 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2995 $cat >gccvers.c <<EOM
3000 printf("%s\n", __VERSION__);
3002 printf("%s\n", "1");
3008 if $cc -o gccvers gccvers.c; then
3009 gccversion=`./gccvers`
3010 case "$gccversion" in
3011 '') echo "You are not using GNU cc." ;;
3012 *) echo "You are using GNU cc $gccversion." ;;
3016 echo "*** WHOA THERE!!! ***" >&4
3017 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3018 case "$knowitall" in
3020 echo " You'd better start hunting for one and let me know about it." >&4
3026 case "$gccversion" in
3027 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3031 case "$usemorebits" in
3032 "$define"|true|[yY]*)
3034 uselongdouble="$define"
3035 usemorebits="$define"
3037 *) usemorebits="$undef"
3044 Perl can be built to understand large files (files larger than 2 gigabytes)
3045 on some systems. To do so, Configure must be run with -Duselargefiles.
3047 If this doesn't make any sense to you, just accept the default.
3049 case "$uselargefiles" in
3050 "$define"|true|[yY]*) dflt='y' ;;
3053 rp='Try to understand large files?'
3056 y|Y) val="$define" ;;
3061 case "$uselargefiles" in
3062 "$define") use64bits="$define" ;;
3067 Perl can be built to take advantage of explicit 64-bit interfaces,
3068 on some systems. To do so, Configure must be run with -Duse64bits.
3070 If this doesn't make any sense to you, just accept the default.
3072 case "$use64bits" in
3073 $define|true|[yY]*) dflt='y';;
3076 rp='Try to use explicit 64-bit interfaces, if available?'
3089 case "$archname64" in
3090 '') archname64='' ;; # not a typo
3093 case "$use64bits" in
3094 "$define"|true|[yY]*)
3095 : Look for a hint-file generated 'call-back-unit'. If the
3096 : user has specified that a 64 bit perl is to be built,
3097 : we may need to set or change some other defaults.
3098 if $test -f use64bits.cbu; then
3099 echo "Your platform has some specific hints for 64-bit builds, using them..."
3103 (Your platform doesn't have any specific hints for 64-bit builds.
3104 This is probably okay, especially if your system is a true 64-bit system.)
3106 case "$gccversion" in
3109 But since you seem to be using gcc,
3110 I will now add -DUSE_LONG_LONG to the compilation flags.
3112 ccflags="$ccflags -DUSE_LONG_LONG"
3119 : determine the architecture name
3121 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3122 tarch=`arch`"-$osname"
3123 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3124 if uname -m > tmparch 2>&1 ; then
3125 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3126 -e 's/$/'"-$osname/" tmparch`
3134 case "$myarchname" in
3137 echo "(Your architecture name used to be $myarchname.)"
3144 *) dflt="$archname";;
3146 rp='What is your architecture name'
3149 case "$usethreads" in
3151 echo "Threads selected." >&4
3153 *-thread*) echo "...and architecture name already has -thread." >&4
3155 *) archname="$archname-thread"
3156 echo "...setting architecture name to $archname." >&4
3161 case "$usemultiplicity" in
3163 echo "Multiplicity selected." >&4
3165 *-multi*) echo "...and architecture name already has -multi." >&4
3167 *) archname="$archname-multi"
3168 echo "...setting architecture name to $archname." >&4
3173 case "$use64bits" in
3175 echo "Explicit 64-bitness selected." >&4
3176 case "$archname64" in
3181 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3183 *) archname="$archname-$archname64"
3184 echo "...setting architecture name to $archname." >&4
3191 : decide how portable to be. Allow command line overrides.
3192 case "$d_portable" in
3194 *) d_portable="$define" ;;
3197 : set up shell script to do ~ expansion
3203 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3206 if $test -f /bin/csh; then
3207 /bin/csh -f -c "glob \$1"
3212 name=\`$expr x\$1 : '..\([^/]*\)'\`
3213 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3214 if $test ! -d "\$dir"; then
3216 echo "\$me: can't locate home directory for: \$name" >&2
3221 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3237 : now set up to get a file name
3241 cat <<'EOSC' >>getfile
3257 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3258 fn=`echo $fn | sed 's/(.*)//'`
3264 loc_file=`expr $fn : '.*:\(.*\)'`
3265 fn=`expr $fn : '\(.*\):.*'`
3273 */*) fullpath=true;;
3282 *e*) exp_file=true;;
3285 *p*) nopath_ok=true;;
3290 *d*) type='Directory';;
3291 *l*) type='Locate';;
3296 Locate) what='File';;
3301 case "$d_portable" in
3309 while test "$type"; do
3314 true) rp="$rp (~name ok)";;
3317 if test -f UU/getfile.ok && \
3318 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3337 value=`UU/filexp $ans`
3340 if test "$ans" != "$value"; then
3341 echo "(That expands to $value on this system.)"
3355 /*) value="$ansexp" ;;
3360 echo "I shall only accept a full path name, as in /bin/ls." >&4
3361 echo "Use a ! shell escape if you wish to check pathnames." >&4
3364 echo "Please give a full path name, starting with slash." >&4
3367 echo "Note that using ~name is ok provided it expands well." >&4
3380 for fp in $gfpth; do
3381 if test "X$fp" = X.; then
3386 if test -f "$pf"; then
3388 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3390 echo "($value is not a plain file, but that's ok.)"
3393 if test X"$type" = X; then
3400 for fp in $gfpth; do
3401 if test "X$fp" = X.; then
3406 if test -d "$pf"; then
3414 if test -d "$ansexp"; then
3415 echo "(Looking for $loc_file in directory $value.)"
3416 value="$value/$loc_file"
3417 ansexp="$ansexp/$loc_file"
3419 if test -f "$ansexp"; then
3422 case "$nopath_ok" in
3423 true) case "$value" in
3425 *) echo "Assuming $value will be in people's path."
3441 if test "$fastread" = yes; then
3446 rp="$what $value doesn't exist. Use that name anyway?"
3465 test "X$gfpthkeep" != Xy && gfpth=""
3468 : determine root of directory hierarchy where package will be installed.
3471 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3479 By default, $package will be installed in $dflt/bin, manual pages
3480 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3481 installation directories. Typically this is something like /usr/local.
3482 If you wish to have binaries under /usr/bin but other parts of the
3483 installation under /usr/local, that's ok: you will be prompted
3484 separately for each of the installation directories, the prefix being
3485 only used to set the defaults.
3489 rp='Installation prefix to use?'
3497 *) oldprefix="$prefix";;
3507 $define|true) afs=true ;;
3508 $undef|false) afs=false ;;
3509 *) if test -d /afs; then
3517 echo "AFS may be running... I'll be extra cautious then..." >&4
3519 echo "AFS does not seem to be running..." >&4
3522 : determine installation prefix for where package is to be installed.
3526 Since you are running AFS, I need to distinguish the directory in which
3527 files will reside from the directory in which they are installed (and from
3528 which they are presumably copied to the former directory by occult means).
3531 case "$installprefix" in
3532 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3533 *) dflt="$installprefix";;
3538 In some special cases, particularly when building $package for distribution,
3539 it is convenient to distinguish between the directory in which files should
3540 be installed from the directory ($prefix) in which they
3541 will eventually reside. For most users, these two directories are the same.
3544 case "$installprefix" in
3546 *) dflt=$installprefix;;
3550 rp='What installation prefix should I use for installing files?'
3552 installprefix="$ans"
3553 installprefixexp="$ansexp"
3555 : set the prefixit variable, to compute a suitable default value
3556 prefixit='case "$3" in
3558 case "$oldprefix" in
3559 "") eval "$1=\"\$$2\"";;
3566 ""|" ") eval "$1=\"\$$2\"";;
3572 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3574 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3575 /*-$oldprefix/*|\~*-$oldprefix/*)
3576 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3577 *) eval "$1=\"\$$2\"";;
3581 : set the base revision
3584 : get the patchlevel
3586 echo "Getting the current patchlevel..." >&4
3587 if $test -r $rsrc/patchlevel.h;then
3588 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3589 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3590 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
3596 $echo $n "(You have $package" $c
3599 *) $echo $n " $baserev" $c ;;
3601 $echo $n " patchlevel $patchlevel" $c
3602 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3605 if test 0 -eq "$subversion"; then
3606 version=`LC_ALL=C; export LC_ALL; \
3607 echo $baserev $patchlevel | \
3608 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3610 version=`LC_ALL=C; export LC_ALL; \
3611 echo $baserev $patchlevel $subversion | \
3612 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3615 : determine installation style
3616 : For now, try to deduce it from prefix unless it is already set.
3617 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3618 case "$installstyle" in
3619 '') case "$prefix" in
3620 *perl*) dflt='lib';;
3621 *) dflt='lib/perl5' ;;
3624 *) dflt='lib/perl5' ;;
3626 : Probably not worth prompting for this since we prompt for all
3627 : the directories individually, and the prompt would be too long and
3631 : determine where private library files go
3632 : Usual default is /usr/local/lib/perl5/$version.
3633 : Also allow things like /opt/perl/lib/$version, since
3634 : /opt/perl/lib/perl5... would be redundant.
3635 : The default "style" setting is made in installstyle.U
3636 case "$installstyle" in
3637 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3638 *) set dflt privlib lib/$version ;;
3643 There are some auxiliary files for $package that need to be put into a
3644 private library directory that is accessible by everyone.
3648 rp='Pathname where the private library files will reside?'
3651 privlibexp="$ansexp"
3652 : Change installation prefix, if necessary.
3653 if $test X"$prefix" != X"$installprefix"; then
3654 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3656 installprivlib="$privlibexp"
3659 : set the prefixup variable, to restore leading tilda escape
3660 prefixup='case "$prefixexp" in
3662 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3665 : determine where public architecture dependent libraries go
3668 : privlib default is /usr/local/lib/$package/$version
3669 : archlib default is /usr/local/lib/$package/$version/$archname
3670 : privlib may have an optional trailing /share.
3671 tdflt=`echo $privlib | $sed 's,/share$,,'`
3672 tdflt=$tdflt/$archname
3681 $spackage contains architecture-dependent library files. If you are
3682 sharing libraries in a heterogeneous environment, you might store
3683 these files in a separate location. Otherwise, you can just include
3684 them with the rest of the public library files.
3688 rp='Where do you want to put the public architecture-dependent libraries?'
3691 archlibexp="$ansexp"
3692 if $test X"$archlib" = X"$privlib"; then
3697 : Change installation prefix, if necessary.
3698 if $test X"$prefix" != X"$installprefix"; then
3699 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3701 installarchlib="$archlibexp"
3705 : Binary compatibility with 5.005 is not possible for builds
3706 : with advanced features
3707 case "$usethreads$usemultiplicity" in
3709 bincompat5005="$undef"
3710 d_bincompat5005="$undef"
3714 Perl 5.006 can be compiled for binary compatibility with 5.005.
3715 If you decide to do so, you will be able to continue using most
3716 of the extensions that were compiled for Perl 5.005.
3719 case "$bincompat5005$d_bincompat5005" in
3720 *"$undef"*) dflt=n ;;
3723 rp='Binary compatibility with Perl 5.005?'
3726 y*) val="$define" ;;
3731 case "$d_bincompat5005" in
3733 bincompat5005="$define"
3735 *) bincompat5005="$undef"
3736 d_bincompat5005="$undef"
3743 : see if setuid scripts can be secure
3746 Some kernels have a bug that prevents setuid #! scripts from being
3747 secure. Some sites have disabled setuid #! scripts because of this.
3749 First let's decide if your kernel supports secure setuid #! scripts.
3750 (If setuid #! scripts would be secure but have been disabled anyway,
3751 don't say that they are secure if asked.)
3756 if $test -d /dev/fd; then
3757 echo "#!$ls" >reflect
3758 chmod +x,u+s reflect
3759 ./reflect >flect 2>&1
3760 if $contains "/dev/fd" flect >/dev/null; then
3761 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3765 If you are not sure if they are secure, I can check but I'll need a
3766 username and password different from the one you are using right now.
3767 If you don't have such a username or don't want me to test, simply
3771 rp='Other username to test security of setuid scripts with?'
3776 case "$d_suidsafe" in
3777 '') echo "I'll assume setuid scripts are *not* secure." >&4
3780 echo "Well, the $hint value is *not* secure." >&4
3782 *) echo "Well, the $hint value *is* secure." >&4
3787 $rm -f reflect flect
3788 echo "#!$ls" >reflect
3789 chmod +x,u+s reflect
3792 echo '"su" will (probably) prompt you for '"$ans's password."
3793 su $ans -c './reflect >flect'
3794 if $contains "/dev/fd" flect >/dev/null; then
3795 echo "Okay, it looks like setuid scripts are secure." >&4
3798 echo "I don't think setuid scripts are secure." >&4
3803 rp='Does your kernel have *secure* setuid scripts?'
3806 [yY]*) val="$define";;
3811 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3812 echo "(That's for file descriptors, not floppy disks.)"
3818 $rm -f reflect flect
3820 : now see if they want to do setuid emulation
3823 case "$d_suidsafe" in
3826 echo "No need to emulate SUID scripts since they are secure here." >& 4
3830 Some systems have disabled setuid scripts, especially systems where
3831 setuid scripts cannot be secure. On systems where setuid scripts have
3832 been disabled, the setuid/setgid bits on scripts are currently
3833 useless. It is possible for $package to detect those bits and emulate
3834 setuid/setgid in a secure fashion. This emulation will only work if
3835 setuid scripts have been disabled in your kernel.
3839 "$define") dflt=y ;;
3842 rp="Do you want to do setuid/setgid emulation?"
3845 [yY]*) val="$define";;
3853 : What should the include directory be ?
3855 $echo $n "Hmm... $c"
3859 if $test -f /bin/mips && /bin/mips; then
3860 echo "Looks like a MIPS system..."
3861 $cat >usr.c <<'EOCP'
3862 #ifdef SYSTYPE_BSD43
3866 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3867 dflt='/bsd43/usr/include'
3871 mips_type='System V'
3873 $rm -f usr.c usr.out
3874 echo "and you're compiling with the $mips_type compiler and libraries."
3878 echo "Doesn't look like a MIPS system."
3888 case "$xxx_prompt" in
3891 rp='Where are the include files you want to use?'
3899 : see how we invoke the C preprocessor
3901 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3902 cat <<'EOT' >testcpp.c
3908 if test ! -f cppstdin; then
3909 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3910 # AIX cc -E doesn't show the absolute headerfile
3911 # locations but we'll cheat by using the -M flag.
3912 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
3914 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3917 echo "Keeping your $hint cppstdin wrapper."
3920 wrapper=`pwd`/cppstdin
3924 if $test "X$cppstdin" != "X" && \
3925 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3926 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3928 echo "You used to use $cppstdin $cppminus so we'll use that again."
3930 '') echo "But let's see if we can live without a wrapper..." ;;
3932 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3933 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3935 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3938 echo "(However, $cpprun $cpplast does not work, let's see...)"
3946 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3953 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3954 $cc -E <testcpp.c >testcpp.out 2>&1; \
3955 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3956 echo "Yup, it does."
3959 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3960 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3961 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3962 echo "Yup, it does."
3965 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3966 $cc -P <testcpp.c >testcpp.out 2>&1; \
3967 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3968 echo "Yipee, that works!"
3971 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3972 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3973 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3974 echo "At long last!"
3977 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3978 $cpp <testcpp.c >testcpp.out 2>&1; \
3979 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3983 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3984 $cpp - <testcpp.c >testcpp.out 2>&1; \
3985 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3986 echo "Hooray, it works! I was beginning to wonder."
3989 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3990 $wrapper <testcpp.c >testcpp.out 2>&1; \
3991 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3997 rp="No dice. I can't find a C preprocessor. Name one:"
4001 $x_cpp <testcpp.c >testcpp.out 2>&1
4002 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4003 echo "OK, that will do." >&4
4005 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4020 echo "Perhaps can we force $cc -E using a wrapper..."
4021 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4022 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4028 echo "Nope, we'll have to live without it..."
4042 "$wrapper"|'cppstdin') ;;
4043 *) $rm -f $wrapper;;
4045 $rm -f testcpp.c testcpp.out
4047 : Set private lib path
4050 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4055 '') dlist="$loclibpth $plibpth $glibpth";;
4056 *) dlist="$libpth";;
4059 : Now check and see which directories actually exist, avoiding duplicates
4063 if $test -d $xxx; then
4066 *) libpth="$libpth $xxx";;
4072 Some systems have incompatible or broken versions of libraries. Among
4073 the directories listed in the question below, please remove any you
4074 know not to be holding relevant libraries, and add any that are needed.
4075 Say "none" for none.
4086 rp="Directories to use for library searches?"
4093 : compute shared library extension
4096 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4106 On some systems, shared libraries may be available. Answer 'none' if
4107 you want to suppress searching of shared libraries for the remaining
4108 of this configuration.
4111 rp='What is the file extension used for shared libraries?'
4115 : Define several unixisms.
4116 : Hints files or command line option can be used to override them.
4117 : The convoluted testing is in case hints files set either the old
4120 '') case "$exe_ext" in
4122 *) _exe="$exe_ext" ;;
4127 '') case "$lib_ext" in
4134 '') case "$obj_ext" in
4141 '') case "$path_sep" in
4152 : Which makefile gets called first. This is used by make depend.
4153 case "$firstmakefile" in
4154 '') firstmakefile='makefile';;
4159 Perl can be built to use the SOCKS proxy protocol library. To do so,
4160 Configure must be run with -Dusesocks.
4162 Normally you do not need this and you should answer no.
4166 $define|true|[yY]*) dflt='y';;
4169 rp='Build Perl for SOCKS?'
4172 y|Y) val="$define" ;;
4178 : Looking for optional libraries
4180 echo "Checking for optional libraries..." >&4
4185 case "$libswanted" in
4186 '') libswanted='c_s';;
4190 libswanted="$libswanted socks5 socks5_sh"
4193 for thislib in $libswanted; do
4195 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4196 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4197 echo "Found -l$thislib (shared)."
4200 *) dflt="$dflt -l$thislib";;
4202 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4203 echo "Found -l$thislib (shared)."
4206 *) dflt="$dflt -l$thislib";;
4208 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4209 echo "Found -l$thislib."
4212 *) dflt="$dflt -l$thislib";;
4214 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4215 echo "Found -l$thislib."
4218 *) dflt="$dflt -l$thislib";;
4220 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4221 echo "Found -l${thislib}_s."
4224 *) dflt="$dflt -l${thislib}_s";;
4226 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4227 echo "Found -l$thislib."
4230 *) dflt="$dflt -l$thislib";;
4233 echo "No -l$thislib."
4244 ' '|'') dflt='none';;
4249 In order to compile $package on your machine, a number of libraries
4250 are usually needed. Include any other special libraries here as well.
4251 Say "none" for none. The default list is almost always right.
4255 rp="What libraries to use?"
4262 : determine optimization, if desired, or use for debug flag also
4264 ' '|$undef) dflt='none';;
4266 *) dflt="$optimize";;
4270 By default, $package compiles with the -O flag to use the optimizer.
4271 Alternately, you might want to use the symbolic debugger, which uses
4272 the -g flag (on traditional Unix systems). Either flag can be
4273 specified here. To use neither flag, specify the word "none".
4276 rp="What optimizer/debugger flag should be used?"
4280 'none') optimize=" ";;
4284 : We will not override a previous value, but we might want to
4285 : augment a hint file
4287 default|recommended)
4288 case "$gccversion" in
4289 1*) dflt='-fpcc-struct-return' ;;
4292 *-g*) dflt="$dflt -DDEBUGGING";;
4294 case "$gccversion" in
4295 2*) if test -d /etc/conf/kconfig.d &&
4296 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4302 case "$gccversion" in
4306 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4307 echo 'int main(void) { return 0; }' > gcctest.c
4308 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4309 echo "Yes, it does." 2>&1
4312 echo "Leaving current flags $ccflags alone." 2>&1
4314 *) dflt="$dflt -fno-strict-aliasing" ;;
4317 echo "Nope, it doesn't, but that's ok." 2>&1
4324 case "$mips_type" in
4325 *BSD*|'') inclwanted="$locincpth $usrinc";;
4326 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4328 for thisincl in $inclwanted; do
4329 if $test -d $thisincl; then
4330 if $test x$thisincl != x$usrinc; then
4333 *) dflt="$dflt -I$thisincl";;
4339 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4341 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4349 *) dflt="$dflt -D$2";;
4353 set signal.h LANGUAGE_C; eval $inctest
4357 ccflags="$ccflags -DSOCKS"
4362 default|recommended) dflt="$ccflags $dflt" ;;
4363 *) dflt="$ccflags";;
4371 Your C compiler may want other flags. For this question you should include
4372 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4373 but you should NOT include libraries or ld flags like -lwhatever. If you
4374 want $package to honor its debug switch, you should include -DDEBUGGING here.
4375 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4377 To use no flags, specify the word "none".
4383 rp="Any additional cc flags?"
4390 : the following weeds options from ccflags that are of no interest to cpp
4392 case "$gccversion" in
4393 1*) cppflags="$cppflags -D__GNUC__"
4395 case "$mips_type" in
4397 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4403 echo "Let me guess what the preprocessor flags are..." >&4
4417 *) ftry="$previous $flag";;
4419 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4420 >cpp1.out 2>/dev/null && \
4421 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4422 >cpp2.out 2>/dev/null && \
4423 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4424 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4426 cppflags="$cppflags $ftry"
4436 *-*) echo "They appear to be: $cppflags";;
4438 $rm -f cpp.c cpp?.out
4442 : flags used in final linking phase
4444 '') if ./venix; then
4450 *-posix*) dflt="$dflt -posix" ;;
4453 *) dflt="$ldflags";;
4456 : Try to guess additional flags to pick up local libraries.
4457 for thislibdir in $libpth; do
4458 case " $loclibpth " in
4461 *"-L$thislibdir "*) ;;
4462 *) dflt="$dflt -L$thislibdir" ;;
4474 Your C linker may need flags. For this question you should
4475 include -L/whatever and any other flags used by the C linker, but you
4476 should NOT include libraries like -lwhatever.
4478 Make sure you include the appropriate -L/path flags if your C linker
4479 does not normally search all of the directories you specified above,
4482 To use no flags, specify the word "none".
4486 rp="Any additional ld flags (NOT including libraries)?"
4492 rmlist="$rmlist pdp11"
4496 echo "Checking your choice of C compiler and flags for coherency..." >&4
4497 $cat > try.c <<'EOF'
4499 int main() { printf("Ok\n"); exit(0); }
4501 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4503 $cat >try.msg <<'EOM'
4504 I've tried to compile and run the following simple program:
4507 $cat try.c >> try.msg
4509 $cat >> try.msg <<EOM
4516 and I got the following output:
4520 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4521 if sh -c './try' >>try.msg 2>&1; then
4525 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4528 cat >> try.msg <<'EOQS'
4529 If $libs contains -lsfio, and sfio is mis-configured, then it
4530 sometimes (apparently) runs and exits with a 0 status, but with no
4531 output! It may have to do with sfio's use of _exit vs. exit.
4534 rp="You have a big problem. Shall I abort Configure"
4541 echo "The program compiled OK, but exited with status $?." >>try.msg
4542 rp="You have a problem. Shall I abort Configure"
4546 echo "I can't compile the test program." >>try.msg
4547 rp="You have a BIG problem. Shall I abort Configure"
4553 case "$knowitall" in
4555 echo "(The supplied flags or libraries might be incorrect.)"
4563 *) echo "Ok. Stopping Configure." >&4
4568 n) echo "OK, that should do.";;
4570 $rm -f try try.* core
4572 : determine filename position in cpp output
4574 echo "Computing filename position in cpp output for #include directives..." >&4
4575 echo '#include <stdio.h>' > foo.c
4578 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4579 $grep '^[ ]*#.*stdio\.h' | \
4580 while read cline; do
4583 while $test \$# -gt 0; do
4584 if $test -r \`echo \$1 | $tr -d '"'\`; then
4589 pos=\`expr \$pos + 1\`
4601 *) pos="${fieldn}th";;
4603 echo "Your cpp writes the filename in the $pos field of the line."
4605 : locate header file
4610 for usrincdir in $usrinc
4612 if test -f \$usrincdir/\$wanted; then
4613 echo "\$usrincdir/\$wanted"
4617 awkprg='{ print \$$fieldn }'
4618 echo "#include <\$wanted>" > foo\$\$.c
4619 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4620 $grep "^[ ]*#.*\$wanted" | \
4621 while read cline; do
4622 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4624 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4625 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4630 # status = 0: grep returned 0 lines, case statement not executed
4631 # status = 1: headerfile found
4632 # status = 2: while loop executed, no headerfile found
4636 if test \$status -eq 1; then
4643 : define an alternate in-header-list? function
4644 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4645 cont=true; xxf="echo \"<\$1> found.\" >&4";
4646 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4647 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4649 case $# in 4) instead=instead;; *) instead="at last";; esac;
4650 while $test "$cont"; do
4652 var=$2; eval "was=\$$2";
4653 if $test "$xxx" && $test -r "$xxx";
4655 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4658 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4659 set $yyy; shift; shift; yyy=$@;
4660 case $# in 0) cont="";;
4661 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4662 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4663 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4664 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4668 do set $yyy; var=$2; eval "was=\$$2";
4669 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4670 set $yyy; shift; shift; yyy=$@;
4673 : see if this is a malloc.h system
4674 set malloc.h i_malloc
4677 : see if stdlib is available
4678 set stdlib.h i_stdlib
4681 : determine which malloc to compile in
4683 case "$usemymalloc" in
4684 ''|[yY]*|true|$define) dflt='y' ;;
4687 rp="Do you wish to attempt to use the malloc that comes with $package?"
4693 mallocsrc='malloc.c'
4694 mallocobj="malloc$_o"
4695 d_mymalloc="$define"
4698 : Remove malloc from list of libraries to use
4699 echo "Removing unneeded -lmalloc from library list" >&4
4700 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4703 echo "libs = $libs" >&4
4715 : compute the return types of malloc and free
4717 $cat >malloc.c <<END
4721 #include <sys/types.h>
4735 case "$malloctype" in
4737 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4744 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4748 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4755 echo "Your system uses $freetype free(), it would seem." >&4
4759 The installation process will also create a directory for
4760 vendor-supplied add-ons. Vendors who supply perl with their system
4761 may find it convenient to place all vendor-supplied files in this
4762 directory rather than in the main distribution directory. This will
4763 ease upgrades between binary-compatible maintenance versions of perl.
4765 Of course you may also use these directories in whatever way you see
4766 fit. For example, you might use them to access modules shared over a
4767 company-wide network.
4769 The default answer should be fine for most people.
4770 This causes further questions about vendor add-ons to be skipped
4771 and no vendor-specific directories will be configured for perl.
4774 rp='Do you want to configure vendor-specific add-on directories?'
4775 case "$usevendorprefix" in
4776 define|true|[yY]*) dflt=y ;;
4782 rp='Installation prefix to use for vendor-supplied add-ons?'
4783 case "$vendorprefix" in
4785 *) dflt=$vendorprefix ;;
4789 case "$vendorprefix" in
4793 *) oldvendorprefix="$prefix";;
4797 usevendorprefix="$define"
4799 vendorprefixexp="$ansexp"
4801 *) usevendorprefix="$undef"
4807 case "$vendorprefix" in
4808 '') d_vendorlib="$undef"
4812 *) d_vendorlib="$define"
4813 : determine where vendor-supplied modules go.
4814 : Usual default is /usr/local/lib/perl5/vendor_perl
4815 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4816 case "$installstyle" in
4817 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4818 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4821 rp='Pathname for the vendor-supplied library files?'
4824 vendorlibexp="$ansexp"
4825 : Change installation prefix, if necessary.
4826 if $test X"$prefix" != X"$installprefix"; then
4827 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4829 installvendorlib="$vendorlibexp"
4834 : Cruising for prototypes
4836 echo "Checking out function prototypes..." >&4
4837 $cat >prototype.c <<'EOCP'
4838 int main(int argc, char *argv[]) {
4841 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4842 echo "Your C compiler appears to support function prototypes."
4845 echo "Your C compiler doesn't seem to understand function prototypes."
4852 case "$prototype" in
4854 *) ansi2knr='ansi2knr'
4859 This version of $package can only be compiled by a compiler that
4860 understands function prototypes. Unfortunately, your C compiler
4862 doesn't seem to understand them. Sorry about that.
4864 If GNU cc is available for your system, perhaps you could try that instead.
4866 Eventually, we hope to support building Perl with pre-ANSI compilers.
4867 If you would like to help in that effort, please contact <perlbug@perl.org>.
4869 Aborting Configure now.
4875 : determine where public executables go
4880 rp='Pathname where the public executables will reside?'
4882 if $test "X$ansexp" != "X$binexp"; then
4887 : Change installation prefix, if necessary.
4888 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4889 if $test X"$prefix" != X"$installprefix"; then
4890 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4892 installbin="$binexp"
4895 : determine whether to install perl also as /usr/bin/perl
4898 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4900 Many scripts expect to perl to be installed as /usr/bin/perl.
4901 I can install the perl you are about to compile also as /usr/bin/perl
4902 (in addition to $installbin/perl).
4904 case "$installusrbinperl" in
4905 "$undef"|[nN]*) dflt='n';;
4908 rp="Do you want to install perl as /usr/bin/perl?"
4911 [yY]*) val="$define";;
4917 set installusrbinperl
4920 : define a shorthand compile call
4924 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4925 : define a shorthand compile call for compilations that should be ok.
4929 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4932 echo "Checking for GNU C Library..." >&4
4933 cat >gnulibc.c <<EOM
4945 if eval $compile_ok && ./gnulibc; then
4947 echo "You are using the GNU C Library"
4950 echo "You are not using the GNU C Library"
4956 : see if nm is to be used to determine whether a symbol is defined or not
4960 case "$d_gnulibc" in
4963 echo "nm probably won't work on the GNU C Library." >&4
4969 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4971 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4972 echo "'nm' won't be sufficient on this sytem." >&4
4978 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4979 if $test $dflt -gt 20; then
4989 true|$define) dflt=y;;
4996 I can use $nm to extract the symbols from your C libraries. This
4997 is a time consuming task which may generate huge output on the disk (up
4998 to 3 megabytes) but that should make the symbols extraction faster. The
4999 alternative is to skip the 'nm' extraction part and to compile a small
5000 test program instead to determine whether each symbol is present. If
5001 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5002 this may be the best solution.
5004 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5007 rp="Shall I use $nm to extract C symbols from the libraries?"
5010 [Nn]*) usenm=false;;
5019 : nm options which may be necessary
5021 '') if $test -f /mach_boot; then
5023 elif $test -d /usr/ccs/lib; then
5024 nm_opt='-p' # Solaris (and SunOS?)
5025 elif $test -f /dgux; then
5027 elif $test -f /lib64/rld; then
5028 nm_opt='-p' # 64-bit Irix
5034 : nm options which may be necessary for shared libraries but illegal
5035 : for archive libraries. Thank you, Linux.
5036 case "$nm_so_opt" in
5037 '') case "$myuname" in
5039 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5040 nm_so_opt='--dynamic'
5049 : get list of predefined functions in a handy place
5054 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5061 *) for thislib in $libs; do
5064 : Handle C library specially below.
5067 thislib=`echo $thislib | $sed -e 's/^-l//'`
5068 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5070 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5072 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5074 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5076 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5078 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5080 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5085 libnames="$libnames $try"
5087 *) libnames="$libnames $thislib" ;;
5096 for xxx in $libpth; do
5097 $test -r $1 || set $xxx/libc.$so
5098 : The messy sed command sorts on library version numbers.
5100 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5101 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5103 s/[0-9][0-9]*/0000&/g
5104 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5107 sort | $sed -e 's/^.* //'`
5110 $test -r $1 || set /usr/ccs/lib/libc.$so
5111 $test -r $1 || set /lib/libsys_s$_a
5117 if $test -r "$1"; then
5118 echo "Your (shared) C library seems to be in $1."
5120 elif $test -r /lib/libc && $test -r /lib/clib; then
5121 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5123 libc='/lib/clib /lib/libc'
5124 if $test -r /lib/syslib; then
5125 echo "(Your math library is in /lib/syslib.)"
5126 libc="$libc /lib/syslib"
5128 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5129 echo "Your C library seems to be in $libc, as you said before."
5130 elif $test -r $incpath/usr/lib/libc$_a; then
5131 libc=$incpath/usr/lib/libc$_a;
5132 echo "Your C library seems to be in $libc. That's fine."
5133 elif $test -r /lib/libc$_a; then
5135 echo "Your C library seems to be in $libc. You're normal."
5137 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5139 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5140 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5141 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5143 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5145 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5148 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5150 if $test -r "$tans"; then
5151 echo "Your C library seems to be in $tans, of all places."
5157 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5161 If the guess above is wrong (which it might be if you're using a strange
5162 compiler, or your machine supports multiple models), you can override it here.
5167 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5169 I can't seem to find your C library. I've looked in the following places:
5172 $sed 's/^/ /' libpath
5175 None of these seems to contain your C library. I need to get its name...
5180 rp='Where is your C library?'
5185 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5186 set X `cat libnames`
5189 case $# in 1) xxx=file; esac
5190 echo "Extracting names from the following $xxx for later perusal:" >&4
5192 $sed 's/^/ /' libnames >&4
5194 $echo $n "This may take a while...$c" >&4
5198 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5199 *) $nm $nm_opt $file 2>/dev/null;;
5204 $grep fprintf libc.tmp > libc.ptf
5205 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5206 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5208 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5210 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5212 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5214 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5216 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5218 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5220 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5222 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5224 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5226 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5228 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5230 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5232 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5233 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5235 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5237 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5239 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5241 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5243 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5245 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5247 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5249 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5251 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5253 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5255 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5257 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5259 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5261 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5263 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5266 $nm -p $* 2>/dev/null >libc.tmp
5267 $grep fprintf libc.tmp > libc.ptf
5268 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5269 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5275 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5277 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5278 for thisname in $libnames $libc; do
5279 $ar t $thisname >>libc.tmp
5281 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5283 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5284 # Repeat libc to extract forwarders to DLL entries too
5285 for thisname in $libnames $libc; do
5286 $ar tv $thisname >>libc.tmp
5287 # Revision 50 of EMX has bug in $ar.
5288 # it will not extract forwarders to DLL entries
5289 # Use emximp which will extract exactly them.
5290 emximp -o tmp.imp $thisname \
5292 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5293 < tmp.imp >>libc.tmp
5296 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5299 echo "$ar didn't seem to work right." >&4
5300 echo "Maybe this is a Cray...trying bld instead..." >&4
5301 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5303 for thisname in $libnames; do
5305 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5306 $ar t $thisname >>libc.tmp
5310 echo "That didn't work either. Giving up." >&4
5317 if $test -f /lib/syscalls.exp; then
5319 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5320 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5324 $rm -f libnames libpath
5326 : see if dld is available
5330 : is a C symbol defined?
5333 -v) tf=libc.tmp; tc=""; tdc="";;
5334 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5335 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5338 case "$reuseval-$4" in
5340 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5346 if $contains $tlook $tf >/dev/null 2>&1;
5351 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5352 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5360 $define) tval=true;;
5366 : define an is-in-libc? function
5367 inlibc='echo " "; td=$define; tu=$undef;
5368 sym=$1; var=$2; eval "was=\$$2";
5370 case "$reuseval$was" in
5380 echo "$sym() found." >&4;
5381 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5383 echo "$sym() NOT found." >&4;
5384 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5388 $define) echo "$sym() found." >&4;;
5389 *) echo "$sym() NOT found." >&4;;
5393 : see if dlopen exists
5400 : determine which dynamic loading, if any, to compile in
5402 dldir="ext/DynaLoader"
5415 $define) dflt='y' ;;
5418 $define) dflt='y' ;;
5420 : Does a dl_xxx.xs file exist for this operating system
5421 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5424 rp="Do you wish to use dynamic loading?"
5431 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5432 dflt="$dldir/dl_${osname}.xs"
5433 elif $test "$d_dlopen" = "$define" ; then
5434 dflt="$dldir/dl_dlopen.xs"
5435 elif $test "$i_dld" = "$define" ; then
5436 dflt="$dldir/dl_dld.xs"
5441 *) dflt="$dldir/$dlsrc"
5444 echo "The following dynamic loading files are available:"
5445 : Can not go over to $dldir because getfile has path hard-coded in.
5446 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5447 rp="Source file to use for dynamic loading"
5453 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5457 Some systems may require passing special flags to $cc -c to
5458 compile modules that will be used to create a shared library.
5459 To use no flags, say "none".
5462 case "$cccdlflags" in
5463 '') case "$gccversion" in
5464 '') case "$osname" in
5466 next) dflt='none' ;;
5467 irix*) dflt='-KPIC' ;;
5468 svr4*|esix*|solaris) dflt='-KPIC' ;;
5469 sunos) dflt='-pic' ;;
5473 *) case "$osname" in
5474 svr4*|esix*|solaris) dflt='-fPIC' ;;
5479 *) dflt="$cccdlflags" ;;
5481 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5484 none) cccdlflags=' ' ;;
5485 *) cccdlflags="$ans" ;;
5490 Some systems use ld to create libraries that can be dynamically loaded,
5491 while other systems (such as those using ELF) use $cc.
5495 '') $cat >try.c <<'EOM'
5496 /* Test for whether ELF binaries are produced */
5501 int i = open("a.out",O_RDONLY);
5504 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5505 exit(0); /* succeed (yes, it's ELF) */
5510 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5512 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5516 echo "I'll use ld to build dynamic libraries."
5525 rp="What command should be used to create dynamic libraries?"
5531 Some systems may require passing special flags to $ld to create a
5532 library that can be dynamically loaded. If your ld flags include
5533 -L/other/path options to locate libraries outside your loader's normal
5534 search path, you may need to specify those -L options here as well. To
5535 use no flags, say "none".
5538 case "$lddlflags" in
5539 '') case "$osname" in
5540 beos) dflt='-nostart' ;;
5542 linux|irix*) dflt='-shared' ;;
5543 next) dflt='none' ;;
5544 solaris) dflt='-G' ;;
5545 sunos) dflt='-assert nodefinitions' ;;
5546 svr4*|esix*) dflt="-G $ldflags" ;;
5550 *) dflt="$lddlflags" ;;
5553 : Try to guess additional flags to pick up local libraries.
5554 : Be careful not to append to a plain 'none'
5558 for thisflag in $ldflags; do
5563 *) dflt="$dflt $thisflag" ;;
5570 ''|' ') dflt='none' ;;
5573 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5576 none) lddlflags=' ' ;;
5577 *) lddlflags="$ans" ;;
5582 Some systems may require passing special flags to $cc to indicate that
5583 the resulting executable will use dynamic linking. To use no flags,
5587 case "$ccdlflags" in
5588 '') case "$osname" in
5589 hpux) dflt='-Wl,-E' ;;
5590 linux) dflt='-rdynamic' ;;
5591 next) dflt='none' ;;
5592 sunos) dflt='none' ;;
5596 *) dflt="$ccdlflags" ;;
5598 rp="Any special flags to pass to $cc to use dynamic loading?"
5601 none) ccdlflags=' ' ;;
5602 *) ccdlflags="$ans" ;;
5616 # No dynamic loading being used, so don't bother even to prompt.
5619 *) case "$useshrplib" in
5620 '') case "$osname" in
5621 svr4*|dgux|dynixptx|esix|powerux|beos)
5623 also='Building a shared libperl is required for dynamic loading to work on your system.'
5628 also='Building a shared libperl is needed for MAB support.'
5646 The perl executable is normally obtained by linking perlmain.c with
5647 libperl${_a}, any static extensions (usually just DynaLoader), and
5648 any other libraries needed on this system (such as -lm, etc.). Since
5649 your system supports dynamic loading, it is probably possible to build
5650 a shared libperl.$so. If you will have more than one executable linked
5651 to libperl.$so, this will significantly reduce the size of each
5652 executable, but it may have a noticeable affect on performance. The
5653 default is probably sensible for your system.
5657 rp="Build a shared libperl.$so (y/n)"
5661 useshrplib='true' ;;
5662 *) useshrplib='false' ;;
5667 case "$useshrplib" in
5671 # Figure out a good name for libperl.so. Since it gets stored in
5672 # a version-specific architecture-dependent library, the version
5673 # number isn't really that important, except for making cc/ld happy.
5675 # A name such as libperl.so.3.1
5676 majmin="libperl.$so.$patchlevel.$subversion"
5677 # A name such as libperl.so.301
5678 majonly=`echo $patchlevel $subversion |
5679 $awk '{printf "%d%02d", $1, $2}'`
5680 majonly=libperl.$so.$majonly
5681 # I'd prefer to keep the os-specific stuff here to a minimum, and
5682 # rely on figuring it out from the naming of libc.
5683 case "${osname}${osvers}" in
5686 # XXX How handle the --version stuff for MAB?
5688 linux*) # ld won't link with a bare -lperl otherwise.
5691 *) # Try to guess based on whether libc has major.minor.
5693 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5694 *libc.$so.[0-9]*) dflt=$majonly ;;
5695 *) dflt=libperl.$so ;;
5705 I need to select a good name for the shared libperl. If your system uses
5706 library names with major and minor numbers, then you might want something
5707 like $majmin. Alternatively, if your system uses a single version
5708 number for shared libraries, then you might want to use $majonly.
5709 Or, your system might be quite happy with a simple libperl.$so.
5711 Since the shared libperl will get installed into a version-specific
5712 architecture-dependent directory, the version number of the shared perl
5713 library probably isn't important, so the default should be o.k.
5716 rp='What name do you want to give to the shared libperl?'
5719 echo "Ok, I'll use $libperl"
5722 libperl="libperl${_a}"
5726 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5730 WARNING: Use of the shrpdir variable for the installation location of
5731 the shared $libperl is not supported. It was never documented and
5732 will not work in this version. Let me (perlbug@perl.com)
5733 know of any problems this may cause.
5739 But your current setting of $shrpdir is
5740 the default anyway, so it's harmless.
5745 Further, your current attempted setting of $shrpdir
5746 conflicts with the value of $archlibexp/CORE
5747 that installperl will use.
5754 # How will the perl executable find the installed shared $libperl?
5755 # Add $xxx to ccdlflags.
5756 # If we can't figure out a command-line option, use $shrpenv to
5757 # set env LD_RUN_PATH. The main perl makefile uses this.
5758 shrpdir=$archlibexp/CORE
5761 if "$useshrplib"; then
5764 # We'll set it in Makefile.SH...
5770 xxx="-Wl,-R$shrpdir"
5772 linux|irix*|dec_osf)
5773 xxx="-Wl,-rpath,$shrpdir"
5776 # next doesn't like the default...
5779 # beos doesn't like the default, either.
5782 # hpux doesn't like the default, either.
5783 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5786 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5792 # Only add $xxx if it isn't already in ccdlflags.
5793 case " $ccdlflags " in
5795 *) ccdlflags="$ccdlflags $xxx"
5798 Adding $xxx to the flags
5799 passed to $ld so that the perl executable will find the
5800 installed shared $libperl.
5808 # Fix ccdlflags in AIX for building external extensions.
5809 # (For building Perl itself bare -bE:perl.exp is needed,
5810 # Makefile.SH takes care of this.)
5812 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5814 # Respect a hint or command-line value.
5816 '') shrpenv="$tmp_shrpenv" ;;
5818 case "$ldlibpthname" in
5819 '') ldlibpthname=LD_LIBRARY_PATH ;;
5820 none) ldlibpthname='' ;;
5823 : determine where manual pages go
5824 set man1dir man1dir none
5828 $spackage has manual pages available in source form.
5832 echo "However, you don't have nroff, so they're probably useless to you."
5834 '') man1dir="none";;
5837 echo "If you don't want the manual sources installed, answer 'none'."
5842 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5843 lookpath="$lookpath $prefixexp/man/p_man/man1"
5844 lookpath="$lookpath $prefixexp/man/u_man/man1"
5845 lookpath="$lookpath $prefixexp/man/man.1"
5847 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5848 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5858 rp="Where do the main $spackage manual pages (source) go?"
5860 if $test "X$man1direxp" != "X$ansexp"; then
5864 man1direxp="$ansexp"
5870 : Change installation prefix, if necessary.
5871 if $test X"$prefix" != X"$installprefix"; then
5872 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5874 installman1dir="$man1direxp"
5877 : What suffix to use on installed man pages
5884 rp="What suffix should be used for the main $spackage man pages?"
5886 '') case "$man1dir" in
5900 *) dflt="$man1ext";;
5907 : see if we can have long filenames
5909 rmlist="$rmlist /tmp/cf$$"
5910 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5911 first=123456789abcdef
5912 second=/tmp/cf$$/$first
5913 $rm -f $first $second
5914 if (echo hi >$first) 2>/dev/null; then
5915 if $test -f 123456789abcde; then
5916 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5919 if (echo hi >$second) 2>/dev/null; then
5920 if $test -f /tmp/cf$$/123456789abcde; then
5922 That's peculiar... You can have filenames longer than 14 characters, but only
5923 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5924 I shall consider your system cannot support long filenames at all.
5928 echo 'You can have filenames longer than 14 characters.' >&4
5933 How confusing! Some of your filesystems are sane enough to allow filenames
5934 longer than 14 characters but some others like /tmp can't even think about them.
5935 So, for now on, I shall assume your kernel does not allow them at all.
5942 You can't have filenames longer than 14 chars. You can't even think about them!
5948 $rm -rf /tmp/cf$$ 123456789abcde*
5950 : determine where library module manual pages go
5951 set man3dir man3dir none
5955 $spackage has manual pages for many of the library modules.
5961 However, you don't have nroff, so they're probably useless to you.
5964 '') man3dir="none";;
5968 case "$d_flexfnam" in
5971 However, your system can't handle the long file names like File::Basename.3.
5974 '') man3dir="none";;
5978 echo "If you don't want the manual sources installed, answer 'none'."
5979 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5981 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5982 if $test -d "$privlib/man/man3"; then
5985 WARNING: Previous versions of perl installed man3 pages into
5986 $privlib/man/man3. This version will suggest a
5987 new default of $dflt.
5991 rp='Do you wish to preserve the old behavior?(y/n)'
5994 y*) dflt="$privlib/man/man3" ;;
6000 *) dflt="$man3dir" ;;
6004 rp="Where do the $package library man pages (source) go?"
6007 man3direxp="$ansexp"
6013 : Change installation prefix, if necessary.
6014 if $test X"$prefix" != X"$installprefix"; then
6015 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6017 installman3dir="$man3direxp"
6020 : What suffix to use on installed man pages
6026 rp="What suffix should be used for the $package library man pages?"
6028 '') case "$man3dir" in
6042 *) dflt="$man3ext";;
6049 : see if we have to deal with yellow pages, now NIS.
6050 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6051 if $test -f /usr/etc/nibindd; then
6053 echo "I'm fairly confident you're on a NeXT."
6055 rp='Do you get the hosts file via NetInfo?'
6064 y*) hostcat='nidump hosts .';;
6065 *) case "$hostcat" in
6066 nidump*) hostcat='';;
6076 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6084 rp='Are you getting the hosts file via yellow pages?'
6087 y*) hostcat='ypcat hosts';;
6088 *) hostcat='cat /etc/hosts';;
6094 '') hostcat='cat /etc/hosts';;
6097 '') groupcat='cat /etc/group';;
6100 '') passcat='cat /etc/passwd';;
6103 : now get the host name
6105 echo "Figuring out host name..." >&4
6106 case "$myhostname" in
6108 echo 'Maybe "hostname" will work...'
6109 if tans=`sh -c hostname 2>&1` ; then
6117 if $test "$cont"; then
6119 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6120 if tans=`cat /etc/systemid 2>&1` ; then
6122 phostname='cat /etc/systemid'
6123 echo "Whadyaknow. Xenix always was a bit strange..."
6126 elif $test -r /etc/systemid; then
6127 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6130 if $test "$cont"; then
6131 echo 'No, maybe "uuname -l" will work...'
6132 if tans=`sh -c 'uuname -l' 2>&1` ; then
6134 phostname='uuname -l'
6136 echo 'Strange. Maybe "uname -n" will work...'
6137 if tans=`sh -c 'uname -n' 2>&1` ; then
6139 phostname='uname -n'
6141 echo 'Oh well, maybe I can mine it out of whoami.h...'
6142 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6143 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6144 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6146 case "$myhostname" in
6147 '') echo "Does this machine have an identity crisis or something?"
6150 echo "Well, you said $myhostname before..."
6151 phostname='echo $myhostname';;
6157 : you do not want to know about this
6162 if $test "$myhostname" ; then
6164 rp='Your host name appears to be "'$myhostname'".'" Right?"
6172 : bad guess or no guess
6173 while $test "X$myhostname" = X ; do
6175 rp="Please type the (one word) name of your host:"
6180 : translate upper to lower if necessary
6181 case "$myhostname" in
6183 echo "(Normalizing case in your host name)"
6184 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6188 case "$myhostname" in
6190 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6191 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6192 echo "(Trimming domain name from host name--host name is now $myhostname)"
6194 *) case "$mydomain" in
6197 test "X$hostcat" = "Xypcat hosts" &&
6198 ypmatch "$myhostname" hosts 2>/dev/null |\
6199 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6202 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6203 /[ ]$myhostname[ . ]/p" > hosts
6206 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6207 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6208 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6209 hosts | $sort | $uniq | \
6210 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6211 case `$echo X$dflt` in
6212 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6215 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6220 tans=`./loc resolv.conf X /etc /usr/etc`
6221 if $test -f "$tans"; then
6222 echo "(Attempting domain name extraction from $tans)"
6223 dflt=.`$sed -n -e 's/ / /g' \
6224 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6225 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6227 .) dflt=.`$sed -n -e 's/ / /g' \
6228 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6229 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6236 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6237 dflt=.`sh -c domainname 2>/dev/null`
6240 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6245 .) echo "(Lost all hope -- silly guess then)"
6251 *) dflt="$mydomain";;
6255 rp="What is your domain name?"
6265 : translate upper to lower if necessary
6268 echo "(Normalizing case in your domain name)"
6269 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6273 : a little sanity check here
6274 case "$phostname" in
6277 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6278 $myhostname$mydomain|$myhostname) ;;
6280 case "$phostname" in
6282 echo "(That doesn't agree with your whoami.h file, by the way.)"
6285 echo "(That doesn't agree with your $phostname command, by the way.)"
6295 I need to get your e-mail address in Internet format if possible, i.e.
6296 something like user@host.domain. Please answer accurately since I have
6297 no easy means to double check it. The default value provided below
6298 is most probably close to the reality but may not be valid from outside
6299 your organization...
6303 while test "$cont"; do
6305 '') dflt="$cf_by@$myhostname$mydomain";;
6306 *) dflt="$cf_email";;
6308 rp='What is your e-mail address?'
6314 rp='Address does not look like an Internet one. Use it anyway?'
6330 If you or somebody else will be maintaining perl at your site, please
6331 fill in the correct e-mail address here so that they may be contacted
6332 if necessary. Currently, the "perlbug" program included with perl
6333 will send mail to this address in addition to perlbug@perl.com. You may
6334 enter "none" for no administrator.
6337 case "$perladmin" in
6338 '') dflt="$cf_email";;
6339 *) dflt="$perladmin";;
6341 rp='Perl administrator e-mail address'
6345 : figure out how to guarantee perl startup
6346 case "$startperl" in
6348 case "$sharpbang" in
6352 I can use the #! construct to start perl on your system. This will
6353 make startup of perl scripts faster, but may cause problems if you
6354 want to share those scripts and perl is not in a standard place
6355 ($binexp/perl) on all your platforms. The alternative is to force
6356 a shell by starting the script with a single ':' character.
6360 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6363 none) startperl=": # use perl";;
6364 *) startperl="#!$ans"
6365 if $test 30 -lt `echo "$ans" | wc -c`; then
6368 WARNING: Some systems limit the #! command to 32 characters.
6369 If you experience difficulty running Perl scripts with #!, try
6370 installing Perl in a directory with a shorter pathname.
6376 *) startperl=": # use perl"
6381 echo "I'll use $startperl to start perl scripts."
6383 : figure best path for perl in scripts
6386 perlpath="$binexp/perl"
6387 case "$startperl" in
6392 I will use the "eval 'exec'" idiom to start Perl on your system.
6393 I can use the full path of your Perl binary for this purpose, but
6394 doing so may cause problems if you want to share those scripts and
6395 Perl is not always in a standard place ($binexp/perl).
6399 rp="What path shall I use in \"eval 'exec'\"?"
6406 case "$startperl" in
6408 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6411 : determine where public executable scripts go
6412 set scriptdir scriptdir
6414 case "$scriptdir" in
6417 : guess some guesses
6418 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6419 $test -d /usr/share/bin && dflt=/usr/share/bin
6420 $test -d /usr/local/script && dflt=/usr/local/script
6421 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6422 $test -d $prefixexp/script && dflt=$prefixexp/script
6426 *) dflt="$scriptdir"
6431 Some installations have a separate directory just for executable scripts so
6432 that they can mount it across multiple architectures but keep the scripts in
6433 one spot. You might, for example, have a subdirectory of /usr/share for this.
6434 Or you might just lump your scripts in with all your other executables.
6438 rp='Where do you keep publicly executable scripts?'
6440 if $test "X$ansexp" != "X$scriptdirexp"; then
6444 scriptdirexp="$ansexp"
6445 : Change installation prefix, if necessary.
6446 if $test X"$prefix" != X"$installprefix"; then
6447 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6449 installscript="$scriptdirexp"
6454 After $package is installed, you may wish to install various
6455 add-on modules and utilities. Typically, these add-ons will
6456 be installed under $prefix with the rest
6457 of this package. However, you may wish to install such add-ons
6458 elsewhere under a different prefix.
6460 If you do not wish to put everything under a single prefix, that's
6461 ok. You will be prompted for the individual locations; this siteprefix
6462 is only used to suggest the defaults.
6464 The default should be fine for most people.
6468 rp='Installation prefix to use for add-on modules and utilities?'
6469 : XXX Here might be another good place for an installstyle setting.
6470 case "$siteprefix" in
6472 *) dflt=$siteprefix ;;
6476 case "$siteprefix" in
6481 *) oldsiteprefix="$prefix";;
6486 siteprefixexp="$ansexp"
6488 : determine where site specific libraries go.
6489 : Usual default is /usr/local/lib/perl5/site_perl
6490 : The default "style" setting is made in installstyle.U
6491 : XXX No longer works with Prefixit stuff.
6492 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6493 case "$installstyle" in
6494 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6495 *) dflt=$siteprefix/lib/site_$prog ;;
6499 The installation process will create a directory for
6500 site-specific extensions and modules. Most users find it convenient
6501 to place all site-specific files in this directory rather than in the
6502 main distribution directory.
6506 rp='Pathname for the site-specific library files?'
6509 sitelibexp="$ansexp"
6510 : Change installation prefix, if necessary.
6511 if $test X"$prefix" != X"$installprefix"; then
6512 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6514 installsitelib="$sitelibexp"
6517 : determine where site specific architecture-dependent libraries go.
6518 : sitelib default is /usr/local/lib/perl5/site_perl/
6519 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6520 : sitelib may have an optional trailing /share.
6521 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6522 tdflt="$tdflt/$apiversion/$archname"
6523 set sitearch sitearch none
6526 '') dflt="$tdflt" ;;
6527 *) dflt="$sitearch" ;;
6531 The installation process will also create a directory for
6532 architecture-dependent site-specific extensions and modules.
6536 rp='Pathname for the site-specific architecture-dependent library files?'
6539 sitearchexp="$ansexp"
6540 : Change installation prefix, if necessary.
6541 if $test X"$prefix" != X"$installprefix"; then
6542 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6544 installsitearch="$sitearchexp"
6547 : determine where add-on public executables go
6549 '') dflt=$siteprefix/bin ;;
6553 rp='Pathname where the add-on public executables should be installed?'
6556 sitebinexp="$ansexp"
6557 : Change installation prefix, if necessary.
6558 if $test X"$prefix" != X"$installprefix"; then
6559 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6561 installsitebin="$sitebinexp"
6566 Perl can be built to take advantage of long doubles which
6567 (if available) may give more accuracy and range for floating point
6568 numbers. To do so, Configure must be run with -Duselongdouble.
6570 If this doesn't make any sense to you, just accept the default 'n'.
6572 case "$uselongdouble" in
6573 $define|true|[yY]*) dflt='y';;
6576 rp='Try to use long doubles if available?'
6579 y|Y) val="$define" ;;
6585 case "$uselongdouble" in
6586 "$define"|true|[yY]*)
6587 : Look for a hint-file generated 'call-back-unit'. If the
6588 : user has specified that long doubles should be used,
6589 : we may need to set or change some other defaults.
6590 if $test -f uselongdouble.cbu; then
6591 echo "Your platform has some specific hints for long doubles, using them..."
6592 . ./uselongdouble.cbu
6595 (Your platform doesn't have any specific hints for long doubles.)
6603 Previous version of $package used the standard IO mechanisms as defined
6604 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6605 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6606 the default. This abstraction layer can use AT&T's sfio (if you already
6607 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6608 problems with some extension modules. Using PerlIO with stdio is safe,
6609 but it is slower than plain stdio and therefore is not the default.
6611 If this doesn't make any sense to you, just accept the default 'n'.
6613 case "$useperlio" in
6614 $define|true|[yY]*) dflt='y';;
6617 rp='Use the experimental PerlIO abstraction layer?'
6624 echo "Ok, doing things the stdio way"
6631 case "$vendorprefix" in
6632 '') d_vendorbin="$undef"
6636 *) d_vendorbin="$define"
6637 : determine where vendor-supplied executables go.
6638 dflt=$vendorprefix/bin
6640 rp='Pathname for the vendor-supplied executables directory?'
6643 vendorbinexp="$ansexp"
6644 : Change installation prefix, if necessary.
6645 if $test X"$prefix" != X"$installprefix"; then
6646 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
6648 installvendorbin="$vendorbinexp"
6653 : Check how to convert floats to strings.
6654 if test "X$d_Gconvert" = X; then
6656 echo "Checking for an efficient way to convert floats to strings."
6659 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6660 char *myname = "gconvert";
6663 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6664 char *myname = "gcvt";
6667 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6668 char *myname = "sprintf";
6674 checkit(expect, got)
6678 if (strcmp(expect, got)) {
6679 printf("%s oddity: Expected %s, got %s\n",
6680 myname, expect, got);
6690 /* This must be 1st test on (which?) platform */
6691 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6692 Gconvert(0.1, 8, 0, buf);
6693 checkit("0.1", buf);
6695 Gconvert(1.0, 8, 0, buf);
6698 Gconvert(0.0, 8, 0, buf);
6701 Gconvert(-1.0, 8, 0, buf);
6704 /* Some Linux gcvt's give 1.e+5 here. */
6705 Gconvert(100000.0, 8, 0, buf);
6706 checkit("100000", buf);
6708 /* Some Linux gcvt's give -1.e+5 here. */
6709 Gconvert(-100000.0, 8, 0, buf);
6710 checkit("-100000", buf);
6715 case "$d_Gconvert" in
6716 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6717 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6718 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6719 *) xxx_list='gconvert gcvt sprintf' ;;
6722 for xxx_convert in $xxx_list; do
6723 echo "Trying $xxx_convert"
6725 set try -DTRY_$xxx_convert
6726 if eval $compile; then
6727 echo "$xxx_convert" found. >&4
6729 echo "I'll use $xxx_convert to convert floats into a string." >&4
6732 echo "...But $xxx_convert didn't work as I expected."
6735 echo "$xxx_convert NOT found." >&4
6739 case "$xxx_convert" in
6740 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6741 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6742 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6746 : see if inttypes.h is available
6747 : we want a real compile instead of Inhdr because some systems
6748 : have an inttypes.h which includes non-existent headers
6751 #include <inttypes.h>
6753 static int32_t foo32 = 0x12345678;
6757 if eval $compile; then
6758 echo "<inttypes.h> found." >&4
6761 echo "<inttypes.h> NOT found." >&4
6769 case "$use64bits" in
6772 $echo $n "Checking to see if your system supports int64_t...$c" >&4
6774 #include <sys/types.h>
6775 #$i_inttypes I_INTTYPES
6777 #include <inttypes.h>
6779 int64_t foo() { int64_t x; x = 7; return x; }
6781 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6783 echo " Yup, it does." >&4
6786 echo " Nope, it doesn't." >&4
6797 : check for lengths of integral types
6801 echo "Checking to see how big your integers are..." >&4
6802 $cat >intsize.c <<'EOCP'
6806 printf("intsize=%d;\n", sizeof(int));
6807 printf("longsize=%d;\n", sizeof(long));
6808 printf("shortsize=%d;\n", sizeof(short));
6813 if eval $compile_ok && ./intsize > /dev/null; then
6815 echo "Your integers are $intsize bytes long."
6816 echo "Your long integers are $longsize bytes long."
6817 echo "Your short integers are $shortsize bytes long."
6821 Help! I can't compile and run the intsize test program: please enlighten me!
6822 (This is probably a misconfiguration in your system or libraries, and
6823 you really ought to fix it. Still, I'll try anyway.)
6827 rp="What is the size of an integer (in bytes)?"
6831 rp="What is the size of a long integer (in bytes)?"
6835 rp="What is the size of a short integer (in bytes)?"
6841 $rm -f intsize intsize.*
6843 : check for long long
6845 $echo $n "Checking to see if your system supports long long...$c" >&4
6846 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6847 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6849 echo " Yup, it does." >&4
6852 echo " Nope, it doesn't." >&4
6858 : check for length of long long
6859 case "${d_longlong}${longlongsize}" in
6862 $echo $n "Checking to see how big your long longs are...$c" >&4
6863 $cat >try.c <<'EOCP'
6867 printf("%d\n", sizeof(long long));
6871 if eval $compile_ok; then
6872 longlongsize=`./try`
6873 $echo " $longlongsize bytes." >&4
6877 echo "(I can't seem to compile the test program. Guessing...)"
6878 rp="What is the size of a long long (in bytes)?"
6882 if $test "X$longsize" = "X$longlongsize"; then
6883 echo "(That isn't any different from an ordinary long.)"
6891 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6893 echo "Checking how to print 64-bit integers..." >&4
6895 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6897 $cat >try.c <<'EOCP'
6898 #include <sys/types.h>
6901 int q = 12345678901;
6906 if eval $compile; then
6910 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6911 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6912 echo "We will use %d."
6918 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6920 $cat >try.c <<'EOCP'
6921 #include <sys/types.h>
6924 long q = 12345678901;
6929 if eval $compile; then
6933 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6934 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6935 echo "We will use %ld."
6941 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6943 $cat >try.c <<'EOCP'
6944 #include <sys/types.h>
6945 #include <inttypes.h>
6948 int64_t q = 12345678901;
6949 printf("%" PRId64 "\n", q);
6953 if eval $compile; then
6957 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6958 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6959 echo "We will use the C9X style."
6965 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6967 $cat >try.c <<'EOCP'
6968 #include <sys/types.h>
6971 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6972 printf("%lld\n", q);
6976 if eval $compile; then
6980 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6981 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6982 echo "We will use the %lld style."
6988 if $test X"$sPRId64" = X -a X"$quad" != X; then
6990 #include <sys/types.h>
6993 $quad q = 12345678901;
6998 if eval $compile; then
7002 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
7003 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
7004 echo "We will use %lld."
7010 if $test X"$sPRId64" = X -a X"$quad" != X; then
7012 #include <sys/types.h>
7015 $quad q = 12345678901;
7020 if eval $compile; then
7024 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
7025 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
7026 echo "We will use %qd."
7032 if $test X"$sPRId64" = X; then
7033 echo "Cannot figure out how to print 64-bit integers." >&4
7038 fi # intsize -o longsize -o d_int64t -o d_longlong
7041 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
7042 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
7044 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
7045 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
7049 : check for length of double
7051 case "$doublesize" in
7053 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7054 $cat >try.c <<'EOCP'
7058 printf("%d\n", sizeof(double));
7062 if eval $compile_ok; then
7064 $echo " $doublesize bytes." >&4
7067 echo "(I can't seem to compile the test program. Guessing...)"
7068 rp="What is the size of a double precision number (in bytes)?"
7076 : check for long doubles
7078 $echo $n "Checking to see if your system supports long double...$c" >&4
7079 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7080 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7082 echo " Yup, it does." >&4
7085 echo " Nope, it doesn't." >&4
7091 : check for length of long double
7092 case "${d_longdbl}${longdblsize}" in
7095 $echo $n "Checking to see how big your long doubles are...$c" >&4
7096 $cat >try.c <<'EOCP'
7100 printf("%d\n", sizeof(long double));
7104 if eval $compile; then
7106 $echo " $longdblsize bytes." >&4
7110 echo "(I can't seem to compile the test program. Guessing...)" >&4
7111 rp="What is the size of a long double (in bytes)?"
7115 if $test "X$doublesize" = "X$longdblsize"; then
7116 echo "(That isn't any different from an ordinary double.)"
7124 if $test X"$d_longdbl" = X"$define"; then
7126 echo "Checking how to print long doubles..." >&4
7128 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7129 $cat >try.c <<'EOCP'
7130 #include <sys/types.h>
7134 printf("%.3f\n", d);
7138 if eval $compile; then
7142 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7143 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7144 echo "We will use %f."
7150 if $test X"$sPRIfldbl" = X; then
7151 $cat >try.c <<'EOCP'
7152 #include <sys/types.h>
7155 long double d = 123.456;
7156 printf("%.3llf\n", d);
7160 if eval $compile; then
7164 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7165 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7166 echo "We will use %llf."
7172 if $test X"$sPRIfldbl" = X; then
7173 $cat >try.c <<'EOCP'
7174 #include <sys/types.h>
7177 long double d = 123.456;
7178 printf("%.3Lf\n", d);
7182 if eval $compile; then
7186 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7187 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7188 echo "We will use %Lf."
7194 if $test X"$sPRIfldbl" = X; then
7195 $cat >try.c <<'EOCP'
7196 #include <sys/types.h>
7199 long double d = 123.456;
7200 printf("%.3lf\n", d);
7204 if eval $compile; then
7208 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7209 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7210 echo "We will use %lf."
7216 if $test X"$sPRIfldbl" = X; then
7217 echo "Cannot figure out how to print long doubles." >&4
7224 case "$sPRIfldbl" in
7225 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7226 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7228 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7229 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7233 : Initialize h_fcntl
7236 : Initialize h_sysfile
7239 : access call always available on UNIX
7243 : locate the flags for 'access()'
7247 $cat >access.c <<'EOCP'
7248 #include <sys/types.h>
7253 #include <sys/file.h>
7262 : check sys/file.h first, no particular reason here
7263 if $test `./findhdr sys/file.h` && \
7264 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7266 echo "<sys/file.h> defines the *_OK access constants." >&4
7267 elif $test `./findhdr fcntl.h` && \
7268 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7270 echo "<fcntl.h> defines the *_OK access constants." >&4
7271 elif $test `./findhdr unistd.h` && \
7272 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7273 echo "<unistd.h> defines the *_OK access constants." >&4
7275 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7281 : see if accessx exists
7282 set accessx d_accessx
7285 : see if alarm exists
7289 : see if atolf exists
7293 : see if atoll exists
7297 : Look for GNU-cc style attribute checking
7299 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7300 $cat >attrib.c <<'EOCP'
7302 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7304 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7305 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7306 echo "Your C compiler doesn't fully support __attribute__."
7309 echo "Your C compiler supports __attribute__."
7313 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7320 : see if bcmp exists
7324 : see if bcopy exists
7328 : see if this is a unistd.h system
7329 set unistd.h i_unistd
7332 : see if getpgrp exists
7333 set getpgrp d_getpgrp
7336 case "$d_getpgrp" in
7339 echo "Checking to see which flavor of getpgrp is in use..."
7342 #include <sys/types.h>
7344 # include <unistd.h>
7348 if (getuid() == 0) {
7349 printf("(I see you are running Configure as super-user...)\n");
7353 if (getpgrp(1) == 0)
7362 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7363 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7365 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7366 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7369 echo "I can't seem to compile and run the test program."
7371 xxx="a USG one, i.e. you use getpgrp()."
7373 # SVR4 systems can appear rather BSD-ish.
7376 xxx="a BSD one, i.e. you use getpgrp(pid)."
7380 xxx="probably a USG one, i.e. you use getpgrp()."
7385 echo "Assuming your getpgrp is $xxx" >&4
7394 : see if setpgrp exists
7395 set setpgrp d_setpgrp
7398 case "$d_setpgrp" in
7401 echo "Checking to see which flavor of setpgrp is in use..."
7404 #include <sys/types.h>
7406 # include <unistd.h>
7410 if (getuid() == 0) {
7411 printf("(I see you are running Configure as super-user...)\n");
7415 if (-1 == setpgrp(1, 1))
7418 if (setpgrp() != -1)
7424 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7425 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7427 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7428 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7431 echo "(I can't seem to compile and run the test program.)"
7433 xxx="a USG one, i.e. you use setpgrp()."
7435 # SVR4 systems can appear rather BSD-ish.
7438 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7442 xxx="probably a USG one, i.e. you use setpgrp()."
7447 echo "Assuming your setpgrp is $xxx" >&4
7455 : see if bzero exists
7459 : see if signal is declared as pointer to function returning int or void
7461 xxx=`./findhdr signal.h`
7462 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7463 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7464 echo "You have int (*signal())() instead of void." >&4
7466 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7467 echo "You have void (*signal())()." >&4
7469 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7470 echo "You have int (*signal())() instead of void." >&4
7472 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7473 echo "You have void (*signal())()." >&4
7476 case "$d_voidsig" in
7478 echo "I can't determine whether signal handler returns void or int..." >&4
7480 rp="What type does your signal handler return?"
7487 echo "As you already told me, signal handler returns void." >&4
7490 *) echo "As you already told me, signal handler returns int." >&4
7497 case "$d_voidsig" in
7498 "$define") signal_t="void";;
7503 : check for ability to cast large floats to 32-bit ints.
7505 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7506 if $test "$intsize" -ge 4; then
7513 #include <sys/types.h>
7515 $signal_t blech(s) int s; { exit(3); }
7522 signal(SIGFPE, blech);
7524 /* Don't let compiler optimize the test away. Store the number
7525 in a writable string for gcc to pass to sscanf under HP/UX.
7527 sprintf(str, "2147483647");
7528 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7532 /* x86 processors will probably give 0x8000 0000, which is a
7533 sign change. We don't want that. We want to mimic SPARC
7534 behavior here, which is to preserve the sign and give
7537 if (i32 != ($xxx) f)
7543 if eval $compile_ok; then
7547 echo "(I can't seem to compile the test program--assuming it can't)"
7555 echo "Nope, it can't."
7562 : check for ability to cast negative floats to unsigned
7564 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7567 #include <sys/types.h>
7569 $signal_t blech(s) int s; { exit(7); }
7570 $signal_t blech_in_list(s) int s; { exit(4); }
7571 unsigned long dummy_long(p) unsigned long p; { return p; }
7572 unsigned int dummy_int(p) unsigned int p; { return p; }
7573 unsigned short dummy_short(p) unsigned short p; { return p; }
7577 unsigned long along;
7579 unsigned short ashort;
7583 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7584 a direct f = -123. assignment. gcc-2.8.0 reportedly
7585 optimized the whole file away
7587 /* Store the number in a writable string for gcc to pass to
7590 sprintf(str, "-123");
7591 sscanf(str, "%lf", &f); /* f = -123.; */
7593 signal(SIGFPE, blech);
7594 along = (unsigned long)f;
7595 aint = (unsigned int)f;
7596 ashort = (unsigned short)f;
7597 if (along != (unsigned long)-123)
7599 if (aint != (unsigned int)-123)
7601 if (ashort != (unsigned short)-123)
7603 sprintf(str, "1073741824.");
7604 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7607 along = (unsigned long)f;
7608 if (along != 0x80000000)
7612 along = (unsigned long)f;
7613 if (along != 0x7fffffff)
7617 along = (unsigned long)f;
7618 if (along != 0x80000001)
7622 signal(SIGFPE, blech_in_list);
7623 sprintf(str, "123.");
7624 sscanf(str, "%lf", &f); /* f = 123.; */
7625 along = dummy_long((unsigned long)f);
7626 aint = dummy_int((unsigned int)f);
7627 ashort = dummy_short((unsigned short)f);
7628 if (along != (unsigned long)123)
7630 if (aint != (unsigned int)123)
7632 if (ashort != (unsigned short)123)
7639 if eval $compile_ok; then
7643 echo "(I can't seem to compile the test program--assuming it can't)"
7646 case "$castflags" in
7651 echo "Nope, it can't."
7658 : see if vprintf exists
7660 if set vprintf val -f d_vprintf; eval $csym; $val; then
7661 echo 'vprintf() found.' >&4
7663 $cat >vprintf.c <<'EOF'
7664 #include <varargs.h>
7666 int main() { xxx("foo"); }
7675 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7679 if eval $compile && ./vprintf; then
7680 echo "Your vsprintf() returns (int)." >&4
7683 echo "Your vsprintf() returns (char*)." >&4
7687 echo 'vprintf() NOT found.' >&4
7697 : see if chown exists
7701 : see if chroot exists
7705 : see if chsize exists
7709 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7710 while $test $# -ge 2; do
7712 $define) echo "#include <$2>";;
7716 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
7717 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7726 : see if this is a sys/uio.h system
7727 set sys/uio.h i_sysuio
7730 echo "Checking to see if your system supports struct iovec..." >&4
7731 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7733 case "$d_iovec_s" in
7734 "$define") echo "Yup, it does." >&4
7736 *) echo "Nope, it doesn't." >&4
7742 : see whether socket exists
7744 $echo $n "Hmm... $c" >&4
7745 if set socket val -f d_socket; eval $csym; $val; then
7746 echo "Looks like you have Berkeley networking support." >&4
7748 if set setsockopt val -f; eval $csym; $val; then
7751 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7755 if $contains socklib libc.list >/dev/null 2>&1; then
7756 echo "Looks like you have Berkeley networking support." >&4
7758 : we will have to assume that it supports the 4.2 BSD interface
7761 echo "You don't have Berkeley networking in libc$_a..." >&4
7762 if test "X$d_socket" = "X$define"; then
7763 echo "...but you seem to believe that you have sockets." >&4
7765 for net in net socket
7767 if test -f /usr/lib/lib$net$_a; then
7768 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7769 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7770 if $contains socket libc.list >/dev/null 2>&1; then
7775 echo "...but the Wollongong group seems to have hacked it in." >&4
7776 sockethdr="-I/usr/netinclude"
7779 echo "Found Berkeley sockets interface in lib$net." >& 4
7780 if $contains setsockopt libc.list >/dev/null 2>&1; then
7783 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7790 if test "X$d_socket" != "X$define"; then
7791 echo "or anywhere else I see." >&4
7799 : see if socketpair exists
7800 set socketpair d_sockpair
7805 echo "Checking the availability of certain socket constants..." >& 4
7806 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7807 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7809 #include <sys/types.h>
7810 #include <sys/socket.h>
7816 set try; if eval $compile; then
7819 set d_${enum}; eval $setvar
7823 set sendmsg d_sendmsg
7826 set recvmsg d_recvmsg
7830 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7831 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7833 case "$d_msghdr_s" in
7834 "$define") echo "Yup, it does." >&4
7836 *) echo "Nope, it doesn't." >&4
7840 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7841 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7843 case "$d_cmsghdr_s" in
7844 "$define") echo "Yup, it does." >&4
7846 *) echo "Nope, it doesn't." >&4
7850 : check for const keyword
7852 echo 'Checking to see if your C compiler knows about "const"...' >&4
7853 $cat >const.c <<'EOCP'
7854 typedef struct spug { int drokk; } spug;
7861 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7863 echo "Yup, it does."
7866 echo "Nope, it doesn't."
7871 : see if crypt exists
7873 if set crypt val -f d_crypt; eval $csym; $val; then
7874 echo 'crypt() found.' >&4
7878 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7879 if $test -z "$cryptlib"; then
7880 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7884 if $test -z "$cryptlib"; then
7885 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7889 if $test -z "$cryptlib"; then
7890 cryptlib=`./loc libcrypt$_a "" $libpth`
7894 if $test -z "$cryptlib"; then
7895 echo 'crypt() NOT found.' >&4
7904 : get csh whereabouts
7906 'csh') val="$undef" ;;
7911 : Respect a hint or command line value for full_csh.
7913 '') full_csh=$csh ;;
7916 : see if cuserid exists
7917 set cuserid d_cuserid
7920 : see if this is a limits.h system
7921 set limits.h i_limits
7924 : see if this is a float.h system
7928 : See if number of significant digits in a double precision number is known
7930 $cat >dbl_dig.c <<EOM
7940 printf("Contains DBL_DIG");
7943 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7944 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7945 echo "DBL_DIG found." >&4
7948 echo "DBL_DIG NOT found." >&4
7955 : see if difftime exists
7956 set difftime d_difftime
7959 : see if this is a dirent system
7961 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7963 echo "<dirent.h> found." >&4
7966 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7967 echo "<sys/dir.h> found." >&4
7970 xinc=`./findhdr sys/ndir.h`
7972 echo "<dirent.h> NOT found." >&4
7977 : Look for type of directory structure.
7979 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7981 case "$direntrytype" in
7984 $define) guess1='struct dirent' ;;
7985 *) guess1='struct direct' ;;
7988 *) guess1="$direntrytype"
7993 'struct dirent') guess2='struct direct' ;;
7994 *) guess2='struct dirent' ;;
7997 if $contains "$guess1" try.c >/dev/null 2>&1; then
7998 direntrytype="$guess1"
7999 echo "Your directory entries are $direntrytype." >&4
8000 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8001 direntrytype="$guess2"
8002 echo "Your directory entries seem to be $direntrytype." >&4
8004 echo "I don't recognize your system's directory entries." >&4
8005 rp="What type is used for directory entries on this system?"
8013 : see if the directory entry stores field length
8015 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8016 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8017 echo "Good, your directory entry keeps length information in d_namlen." >&4
8020 echo "Your directory entry does not know about the d_namlen field." >&4
8027 : see if dlerror exists
8030 set dlerror d_dlerror
8034 : see if dlfcn is available
8042 On a few systems, the dynamically loaded modules that perl generates and uses
8043 will need a different extension than shared libs. The default will probably
8051 rp='What is the extension of dynamically loaded modules'
8060 : Check if dlsym need a leading underscore
8066 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8067 $cat >dyna.c <<'EOM'
8076 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8078 #include <sys/types.h>
8092 int mode = RTLD_LAZY ;
8094 handle = dlopen("./dyna.$dlext", mode) ;
8095 if (handle == NULL) {
8100 symbol = dlsym(handle, "fred") ;
8101 if (symbol == NULL) {
8102 /* try putting a leading underscore */
8103 symbol = dlsym(handle, "_fred") ;
8104 if (symbol == NULL) {
8117 : Call the object file tmp-dyna.o in case dlext=o.
8118 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8119 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8120 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8121 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8124 1) echo "Test program failed using dlopen." >&4
8125 echo "Perhaps you should not use dynamic loading." >&4;;
8126 2) echo "Test program failed using dlsym." >&4
8127 echo "Perhaps you should not use dynamic loading." >&4;;
8128 3) echo "dlsym needs a leading underscore" >&4
8130 4) echo "dlsym doesn't need a leading underscore." >&4;;
8133 echo "I can't compile and run the test program." >&4
8134 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8139 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8144 hasproto='varname=$1; func=$2; shift; shift;
8145 while $test $# -ge 2; do
8147 $define) echo "#include <$2>";;
8151 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8152 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8153 echo "$func() prototype found.";
8156 echo "$func() prototype NOT found.";
8161 $rm -f try.c tryout.c'
8163 : see if prototype for drand48 is available
8165 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8168 : see if dup2 exists
8172 : see if eaccess exists
8173 set eaccess d_eaccess
8176 : see if endgrent exists
8177 set endgrent d_endgrent
8180 : see if endhostent exists
8181 set endhostent d_endhent
8184 : see if endnetent exists
8185 set endnetent d_endnent
8188 : see if endprotoent exists
8189 set endprotoent d_endpent
8192 : see if endpwent exists
8193 set endpwent d_endpwent
8196 : see if endservent exists
8197 set endservent d_endsent
8200 : see if endspent exists
8201 set endspent d_endspent
8204 : Locate the flags for 'open()'
8206 $cat >open3.c <<'EOCP'
8207 #include <sys/types.h>
8212 #include <sys/file.h>
8223 : check sys/file.h first to get FREAD on Sun
8224 if $test `./findhdr sys/file.h` && \
8225 set open3 -DI_SYS_FILE && eval $compile; then
8227 echo "<sys/file.h> defines the O_* constants..." >&4
8229 echo "and you have the 3 argument form of open()." >&4
8232 echo "but not the 3 argument form of open(). Oh, well." >&4
8235 elif $test `./findhdr fcntl.h` && \
8236 set open3 -DI_FCNTL && eval $compile; then
8238 echo "<fcntl.h> defines the O_* constants..." >&4
8240 echo "and you have the 3 argument form of open()." >&4
8243 echo "but not the 3 argument form of open(). Oh, well." >&4
8248 echo "I can't find the O_* constant definitions! You got problems." >&4
8254 : check for non-blocking I/O stuff
8255 case "$h_sysfile" in
8256 true) echo "#include <sys/file.h>" > head.c;;
8259 true) echo "#include <fcntl.h>" > head.c;;
8260 *) echo "#include <sys/fcntl.h>" > head.c;;
8265 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8266 case "$o_nonblock" in
8269 $cat >>try.c <<'EOCP'
8272 printf("O_NONBLOCK\n");
8276 printf("O_NDELAY\n");
8280 printf("FNDELAY\n");
8287 if eval $compile_ok; then
8289 case "$o_nonblock" in
8290 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8291 *) echo "Seems like we can use $o_nonblock.";;
8294 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8297 *) echo "Using $hint value $o_nonblock.";;
8299 $rm -f try try.* .out core
8302 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8308 #include <sys/types.h>
8310 #define MY_O_NONBLOCK $o_nonblock
8311 #ifndef errno /* XXX need better Configure test */
8314 $signal_t blech(x) int x; { exit(3); }
8316 $cat >> try.c <<'EOCP'
8324 pipe(pd); /* Down: child -> parent */
8325 pipe(pu); /* Up: parent -> child */
8328 close(pd[1]); /* Parent reads from pd[0] */
8329 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8330 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8332 signal(SIGALRM, blech);
8334 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8336 sprintf(string, "%d\n", ret);
8337 write(2, string, strlen(string));
8340 if (errno == EAGAIN) {
8346 if (errno == EWOULDBLOCK)
8347 printf("EWOULDBLOCK\n");
8350 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8351 sleep(2); /* Give it time to close our pipe */
8353 ret = read(pd[0], buf, 1); /* Should read EOF */
8355 sprintf(string, "%d\n", ret);
8356 write(3, string, strlen(string));
8360 close(pd[0]); /* We write to pd[1] */
8361 close(pu[1]); /* We read from pu[0] */
8362 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8363 close(pd[1]); /* Pipe pd is now fully closed! */
8364 exit(0); /* Bye bye, thank you for playing! */
8368 if eval $compile_ok; then
8369 echo "$startsh" >mtry
8370 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8372 ./mtry >/dev/null 2>&1
8374 0) eagain=`$cat try.out`;;
8375 1) echo "Could not perform non-blocking setting!";;
8376 2) echo "I did a successful read() for something that was not there!";;
8377 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8378 *) echo "Something terribly wrong happened during testing.";;
8380 rd_nodata=`$cat try.ret`
8381 echo "A read() system call with no data present returns $rd_nodata."
8382 case "$rd_nodata" in
8385 echo "(That's peculiar, fixing that to be -1.)"
8391 echo "Forcing errno EAGAIN on read() with no data available."
8395 echo "Your read() sets errno to $eagain when no data is available."
8398 status=`$cat try.err`
8400 0) echo "And it correctly returns 0 to signal EOF.";;
8401 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8402 *) echo "However, your read() returns '$status' on EOF??";;
8405 if test "$status" = "$rd_nodata"; then
8406 echo "WARNING: you can't distinguish between EOF and no data!"
8410 echo "I can't compile the test program--assuming errno EAGAIN will do."
8417 echo "Using $hint value $eagain."
8418 echo "Your read() returns $rd_nodata when no data is present."
8419 case "$d_eofnblk" in
8420 "$define") echo "And you can see EOF because read() returns 0.";;
8421 "$undef") echo "But you can't see EOF status from read() returned value.";;
8423 echo "(Assuming you can't see EOF status from read anyway.)"
8429 $rm -f try try.* .out core head.c mtry
8431 : see if fchmod exists
8435 : see if fchown exists
8439 : see if this is an fcntl system
8443 : see if sys/select.h has to be included
8444 set sys/select.h i_sysselct
8447 : see if we should include time.h, sys/time.h, or both
8449 if test "X$timeincl" = X; then
8450 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8451 $echo $n "I'm now running the test program...$c"
8452 $cat >try.c <<'EOCP'
8453 #include <sys/types.h>
8458 #ifdef SYSTIMEKERNEL
8461 #include <sys/time.h>
8464 #include <sys/select.h>
8473 struct timezone tzp;
8475 if (foo.tm_sec == foo.tm_sec)
8478 if (bar.tv_sec == bar.tv_sec)
8485 for s_timezone in '-DS_TIMEZONE' ''; do
8487 for s_timeval in '-DS_TIMEVAL' ''; do
8488 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8489 for i_time in '' '-DI_TIME'; do
8490 for i_systime in '-DI_SYSTIME' ''; do
8493 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8494 if eval $compile; then
8495 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8499 $echo $n "Succeeded with $flags$c"
8511 *SYSTIMEKERNEL*) i_systimek="$define"
8512 timeincl=`./findhdr sys/time.h`
8513 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8514 *) i_systimek="$undef";;
8517 *I_TIME*) i_time="$define"
8518 timeincl=`./findhdr time.h`" $timeincl"
8519 echo "We'll include <time.h>." >&4;;
8520 *) i_time="$undef";;
8523 *I_SYSTIME*) i_systime="$define"
8524 timeincl=`./findhdr sys/time.h`" $timeincl"
8525 echo "We'll include <sys/time.h>." >&4;;
8526 *) i_systime="$undef";;
8531 : check for fd_set items
8534 Checking to see how well your C compiler handles fd_set and friends ...
8536 $cat >fd_set.c <<EOCP
8537 #$i_systime I_SYS_TIME
8538 #$i_sysselct I_SYS_SELECT
8539 #$d_socket HAS_SOCKET
8540 #include <sys/types.h>
8542 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8545 #include <sys/time.h>
8548 #include <sys/select.h>
8557 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8564 set fd_set -DTRYBITS
8565 if eval $compile; then
8566 d_fds_bits="$define"
8568 echo "Well, your system knows about the normal fd_set typedef..." >&4
8570 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8571 d_fd_macros="$define"
8574 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8576 d_fd_macros="$undef"
8580 Hmm, your compiler has some difficulty with fd_set. Checking further...
8583 if eval $compile; then
8586 echo "Well, your system has some sort of fd_set available..." >&4
8588 echo "and you have the normal fd_set macros." >&4
8589 d_fd_macros="$define"
8592 but not the normal fd_set macros! Gross! More work for me...
8594 d_fd_macros="$undef"
8597 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8600 d_fd_macros="$undef"
8605 : see if fgetpos exists
8606 set fgetpos d_fgetpos
8609 : see if flock exists
8613 : see if fork exists
8617 : see if pathconf exists
8618 set pathconf d_pathconf
8621 : see if fpathconf exists
8622 set fpathconf d_fpathconf
8626 : see if llseek exists
8632 $echo $n "Checking to see if your system supports off64_t...$c" >&4
8634 #include <sys/types.h>
8636 off64_t foo() { off64_t x; x = 7; return x; }'
8638 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8640 echo " Yup, it does." >&4
8643 echo " Nope, it doesn't." >&4
8649 : check for fpos64_t
8651 $echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8653 #include <sys/stdio.h>
8654 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8656 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8658 echo " Yup, it does." >&4
8661 echo " Nope, it doesn't." >&4
8667 : see if fseeko exists
8671 : see if fsetpos exists
8672 set fsetpos d_fsetpos
8675 : see if this is a sys/param system
8676 set sys/param.h i_sysparam
8679 : see if this is a sys/mount.h system
8680 set sys/mount.h i_sysmount
8684 : see if statfs exists
8688 : see if fstatfs exists
8689 set fstatfs d_fstatfs
8692 : see if statfs knows about mount flags
8694 define) set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8704 : see if statvfs exists
8705 set statvfs d_statvfs
8708 : see if fstatvfs exists
8709 set fstatvfs d_fstatvfs
8713 : see if ftello exists
8717 : see if getgrent exists
8718 set getgrent d_getgrent
8721 : see if gethostbyaddr exists
8722 set gethostbyaddr d_gethbyaddr
8725 : see if gethostbyname exists
8726 set gethostbyname d_gethbyname
8729 : see if gethostent exists
8730 set gethostent d_gethent
8733 : see how we will look up host name
8736 if set gethostname val -f d_gethname; eval $csym; $val; then
8737 echo 'gethostname() found.' >&4
8738 d_gethname="$define"
8741 if set uname val -f d_uname; eval $csym; $val; then
8744 uname() was found, but you're running xenix, and older versions of xenix
8745 have a broken uname(). If you don't really know whether your xenix is old
8746 enough to have a broken system call, use the default answer.
8753 rp='Is your uname() broken?'
8756 n*) d_uname="$define"; call=uname;;
8759 echo 'uname() found.' >&4
8766 case "$d_gethname" in
8767 '') d_gethname="$undef";;
8770 '') d_uname="$undef";;
8772 case "$d_uname$d_gethname" in
8777 Every now and then someone has a $call() that lies about the hostname
8778 but can't be fixed for political or economic reasons. If you wish, I can
8779 pretend $call() isn't there and maybe compute hostname at run-time
8780 thanks to the '$phostname' command.
8783 rp="Shall I ignore $call() from now on?"
8786 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8789 case "$phostname" in
8791 *) case "$aphostname" in
8797 file=`./loc $file $file $pth`
8798 aphostname=`echo $file $*`
8803 case "$d_uname$d_gethname" in
8806 case "$phostname" in
8808 echo "There will be no way for $package to get your hostname." >&4;;
8810 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8814 case "$d_phostname" in
8815 '') d_phostname="$undef";;
8818 : see if this is a netdb.h system
8822 : see if prototypes for various gethostxxx netdb.h functions are available
8824 set d_gethostprotos gethostent $i_netdb netdb.h
8827 : see if getlogin exists
8828 set getlogin d_getlogin
8831 : see if getmntent exists
8832 set getmntent d_getmntent
8835 : see if getnetbyaddr exists
8836 set getnetbyaddr d_getnbyaddr
8839 : see if getnetbyname exists
8840 set getnetbyname d_getnbyname
8843 : see if getnetent exists
8844 set getnetent d_getnent
8847 : see if prototypes for various getnetxxx netdb.h functions are available
8849 set d_getnetprotos getnetent $i_netdb netdb.h
8853 : see if getprotobyname exists
8854 set getprotobyname d_getpbyname
8857 : see if getprotobynumber exists
8858 set getprotobynumber d_getpbynumber
8861 : see if getprotoent exists
8862 set getprotoent d_getpent
8865 : see if getpgid exists
8866 set getpgid d_getpgid
8869 : see if getpgrp2 exists
8870 set getpgrp2 d_getpgrp2
8873 : see if getppid exists
8874 set getppid d_getppid
8877 : see if getpriority exists
8878 set getpriority d_getprior
8881 : see if prototypes for various getprotoxxx netdb.h functions are available
8883 set d_getprotoprotos getprotoent $i_netdb netdb.h
8886 : see if getpwent exists
8887 set getpwent d_getpwent
8891 : see if getservbyname exists
8892 set getservbyname d_getsbyname
8895 : see if getservbyport exists
8896 set getservbyport d_getsbyport
8899 : see if getservent exists
8900 set getservent d_getsent
8903 : see if prototypes for various getservxxx netdb.h functions are available
8905 set d_getservprotos getservent $i_netdb netdb.h
8908 : see if getspent exists
8909 set getspent d_getspent
8912 : see if getspnam exists
8913 set getspnam d_getspnam
8916 : see if gettimeofday or ftime exists
8917 set gettimeofday d_gettimeod
8919 case "$d_gettimeod" in
8925 val="$undef"; set d_ftime; eval $setvar
8928 case "$d_gettimeod$d_ftime" in
8931 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8935 : see if this is an grp system
8941 xxx=`./findhdr grp.h`
8942 $cppstdin $cppflags $cppminus < $xxx >$$.h
8944 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8956 set d_grpasswd; eval $setvar
8960 : see if hasmntopt exists
8961 set hasmntopt d_hasmntopt
8964 : see if this is a netinet/in.h or sys/in.h system
8965 set netinet/in.h i_niin sys/in.h i_sysin
8968 : see if arpa/inet.h has to be included
8969 set arpa/inet.h i_arpainet
8972 : see if htonl --and friends-- exists
8977 : Maybe they are macros.
8982 #include <sys/types.h>
8983 #$i_niin I_NETINET_IN
8985 #$i_arpainet I_ARPA_INET
8987 #include <netinet/in.h>
8993 #include <arpa/inet.h>
8996 printf("Defined as a macro.");
8999 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9000 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9002 echo "But it seems to be defined as a macro." >&4
9010 : see which of string.h or strings.h is needed
9012 strings=`./findhdr string.h`
9013 if $test "$strings" && $test -r "$strings"; then
9014 echo "Using <string.h> instead of <strings.h>." >&4
9018 strings=`./findhdr strings.h`
9019 if $test "$strings" && $test -r "$strings"; then
9020 echo "Using <strings.h> instead of <string.h>." >&4
9022 echo "No string header found -- You'll surely have problems." >&4
9028 "$undef") strings=`./findhdr strings.h`;;
9029 *) strings=`./findhdr string.h`;;
9034 if set index val -f; eval $csym; $val; then
9035 if set strchr val -f d_strchr; eval $csym; $val; then
9036 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9039 echo "strchr() found." >&4
9043 echo "index() found." >&4
9048 echo "index() found." >&4
9051 if set strchr val -f d_strchr; eval $csym; $val; then
9054 echo "strchr() found." >&4
9056 echo "No index() or strchr() found!" >&4
9061 set d_strchr; eval $setvar
9063 set d_index; eval $setvar
9065 : check whether inet_aton exists
9066 set inet_aton d_inetaton
9071 $cat >isascii.c <<'EOCP'
9083 if eval $compile; then
9084 echo "isascii() found." >&4
9087 echo "isascii() NOT found." >&4
9094 : see if killpg exists
9098 : see if lchown exists
9100 $cat > try.c <<'EOCP'
9101 /* System header to define __stub macros and hopefully few prototypes,
9102 which can conflict with char lchown(); below. */
9104 /* Override any gcc2 internal prototype to avoid an error. */
9105 /* We use char because int might match the return type of a gcc2
9106 builtin and then its argument prototype would still apply. */
9109 /* The GNU C library defines this for functions which it implements
9110 to always fail with ENOSYS. Some functions are actually named
9111 something starting with __ and the normal name is an alias. */
9112 #if defined (__stub_lchown) || defined (__stub___lchown)
9120 if eval $compile; then
9121 $echo "lchown() found." >&4
9124 $echo "lchown() NOT found." >&4
9130 : See if number of significant digits in a double precision number is known
9132 $cat >ldbl_dig.c <<EOM
9142 printf("Contains LDBL_DIG");
9145 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9146 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9147 echo "LDBL_DIG found." >&4
9150 echo "LDBL_DIG NOT found." >&4
9157 : see if link exists
9161 : see if localeconv exists
9162 set localeconv d_locconv
9165 : see if lockf exists
9169 : see if lstat exists
9173 : see if madvise exists
9174 set madvise d_madvise
9177 : see if mblen exists
9181 : see if mbstowcs exists
9182 set mbstowcs d_mbstowcs
9185 : see if mbtowc exists
9189 : see if memchr exists
9193 : see if memcmp exists
9197 : see if memcpy exists
9201 : see if memmove exists
9202 set memmove d_memmove
9205 : see if memset exists
9209 : see if mkdir exists
9213 : see if mkfifo exists
9217 : see if mktime exists
9221 : see if this is a sys/mman.h system
9222 set sys/mman.h i_sysmman
9225 : see if mmap exists
9228 : see what shmat returns
9229 : default to something harmless
9231 case "$i_sysmman$d_mmap" in
9233 $cat >mmap.c <<'END'
9234 #include <sys/mman.h>
9237 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9242 echo "and it returns ($mmaptype)." >&4
9248 : see if mprotect exists
9249 set mprotect d_mprotect
9252 : see if msgctl exists
9256 : see if msgget exists
9260 : see if msgsnd exists
9264 : see if msgrcv exists
9268 : see how much of the 'msg*(2)' library is present.
9271 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9272 *"$undef"*) h_msg=false;;
9276 case "`ipcs 2>&1`" in
9277 "SVID messages"*"not configured"*)
9278 echo "Your $osname does not have the msg*(2) configured." >&4
9293 : we could also check for sys/ipc.h ...
9294 if $h_msg && $test `./findhdr sys/msg.h`; then
9295 echo "You have the full msg*(2) library." >&4
9298 echo "You don't have the full msg*(2) library." >&4
9304 : see if msync exists
9308 : see if munmap exists
9312 : see if nice exists
9316 : see if POSIX threads are available
9317 set pthread.h i_pthread
9323 : how to create joinable pthreads
9324 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9326 echo "Checking what constant to use for creating joinable pthreads..." >&4
9327 $cat >try.c <<'EOCP'
9328 #include <pthread.h>
9330 int detachstate = JOINABLE;
9333 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9334 if eval $compile; then
9335 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9336 val="$undef" # Yes, undef.
9337 set d_old_pthread_create_joinable
9340 set old_pthread_create_joinable
9343 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9344 if eval $compile; then
9345 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9347 set d_old_pthread_create_joinable
9349 val=PTHREAD_CREATE_UNDETACHED
9350 set old_pthread_create_joinable
9353 set try -DJOINABLE=__UNDETACHED
9354 if eval $compile; then
9355 echo "You seem to use __UNDETACHED." >&4
9357 set d_old_pthread_create_joinable
9360 set old_pthread_create_joinable
9363 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9365 set d_old_pthread_create_joinable
9368 set old_pthread_create_joinable
9375 d_old_pthread_create_joinable="$undef"
9376 old_pthread_create_joinable=""
9379 : see if pause exists
9383 : see if pipe exists
9387 : see if poll exists
9392 : see whether the various POSIXish _yields exist
9394 #include <pthread.h>
9400 #ifdef PTHREAD_YIELD
9403 #ifdef PTHREAD_YIELD_NULL
9404 pthread_yield(NULL);
9410 : see if sched_yield exists
9411 set try -DSCHED_YIELD
9412 if eval $compile; then
9414 sched_yield='sched_yield()'
9418 case "$usethreads" in
9421 $define) echo 'sched_yield() found.' >&4 ;;
9422 *) echo 'sched_yield() NOT found.' >&4 ;;
9428 : see if pthread_yield exists
9429 set try -DPTHREAD_YIELD
9430 if eval $compile; then
9432 case "$sched_yield" in
9433 '') sched_yield='pthread_yield()' ;;
9436 set try -DPTHREAD_YIELD_NULL
9437 if eval $compile; then
9439 case "$sched_yield" in
9440 '') sched_yield='pthread_yield(NULL)' ;;
9446 case "$usethreads" in
9449 $define) echo 'pthread_yield() found.' >&4 ;;
9450 *) echo 'pthread_yield() NOT found.' >&4 ;;
9457 case "$sched_yield" in
9458 '') sched_yield=undef ;;
9463 : see if this is a pwd.h system
9469 xxx=`./findhdr pwd.h`
9470 $cppstdin $cppflags $cppminus < $xxx >$$.h
9472 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9480 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9488 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9496 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9504 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9512 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9520 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9528 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9540 set d_pwquota; eval $setvar
9541 set d_pwage; eval $setvar
9542 set d_pwchange; eval $setvar
9543 set d_pwclass; eval $setvar
9544 set d_pwexpire; eval $setvar
9545 set d_pwcomment; eval $setvar
9546 set d_pwgecos; eval $setvar
9547 set d_pwpasswd; eval $setvar
9551 : see if readdir and friends exist
9552 set readdir d_readdir
9554 set seekdir d_seekdir
9556 set telldir d_telldir
9558 set rewinddir d_rewinddir
9561 : see if readlink exists
9562 set readlink d_readlink
9565 : see if readv exists
9569 : see if rename exists
9573 : see if rmdir exists
9577 : see if memory.h is available.
9582 : See if it conflicts with string.h
9588 $cppstdin $cppflags $cppminus < $strings > mem.h
9589 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9591 echo "We won't be including <memory.h>."
9601 : can bcopy handle overlapping blocks?
9606 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9613 $cat >>try.c <<'EOCP'
9616 # include <memory.h>
9619 # include <stdlib.h>
9622 # include <string.h>
9624 # include <strings.h>
9627 # include <unistd.h> /* Needed for NetBSD */
9631 char buf[128], abc[128];
9637 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9639 for (align = 7; align >= 0; align--) {
9640 for (len = 36; len; len--) {
9643 for (off = 1; off <= len; off++) {
9644 bcopy(b, b+off, len);
9645 bcopy(b+off, b, len);
9646 if (bcmp(b, abc, len))
9655 if eval $compile_ok; then
9656 if ./try 2>/dev/null; then
9660 echo "It can't, sorry."
9661 case "$d_memmove" in
9662 "$define") echo "But that's Ok since you have memmove()." ;;
9666 echo "(I can't compile the test program, so we'll assume not...)"
9667 case "$d_memmove" in
9668 "$define") echo "But that's Ok since you have memmove()." ;;
9673 $rm -f try.* try core
9677 : can memcpy handle overlapping blocks?
9682 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9689 $cat >>try.c <<'EOCP'
9692 # include <memory.h>
9695 # include <stdlib.h>
9698 # include <string.h>
9700 # include <strings.h>
9703 # include <unistd.h> /* Needed for NetBSD */
9707 char buf[128], abc[128];
9713 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9714 try to store the string in read-only memory. */
9715 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9717 for (align = 7; align >= 0; align--) {
9718 for (len = 36; len; len--) {
9720 memcpy(b, abc, len);
9721 for (off = 1; off <= len; off++) {
9722 memcpy(b+off, b, len);
9723 memcpy(b, b+off, len);
9724 if (memcmp(b, abc, len))
9733 if eval $compile_ok; then
9734 if ./try 2>/dev/null; then
9738 echo "It can't, sorry."
9739 case "$d_memmove" in
9740 "$define") echo "But that's Ok since you have memmove()." ;;
9744 echo "(I can't compile the test program, so we'll assume not...)"
9745 case "$d_memmove" in
9746 "$define") echo "But that's Ok since you have memmove()." ;;
9751 $rm -f try.* try core
9755 : can memcmp be trusted to compare relative magnitude?
9760 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9767 $cat >>try.c <<'EOCP'
9770 # include <memory.h>
9773 # include <stdlib.h>
9776 # include <string.h>
9778 # include <strings.h>
9781 # include <unistd.h> /* Needed for NetBSD */
9787 if ((a < b) && memcmp(&a, &b, 1) < 0)
9793 if eval $compile_ok; then
9794 if ./try 2>/dev/null; then
9798 echo "No, it can't (it uses signed chars)."
9801 echo "(I can't compile the test program, so we'll assume not...)"
9805 $rm -f try.* try core
9809 : see if select exists
9813 : see if semctl exists
9817 : see if semget exists
9821 : see if semop exists
9825 : see how much of the 'sem*(2)' library is present.
9828 case "$d_semctl$d_semget$d_semop" in
9829 *"$undef"*) h_sem=false;;
9833 case "`ipcs 2>&1`" in
9834 "SVID messages"*"not configured"*)
9835 echo "Your $osname does not have the sem*(2) configured." >&4
9848 : we could also check for sys/ipc.h ...
9849 if $h_sem && $test `./findhdr sys/sem.h`; then
9850 echo "You have the full sem*(2) library." >&4
9853 echo "You don't have the full sem*(2) library." >&4
9859 : see whether sys/sem.h defines union semun
9861 $cat > try.c <<'END'
9862 #include <sys/types.h>
9863 #include <sys/ipc.h>
9864 #include <sys/sem.h>
9865 int main () { union semun semun; semun.buf = 0; }
9868 if eval $compile; then
9869 echo "You have union semun in <sys/sem.h>." >&4
9872 echo "You do not have union semun in <sys/sem.h>." >&4
9875 $rm -f try try.c try.h
9879 : see how to do semctl IPC_STAT
9882 : see whether semctl IPC_STAT can use union semun
9887 # define S_IRUSR S_IREAD
9888 # define S_IWUSR S_IWRITE
9889 # define S_IXUSR S_IEXEC
9891 # define S_IRUSR 0400
9892 # define S_IWUSR 0200
9893 # define S_IXUSR 0100
9895 # define S_IRGRP (S_IRUSR>>3)
9896 # define S_IWGRP (S_IWUSR>>3)
9897 # define S_IXGRP (S_IXUSR>>3)
9898 # define S_IROTH (S_IRUSR>>6)
9899 # define S_IWOTH (S_IWUSR>>6)
9900 # define S_IXOTH (S_IXUSR>>6)
9903 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9904 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9905 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9910 #include <sys/types.h>
9911 #include <sys/ipc.h>
9912 #include <sys/sem.h>
9913 #include <sys/stat.h>
9920 #$d_union_semun HAS_UNION_SEMUN
9923 #ifndef HAS_UNION_SEMUN
9926 struct semid_ds *buf;
9927 unsigned short *array;
9933 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9934 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9936 struct semid_ds argbuf;
9939 st = semctl(sem, 0, IPC_STAT, arg);
9943 # endif /* IPC_STAT */
9944 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9946 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9947 # endif /* IPC_RMID */
9948 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9950 #endif /* IPC_PRIVATE && ... */
9951 printf("semget failed: errno = %d\n", errno);
9957 if eval $compile; then
9960 semun) val="$define" ;;
9966 case "$d_semctl_semun" in
9968 echo "You can use union semun for semctl IPC_STAT." >&4
9971 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9976 : see whether semctl IPC_STAT can use struct semid_ds pointer
9977 $cat > try.c <<'END'
9978 #include <sys/types.h>
9979 #include <sys/ipc.h>
9980 #include <sys/sem.h>
9981 #include <sys/stat.h>
9989 struct semid_ds arg;
9992 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9993 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9996 st = semctl(sem, 0, IPC_STAT, &arg);
9998 printf("semid_ds\n");
10000 # endif /* IPC_STAT */
10001 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10003 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10004 # endif /* IPC_RMID */
10005 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10007 #endif /* IPC_PRIVATE && ... */
10008 printf("semget failed: errno = %d\n", errno);
10015 if eval $compile; then
10018 semid_ds) val="$define" ;;
10022 set d_semctl_semid_ds
10024 case "$d_semctl_semid_ds" in
10026 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10028 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10035 # We do not have the full sem*(2) library, so assume we can not
10041 set d_semctl_semid_ds
10046 : see if setegid exists
10047 set setegid d_setegid
10050 : see if seteuid exists
10051 set seteuid d_seteuid
10054 : see if setgrent exists
10055 set setgrent d_setgrent
10058 : see if sethostent exists
10059 set sethostent d_sethent
10062 : see if setlinebuf exists
10063 set setlinebuf d_setlinebuf
10066 : see if setlocale exists
10067 set setlocale d_setlocale
10070 : see if setnetent exists
10071 set setnetent d_setnent
10074 : see if setprotoent exists
10075 set setprotoent d_setpent
10078 : see if setpgid exists
10079 set setpgid d_setpgid
10082 : see if setpgrp2 exists
10083 set setpgrp2 d_setpgrp2
10086 : see if setpriority exists
10087 set setpriority d_setprior
10090 : see if setpwent exists
10091 set setpwent d_setpwent
10094 : see if setregid exists
10095 set setregid d_setregid
10097 set setresgid d_setresgid
10100 : see if setreuid exists
10101 set setreuid d_setreuid
10103 set setresuid d_setresuid
10106 : see if setrgid exists
10107 set setrgid d_setrgid
10110 : see if setruid exists
10111 set setruid d_setruid
10114 : see if setservent exists
10115 set setservent d_setsent
10118 : see if setsid exists
10119 set setsid d_setsid
10122 : see if setspent exists
10123 set setspent d_setspent
10126 : see if setvbuf exists
10127 set setvbuf d_setvbuf
10130 : see if sfio.h is available
10135 : see if sfio library is available
10146 : Ok, but do we want to use it.
10150 true|$define|[yY]*) dflt='y';;
10153 echo "$package can use the sfio library, but it is experimental."
10154 rp="You seem to have sfio available, do you want to try using it?"
10158 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10160 : Remove sfio from list of libraries to use
10161 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10164 echo "libs = $libs" >&4
10168 *) case "$usesfio" in
10169 true|$define|[yY]*)
10170 echo "Sorry, cannot find sfio on this machine" >&4
10171 echo "Ignoring your setting of usesfio=$usesfio" >&4
10179 $define) usesfio='true';;
10180 *) usesfio='false';;
10183 : see if shmctl exists
10184 set shmctl d_shmctl
10187 : see if shmget exists
10188 set shmget d_shmget
10191 : see if shmat exists
10194 : see what shmat returns
10197 $cat >shmat.c <<'END'
10198 #include <sys/shm.h>
10201 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10206 echo "and it returns ($shmattype)." >&4
10207 : see if a prototype for shmat is available
10208 xxx=`./findhdr sys/shm.h`
10209 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10210 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10221 set d_shmatprototype
10224 : see if shmdt exists
10228 : see how much of the 'shm*(2)' library is present.
10231 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10232 *"$undef"*) h_shm=false;;
10236 case "`ipcs 2>&1`" in
10237 "SVID shared memory"*"not configured"*)
10238 echo "Your $osname does not have the shm*(2) configured." >&4
10241 set shmctl d_shmctl
10243 set shmget d_shmget
10253 : we could also check for sys/ipc.h ...
10254 if $h_shm && $test `./findhdr sys/shm.h`; then
10255 echo "You have the full shm*(2) library." >&4
10258 echo "You don't have the full shm*(2) library." >&4
10265 : see if we have sigaction
10266 if set sigaction val -f d_sigaction; eval $csym; $val; then
10267 echo 'sigaction() found.' >&4
10268 $cat > try.c <<'EOP'
10270 #include <sys/types.h>
10271 #include <signal.h>
10274 struct sigaction act, oact;
10276 oact.sa_handler = 0;
10280 if eval $compile_ok; then
10283 echo "But you don't seem to have a useable struct sigaction." >&4
10287 echo 'sigaction NOT found.' >&4
10290 set d_sigaction; eval $setvar
10291 $rm -f try try$_o try.c
10293 : see if sigsetjmp exists
10295 case "$d_sigsetjmp" in
10297 $cat >try.c <<'EOP'
10298 #include <setjmp.h>
10303 if (sigsetjmp(env,1))
10306 siglongjmp(env, 1);
10311 if eval $compile; then
10312 if ./try >/dev/null 2>&1; then
10313 echo "POSIX sigsetjmp found." >&4
10317 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10323 echo "sigsetjmp not found." >&4
10327 *) val="$d_sigsetjmp"
10328 case "$d_sigsetjmp" in
10329 $define) echo "POSIX sigsetjmp found." >&4;;
10330 $undef) echo "sigsetjmp not found." >&4;;
10338 : see if sqrtl exists
10342 : see if sys/stat.h is available
10343 set sys/stat.h i_sysstat
10346 : see if stat knows about block sizes
10348 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10351 : see if _ptr and _cnt from stdio act std
10353 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10354 echo "(Looks like you have stdio.h from Linux.)"
10355 case "$stdio_ptr" in
10356 '') stdio_ptr='((fp)->_IO_read_ptr)'
10359 *) ptr_lval=$d_stdio_ptr_lval;;
10361 case "$stdio_cnt" in
10362 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10365 *) cnt_lval=$d_stdio_cnt_lval;;
10367 case "$stdio_base" in
10368 '') stdio_base='((fp)->_IO_read_base)';;
10370 case "$stdio_bufsiz" in
10371 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10374 case "$stdio_ptr" in
10375 '') stdio_ptr='((fp)->_ptr)'
10378 *) ptr_lval=$d_stdio_ptr_lval;;
10380 case "$stdio_cnt" in
10381 '') stdio_cnt='((fp)->_cnt)'
10384 *) cnt_lval=$d_stdio_cnt_lval;;
10386 case "$stdio_base" in
10387 '') stdio_base='((fp)->_base)';;
10389 case "$stdio_bufsiz" in
10390 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10393 : test whether _ptr and _cnt really work
10394 echo "Checking how std your stdio is..." >&4
10397 #define FILE_ptr(fp) $stdio_ptr
10398 #define FILE_cnt(fp) $stdio_cnt
10400 FILE *fp = fopen("try.c", "r");
10403 18 <= FILE_cnt(fp) &&
10404 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10412 if eval $compile; then
10414 echo "Your stdio acts pretty std."
10417 echo "Your stdio isn't very std."
10420 echo "Your stdio doesn't appear very std."
10426 : Can _ptr be used as an lvalue?
10427 case "$d_stdstdio$ptr_lval" in
10428 $define$define) val=$define ;;
10431 set d_stdio_ptr_lval
10434 : Can _cnt be used as an lvalue?
10435 case "$d_stdstdio$cnt_lval" in
10436 $define$define) val=$define ;;
10439 set d_stdio_cnt_lval
10442 : see if _base is also standard
10444 case "$d_stdstdio" in
10448 #define FILE_base(fp) $stdio_base
10449 #define FILE_bufsiz(fp) $stdio_bufsiz
10451 FILE *fp = fopen("try.c", "r");
10454 19 <= FILE_bufsiz(fp) &&
10455 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10462 if eval $compile; then
10464 echo "And its _base field acts std."
10467 echo "But its _base field isn't std."
10470 echo "However, it seems to be lacking the _base field."
10479 Checking how to access stdio streams by file descriptor number...
10481 case "$stdio_stream_array" in
10482 '') $cat >try.c <<EOCP
10485 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10489 for s in _iob __iob __sF
10491 set try -DSTDIO_STREAM_ARRAY=$s
10492 if eval $compile; then
10493 case "`./try$exe_ext`" in
10494 yes) stdio_stream_array=$s; break ;;
10498 $rm -f try.* try$exe_ext
10500 case "$stdio_stream_array" in
10502 I can't figure out how to access stdio streams by file descriptor number.
10504 d_stdio_stream_array="$undef"
10507 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10509 d_stdio_stream_array="$define"
10513 : see if strcoll exists
10514 set strcoll d_strcoll
10517 : check for structure copying
10519 echo "Checking to see if your C compiler can copy structs..." >&4
10520 $cat >try.c <<'EOCP'
10530 if $cc -c try.c >/dev/null 2>&1 ; then
10532 echo "Yup, it can."
10535 echo "Nope, it can't."
10541 : see if strerror and/or sys_errlist[] exist
10543 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10544 if set strerror val -f d_strerror; eval $csym; $val; then
10545 echo 'strerror() found.' >&4
10546 d_strerror="$define"
10547 d_strerrm='strerror(e)'
10548 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10549 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10550 d_syserrlst="$define"
10552 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10553 d_syserrlst="$undef"
10555 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10556 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10557 echo 'strerror() found in string header.' >&4
10558 d_strerror="$define"
10559 d_strerrm='strerror(e)'
10560 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10561 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10562 d_syserrlst="$define"
10564 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10565 d_syserrlst="$undef"
10567 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10568 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10569 d_strerror="$undef"
10570 d_syserrlst="$define"
10571 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10573 echo 'strerror() and sys_errlist[] NOT found.' >&4
10574 d_strerror="$undef"
10575 d_syserrlst="$undef"
10576 d_strerrm='"unknown"'
10580 : see if strtod exists
10581 set strtod d_strtod
10584 : see if strtol exists
10585 set strtol d_strtol
10588 : see if strtoul exists
10589 set strtoul d_strtoul
10592 : see if strtoull exists
10593 set strtoull d_strtoull
10596 : see if strxfrm exists
10597 set strxfrm d_strxfrm
10600 : see if symlink exists
10601 set symlink d_symlink
10604 : see if syscall exists
10605 set syscall d_syscall
10608 : see if sysconf exists
10609 set sysconf d_sysconf
10612 : see if system exists
10613 set system d_system
10616 : see if tcgetpgrp exists
10617 set tcgetpgrp d_tcgetpgrp
10620 : see if tcsetpgrp exists
10621 set tcsetpgrp d_tcsetpgrp
10624 : see if sys/types.h has to be included
10625 set sys/types.h i_systypes
10628 : see if prototype for telldir is available
10630 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10633 : define an is-a-typedef? function
10634 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10636 "") inclist="sys/types.h";;
10638 eval "varval=\$$var";
10642 for inc in $inclist; do
10643 echo "#include <$inc>" >>temp.c;
10645 echo "#ifdef $type" >> temp.c;
10646 echo "printf(\"We have $type\");" >> temp.c;
10647 echo "#endif" >> temp.c;
10648 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10649 if $contains $type temp.E >/dev/null 2>&1; then
10650 eval "$var=\$type";
10655 *) eval "$var=\$varval";;
10658 : define an is-a-typedef? function that prompts if the type is not available.
10659 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10661 "") inclist="sys/types.h";;
10663 eval "varval=\$$var";
10667 for inc in $inclist; do
10668 echo "#include <$inc>" >>temp.c;
10670 echo "#ifdef $type" >> temp.c;
10671 echo "printf(\"We have $type\");" >> temp.c;
10672 echo "#endif" >> temp.c;
10673 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10675 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10676 if $contains $type temp.E >/dev/null 2>&1; then
10677 echo "$type found." >&4;
10678 eval "$var=\$type";
10680 echo "$type NOT found." >&4;
10686 *) eval "$var=\$varval";;
10689 : see if this is a sys/times.h system
10690 set sys/times.h i_systimes
10693 : see if times exists
10695 if set times val -f d_times; eval $csym; $val; then
10696 echo 'times() found.' >&4
10699 case "$i_systimes" in
10700 "$define") inc='sys/times.h';;
10702 rp="What is the type returned by times() on this system?"
10703 set clock_t clocktype long stdio.h sys/types.h $inc
10706 echo 'times() NOT found, hope that will do.' >&4
10711 : see if truncate exists
10712 set truncate d_truncate
10715 : see if tzname[] exists
10717 if set tzname val -a d_tzname; eval $csym; $val; then
10719 echo 'tzname[] found.' >&4
10722 echo 'tzname[] NOT found.' >&4
10727 : see if umask exists
10731 : backward compatibility for d_hvfork
10732 if test X$d_hvfork != X; then
10733 d_vfork="$d_hvfork"
10736 : see if there is a vfork
10741 : Ok, but do we want to use it. vfork is reportedly unreliable in
10742 : perl on Solaris 2.x, and probably elsewhere.
10746 case "$usevfork" in
10752 Perl can only use a vfork() that doesn't suffer from strict
10753 restrictions on calling functions or modifying global data in
10754 the child. For example, glibc-2.1 contains such a vfork()
10755 that is unsuitable. If your system provides a proper fork()
10756 call, chances are that you do NOT want perl to use vfork().
10759 rp="Do you still want to use vfork()?"
10764 echo "Ok, we won't use vfork()."
10773 $define) usevfork='true';;
10774 *) usevfork='false';;
10777 : see if this is an sysdir system
10778 set sys/dir.h i_sysdir
10781 : see if this is an sysndir system
10782 set sys/ndir.h i_sysndir
10785 : see if closedir exists
10786 set closedir d_closedir
10789 case "$d_closedir" in
10792 echo "Checking whether closedir() returns a status..." >&4
10793 cat > closedir.c <<EOM
10794 #$i_dirent I_DIRENT /**/
10795 #$i_sysdir I_SYS_DIR /**/
10796 #$i_sysndir I_SYS_NDIR /**/
10797 #$i_systypes I_SYS_TYPES /**/
10799 #if defined(I_SYS_TYPES)
10800 #include <sys/types.h>
10802 #if defined(I_DIRENT)
10803 #include <dirent.h>
10804 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10805 #include <sys/dir.h>
10809 #include <sys/ndir.h>
10813 #include <ndir.h> /* may be wrong in the future */
10815 #include <sys/dir.h>
10820 int main() { return closedir(opendir(".")); }
10823 if eval $compile_ok; then
10824 if ./closedir > /dev/null 2>&1 ; then
10825 echo "Yes, it does."
10828 echo "No, it doesn't."
10832 echo "(I can't seem to compile the test program--assuming it doesn't)"
10840 set d_void_closedir
10843 : check for volatile keyword
10845 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10846 $cat >try.c <<'EOCP'
10849 typedef struct _goo_struct goo_struct;
10850 goo_struct * volatile goo = ((goo_struct *)0);
10851 struct _goo_struct {
10856 typedef unsigned short foo_t;
10857 char *volatile foo;
10859 volatile foo_t blech;
10863 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10865 echo "Yup, it does."
10868 echo "Nope, it doesn't."
10874 : see if there is a wait4
10878 : see if waitpid exists
10879 set waitpid d_waitpid
10882 : see if wcstombs exists
10883 set wcstombs d_wcstombs
10886 : see if wctomb exists
10887 set wctomb d_wctomb
10890 : see if writev exists
10891 set writev d_writev
10894 : preserve RCS keywords in files with variable substitution, grrr
10899 Revision='$Revision'
10901 case "$crosscompile" in
10902 ''|[nN]*) crosscompile="$undef" ;;
10906 next|rhapsody) multiarch="$define" ;;
10908 case "$multiarch" in
10909 ''|[nN]*) multiarch="$undef" ;;
10912 : check for alignment requirements
10914 case "$crosscompile$multiarch" in
10917 You seem to be either cross-compiling or doing a multiarchitecture build,
10918 skipping the memory alignment check.
10921 case "$alignbytes" in
10922 '') alignbytes=8 ;;
10926 case "$alignbytes" in
10927 '') echo "Checking alignment constraints..." >&4
10928 $cat >try.c <<'EOCP'
10935 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10939 if eval $compile_ok; then
10943 echo "(I can't seem to compile the test program...)"
10946 *) dflt="$alignbytes"
10949 rp="Doubles must be aligned on a how-many-byte boundary?"
10957 : check for ordering of bytes in a long
10959 case "$crosscompile$multiarch" in
10962 You seem to be either cross-compiling or doing a multiarchitecture build,
10963 skipping the byteorder check.
10969 case "$byteorder" in
10972 In the following, larger digits indicate more significance. A big-endian
10973 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10974 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10975 machines may have weird orders like 3412. A Cray will report 87654321,
10976 an Alpha will report 12345678. If the test program works the default is
10978 I'm now running the test program...
10980 $cat >try.c <<'EOCP'
10987 char c[sizeof(long)];
10990 if (sizeof(long) > 4)
10991 u.l = (0x08070605L << 32) | 0x04030201L;
10994 for (i = 0; i < sizeof(long); i++)
10995 printf("%c", u.c[i]+'0');
11002 if eval $compile && ./try > /dev/null; then
11005 [1-4][1-4][1-4][1-4]|12345678|87654321)
11006 echo "(The test program ran ok.)"
11007 echo "byteorder=$dflt"
11010 ????|????????) echo "(The test program ran ok.)" ;;
11011 *) echo "(The test program didn't run right for some reason.)" ;;
11016 (I can't seem to compile the test program. Guessing big-endian...)
11019 case "$xxx_prompt" in
11021 rp="What is the order of bytes in a long?"
11035 : how do we catenate cpp tokens here?
11037 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11038 $cat >cpp_stuff.c <<'EOCP'
11039 #define RCAT(a,b)a/**/b
11040 #define ACAT(a,b)a ## b
11044 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11045 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11046 echo "Oh! Smells like ANSI's been here." >&4
11047 echo "We can catify or stringify, separately or together!"
11049 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11050 echo "Ah, yes! The good old days!" >&4
11051 echo "However, in the good old days we don't know how to stringify and"
11052 echo "catify at the same time."
11056 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11057 to have to edit the values of CAT[2-5] in config.h...
11059 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11063 : see if this is a db.h system
11069 : Check db version.
11071 echo "Checking Berkeley DB version ..." >&4
11077 #include <sys/types.h>
11082 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11083 int Major, Minor, Patch ;
11084 unsigned long Version ;
11085 (void)db_version(&Major, &Minor, &Patch) ;
11086 printf("You have Berkeley DB Version 2 or greater\n");
11088 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11089 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11090 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11091 Major, Minor, Patch) ;
11093 /* check that db.h & libdb are compatible */
11094 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11095 printf("db.h and libdb are incompatible\n") ;
11099 printf("db.h and libdb are compatible\n") ;
11101 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11102 + DB_VERSION_PATCH ;
11104 /* needs to be >= 2.3.4 */
11105 if (Version < 2003004) {
11106 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11107 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11113 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11114 printf("You have Berkeley DB Version 1\n");
11115 exit(0); /* DB version < 2: the coast is clear. */
11117 exit(1); /* <db.h> not Berkeley DB? */
11123 if eval $compile && ./try; then
11124 echo 'Looks OK.' >&4
11126 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11130 : Remove db from list of libraries to use
11131 echo "Removing unusable -ldb from library list" >&4
11132 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11135 echo "libs = $libs" >&4
11145 : Check the return type needed for hash
11147 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11153 #include <sys/types.h>
11156 #ifndef DB_VERSION_MAJOR
11157 u_int32_t hash_cb (ptr, size)
11165 info.hash = hash_cb;
11169 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11170 if $contains warning try.out >>/dev/null 2>&1 ; then
11173 db_hashtype='u_int32_t'
11176 : XXX Maybe we should just give up here.
11177 db_hashtype=u_int32_t
11179 echo "Help: I can't seem to compile the db test program." >&4
11180 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11183 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11185 *) db_hashtype=u_int32_t
11190 : Check the return type needed for prefix
11192 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11198 #include <sys/types.h>
11201 #ifndef DB_VERSION_MAJOR
11202 size_t prefix_cb (key1, key2)
11210 info.prefix = prefix_cb;
11214 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11215 if $contains warning try.out >>/dev/null 2>&1 ; then
11216 db_prefixtype='int'
11218 db_prefixtype='size_t'
11221 db_prefixtype='size_t'
11222 : XXX Maybe we should just give up here.
11224 echo "Help: I can't seem to compile the db test program." >&4
11225 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11228 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11230 *) db_prefixtype='size_t'
11234 : check for void type
11236 echo "Checking to see how well your C compiler groks the void type..." >&4
11237 case "$voidflags" in
11239 $cat >try.c <<'EOCP'
11245 extern void moo(); /* function returning void */
11246 void (*goo)(); /* ptr to func returning void */
11248 void *hue; /* generic ptr */
11261 int main() { sub(); }
11263 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11264 voidflags=$defvoidused
11265 echo "Good. It appears to support void to the level $package wants.">&4
11266 if $contains warning .out >/dev/null 2>&1; then
11267 echo "However, you might get some warnings that look like this:"
11271 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11272 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11273 echo "It supports 1..."
11274 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11275 echo "It also supports 2..."
11276 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11278 echo "And it supports 4 but not 8 definitely."
11280 echo "It doesn't support 4..."
11281 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11283 echo "But it supports 8."
11286 echo "Neither does it support 8."
11290 echo "It does not support 2..."
11291 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11293 echo "But it supports 4 and 8."
11295 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11297 echo "And it supports 4 but has not heard about 8."
11299 echo "However it supports 8 but not 4."
11304 echo "There is no support at all for void."
11309 case "$voidflags" in
11311 *) $cat >&4 <<'EOM'
11312 Support flag bits are:
11313 1: basic void declarations.
11314 2: arrays of pointers to functions returning void.
11315 4: operations between pointers to and addresses of void functions.
11316 8: generic void pointers.
11319 rp="Your void support flags add up to what?"
11327 : How can we generate normalized random numbers ?
11329 echo "Looking for a random number function..." >&4
11330 case "$randfunc" in
11332 if set drand48 val -f; eval $csym; $val; then
11334 echo "Good, found drand48()." >&4
11335 elif set random val -f; eval $csym; $val; then
11337 echo "OK, found random()." >&4
11340 echo "Yick, looks like I have to use rand()." >&4
11351 *-Dmy_rand=*|*-Dmy_srand=*)
11352 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11353 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11354 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11355 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11359 while $test "$cont"; do
11360 rp="Use which function to generate random numbers?"
11362 if $test "$ans" = "$dflt"; then
11368 if set $ans val -f; eval $csym; $val; then
11372 rp="I cannot find function $ans. Use that name anyway?"
11381 case "$randfunc" in
11383 drand01="drand48()"
11389 case "$randbits" in
11391 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11393 #$i_unistd I_UNISTD
11394 #$i_stdlib I_STDLIB
11397 # include <unistd.h>
11400 # include <stdlib.h>
11405 register unsigned long tmp;
11406 register unsigned long max = 0L;
11408 for (i = 1000; i; i--) {
11409 tmp = (unsigned long) $randfunc();
11410 if (tmp > max) max = tmp;
11412 for (i = 0; max; i++)
11418 if eval $compile_ok; then
11422 echo "(I can't seem to compile the test program...)"
11429 rp="How many bits does your $randfunc() function produce?"
11433 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11434 seedfunc="s$randfunc"
11435 randseedtype=unsigned
11439 rp="How many bits does your $randfunc() function produce?"
11442 seedfunc="s$randfunc"
11443 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11444 if set $seedfunc val -f; eval $csym; $val; then
11445 echo "(Using $seedfunc() to seed random generator)"
11447 echo "(Warning: no $seedfunc() to seed random generator)"
11450 randseedtype=unsigned
11458 echo "Determining whether or not we are on an EBCDIC system..." >&4
11459 $cat >tebcdic.c <<'EOM'
11462 if ('M'==0xd4) return 0;
11469 if eval $compile_ok; then
11471 echo "You have EBCDIC." >&4
11474 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11477 echo "I'm unable to compile the test program." >&4
11478 echo "I'll assume ASCII or some ISO Latin." >&4
11480 $rm -f tebcdic.c tebcdic
11486 Checking how to flush all pending stdio output...
11488 # I only know how to find the first 32 possibly open files on SunOS.
11489 # See also hints/sunos_4_1.sh and util.c --AD
11491 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11493 $cat >>try.c <<EOCP
11495 #$i_unistd I_UNISTD
11497 # include <unistd.h>
11499 #$d_sysconf HAS_SYSCONF
11500 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11501 #ifdef HAS_STDIO_STREAM_ARRAY
11502 # define STDIO_STREAM_ARRAY $stdio_stream_array
11505 FILE* p = fopen("try.out", "w");
11509 # ifdef TRY_FPRINTF
11513 #ifdef TRY_FFLUSH_NULL
11516 #ifdef TRY_FFLUSH_ALL
11518 long open_max = -1;
11519 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11520 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11522 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11523 open_max = sysconf(_SC_OPEN_MAX);
11526 open_max = FOPEN_MAX;
11529 open_max = OPEN_MAX;
11538 # ifdef HAS_STDIO_STREAM_ARRAY
11539 if (open_max > 0) {
11541 for (i = 0; i < open_max; i++)
11542 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11543 STDIO_STREAM_ARRAY[i]._file < open_max &&
11544 STDIO_STREAM_ARRAY[i]._flag)
11545 fflush(&STDIO_STREAM_ARRAY[i]);
11553 : first we have to find out how _not_ to flush
11554 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11556 set try -DTRY_FPUTC
11557 if eval $compile; then
11559 ./try$exe_ext 2>/dev/null
11560 if $test ! -s try.out -a "X$?" = X42; then
11566 set try -DTRY_FPRINTF
11568 if eval $compile; then
11570 ./try$exe_ext 2>/dev/null
11571 if $test ! -s try.out -a "X$?" = X42; then
11572 output=-DTRY_FPRINTF
11578 : check for fflush NULL behaviour
11579 case "$fflushNULL" in
11580 '') set try -DTRY_FFLUSH_NULL $output
11581 if eval $compile; then
11583 ./try$exe_ext 2>/dev/null
11585 if $test -s try.out -a "X$code" = X42; then
11586 fflushNULL="`$cat try.out`"
11588 if $test "X$code" != X42; then
11590 (If this test failed, don't worry, we'll try another method shortly.)
11595 $rm -f core try.core core.try.*
11596 case "$fflushNULL" in
11598 Your fflush(NULL) works okay.
11600 fflushNULL="$define"
11603 Your fflush(NULL) isn't working (contrary to ANSI C).
11605 fflushNULL="$undef"
11608 Cannot figure out whether your fflush(NULL) works or not.
11609 I'm assuming it doesn't (contrary to ANSI C).
11611 fflushNULL="$undef"
11615 $define|true|[yY]*)
11616 fflushNULL="$define"
11619 fflushNULL="$undef"
11622 : check explicit looping only if NULL did not work
11623 case "$fflushNULL" in
11625 : check for fflush all behaviour
11626 case "$fflushall" in
11627 '') set try -DTRY_FFLUSH_ALL $output
11628 if eval $compile; then
11630 (Now testing the other method--but note that also this may fail.)
11633 ./try$exe_ext 2>/dev/null
11634 if $test -s try.out -a "X$?" = X42; then
11635 fflushall="`$cat try.out`"
11638 $rm -f core try.core core.try.*
11639 case "$fflushall" in
11641 Whew. Flushing explicitly all the stdio streams works.
11643 fflushall="$define"
11646 Sigh. Flushing explicitly all the stdio streams doesn't work.
11651 Cannot figure out whether flushing stdio streams explicitly works or not.
11652 I'm assuming it doesn't.
11658 "$define"|true|[yY]*)
11659 fflushall="$define"
11666 *) fflushall="$undef"
11669 case "$fflushNULL$fflushall" in
11672 I cannot figure out how to flush pending stdio output.
11676 $rm -f try.* try$exe_ext
11678 : see what type file positions are declared as in the library
11679 rp="What is the type for file position used by fsetpos()?"
11680 set fpos_t fpostype long stdio.h sys/types.h
11683 : Store the full pathname to the ar program for use in the C program
11684 : Respect a hint or command line value for full_ar.
11689 : Store the full pathname to the sed program for use in the C program
11692 : see what type gids are declared as in the kernel
11694 echo "Looking for the type for group ids returned by getgid()."
11695 set gid_t gidtype xxx stdio.h sys/types.h
11699 xxx=`./findhdr sys/user.h`
11700 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11702 unsigned) dflt="$1 $2" ;;
11706 *) dflt="$gidtype";;
11709 gid_t) echo "gid_t found." ;;
11710 *) rp="What is the type for group ids returned by getgid()?"
11716 : see if getgroups exists
11717 set getgroups d_getgrps
11720 : see if setgroups exists
11721 set setgroups d_setgrps
11725 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11727 case "$d_getgrps$d_setgrps" in
11729 case "$groupstype" in
11730 '') dflt="$gidtype" ;;
11731 *) dflt="$groupstype" ;;
11734 What type of pointer is the second argument to getgroups() and setgroups()?
11735 Usually this is the same as group ids, $gidtype, but not always.
11738 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11742 *) groupstype="$gidtype";;
11745 : see what type lseek is declared as in the kernel
11746 rp="What is the type used for lseek's offset on this system?"
11747 set off_t lseektype long stdio.h sys/types.h
11751 $echo $n "Checking to see how big your file offsets are...$c" >&4
11753 #include <sys/types.h>
11757 printf("%d\n", sizeof($lseektype));
11761 if eval $compile_ok; then
11763 $echo " $lseeksize bytes." >&4
11767 echo "(I can't seem to compile the test program. Guessing...)"
11768 rp="What is the size of your file offsets (in bytes)?"
11775 echo "Checking if your $make program sets \$(MAKE)..." >&4
11776 case "$make_set_make" in
11778 $sed 's/^X //' > testmake.mak << 'EOF'
11780 X @echo 'maketemp="$(MAKE)"'
11782 case "`$make -f testmake.mak 2>/dev/null`" in
11783 *maketemp=*) make_set_make='#' ;;
11784 *) make_set_make="MAKE=$make" ;;
11786 $rm -f testmake.mak
11789 case "$make_set_make" in
11790 '#') echo "Yup, it does.";;
11791 *) echo "Nope, it doesn't.";;
11794 : see what type is used for mode_t
11795 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11796 set mode_t modetype int stdio.h sys/types.h
11799 : define a fucntion to check prototypes
11800 $cat > protochk <<EOSH
11803 optimize="$optimize"
11805 prototype="$prototype"
11810 $cat >> protochk <<'EOSH'
11815 while test $# -ge 2; do
11817 $define) echo "#include <$2>" >> try.c ;;
11818 literal) echo "$2" >> try.c ;;
11822 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11823 cat >> try.c <<'EOCP'
11824 #ifdef CAN_PROTOTYPE
11825 #define _(args) args
11830 echo "$foo" >> try.c
11831 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11832 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11838 $eunicefix protochk
11840 : see what type is used for size_t
11841 rp="What is the type used for the length parameter for string functions?"
11842 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11845 : check for type of arguments to gethostbyaddr.
11846 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11847 case "$d_gethbyaddr" in
11851 Checking to see what type of arguments are accepted by gethostbyaddr().
11853 hdrs="$define sys/types.h
11854 $d_socket sys/socket.h
11855 $i_niin netinet/in.h
11857 $i_unistd unistd.h"
11858 : The first arg can 'char *' or 'void *'
11859 : The second arg is some of integral type
11860 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11861 for yyy in size_t long int; do
11862 case "$netdb_host_type" in
11863 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11864 if ./protochk "$try" $hdrs; then
11865 echo "Your system accepts $xxx for the first arg."
11866 echo "...and $yyy for the second arg."
11867 netdb_host_type="$xxx"
11868 netdb_hlen_type="$yyy"
11874 : In case none of those worked, prompt the user.
11875 case "$netdb_host_type" in
11876 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11879 netdb_host_type=$ans
11880 rp='What is the type for the 2nd argument to gethostbyaddr?'
11883 netdb_hlen_type=$ans
11887 *) : no gethostbyaddr, so pick harmless defaults
11888 netdb_host_type='char *'
11889 netdb_hlen_type="$sizetype"
11892 # Remove the "const" if needed. -- but then we'll have a
11894 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11897 : check for type of argument to gethostbyname.
11898 if test "X$netdb_name_type" = X ; then
11899 case "$d_gethbyname" in
11903 Checking to see what type of argument is accepted by gethostbyname().
11905 hdrs="$define sys/types.h
11906 $d_socket sys/socket.h
11907 $i_niin netinet/in.h
11909 $i_unistd unistd.h"
11910 for xxx in "const char *" "char *"; do
11911 case "$netdb_name_type" in
11912 '') try="extern struct hostent *gethostbyname($xxx);"
11913 if ./protochk "$try" $hdrs; then
11914 echo "Your system accepts $xxx."
11915 netdb_name_type="$xxx"
11920 : In case none of those worked, prompt the user.
11921 case "$netdb_name_type" in
11922 '') rp='What is the type for the 1st argument to gethostbyname?'
11925 netdb_name_type=$ans
11929 *) : no gethostbyname, so pick harmless default
11930 netdb_name_type='char *'
11935 : check for type of 1st argument to getnetbyaddr.
11936 if test "X$netdb_net_type" = X ; then
11937 case "$d_getnbyaddr" in
11941 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11943 hdrs="$define sys/types.h
11944 $d_socket sys/socket.h
11945 $i_niin netinet/in.h
11947 $i_unistd unistd.h"
11948 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11949 case "$netdb_net_type" in
11950 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11951 if ./protochk "$try" $hdrs; then
11952 echo "Your system accepts $xxx."
11953 netdb_net_type="$xxx"
11958 : In case none of those worked, prompt the user.
11959 case "$netdb_net_type" in
11960 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11963 netdb_net_type=$ans
11967 *) : no getnetbyaddr, so pick harmless default
11968 netdb_net_type='long'
11972 : locate the preferred pager for this system
11986 '') dflt=/usr/ucb/more;;
11993 rp='What pager is used on your system?'
11997 : see what type pids are declared as in the kernel
11998 rp="What is the type of process ids on this system?"
11999 set pid_t pidtype int stdio.h sys/types.h
12002 : Find earliest binary compatible site_perl subdirectory perl can use.
12003 case "$bincompat5005" in
12004 "$define") xs_apiversion='5.005' ;;
12005 *) xs_apiversion=$apiversion ;; # The current site_perl version.
12007 : Find earliest pure perl site_perl subdirectory perl can use.
12008 : The versioned directories started at 5.005.
12009 pm_apiversion='5.005'
12011 : check for length of pointer
12015 $echo $n "Checking to see how big your pointers are...$c" >&4
12016 if test "$voidflags" -gt 7; then
12017 echo '#define VOID_PTR char *' > try.c
12019 echo '#define VOID_PTR void *' > try.c
12021 $cat >>try.c <<'EOCP'
12025 printf("%d\n", sizeof(VOID_PTR));
12030 if eval $compile_ok; then
12032 $echo " $ptrsize bytes." >&4
12035 echo "(I can't seem to compile the test program. Guessing...)" >&4
12036 rp="What is the size of a pointer (in bytes)?"
12044 : see if ar generates random libraries by itself
12046 echo "Checking how to generate random libraries on your machine..." >&4
12047 echo 'int bar1() { return bar2(); }' > bar1.c
12048 echo 'int bar2() { return 2; }' > bar2.c
12049 $cat > foo.c <<'EOP'
12050 int main() { printf("%d\n", bar1()); exit(0); }
12052 $cc $ccflags -c bar1.c >/dev/null 2>&1
12053 $cc $ccflags -c bar2.c >/dev/null 2>&1
12054 $cc $ccflags -c foo.c >/dev/null 2>&1
12055 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12056 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12057 ./foobar >/dev/null 2>&1; then
12058 echo "$ar appears to generate random libraries itself."
12061 elif $ar ts bar$_a >/dev/null 2>&1 &&
12062 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12063 ./foobar >/dev/null 2>&1; then
12064 echo "a table of contents needs to be added with '$ar ts'."
12071 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12072 $test -f $ranlib || ranlib=''
12075 if $test -n "$ranlib"; then
12076 echo "your system has '$ranlib'; we'll use that."
12079 echo "your system doesn't seem to support random libraries"
12080 echo "so we'll use lorder and tsort to order the libraries."
12087 : check for type of arguments to select.
12088 case "$selecttype" in
12089 '') case "$d_select" in
12092 Checking to see what type of arguments are accepted by select().
12094 hdrs="$define sys/types.h
12095 $i_systime sys/time.h
12096 $i_sysselct sys/select.h
12097 $d_socket sys/socket.h"
12098 : The first arg can be int, unsigned, or size_t
12099 : The last arg may or may not be 'const'
12101 : void pointer has been seen but using that
12102 : breaks the selectminbits test
12103 for xxx in 'fd_set *' 'int *'; do
12104 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12105 for tmo in 'struct timeval *' 'const struct timeval *'; do
12107 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12108 if ./protochk "$try" $hdrs; then
12109 echo "Your system accepts $xxx."
12118 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12119 case "$d_fd_set" in
12120 $define) dflt="fd_set *" ;;
12129 *) : no select, so pick a harmless default
12136 : check for the select 'width'
12137 case "$selectminbits" in
12138 '') case "$d_select" in
12142 Checking to see on how many bits at a time your select() operates...
12145 #include <sys/types.h>
12147 #$i_systime I_SYS_TIME
12148 #$i_systimek I_SYS_TIME_KERNEL
12153 # ifdef I_SYS_TIME_KERNEL
12156 # include <sys/time.h>
12157 # ifdef I_SYS_TIME_KERNEL
12161 #$i_sysselct I_SYS_SELECT
12162 #ifdef I_SYS_SELECT
12163 #include <sys/select.h>
12165 #$d_socket HAS_SOCKET
12167 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12171 #define S sizeof(*(b))
12173 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12174 #define NBITS (NBYTES * 8)
12183 fp = fopen("try.c", "r");
12189 b = ($selecttype)s;
12190 for (i = 0; i < NBITS; i++)
12194 select(fd + 1, b, 0, 0, &t);
12195 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12196 printf("%d\n", i + 1);
12201 if eval $compile_ok; then
12202 selectminbits=`./try`
12203 case "$selectminbits" in
12205 Cannot figure out on how many bits at a time your select() operates.
12206 I'll play safe and guess it is 32 bits.
12212 *) bits="$selectminbits bits" ;;
12214 echo "Your select() operates on $bits at a time." >&4
12216 rp='What is the minimum number of bits your select() operates on?'
12217 case "$byteorder" in
12218 1234|12345678) dflt=32 ;;
12223 selectminbits="$val"
12227 *) : no select, so pick a harmless default
12234 : Trace out the files included by signal.h, then look for SIGxxx names.
12235 : Remove SIGARRAYSIZE used by HPUX.
12236 : Remove SIGSTKSIZE used by Linux.
12237 : Remove SIGSTKSZ used by Posix.
12238 : Remove SIGTYP void lines used by OS2.
12239 xxx=`echo '#include <signal.h>' |
12240 $cppstdin $cppminus $cppflags 2>/dev/null |
12241 $grep '^[ ]*#.*include' |
12242 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12243 : Check this list of files to be sure we have parsed the cpp output ok.
12244 : This will also avoid potentially non-existent files, such
12247 for xx in $xxx /dev/null ; do
12248 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12250 : If we have found no files, at least try signal.h
12251 case "$xxxfiles" in
12252 '') xxxfiles=`./findhdr signal.h` ;;
12255 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12256 print substr($2, 4, 20)
12258 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12259 print substr($3, 4, 20)
12261 : Append some common names just in case the awk scan failed.
12262 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12263 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12264 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12265 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12266 : generate a few handy files for later
12267 $cat > signal.c <<'EOCP'
12268 #include <sys/types.h>
12269 #include <signal.h>
12273 /* Strange style to avoid deeply-nested #if/#else/#endif */
12276 # define NSIG (_NSIG)
12282 # define NSIG (SIGMAX+1)
12288 # define NSIG (SIG_MAX+1)
12294 # define NSIG (MAXSIG+1)
12300 # define NSIG (MAX_SIG+1)
12305 # ifdef SIGARRAYSIZE
12306 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12312 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12316 /* Default to some arbitrary number that's big enough to get most
12317 of the common signals.
12323 printf("NSIG %d\n", NSIG);
12329 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12331 printf "#ifdef SIG"; printf $1; printf "\n"
12332 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12333 printf $1; printf ");\n"
12337 printf "#endif /* JUST_NSIG */\n";
12341 $cat >signal.awk <<'EOP'
12342 BEGIN { ndups = 0 }
12343 $1 ~ /^NSIG$/ { nsig = $2 }
12344 ($1 !~ /^NSIG$/) && (NF == 2) {
12345 if ($2 > maxsig) { maxsig = $2 }
12346 if (sig_name[$2]) {
12347 dup_name[ndups] = $1
12348 dup_num[ndups] = $2
12360 printf("NSIG %d\n", nsig);
12361 for (n = 1; n < nsig; n++) {
12363 printf("%s %d\n", sig_name[n], sig_num[n])
12366 printf("NUM%d %d\n", n, n)
12369 for (n = 0; n < ndups; n++) {
12370 printf("%s %d\n", dup_name[n], dup_num[n])
12374 $cat >signal_cmd <<EOS
12376 if $test -s signal.lst; then
12377 echo "Using your existing signal.lst file"
12382 $cat >>signal_cmd <<'EOS'
12385 if eval $compile_ok; then
12386 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12388 echo "(I can't seem be able to compile the whole test program)" >&4
12389 echo "(I'll try it in little pieces.)" >&4
12390 set signal -DJUST_NSIG
12391 if eval $compile_ok; then
12392 ./signal$_exe > signal.nsg
12395 echo "I can't seem to figure out how many signals you have." >&4
12396 echo "Guessing 50." >&4
12397 echo 'NSIG 50' > signal.nsg
12399 : Now look at all the signal names, one at a time.
12400 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12401 $cat > signal.c <<EOCP
12402 #include <sys/types.h>
12403 #include <signal.h>
12406 printf("$xx %d\n", SIG${xx});
12411 if eval $compile; then
12412 echo "SIG${xx} found."
12413 ./signal$_exe >> signal.ls1
12415 echo "SIG${xx} NOT found."
12418 if $test -s signal.ls1; then
12419 $cat signal.nsg signal.ls1 |
12420 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12424 if $test -s signal.lst; then
12427 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12428 echo 'kill -l' >signal
12429 set X `csh -f <signal`
12433 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12435 echo $@ | $tr ' ' $trnl | \
12436 $awk '{ printf "%s %d\n", $1, ++s; }
12437 END { printf "NSIG %d\n", ++s }' >signal.lst
12439 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12441 chmod a+x signal_cmd
12442 $eunicefix signal_cmd
12444 : generate list of signal names
12446 case "$sig_name_init" in
12448 *) case "$sig_num_init" in
12449 ''|*,*) doinit=yes ;;
12454 echo "Generating a list of signal names and numbers..." >&4
12456 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12457 sig_name=`$awk 'BEGIN { printf "ZERO " }
12458 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12459 sig_num=`$awk 'BEGIN { printf "0 " }
12460 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12461 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12462 !/^NSIG/ { printf "\"%s\", ", $1 }
12463 END { printf "0\n" }' signal.lst`
12464 sig_num_init=`$awk 'BEGIN { printf "0, " }
12465 !/^NSIG/ { printf "%d, ", $2}
12466 END { printf "0\n"}' signal.lst`
12469 echo "The following $sig_count signals are available:"
12471 echo $sig_name | $awk \
12472 'BEGIN { linelen = 0 }
12474 for (i = 1; i <= NF; i++) {
12475 name = "SIG" $i " "
12476 linelen = linelen + length(name)
12477 if (linelen > 70) {
12479 linelen = length(name)
12485 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12487 : see what type is used for signed size_t
12488 set ssize_t ssizetype int stdio.h sys/types.h
12491 $cat > ssize.c <<EOM
12493 #include <sys/types.h>
12494 #define Size_t $sizetype
12495 #define SSize_t $dflt
12498 if (sizeof(Size_t) == sizeof(SSize_t))
12500 else if (sizeof(Size_t) == sizeof(int))
12509 if eval $compile_ok && ./ssize > /dev/null; then
12510 ssizetype=`./ssize`
12511 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12514 Help! I can't compile and run the ssize_t test program: please enlighten me!
12515 (This is probably a misconfiguration in your system or libraries, and
12516 you really ought to fix it. Still, I'll try anyway.)
12518 I need a type that is the same size as $sizetype, but is guaranteed to
12519 be signed. Common values are ssize_t, int and long.
12522 rp="What signed type is the same size as $sizetype?"
12526 $rm -f ssize ssize.*
12528 : see what type of char stdio uses.
12530 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12531 echo "Your stdio uses unsigned chars." >&4
12532 stdchar="unsigned char"
12534 echo "Your stdio uses signed chars." >&4
12538 : see if time exists
12540 if test "X$d_time" = X -o X"$timetype" = X; then
12541 if set time val -f d_time; eval $csym; $val; then
12542 echo 'time() found.' >&4
12544 rp="What is the type returned by time() on this system?"
12545 set time_t timetype long stdio.h sys/types.h
12548 echo 'time() not found, hope that will do.' >&4
12556 : see what type uids are declared as in the kernel
12558 echo "Looking for the type for user ids returned by getuid()."
12559 set uid_t uidtype xxx stdio.h sys/types.h
12563 xxx=`./findhdr sys/user.h`
12564 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12566 unsigned) dflt="$1 $2" ;;
12570 *) dflt="$uidtype";;
12573 uid_t) echo "uid_t found." ;;
12574 *) rp="What is the type for user ids returned by getuid()?"
12582 *_t) zzz="$uidtype" ;;
12585 echo "Checking the sign of $zzz..." >&4
12587 #include <sys/types.h>
12598 if eval $compile; then
12602 echo "(I can't execute the test program--guessing unsigned.)" >&4
12606 1) echo "Your $zzz is unsigned." ;;
12607 -1) echo "Your $zzz is signed." ;;
12613 echo "(I can't compile the test program--guessing unsigned.)" >&4
12617 : see if dbm.h is available
12618 : see if dbmclose exists
12619 set dbmclose d_dbmclose
12622 case "$d_dbmclose" in
12632 *) set rpcsvc/dbm.h i_rpcsvcdbm
12637 *) echo "We won't be including <dbm.h>"
12647 : see if this is a sys/file.h system
12652 : do we need to include sys/file.h ?
12656 if $h_sysfile; then
12658 echo "We'll be including <sys/file.h>." >&4
12661 echo "We won't be including <sys/file.h>." >&4
12671 : see if fcntl.h is there
12676 : see if we can include fcntl.h
12682 echo "We'll be including <fcntl.h>." >&4
12685 if $h_sysfile; then
12686 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12688 echo "We won't be including <fcntl.h>." >&4
12700 : see if locale.h is available
12701 set locale.h i_locale
12704 : see if mach cthreads are available
12705 if test "X$usethreads" = "X$define"; then
12706 set mach/cthreads.h i_machcthr
12709 i_machcthr="$undef"
12714 : see if this is a math.h system
12718 : see if this is a mntent.h system
12719 set mntent.h i_mntent
12722 : see if ndbm.h is available
12727 : see if dbm_open exists
12728 set dbm_open d_dbm_open
12730 case "$d_dbm_open" in
12733 echo "We won't be including <ndbm.h>"
12742 : see if net/errno.h is available
12744 set net/errno.h val
12747 : Unfortunately, it causes problems on some systems. Arrgh.
12750 cat > try.c <<'EOM'
12753 #include <net/errno.h>
12759 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12760 echo "We'll be including <net/errno.h>." >&4
12762 echo "We won't be including <net/errno.h>." >&4
12771 : see if netinet/tcp.h is available
12772 set netinet/tcp.h i_netinettcp
12775 : see if this is a poll.h system
12779 : get C preprocessor symbols handy
12781 $echo $n "Hmm... $c"
12782 echo $al | $tr ' ' $trnl >Cppsym.know
12783 $cat <<EOSS >Cppsym
12791 case "\$list\$#" in
12794 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12796 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12799 unknown="\$unknown \$sym"
12809 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12811 exit 0; _ _ _ _\1\\ \1\\
12814 echo "exit 1; _ _ _" >>Cppsym\$\$
12815 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12817 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12823 $rm -f Cppsym\$\$ Cppsym2\$\$
12828 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12830 : now check the C compiler for additional symbols
12831 postprocess_cc_v=''
12833 aix) postprocess_cc_v="|$tr , ' '" ;;
12840 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12843 -D*) echo "\$i" | $sed 's/^-D//';;
12844 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12849 postprocess_cc_v=''
12852 ./ccsym > ccsym1.raw
12853 if $test -s ccsym1.raw; then
12854 $sort ccsym1.raw | $uniq >ccsym.raw
12856 mv ccsym1.raw ccsym.raw
12859 $awk '/\=/ { print $0; next }
12860 { print $0"=1" }' ccsym.raw >ccsym.list
12861 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12862 $comm -13 ccsym.true ccsym.list >ccsym.own
12863 $comm -12 ccsym.true ccsym.list >ccsym.com
12864 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12866 if $test -z ccsym.raw; then
12867 echo "Your C compiler doesn't seem to define any symbols!" >&4
12869 echo "However, your C preprocessor defines the following symbols:"
12872 cppsymbols=`$cat Cppsym.true`
12873 cppsymbols=`echo $cppsymbols`
12874 cppccsymbols="$cppsymbols"
12876 if $test -s ccsym.com; then
12877 echo "Your C compiler and pre-processor define these symbols:"
12878 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12881 cppccsymbols=`$cat ccsym.com`
12882 cppccsymbols=`echo $cppccsymbols`
12883 $test "$silent" || sleep 1
12885 if $test -s ccsym.cpp; then
12886 $test "$also" && echo " "
12887 echo "Your C pre-processor ${also}defines the following symbols:"
12888 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12890 cppsymbols=`$cat ccsym.cpp`
12891 cppsymbols=`echo $cppsymbols`
12892 $test "$silent" || sleep 1
12894 if $test -s ccsym.own; then
12895 $test "$also" && echo " "
12896 echo "Your C compiler ${also}defines the following cpp symbols:"
12897 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12898 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12899 ccsymbols=`$cat ccsym.own`
12900 ccsymbols=`echo $ccsymbols`
12901 $test "$silent" || sleep 1
12906 : see if this is a termio system
12910 if $test `./findhdr termios.h`; then
12911 set tcsetattr i_termios
12917 "$define") echo "You have POSIX termios.h... good!" >&4;;
12918 *) if ./Cppsym pyr; then
12919 case "`/bin/universe`" in
12920 ucb) if $test `./findhdr sgtty.h`; then
12922 echo "<sgtty.h> found." >&4
12924 echo "System is pyramid with BSD universe."
12925 echo "<sgtty.h> not found--you could have problems." >&4
12927 *) if $test `./findhdr termio.h`; then
12929 echo "<termio.h> found." >&4
12931 echo "System is pyramid with USG universe."
12932 echo "<termio.h> not found--you could have problems." >&4
12936 if $test `./findhdr termio.h`; then
12937 echo "<termio.h> found." >&4
12939 elif $test `./findhdr sgtty.h`; then
12940 echo "<sgtty.h> found." >&4
12943 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12946 if $test `./findhdr sgtty.h`; then
12947 echo "<sgtty.h> found." >&4
12949 elif $test `./findhdr termio.h`; then
12950 echo "<termio.h> found." >&4
12953 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12957 set i_termio; eval $setvar
12958 val=$val2; set i_sgtty; eval $setvar
12959 val=$val3; set i_termios; eval $setvar
12961 : see if this is a shadow.h system
12962 set shadow.h i_shadow
12965 : see if this is a socks.h system
12966 set socks.h i_socks
12969 : see if stdarg is available
12971 if $test `./findhdr stdarg.h`; then
12972 echo "<stdarg.h> found." >&4
12975 echo "<stdarg.h> NOT found." >&4
12979 : see if varags is available
12981 if $test `./findhdr varargs.h`; then
12982 echo "<varargs.h> found." >&4
12984 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12987 : set up the varargs testing programs
12988 $cat > varargs.c <<EOP
12990 #include <stdarg.h>
12993 #include <varargs.h>
12997 int f(char *p, ...)
13011 p = va_arg(ap, char *);
13016 $cat > varargs <<EOP
13018 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13027 : now check which varargs header should be included
13032 if `./varargs I_STDARG`; then
13034 elif `./varargs I_VARARGS`; then
13039 if `./varargs I_VARARGS`; then
13046 echo "I could not find the definition for va_dcl... You have problems..." >&4
13047 val="$undef"; set i_stdarg; eval $setvar
13048 val="$undef"; set i_varargs; eval $setvar
13053 case "$i_varhdr" in
13055 val="$define"; set i_stdarg; eval $setvar
13056 val="$undef"; set i_varargs; eval $setvar
13059 val="$undef"; set i_stdarg; eval $setvar
13060 val="$define"; set i_varargs; eval $setvar
13063 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13067 : see if stddef is available
13068 set stddef.h i_stddef
13071 : see if sys/access.h is available
13072 set sys/access.h i_sysaccess
13075 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13076 set sys/filio.h i_sysfilio
13079 if $test `./findhdr sys/ioctl.h`; then
13081 echo '<sys/ioctl.h> found.' >&4
13084 if $test $i_sysfilio = "$define"; then
13085 echo '<sys/ioctl.h> NOT found.' >&4
13087 $test $i_sgtty = "$define" && xxx="sgtty.h"
13088 $test $i_termio = "$define" && xxx="termio.h"
13089 $test $i_termios = "$define" && xxx="termios.h"
13090 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13096 : see if sys/resource.h has to be included
13097 set sys/resource.h i_sysresrc
13100 : see if sys/security.h is available
13101 set sys/security.h i_syssecrt
13104 : see if this is a sys/statvfs.h system
13105 set sys/statvfs.h i_sysstatvfs
13108 : see if this is a sys/un.h system
13109 set sys/un.h i_sysun
13112 : see if this is a syswait system
13113 set sys/wait.h i_syswait
13116 : see if this is an utime system
13117 set utime.h i_utime
13120 : see if this is a values.h system
13121 set values.h i_values
13124 : see if this is a vfork system
13127 set vfork.h i_vfork
13135 : see if gdbm.h is available
13140 : see if gdbm_open exists
13141 set gdbm_open d_gdbm_open
13143 case "$d_gdbm_open" in
13146 echo "We won't be including <gdbm.h>"
13156 echo "Looking for extensions..." >&4
13157 : If we are using the old config.sh, known_extensions may contain
13158 : old or inaccurate or duplicate values.
13159 known_extensions=''
13160 nonxs_extensions=''
13161 : We do not use find because it might not be available.
13162 : We do not just use MANIFEST because the user may have dropped
13163 : some additional extensions into the source tree and expect them
13166 : Function to recursively find available extensions, ignoring DynaLoader
13167 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13171 DynaLoader|dynaload) ;;
13173 if $test -f $xxx/$xxx.xs; then
13174 known_extensions="$known_extensions $1$xxx";
13175 elif $test -f $xxx/Makefile.PL; then
13176 nonxs_extensions="$nonxs_extensions $1$xxx";
13178 if $test -d $xxx -a $# -lt 10; then
13181 eval $find_extensions;
13193 eval $find_extensions
13194 set X $nonxs_extensions
13196 nonxs_extensions="$*"
13197 set X $known_extensions
13199 known_extensions="$*"
13202 : Now see which are supported on this system.
13204 for xxx in $known_extensions ; do
13208 $define) avail_ext="$avail_ext $xxx" ;;
13211 GDBM_File|gdbm_fil)
13213 $define) avail_ext="$avail_ext $xxx" ;;
13216 NDBM_File|ndbm_fil)
13218 $define) avail_ext="$avail_ext $xxx" ;;
13221 ODBM_File|odbm_fil)
13222 case "${i_dbm}${i_rpcsvcdbm}" in
13223 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13227 case "$useposix" in
13228 true|define|y) avail_ext="$avail_ext $xxx" ;;
13232 case "$useopcode" in
13233 true|define|y) avail_ext="$avail_ext $xxx" ;;
13237 case "$d_socket" in
13238 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13242 case "$usethreads" in
13243 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13247 : XXX Do we need a useipcsysv variable here
13248 case "${d_msg}${d_sem}${d_shm}" in
13249 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13252 *) avail_ext="$avail_ext $xxx"
13261 : Now see which nonxs extensions are supported on this system.
13262 : For now assume all are.
13264 for xxx in $nonxs_extensions ; do
13266 *) nonxs_ext="$nonxs_ext $xxx"
13278 A number of extensions are supplied with $package. You may choose to
13279 compile these extensions for dynamic loading (the default), compile
13280 them into the $package executable (static loading), or not include
13281 them at all. Answer "none" to include no extensions.
13282 Note that DynaLoader is always built and need not be mentioned here.
13285 case "$dynamic_ext" in
13286 '') dflt="$avail_ext" ;;
13287 *) dflt="$dynamic_ext"
13288 # Perhaps we are reusing an old out-of-date config.sh.
13291 if test X"$dynamic_ext" != X"$avail_ext"; then
13293 NOTICE: Your previous config.sh list may be incorrect.
13294 The extensions now available to you are
13296 but the default list from your previous config.sh is
13308 rp="What extensions do you wish to load dynamically?"
13311 none) dynamic_ext=' ' ;;
13312 *) dynamic_ext="$ans" ;;
13315 case "$static_ext" in
13317 : Exclude those already listed in dynamic linking
13319 for xxx in $avail_ext; do
13320 case " $dynamic_ext " in
13322 *) dflt="$dflt $xxx" ;;
13329 *) dflt="$static_ext"
13336 rp="What extensions do you wish to load statically?"
13339 none) static_ext=' ' ;;
13340 *) static_ext="$ans" ;;
13345 A number of extensions are supplied with $package. Answer "none"
13346 to include no extensions.
13347 Note that DynaLoader is always built and need not be mentioned here.
13350 case "$static_ext" in
13351 '') dflt="$avail_ext" ;;
13352 *) dflt="$static_ext"
13353 # Perhaps we are reusing an old out-of-date config.sh.
13356 if test X"$static_ext" != X"$avail_ext"; then
13358 NOTICE: Your previous config.sh list may be incorrect.
13359 The extensions now available to you are
13361 but the default list from your previous config.sh is
13370 : Exclude those that are not xs extensions
13374 rp="What extensions do you wish to include?"
13377 none) static_ext=' ' ;;
13378 *) static_ext="$ans" ;;
13383 set X $dynamic_ext $static_ext $nonxs_ext
13387 : Remove build directory name from cppstdin so it can be used from
13388 : either the present location or the final installed location.
13390 : Get out of the UU directory to get correct path name.
13392 case "$cppstdin" in
13394 echo "Stripping down cppstdin path name"
13400 : end of configuration questions
13402 echo "End of configuration questions."
13405 : back to where it started
13406 if test -d ../UU; then
13410 : configuration may be patched via a 'config.over' file
13411 if $test -f config.over; then
13414 rp='I see a config.over file. Do you wish to load it?'
13417 n*) echo "OK, I'll ignore it.";;
13419 echo "Configuration override changes have been loaded."
13424 : in case they want portability, strip down executable paths
13425 case "$d_portable" in
13428 echo "Stripping down executable paths..." >&4
13429 for file in $loclist $trylist; do
13431 eval $file=`basename $temp`
13436 : create config.sh file
13438 echo "Creating config.sh..." >&4
13439 $spitshell <<EOT >config.sh
13442 # This file was produced by running the Configure script. It holds all the
13443 # definitions figured out by Configure. Should you modify one of these values,
13444 # do not forget to propagate your changes by running "Configure -der". You may
13445 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13448 # Package name : $package
13449 # Source directory : $src
13450 # Configuration time: $cf_time
13451 # Configured by : $cf_by
13452 # Target system : $myuname
13462 Revision='$Revision'
13469 alignbytes='$alignbytes'
13470 ansi2knr='$ansi2knr'
13471 aphostname='$aphostname'
13472 apiversion='$apiversion'
13475 archlibexp='$archlibexp'
13476 archname64='$archname64'
13477 archname='$archname'
13478 archobjs='$archobjs'
13483 bincompat5005='$bincompat5005'
13487 byteorder='$byteorder'
13489 castflags='$castflags'
13492 cccdlflags='$cccdlflags'
13493 ccdlflags='$ccdlflags'
13495 ccsymbols='$ccsymbols'
13497 cf_email='$cf_email'
13502 clocktype='$clocktype'
13504 compress='$compress'
13505 contains='$contains'
13509 cpp_stuff='$cpp_stuff'
13510 cppccsymbols='$cppccsymbols'
13511 cppflags='$cppflags'
13513 cppminus='$cppminus'
13515 cppstdin='$cppstdin'
13516 cppsymbols='$cppsymbols'
13517 crosscompile='$crosscompile'
13518 cryptlib='$cryptlib'
13520 d_Gconvert='$d_Gconvert'
13521 d_PRIEldbl='$d_PRIEldbl'
13522 d_PRIFldbl='$d_PRIFldbl'
13523 d_PRIGldbl='$d_PRIGldbl'
13524 d_PRIX64='$d_PRIX64'
13525 d_PRId64='$d_PRId64'
13526 d_PRIeldbl='$d_PRIeldbl'
13527 d_PRIfldbl='$d_PRIfldbl'
13528 d_PRIgldbl='$d_PRIgldbl'
13529 d_PRIi64='$d_PRIi64'
13530 d_PRIo64='$d_PRIo64'
13531 d_PRIu64='$d_PRIu64'
13532 d_PRIx64='$d_PRIx64'
13533 d_access='$d_access'
13534 d_accessx='$d_accessx'
13536 d_archlib='$d_archlib'
13539 d_attribut='$d_attribut'
13542 d_bincompat5005='$d_bincompat5005'
13544 d_bsdgetpgrp='$d_bsdgetpgrp'
13545 d_bsdsetpgrp='$d_bsdsetpgrp'
13547 d_casti32='$d_casti32'
13548 d_castneg='$d_castneg'
13549 d_charvspr='$d_charvspr'
13551 d_chroot='$d_chroot'
13552 d_chsize='$d_chsize'
13553 d_closedir='$d_closedir'
13554 d_cmsghdr_s='$d_cmsghdr_s'
13558 d_cuserid='$d_cuserid'
13559 d_dbl_dig='$d_dbl_dig'
13560 d_difftime='$d_difftime'
13561 d_dirnamlen='$d_dirnamlen'
13562 d_dlerror='$d_dlerror'
13563 d_dlopen='$d_dlopen'
13564 d_dlsymun='$d_dlsymun'
13565 d_dosuid='$d_dosuid'
13566 d_drand48proto='$d_drand48proto'
13568 d_eaccess='$d_eaccess'
13569 d_endgrent='$d_endgrent'
13570 d_endhent='$d_endhent'
13571 d_endnent='$d_endnent'
13572 d_endpent='$d_endpent'
13573 d_endpwent='$d_endpwent'
13574 d_endsent='$d_endsent'
13575 d_endspent='$d_endspent'
13576 d_eofnblk='$d_eofnblk'
13577 d_eunice='$d_eunice'
13578 d_fchmod='$d_fchmod'
13579 d_fchown='$d_fchown'
13581 d_fd_macros='$d_fd_macros'
13582 d_fd_set='$d_fd_set'
13583 d_fds_bits='$d_fds_bits'
13584 d_fgetpos='$d_fgetpos'
13585 d_flexfnam='$d_flexfnam'
13588 d_fpathconf='$d_fpathconf'
13589 d_fpos64_t='$d_fpos64_t'
13590 d_fseeko='$d_fseeko'
13591 d_fsetpos='$d_fsetpos'
13592 d_fstatfs='$d_fstatfs'
13593 d_fstatvfs='$d_fstatvfs'
13594 d_ftello='$d_ftello'
13596 d_getgrent='$d_getgrent'
13597 d_getgrps='$d_getgrps'
13598 d_gethbyaddr='$d_gethbyaddr'
13599 d_gethbyname='$d_gethbyname'
13600 d_gethent='$d_gethent'
13601 d_gethname='$d_gethname'
13602 d_gethostprotos='$d_gethostprotos'
13603 d_getlogin='$d_getlogin'
13604 d_getmntent='$d_getmntent'
13605 d_getnbyaddr='$d_getnbyaddr'
13606 d_getnbyname='$d_getnbyname'
13607 d_getnent='$d_getnent'
13608 d_getnetprotos='$d_getnetprotos'
13609 d_getpbyname='$d_getpbyname'
13610 d_getpbynumber='$d_getpbynumber'
13611 d_getpent='$d_getpent'
13612 d_getpgid='$d_getpgid'
13613 d_getpgrp2='$d_getpgrp2'
13614 d_getpgrp='$d_getpgrp'
13615 d_getppid='$d_getppid'
13616 d_getprior='$d_getprior'
13617 d_getprotoprotos='$d_getprotoprotos'
13618 d_getpwent='$d_getpwent'
13619 d_getsbyname='$d_getsbyname'
13620 d_getsbyport='$d_getsbyport'
13621 d_getsent='$d_getsent'
13622 d_getservprotos='$d_getservprotos'
13623 d_getspent='$d_getspent'
13624 d_getspnam='$d_getspnam'
13625 d_gettimeod='$d_gettimeod'
13626 d_gnulibc='$d_gnulibc'
13627 d_grpasswd='$d_grpasswd'
13628 d_hasmntopt='$d_hasmntopt'
13631 d_inetaton='$d_inetaton'
13632 d_int64t='$d_int64t'
13633 d_iovec_s='$d_iovec_s'
13634 d_isascii='$d_isascii'
13635 d_killpg='$d_killpg'
13636 d_lchown='$d_lchown'
13637 d_ldbl_dig='$d_ldbl_dig'
13639 d_llseek='$d_llseek'
13640 d_locconv='$d_locconv'
13642 d_longdbl='$d_longdbl'
13643 d_longlong='$d_longlong'
13645 d_madvise='$d_madvise'
13647 d_mbstowcs='$d_mbstowcs'
13648 d_mbtowc='$d_mbtowc'
13649 d_memchr='$d_memchr'
13650 d_memcmp='$d_memcmp'
13651 d_memcpy='$d_memcpy'
13652 d_memmove='$d_memmove'
13653 d_memset='$d_memset'
13655 d_mkfifo='$d_mkfifo'
13656 d_mktime='$d_mktime'
13658 d_mprotect='$d_mprotect'
13660 d_msg_ctrunc='$d_msg_ctrunc'
13661 d_msg_dontroute='$d_msg_dontroute'
13662 d_msg_oob='$d_msg_oob'
13663 d_msg_peek='$d_msg_peek'
13664 d_msg_proxy='$d_msg_proxy'
13665 d_msgctl='$d_msgctl'
13666 d_msgget='$d_msgget'
13667 d_msghdr_s='$d_msghdr_s'
13668 d_msgrcv='$d_msgrcv'
13669 d_msgsnd='$d_msgsnd'
13671 d_munmap='$d_munmap'
13672 d_mymalloc='$d_mymalloc'
13674 d_off64_t='$d_off64_t'
13675 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13676 d_oldpthreads='$d_oldpthreads'
13677 d_oldsock='$d_oldsock'
13679 d_pathconf='$d_pathconf'
13681 d_phostname='$d_phostname'
13684 d_portable='$d_portable'
13685 d_pthread_yield='$d_pthread_yield'
13687 d_pwchange='$d_pwchange'
13688 d_pwclass='$d_pwclass'
13689 d_pwcomment='$d_pwcomment'
13690 d_pwexpire='$d_pwexpire'
13691 d_pwgecos='$d_pwgecos'
13692 d_pwpasswd='$d_pwpasswd'
13693 d_pwquota='$d_pwquota'
13694 d_readdir='$d_readdir'
13695 d_readlink='$d_readlink'
13697 d_recvmsg='$d_recvmsg'
13698 d_rename='$d_rename'
13699 d_rewinddir='$d_rewinddir'
13701 d_safebcpy='$d_safebcpy'
13702 d_safemcpy='$d_safemcpy'
13703 d_sanemcmp='$d_sanemcmp'
13704 d_sched_yield='$d_sched_yield'
13705 d_scm_rights='$d_scm_rights'
13706 d_seekdir='$d_seekdir'
13707 d_select='$d_select'
13709 d_semctl='$d_semctl'
13710 d_semctl_semid_ds='$d_semctl_semid_ds'
13711 d_semctl_semun='$d_semctl_semun'
13712 d_semget='$d_semget'
13714 d_sendmsg='$d_sendmsg'
13715 d_setegid='$d_setegid'
13716 d_seteuid='$d_seteuid'
13717 d_setgrent='$d_setgrent'
13718 d_setgrps='$d_setgrps'
13719 d_sethent='$d_sethent'
13720 d_setlinebuf='$d_setlinebuf'
13721 d_setlocale='$d_setlocale'
13722 d_setnent='$d_setnent'
13723 d_setpent='$d_setpent'
13724 d_setpgid='$d_setpgid'
13725 d_setpgrp2='$d_setpgrp2'
13726 d_setpgrp='$d_setpgrp'
13727 d_setprior='$d_setprior'
13728 d_setpwent='$d_setpwent'
13729 d_setregid='$d_setregid'
13730 d_setresgid='$d_setresgid'
13731 d_setresuid='$d_setresuid'
13732 d_setreuid='$d_setreuid'
13733 d_setrgid='$d_setrgid'
13734 d_setruid='$d_setruid'
13735 d_setsent='$d_setsent'
13736 d_setsid='$d_setsid'
13737 d_setspent='$d_setspent'
13738 d_setvbuf='$d_setvbuf'
13742 d_shmatprototype='$d_shmatprototype'
13743 d_shmctl='$d_shmctl'
13745 d_shmget='$d_shmget'
13746 d_sigaction='$d_sigaction'
13747 d_sigsetjmp='$d_sigsetjmp'
13748 d_socket='$d_socket'
13749 d_sockpair='$d_sockpair'
13751 d_statblks='$d_statblks'
13752 d_statfs='$d_statfs'
13753 d_statfsflags='$d_statfsflags'
13754 d_statvfs='$d_statvfs'
13755 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13756 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13757 d_stdio_stream_array='$d_stdio_stream_array'
13758 d_stdiobase='$d_stdiobase'
13759 d_stdstdio='$d_stdstdio'
13760 d_strchr='$d_strchr'
13761 d_strcoll='$d_strcoll'
13762 d_strctcpy='$d_strctcpy'
13763 d_strerrm='$d_strerrm'
13764 d_strerror='$d_strerror'
13765 d_strtod='$d_strtod'
13766 d_strtol='$d_strtol'
13767 d_strtoul='$d_strtoul'
13768 d_strtoull='$d_strtoull'
13769 d_strxfrm='$d_strxfrm'
13770 d_suidsafe='$d_suidsafe'
13771 d_symlink='$d_symlink'
13772 d_syscall='$d_syscall'
13773 d_sysconf='$d_sysconf'
13774 d_sysernlst='$d_sysernlst'
13775 d_syserrlst='$d_syserrlst'
13776 d_system='$d_system'
13777 d_tcgetpgrp='$d_tcgetpgrp'
13778 d_tcsetpgrp='$d_tcsetpgrp'
13779 d_telldir='$d_telldir'
13780 d_telldirproto='$d_telldirproto'
13783 d_truncate='$d_truncate'
13784 d_tzname='$d_tzname'
13787 d_union_semun='$d_union_semun'
13788 d_vendorbin='$d_vendorbin'
13789 d_vendorlib='$d_vendorlib'
13791 d_void_closedir='$d_void_closedir'
13792 d_voidsig='$d_voidsig'
13793 d_voidtty='$d_voidtty'
13794 d_volatile='$d_volatile'
13795 d_vprintf='$d_vprintf'
13797 d_waitpid='$d_waitpid'
13798 d_wcstombs='$d_wcstombs'
13799 d_wctomb='$d_wctomb'
13800 d_writev='$d_writev'
13803 db_hashtype='$db_hashtype'
13804 db_prefixtype='$db_prefixtype'
13805 defvoidused='$defvoidused'
13806 direntrytype='$direntrytype'
13809 doublesize='$doublesize'
13811 dynamic_ext='$dynamic_ext'
13817 eunicefix='$eunicefix'
13820 extensions='$extensions'
13821 fflushNULL='$fflushNULL'
13822 fflushall='$fflushall'
13824 firstmakefile='$firstmakefile'
13826 fpostype='$fpostype'
13827 freetype='$freetype'
13829 full_csh='$full_csh'
13830 full_sed='$full_sed'
13831 gccversion='$gccversion'
13835 groupcat='$groupcat'
13836 groupstype='$groupstype'
13839 h_sysfile='$h_sysfile'
13843 i_arpainet='$i_arpainet'
13844 i_bsdioctl='$i_bsdioctl'
13847 i_dirent='$i_dirent'
13854 i_inttypes='$i_inttypes'
13855 i_limits='$i_limits'
13856 i_locale='$i_locale'
13857 i_machcthr='$i_machcthr'
13858 i_malloc='$i_malloc'
13860 i_memory='$i_memory'
13861 i_mntent='$i_mntent'
13864 i_neterrno='$i_neterrno'
13865 i_netinettcp='$i_netinettcp'
13868 i_pthread='$i_pthread'
13870 i_rpcsvcdbm='$i_rpcsvcdbm'
13873 i_shadow='$i_shadow'
13875 i_stdarg='$i_stdarg'
13876 i_stddef='$i_stddef'
13877 i_stdlib='$i_stdlib'
13878 i_string='$i_string'
13879 i_sysaccess='$i_sysaccess'
13880 i_sysdir='$i_sysdir'
13881 i_sysfile='$i_sysfile'
13882 i_sysfilio='$i_sysfilio'
13884 i_sysioctl='$i_sysioctl'
13885 i_sysmman='$i_sysmman'
13886 i_sysmount='$i_sysmount'
13887 i_sysndir='$i_sysndir'
13888 i_sysparam='$i_sysparam'
13889 i_sysresrc='$i_sysresrc'
13890 i_syssecrt='$i_syssecrt'
13891 i_sysselct='$i_sysselct'
13892 i_syssockio='$i_syssockio'
13893 i_sysstat='$i_sysstat'
13894 i_sysstatvfs='$i_sysstatvfs'
13895 i_systime='$i_systime'
13896 i_systimek='$i_systimek'
13897 i_systimes='$i_systimes'
13898 i_systypes='$i_systypes'
13899 i_sysuio='$i_sysuio'
13901 i_syswait='$i_syswait'
13902 i_termio='$i_termio'
13903 i_termios='$i_termios'
13905 i_unistd='$i_unistd'
13907 i_values='$i_values'
13908 i_varargs='$i_varargs'
13909 i_varhdr='$i_varhdr'
13911 ignore_versioned_solibs='$ignore_versioned_solibs'
13914 installarchlib='$installarchlib'
13915 installbin='$installbin'
13916 installman1dir='$installman1dir'
13917 installman3dir='$installman3dir'
13918 installprefix='$installprefix'
13919 installprefixexp='$installprefixexp'
13920 installprivlib='$installprivlib'
13921 installscript='$installscript'
13922 installsitearch='$installsitearch'
13923 installsitebin='$installsitebin'
13924 installsitelib='$installsitelib'
13925 installstyle='$installstyle'
13926 installusrbinperl='$installusrbinperl'
13927 installvendorbin='$installvendorbin'
13928 installvendorlib='$installvendorlib'
13930 known_extensions='$known_extensions'
13934 lddlflags='$lddlflags'
13936 ldlibpthname='$ldlibpthname'
13943 libswanted='$libswanted'
13949 locincpth='$locincpth'
13950 loclibpth='$loclibpth'
13951 longdblsize='$longdblsize'
13952 longlongsize='$longlongsize'
13953 longsize='$longsize'
13957 lseeksize='$lseeksize'
13958 lseektype='$lseektype'
13962 make_set_make='$make_set_make'
13963 mallocobj='$mallocobj'
13964 mallocsrc='$mallocsrc'
13965 malloctype='$malloctype'
13967 man1direxp='$man1direxp'
13970 man3direxp='$man3direxp'
13974 mips_type='$mips_type'
13976 mmaptype='$mmaptype'
13978 modetype='$modetype'
13980 multiarch='$multiarch'
13982 myarchname='$myarchname'
13983 mydomain='$mydomain'
13984 myhostname='$myhostname'
13987 netdb_hlen_type='$netdb_hlen_type'
13988 netdb_host_type='$netdb_host_type'
13989 netdb_name_type='$netdb_name_type'
13990 netdb_net_type='$netdb_net_type'
13993 nm_so_opt='$nm_so_opt'
13994 nonxs_ext='$nonxs_ext'
13996 o_nonblock='$o_nonblock'
13998 old_pthread_create_joinable='$old_pthread_create_joinable'
13999 optimize='$optimize'
14000 orderlib='$orderlib'
14006 patchlevel='$patchlevel'
14007 path_sep='$path_sep'
14009 perladmin='$perladmin'
14010 perlpath='$perlpath'
14012 phostname='$phostname'
14015 pm_apiversion='$pm_apiversion'
14019 prefixexp='$prefixexp'
14021 privlibexp='$privlibexp'
14022 prototype='$prototype'
14024 randbits='$randbits'
14025 randfunc='$randfunc'
14026 randseedtype='$randseedtype'
14028 rd_nodata='$rd_nodata'
14032 sPRIEldbl='$sPRIEldbl'
14033 sPRIFldbl='$sPRIFldbl'
14034 sPRIGldbl='$sPRIGldbl'
14037 sPRIeldbl='$sPRIeldbl'
14038 sPRIfldbl='$sPRIfldbl'
14039 sPRIgldbl='$sPRIgldbl'
14044 sched_yield='$sched_yield'
14045 scriptdir='$scriptdir'
14046 scriptdirexp='$scriptdirexp'
14048 seedfunc='$seedfunc'
14049 selectminbits='$selectminbits'
14050 selecttype='$selecttype'
14051 sendmail='$sendmail'
14054 sharpbang='$sharpbang'
14055 shmattype='$shmattype'
14056 shortsize='$shortsize'
14059 sig_count='$sig_count'
14060 sig_name='$sig_name'
14061 sig_name_init='$sig_name_init'
14063 sig_num_init='$sig_num_init'
14064 signal_t='$signal_t'
14065 sitearch='$sitearch'
14066 sitearchexp='$sitearchexp'
14068 sitebinexp='$sitebinexp'
14070 sitelibexp='$sitelibexp'
14071 siteprefix='$siteprefix'
14072 siteprefixexp='$siteprefixexp'
14073 sizetype='$sizetype'
14078 sockethdr='$sockethdr'
14079 socketlib='$socketlib'
14081 spackage='$spackage'
14082 spitshell='$spitshell'
14085 ssizetype='$ssizetype'
14086 startperl='$startperl'
14088 static_ext='$static_ext'
14090 stdio_base='$stdio_base'
14091 stdio_bufsiz='$stdio_bufsiz'
14092 stdio_cnt='$stdio_cnt'
14093 stdio_filbuf='$stdio_filbuf'
14094 stdio_ptr='$stdio_ptr'
14095 stdio_stream_array='$stdio_stream_array'
14098 subversion='$subversion'
14105 timeincl='$timeincl'
14106 timetype='$timetype'
14115 use64bits='$use64bits'
14117 uselargefiles='$uselargefiles'
14118 uselongdouble='$uselongdouble'
14119 usemorebits='$usemorebits'
14120 usemultiplicity='$usemultiplicity'
14121 usemymalloc='$usemymalloc'
14123 useopcode='$useopcode'
14124 useperlio='$useperlio'
14125 useposix='$useposix'
14127 useshrplib='$useshrplib'
14128 usesocks='$usesocks'
14129 usethreads='$usethreads'
14130 usevendorprefix='$usevendorprefix'
14131 usevfork='$usevfork'
14134 vendorbin='$vendorbin'
14135 vendorbinexp='$vendorbinexp'
14136 vendorlib='$vendorlib'
14137 vendorlibexp='$vendorlibexp'
14138 vendorprefix='$vendorprefix'
14139 vendorprefixexp='$vendorprefixexp'
14142 voidflags='$voidflags'
14144 xs_apiversion='$xs_apiversion'
14149 : Add in command line options if available
14150 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14152 : add special variables
14153 $test -f $src/patchlevel.h && \
14154 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14155 echo "CONFIGDOTSH=true" >>config.sh
14157 : propagate old symbols
14158 if $test -f UU/config.sh; then
14159 <UU/config.sh sort | uniq >UU/oldconfig.sh
14160 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14161 sort | uniq -u >UU/oldsyms
14162 set X `cat UU/oldsyms`
14168 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14170 echo "# Variables propagated from previous config.sh file." >>config.sh
14171 for sym in `cat UU/oldsyms`; do
14172 echo " Propagating $hint variable "'$'"$sym..."
14173 eval 'tmp="$'"${sym}"'"'
14175 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14181 : Finish up by extracting the .SH files
14195 If you'd like to make any changes to the config.sh file before I begin
14196 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14199 rp="Press return or use a shell escape to edit config.sh:"
14204 *) : in case they cannot read
14205 sh 1>&4 -c "$ans";;
14210 : if this fails, just run all the .SH files by hand
14217 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14224 Now you need to generate make dependencies by running "$make depend".
14225 You might prefer to run it in background: "$make depend > makedepend.out &"
14226 It can take a while, so you might not want to run it right now.
14231 rp="Run $make depend now?"
14235 $make depend && echo "Now you must run a $make."
14238 echo "You must run '$make depend' then '$make'."
14241 elif test -f [Mm]akefile; then
14243 echo "Now you must run a $make."
14248 if $test -f Policy.sh; then
14251 If you compile $package on a different machine or from a different object
14252 directory, copy the Policy.sh file from this object directory to the
14253 new one before you run Configure -- this will help you with most of
14254 the policy defaults.
14258 if $test -f config.msg; then
14259 echo "Hmm. I also noted the following information while running:"
14261 $cat config.msg >&4
14264 $rm -f kit*isdone ark*isdone