3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Mon Sep 20 22:45:40 EET DST 1999 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
441 d_old_pthread_create_joinable=''
442 old_pthread_create_joinable=''
691 ignore_versioned_solibs=''
812 d_stdio_stream_array=''
813 stdio_stream_array=''
849 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
852 : We must find out about Eunice early
854 if test -f /etc/unixtovms; then
855 eunicefix=/etc/unixtovms
857 if test -f /etc/unixtovms.exe; then
858 eunicefix=/etc/unixtovms.exe
862 : Possible local include directories to search.
863 : Set locincpth to "" in a hint file to defeat local include searches.
864 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
865 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
867 : no include file wanted by default
870 : list of known cpp symbols, sorted alphabetically
871 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
872 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
873 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
874 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
875 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
876 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
877 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
878 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
879 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
880 al="$al VMS Xenix286"
881 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
882 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
883 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
884 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
885 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
886 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
887 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
888 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
889 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
890 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
891 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
892 al="$al __SVR4_2__ __UMAXV__"
893 al="$al ____386BSD____ __alpha __alpha__ __amiga"
894 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
895 al="$al __host_mips__"
896 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
897 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
898 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
899 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
900 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
901 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
902 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
903 al="$al __mc88100 __mc88100__ __mips __mips__"
904 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
905 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
906 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
907 al="$al _host_mips _mips _unix"
908 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
909 al="$al apollo ardent att386 att3b"
910 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
911 al="$al cadmus clipper concurrent convex cray ctix"
912 al="$al dmert encore gcos gcx gimpel gould"
913 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
914 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
915 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
916 al="$al i186 i286 i386 i486 i8086"
917 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
918 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
919 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
920 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
921 al="$al mc88000 mc88100 merlin mert mips mvs n16"
922 al="$al ncl_el ncl_mr"
923 al="$al news1500 news1700 news1800 news1900 news3700"
924 al="$al news700 news800 news900 ns16000 ns32000"
925 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
926 al="$al parisc pc532 pdp11 plexus posix pyr"
927 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
928 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
929 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
930 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
931 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
932 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
935 : Trailing extension. Override this in a hint file, if needed.
937 : Extra object files, if any, needed on this platform.
940 : change the next line if compiling for Xenix/286 on Xenix/386
941 xlibpth='/usr/lib/386 /lib/386'
943 : Possible local library directories to search.
944 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
945 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
947 : general looking path for locating libraries
948 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
949 glibpth="$glibpth /lib /usr/lib $xlibpth"
950 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
951 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
953 : Private path used by Configure to find libraries. Its value
954 : is prepended to libpth. This variable takes care of special
955 : machines, like the mips. Usually, it should be empty.
958 : default library list
960 : some systems want to use only the non-versioned libso:s
961 ignore_versioned_solibs=''
962 : full support for void wanted by default
965 : set useposix=false in your hint file to disable the POSIX extension.
967 : set useopcode=false in your hint file to disable the Opcode extension.
969 : set usemultiplicity on the Configure command line to enable multiplicity.
970 : set usesocks on the Configure command line to enable socks.
971 : set usethreads on the Configure command line to enable threads.
972 : List of libraries we want.
973 : If anyone needs -lnet, put it in a hint file.
974 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
975 libswanted="$libswanted dld ld sun m c cposix posix"
976 libswanted="$libswanted ndir dir crypt sec"
977 libswanted="$libswanted ucb bsd BSD PW x"
978 : We probably want to search /usr/shlib before most other libraries.
979 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
980 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
981 glibpth="/usr/shlib $glibpth"
982 : Do not use vfork unless overridden by a hint file.
985 : Find the basic shell for Bourne shell scripts
989 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
992 if test -f "$xxx"; then
995 : Build up a list and do a single loop so we can 'break' out.
996 pth=`echo $PATH | sed -e "s/$p_/ /g"`
997 for xxx in sh bash ksh pdksh ash; do
999 try="$try ${p}/${xxx}"
1003 if test -f "$xxx"; then
1006 elif test -f "$xxx.exe"; then
1017 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1019 Usually it's in /bin/sh. How did you even get this far?
1020 Please contact me (Perl Maintainers) at perlbug@perl.com and
1021 we'll try to straighten this all out.
1027 : see if sh knows # comments
1028 if `$sh -c '#' >/dev/null 2>&1`; then
1032 test -f $xcat || xcat=/usr/bin/cat
1037 if test -s today; then
1040 echo "#! $xcat" > try
1044 if test -s today; then
1052 echo "Your $sh doesn't grok # comments--I will strip them later on."
1055 echo "exec grep -v '^[ ]*#'" >spitshell
1057 $eunicefix spitshell
1058 spitshell=`pwd`/spitshell
1060 echo "I presume that if # doesn't work, #! won't work either!"
1065 : figure out how to guarantee sh startup
1067 '') startsh=${sharpbang}${sh} ;;
1079 : echo "Yup, it does."
1081 echo "Hmm... '$startsh' does not guarantee sh startup..."
1082 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1087 : Save command line options in file UU/cmdline.opt for later use in
1088 : generating config.sh.
1089 cat > cmdline.opt <<EOSH
1090 # Configure command line arguments.
1097 cat >>cmdline.opt <<EOSH
1098 config_arg$argn='$arg'
1100 argn=`expr $argn + 1`
1103 : produce awk script to parse command line options
1104 cat >options.awk <<'EOF'
1106 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1108 len = length(optstr);
1109 for (i = 1; i <= len; i++) {
1110 c = substr(optstr, i, 1);
1111 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1122 if (substr(str, 1, 1) != "-") {
1123 printf("'%s'\n", str);
1127 for (i = 2; i <= len; i++) {
1128 c = substr(str, i, 1);
1130 printf("-%s\n", substr(str, i));
1136 printf("'%s'\n", substr(str, i + 1));
1149 : process the command line options
1150 set X `for arg in "$@"; do echo "X$arg"; done |
1151 sed -e s/X// | awk -f options.awk`
1156 : set up default values
1166 rm -f optdef.sh posthint.sh
1167 cat >optdef.sh <<EOS
1173 while test $# -gt 0; do
1175 -d) shift; fastread=yes;;
1176 -e) shift; alldone=cont;;
1180 if test -r "$1"; then
1183 echo "$me: cannot read config file $1." >&2
1188 -h) shift; error=true;;
1189 -r) shift; reuseval=true;;
1190 -s) shift; silent=true; realsilent=true;;
1191 -E) shift; alldone=exit;;
1192 -K) shift; knowitall=true;;
1193 -O) shift; override=true;;
1194 -S) shift; silent=true; extractsh=true;;
1199 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1200 echo "$me: ignoring -D $1" >&2
1203 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1204 *) echo "$1='define'" >> optdef.sh;;
1211 *=) echo "$1" >> optdef.sh;;
1213 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1214 echo "$me: ignoring -U $1" >&2
1216 *) echo "$1='undef'" >> optdef.sh;;
1227 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1231 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1232 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1238 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1239 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1240 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1241 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1242 *) xxx=`echo $yyy|sed 's!:.*!!'`
1243 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1249 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1251 echo "$yyy=''" >> posthint.sh ;;
1256 echo "$yyy='$zzz'" >> posthint.sh ;;
1258 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1260 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1265 echo "$yyy=$zzz" >> posthint.sh ;;
1266 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1269 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1272 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1280 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1281 [-U symbol] [-U symbol=] [-A command:symbol...]
1282 -d : use defaults for all answers.
1283 -e : go on without questioning past the production of config.sh.
1284 -f : specify an alternate default configuration file.
1285 -h : print this help message and exit (with an error status).
1286 -r : reuse C symbols value if possible (skips costly nm extraction).
1287 -s : silent mode, only echoes questions and essential information.
1288 -D : define symbol to have some value:
1289 -D symbol symbol gets the value 'define'
1290 -D symbol=value symbol gets the value 'value'
1291 -E : stop at the end of questions, after having produced config.sh.
1292 -K : do not use unless you know what you are doing.
1293 -O : let -D and -U override definitions from loaded configuration file.
1294 -S : perform variable substitutions on all .SH files (can mix with -f)
1295 -U : undefine symbol:
1296 -U symbol symbol gets the value 'undef'
1297 -U symbol= symbol gets completely empty
1298 -A : manipulate symbol after the platform specific hints have been applied:
1299 -A symbol=value append " "value to symbol
1300 -A append:symbol=value append value to symbol
1301 -A define:symbol=value define symbol to have value
1302 -A clear:symbol define symbol to be ''
1303 -A define:symbol define symbol to be 'define'
1304 -A eval:symbol=value define symbol to be eval of value
1305 -A prepend:symbol=value prepend value to symbol
1306 -A undef:symbol define symbol to be 'undef'
1307 -A undef:symbol= define symbol to be ''
1308 -V : print version number and exit (with a zero status).
1315 case "$fastread$alldone" in
1318 if test ! -t 0; then
1319 echo "Say 'sh Configure', not 'sh <Configure'"
1327 true) exec 1>/dev/null;;
1330 : run the defines and the undefines, if any, but leave the file out there...
1333 : create the posthint manipulation script and leave the file out there...
1338 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1339 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1340 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1341 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1342 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1345 : Some greps do not return status, grrr.
1346 echo "grimblepritz" >grimble
1347 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1349 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1355 : the following should work in any shell
1359 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1360 cat >contains <<'EOSS'
1361 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1366 : Find the path to the source tree
1369 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1372 *) src=`cd ../$src && pwd` ;;
1385 if test -f $rsrc/Configure && \
1386 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1388 : found it, so we are ok.
1391 for src in . .. ../.. ../../.. ../../../..; do
1392 if test -f ../$src/Configure && \
1393 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1404 Sorry, I can't seem to locate the source dir for $package. Please start
1405 Configure with an explicit path -- i.e. /some/path/Configure.
1413 echo "Sources for $package found in \"$src\"." >&4
1417 : script used to extract .SH files with variable substitutions
1418 cat >extract <<'EOS'
1420 echo "Doing variable substitutions on .SH files..."
1421 if test -f $src/MANIFEST; then
1422 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1424 echo "(Looking for .SH files under the source directory.)"
1425 set x `(cd $src; find . -name "*.SH" -print)`
1429 0) set x `(cd $src; echo *.SH)`; shift;;
1431 if test ! -f $src/$1; then
1437 while test $name; do
1438 if test ! -d "$name"; then
1439 create="$name $create";
1440 name=`echo $name | sed -e "s|^[^/]*$||"`;
1441 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1446 for file in $create; do
1455 dir=`expr X$file : 'X\(.*\)/'`
1456 file=`expr X$file : 'X.*/\(.*\)'`
1457 (cd $dir && . ./$file)
1467 dir=`expr X$file : 'X\(.*\)/'`
1468 file=`expr X$file : 'X.*/\(.*\)'`
1469 (set x $dir; shift; eval $mkdir_p)
1479 if test -f $src/config_h.SH; then
1480 if test ! -f config.h; then
1481 : oops, they left it out of MANIFEST, probably, so do it anyway.
1487 : extract files and exit if asked to do so
1488 case "$extractsh" in
1490 case "$realsilent" in
1494 case "$config_sh" in
1495 '') config_sh='config.sh';;
1498 echo "Fetching answers from $config_sh..."
1501 test "$override" && . ./optdef.sh
1510 : Eunice requires " " instead of "", can you believe it
1513 echo "Beginning of configuration questions for $package."
1515 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1517 : first determine how to suppress newline on echo command
1519 echo "Checking echo to see how to suppress newlines..."
1520 (echo "hi there\c" ; echo " ") >.echotmp
1521 if $contains c .echotmp >/dev/null 2>&1 ; then
1532 echo $n "The star should be here-->$c"
1536 : Now test for existence of everything in MANIFEST
1538 if test -f $rsrc/MANIFEST; then
1539 echo "First let's make sure your kit is complete. Checking..." >&4
1540 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1543 for filelist in x??; do
1544 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1546 if test -s missing; then
1550 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1552 You have the option of continuing the configuration process, despite the
1553 distinct possibility that your kit is damaged, by typing 'y'es. If you
1554 do, don't blame me if something goes wrong. I advise you to type 'n'o
1555 and contact the author (perlbug@perl.com).
1558 echo $n "Continue? [n] $c" >&4
1562 echo "Continuing..." >&4
1566 echo "ABORTING..." >&4
1571 echo "Looks good..."
1574 echo "There is no MANIFEST file. I hope your kit is complete !"
1579 : Find the appropriate value for a newline for tr
1580 if test -n "$DJGPP"; then
1583 if test X"$trnl" = X; then
1584 case "`echo foo|tr '\n' x 2>/dev/null`" in
1588 if test X"$trnl" = X; then
1589 case "`echo foo|tr '\012' x 2>/dev/null`" in
1590 foox) trnl='\012' ;;
1593 if test X"$trnl" = X; then
1596 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1602 : compute the number of columns on the terminal for proper question formatting
1607 : set up the echo used in my read
1608 myecho="case \"\$xxxm\" in
1609 '') echo $n \"\$rp $c\" >&4;;
1611 '') echo $n \"[\$xxxm] $c\";;
1613 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1615 echo $n \"[\$xxxm] $c\" >&4
1617 echo $n \"\$rp [\$xxxm] $c\" >&4
1623 : now set up to do reads with possible shell escape and default assignment
1629 case "\$fastread" in
1630 yes) case "\$dflt" in
1633 case "\$silent-\$rp" in
1638 *) case "\$silent" in
1639 true) case "\$rp" in
1644 while expr "X\$ans" : "X!" >/dev/null; do
1648 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1656 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1665 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1670 echo "(OK, I'll run with -d after this question.)" >&4
1673 echo "*** Sorry, \$1 not supported yet." >&4
1683 echo "*** Substitution done -- please confirm."
1685 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1690 echo "*** Error -- try again."
1697 case "\$ans\$xxxm\$nostick" in
1709 : create .config dir to save info across Configure sessions
1710 test -d ../.config || mkdir ../.config
1711 cat >../.config/README <<EOF
1712 This directory created by Configure to save information that should
1713 persist across sessions for $package.
1715 You may safely delete it if you wish.
1718 : general instructions
1721 user=`(logname) 2>/dev/null`
1723 '') user=`whoami 2>&1`;;
1725 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1728 rp='Would you like to see the instructions?'
1739 This installation shell script will examine your system and ask you questions
1740 to determine how the perl5 package should be installed. If you get
1741 stuck on a question, you may use a ! shell escape to start a subshell or
1742 execute a command. Many of the questions will have default answers in square
1743 brackets; typing carriage return will give you the default.
1745 On some of the questions which ask for file or directory names you are allowed
1746 to use the ~name construct to specify the login directory belonging to "name",
1747 even if you don't have a shell which knows about that. Questions where this is
1748 allowed will be marked "(~name ok)".
1752 dflt='Type carriage return to continue'
1756 The prompter used in this script allows you to use shell variables and
1757 backticks in your answers. You may use $1, $2, etc... to refer to the words
1758 in the default answer, as if the default line was a set of arguments given to a
1759 script shell. This means you may also use $* to repeat the whole default line,
1760 so you do not have to re-type everything to add something to the default.
1762 Everytime there is a substitution, you will have to confirm. If there is an
1763 error (e.g. an unmatched backtick), the default answer will remain unchanged
1764 and you will be prompted again.
1766 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1767 the questions and use the computed defaults (or the previous answers if there
1768 was already a config.sh file). Type 'Configure -h' for a list of options.
1769 You may also start interactively and then answer '& -d' at any prompt to turn
1770 on the non-interactive behaviour for the remainder of the execution.
1776 Much effort has been expended to ensure that this shell script will run on any
1777 Unix system. If despite that it blows up on yours, your best bet is to edit
1778 Configure and run it again. If you can't run Configure for some reason,
1779 you'll have to generate a config.sh file by hand. Whatever problems you
1780 have, let me (perlbug@perl.com) know how I blew it.
1782 This installation script affects things in two ways:
1784 1) it may do direct variable substitutions on some of the files included
1786 2) it builds a config.h file for inclusion in C programs. You may edit
1787 any of these files as the need arises after running this script.
1789 If you make a mistake on a question, there is no easy way to back up to it
1790 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1791 files. Configure will offer to let you do this before it runs the SH files.
1794 dflt='Type carriage return to continue'
1796 case "$firsttime" in
1797 true) echo $user >>../.config/instruct;;
1801 : find out where common programs are
1803 echo "Locating common programs..." >&4
1816 if test -d \$dir/\$thing; then
1822 for thisthing in \$dir/\$thing; do
1823 : just loop through to pick last item
1825 if test -f \$thisthing; then
1828 elif test -f \$dir/\$thing.exe; then
1829 if test -n "$DJGPP"; then
1830 echo \$dir/\$thing.exe
1832 : on Eunice apparently
1882 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1883 pth="$pth /lib /usr/lib"
1884 for file in $loclist; do
1888 if test -f "$xxx"; then
1891 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1892 xxx=`./loc $file $file $pth`
1895 '') xxx=`./loc $file $file $pth`;;
1896 *) xxx=`./loc $xxx $xxx $pth`;;
1902 echo $file is in $xxx.
1905 echo $file is in $xxx.
1908 echo "I don't know where '$file' is, and my life depends on it." >&4
1909 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1915 echo "Don't worry if any of the following aren't found..."
1917 for file in $trylist; do
1921 if test -f "$xxx"; then
1924 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1925 xxx=`./loc $file $file $pth`
1928 '') xxx=`./loc $file $file $pth`;;
1929 *) xxx=`./loc $xxx $xxx $pth`;;
1935 echo $file is in $xxx.
1938 echo $file is in $xxx.
1941 echo "I don't see $file out there, $say."
1948 echo "Substituting grep for egrep."
1954 echo "Substituting cp for ln."
1960 echo "Hopefully test is built into your sh."
1963 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1964 echo "Using the test built into your sh."
1972 echo "Hopefully echo is built into your sh."
1977 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1978 $echo $n "hi there$c" >foo1
1979 echo $n "hi there$c" >foo2
1980 if cmp foo1 foo2 >/dev/null 2>&1; then
1981 echo "They are compatible. In fact, they may be identical."
1988 They are not compatible! You are probably running ksh on a non-USG system.
1989 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1990 have echo built in and we may have to run some Bourne shell scripts. That
1991 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1994 $echo $n "The star should be here-->$c"
2001 : determine whether symbolic links are supported
2004 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2005 echo "Symbolic links are supported." >&4
2008 echo "Symbolic links are NOT supported." >&4
2013 : see whether [:lower:] and [:upper:] are supported character classes
2015 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2017 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2021 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2022 # (0xc9 and 0xd1), therefore that is a nice testing point.
2023 if test "X$up" = X -o "X$low" = X; then
2024 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2030 if test "X$up" = X -o "X$low" = X; then
2031 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2037 if test "X$up" = X -o "X$low" = X; then
2038 case "`echo IJ | od -x 2>/dev/null`" in
2040 echo "Hey, this might be EBCDIC." >&4
2041 if test "X$up" = X -o "X$low" = X; then
2042 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2043 ij) up='[A-IJ-RS-Z]'
2048 if test "X$up" = X -o "X$low" = X; then
2049 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2059 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2061 echo "Using $up and $low to convert case." >&4
2064 echo "I don't know how to translate letters from upper to lower case." >&4
2065 echo "Your tr is not acting any way I know of." >&4
2069 : set up the translation script tr, must be called with ./tr of course
2073 '[A-Z][a-z]') exec $tr '$up' '$low';;
2074 '[a-z][A-Z]') exec $tr '$low' '$up';;
2081 : Try to determine whether config.sh was made on this system
2082 case "$config_sh" in
2084 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2085 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2086 # because the A-Z/a-z are not consecutive.
2087 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2088 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2089 newmyuname="$myuname"
2091 case "$knowitall" in
2093 if test -f ../config.sh; then
2094 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2095 eval "`grep myuname= ../config.sh`"
2097 if test "X$myuname" = "X$newmyuname"; then
2105 : Get old answers from old config file if Configure was run on the
2106 : same system, otherwise use the hints.
2109 if test -f config.sh; then
2111 rp="I see a config.sh file. Shall I use it to set the defaults?"
2114 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2115 *) echo "Fetching default answers from your old config.sh file..." >&4
2123 : Older versions did not always set $sh. Catch re-use of such
2132 if test ! -f config.sh; then
2135 First time through, eh? I have some defaults handy for some systems
2136 that need some extra help getting the Configure answers right:
2139 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2141 : Half the following guesses are probably wrong... If you have better
2142 : tests or hints, please send them to perlbug@perl.com
2143 : The metaconfig authors would also appreciate a copy...
2144 $test -f /irix && osname=irix
2145 $test -f /xenix && osname=sco_xenix
2146 $test -f /dynix && osname=dynix
2147 $test -f /dnix && osname=dnix
2148 $test -f /lynx.os && osname=lynxos
2149 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2150 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2151 $test -f /bin/mips && /bin/mips && osname=mips
2152 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2153 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2154 $test -d /usr/apollo/bin && osname=apollo
2155 $test -f /etc/saf/_sactab && osname=svr4
2156 $test -d /usr/include/minix && osname=minix
2157 if $test -d /MachTen -o -d /MachTen_Folder; then
2159 if $test -x /sbin/version; then
2160 osvers=`/sbin/version | $awk '{print $2}' |
2161 $sed -e 's/[A-Za-z]$//'`
2162 elif $test -x /usr/etc/version; then
2163 osvers=`/usr/etc/version | $awk '{print $2}' |
2164 $sed -e 's/[A-Za-z]$//'`
2169 $test -f /sys/posix.dll &&
2170 $test -f /usr/bin/what &&
2171 set X `/usr/bin/what /sys/posix.dll` &&
2172 $test "$3" = UWIN &&
2175 if $test -f $uname; then
2183 umips) osname=umips ;;
2186 [23]100) osname=mips ;;
2187 next*) osname=next ;;
2189 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2190 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2193 elif $test -f /etc/kconfig; then
2195 if test "$lns" = "$ln -s"; then
2197 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2199 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2206 if test -n "$DJGPP"; then
2215 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2217 'not found') osvers="$4"."$3" ;;
2218 '<3240'|'<>3240') osvers=3.2.0 ;;
2219 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2220 '=3250'|'>3250') osvers=3.2.5 ;;
2224 *dc.osx) osname=dcosx
2230 domainos) osname=apollo
2236 dynixptx*) osname=dynixptx
2237 osvers=`echo "$4"|sed 's/^v//'`
2239 freebsd) osname=freebsd
2241 genix) osname=genix ;;
2243 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2259 netbsd*) osname=netbsd
2262 news-os) osvers="$3"
2264 4*) osname=newsos4 ;;
2268 bsd386) osname=bsd386
2271 POSIX-BC | posix-bc ) osname=posix-bc
2274 powerux | power_ux | powermax_os | powermaxos | \
2275 powerunix | power_unix) osname=powerux
2278 next*) osname=next ;;
2279 solaris) osname=solaris
2281 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2288 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2292 titanos) osname=titanos
2301 ultrix) osname=ultrix
2304 osf1|mls+) case "$5" in
2307 osvers=`echo "$3" | sed 's/^[xvt]//'`
2309 hp*) osname=hp_osf1 ;;
2310 mips) osname=mips_osf1 ;;
2319 $2) case "$osname" in
2323 : svr4.x or possibly later
2333 if test -f /stand/boot ; then
2334 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2335 if test -n "$INITPROG" -a -f "$INITPROG"; then
2336 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2337 if test -n "$isesix"; then
2345 *) if test -f /etc/systemid; then
2347 set `echo $3 | $sed 's/\./ /g'` $4
2348 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2350 elif $test -f $src/hints/sco_$1_$2.sh; then
2352 elif $test -f $src/hints/sco_$1.sh; then
2357 '') : Still unknown. Probably a generic Sys V.
2366 *) case "$osname" in
2367 '') : Still unknown. Probably a generic BSD.
2375 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2376 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2377 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2380 $rm -f UU/kernel.what
2381 elif test -d c:/.; then
2388 : Now look for a hint file osname_osvers, unless one has been
2389 : specified already.
2392 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2393 : Also try without trailing minor version numbers.
2394 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2395 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2396 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2397 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2400 *) case "$osvers" in
2403 *) if $test -f $src/hints/$file.sh ; then
2405 elif $test -f $src/hints/$xfile.sh ; then
2407 elif $test -f $src/hints/$xxfile.sh ; then
2409 elif $test -f $src/hints/$xxxfile.sh ; then
2411 elif $test -f $src/hints/$xxxxfile.sh ; then
2413 elif $test -f "$src/hints/${osname}.sh" ; then
2422 if $test -f Policy.sh ; then
2425 none) dflt="Policy" ;;
2426 *) dflt="Policy $dflt" ;;
2431 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2435 if $test -f Policy.sh ; then
2438 There's also a Policy hint file available, which should make the
2439 site-specific (policy) questions easier to answer.
2446 You may give one or more space-separated answers, or "none" if appropriate.
2447 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2448 is a good thing. DO NOT give a wrong version or a wrong OS.
2452 rp="Which of these apply, if any?"
2455 for file in $tans; do
2456 if $test X$file = XPolicy -a -f Policy.sh; then
2458 $cat Policy.sh >> UU/config.sh
2459 elif $test -f $src/hints/$file.sh; then
2460 . $src/hints/$file.sh
2461 $cat $src/hints/$file.sh >> UU/config.sh
2462 elif $test X$tans = X -o X$tans = Xnone ; then
2465 : Give one chance to correct a possible typo.
2466 echo "$file.sh does not exist"
2468 rp="hint to use instead?"
2470 for file in $ans; do
2471 if $test -f "$src/hints/$file.sh"; then
2472 . $src/hints/$file.sh
2473 $cat $src/hints/$file.sh >> UU/config.sh
2474 elif $test X$ans = X -o X$ans = Xnone ; then
2477 echo "$file.sh does not exist -- ignored."
2484 : Remember our hint file for later.
2485 if $test -f "$src/hints/$file.sh" ; then
2495 echo "Fetching default answers from $config_sh..." >&4
2499 cp $config_sh config.sh 2>/dev/null
2509 test "$override" && . ./optdef.sh
2510 myuname="$newmyuname"
2512 : Restore computed paths
2513 for file in $loclist $trylist; do
2514 eval $file="\$_$file"
2519 Configure uses the operating system name and version to set some defaults.
2520 The default value is probably right if the name rings a bell. Otherwise,
2521 since spelling matters for me, either accept the default or answer "none"
2528 ''|' '|none) dflt=none ;;
2529 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2532 *) dflt="$osname" ;;
2534 rp="Operating system name?"
2538 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2544 ''|' '|none) dflt=none ;;
2545 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2546 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2548 ''|' ') dflt=none ;;
2553 *) dflt="$osvers" ;;
2555 rp="Operating system version?"
2565 : who configured the system
2566 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2567 cf_by=`(logname) 2>/dev/null`
2570 cf_by=`(whoami) 2>/dev/null`
2572 "") cf_by=unknown ;;
2576 : set up the script used to warn in case of inconsistency
2583 echo "*** WHOA THERE!!! ***" >&4
2584 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2585 rp=" Keep the $hint value?"
2588 y) td=$was; tu=$was;;
2592 : function used to set $1 to $val
2593 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2595 $define$undef) . ./whoa; eval "$var=\$td";;
2596 $undef$define) . ./whoa; eval "$var=\$tu";;
2597 *) eval "$var=$val";;
2602 Perl can be built to take advantage of threads, on some systems.
2603 To do so, Configure must be run with -Dusethreads.
2605 Note that threading is a highly experimental feature, and
2606 some known race conditions still remain. If you choose to try
2607 it, be very sure to not actually deploy it for production
2608 purposes. README.threads has more details, and is required
2609 reading if you enable threads.
2611 case "$usethreads" in
2612 $define|true|[yY]*) dflt='y';;
2615 rp='Build a threading Perl?'
2618 y|Y) val="$define" ;;
2624 case "$d_oldpthreads" in
2625 '') : Configure tests would be welcome here. For now, assume undef.
2627 *) val="$d_oldpthreads" ;;
2633 case "$usethreads" in
2634 "$define"|true|[yY]*)
2635 : Look for a hint-file generated 'call-back-unit'. If the
2636 : user has specified that a threading perl is to be built,
2637 : we may need to set or change some other defaults.
2638 if $test -f usethreads.cbu; then
2639 echo "Your platform has some specific hints for threaded builds, using them..."
2643 (Your platform doesn't have any specific hints for threaded builds.
2644 Assuming POSIX threads, then.)
2652 Perl can be built so that multiple Perl interpreters can coexist
2653 within the same Perl executable. To do so, Configure must be run with
2656 Normally you do not need this and you should answer no.
2659 case "$usemultiplicity" in
2660 $define|true|[yY]*) dflt='y';;
2663 rp='Build Perl for multiplicity?'
2666 y|Y) val="$define" ;;
2672 : determine where manual pages are on this system
2676 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2677 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2678 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2679 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2680 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2681 sysman=`./loc . /usr/man/man1 $syspath`
2684 if $test -d "$sysman"; then
2685 echo "System manual is in $sysman." >&4
2687 echo "Could not find manual pages in source form." >&4
2690 : see what memory models we can support
2693 $cat >pdp11.c <<'EOP'
2702 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2703 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2704 dflt='unsplit split'
2706 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2709 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2714 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2717 if $test -d /lib/large || $test -d /usr/lib/large; then
2720 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2729 Some systems have different model sizes. On most systems they are called
2730 small, medium, large, and huge. On the PDP11 they are called unsplit and
2731 split. If your system doesn't support different memory models, say "none".
2732 If you wish to force everything to one memory model, say "none" here and
2733 put the appropriate flags later when it asks you for other cc and ld flags.
2734 Venix systems may wish to put "none" and let the compiler figure things out.
2735 (In the following question multiple model names should be space separated.)
2737 The default for most systems is "none".
2740 rp="Which memory models are supported?"
2755 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2756 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2763 rp="What flag indicates separate I and D space?"
2771 *large*|*small*|*medium*|*huge*)
2778 rp="What flag indicates large model?"
2788 *huge*) case "$huge" in
2792 rp="What flag indicates huge model?"
2802 *medium*) case "$medium" in
2806 rp="What flag indicates medium model?"
2813 *) medium="$large";;
2816 *small*) case "$small" in
2820 rp="What flag indicates small model?"
2831 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2834 $rm -f pdp11.* pdp11
2836 : make some quick guesses about what we are up against
2838 $echo $n "Hmm... $c"
2848 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2849 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2851 echo "Looks kind of like an OSF/1 system, but we'll see..."
2853 elif test `echo abc | tr a-z A-Z` = Abc ; then
2854 xxx=`./loc addbib blurfl $pth`
2855 if $test -f $xxx; then
2856 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2860 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2861 echo "Looks kind of like an extended USG system, but we'll see..."
2863 echo "Looks kind of like a USG system, but we'll see..."
2867 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2868 echo "Looks kind of like a BSD system, but we'll see..."
2872 echo "Looks kind of like a Version 7 system, but we'll see..."
2875 case "$eunicefix" in
2878 There is, however, a strange, musty smell in the air that reminds me of
2879 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2883 : it so happens the Eunice I know will not run shell scripts in Unix format
2887 echo "Congratulations. You aren't running Eunice."
2891 : Detect OS2. The p_ variable is set above in the Head.U unit.
2896 I have the feeling something is not exactly right, however...don't tell me...
2897 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2902 if test -f /xenix; then
2903 echo "Actually, this looks more like a XENIX system..."
2908 echo "It's not Xenix..."
2913 if test -f /venix; then
2914 echo "Actually, this looks more like a VENIX system..."
2921 echo "Nor is it Venix..."
2924 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2925 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2928 : see if we need a special compiler
2936 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2937 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2951 On some older systems the default C compiler will not resolve multiple global
2952 references that happen to have the same name. On some such systems the "Mcc"
2953 command may be used to force these to be resolved. On other systems a "cc -M"
2954 command is required. (Note that the -M flag on other systems indicates a
2955 memory model to use!) If you have the Gnu C compiler, you might wish to use
2961 rp="Use which C compiler?"
2969 rp="Use which C compiler?"
2973 : Look for a hint-file generated 'call-back-unit'. Now that the
2974 : user has specified the compiler, we may need to set or change some
2976 if $test -f cc.cbu; then
2980 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2981 $cat >gccvers.c <<EOM
2986 printf("%s\n", __VERSION__);
2988 printf("%s\n", "1");
2994 if $cc -o gccvers gccvers.c; then
2995 gccversion=`./gccvers`
2996 case "$gccversion" in
2997 '') echo "You are not using GNU cc." ;;
2998 *) echo "You are using GNU cc $gccversion." ;;
3002 echo "*** WHOA THERE!!! ***" >&4
3003 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3004 case "$knowitall" in
3006 echo " You'd better start hunting for one and let me know about it." >&4
3012 case "$gccversion" in
3013 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3017 case "$usemorebits" in
3018 "$define"|true|[yY]*)
3020 uselongdouble="$define"
3021 usemorebits="$define"
3023 *) usemorebits="$undef"
3030 Perl can be built to understand large files (files larger than 2 gigabytes)
3031 on some systems. To do so, Configure must be run with -Duselfs.
3033 If this doesn't make any sense to you, just accept the default.
3036 "$define"|true|[yY]*) dflt='y' ;;
3039 rp='Try to understand large files?'
3042 y|Y) val="$define" ;;
3048 "$define") use64bits="$define" ;;
3053 Perl can be built to take advantage of explicit 64-bit interfaces,
3054 on some systems. To do so, Configure must be run with -Duse64bits.
3056 If this doesn't make any sense to you, just accept the default.
3058 case "$use64bits" in
3059 $define|true|[yY]*) dflt='y';;
3062 rp='Try to use explicit 64-bit interfaces, if available?'
3075 case "$archname64" in
3076 '') archname64='' ;; # not a typo
3079 case "$use64bits" in
3080 "$define"|true|[yY]*)
3081 : Look for a hint-file generated 'call-back-unit'. If the
3082 : user has specified that a 64 bit perl is to be built,
3083 : we may need to set or change some other defaults.
3084 if $test -f use64bits.cbu; then
3085 echo "Your platform has some specific hints for 64-bit builds, using them..."
3089 (Your platform doesn't have any specific hints for 64-bit builds.
3090 This is probably okay, especially if your system is a true 64-bit system.)
3092 case "$gccversion" in
3095 But since you seem to be using gcc,
3096 I will now add -DUSE_LONG_LONG to the compilation flags.
3098 ccflags="$ccflags -DUSE_LONG_LONG"
3105 : determine the architecture name
3107 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3108 tarch=`arch`"-$osname"
3109 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3110 if uname -m > tmparch 2>&1 ; then
3111 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3112 -e 's/$/'"-$osname/" tmparch`
3120 case "$myarchname" in
3123 echo "(Your architecture name used to be $myarchname.)"
3130 *) dflt="$archname";;
3132 rp='What is your architecture name'
3135 case "$usethreads" in
3137 echo "Threads selected." >&4
3139 *-thread*) echo "...and architecture name already has -thread." >&4
3141 *) archname="$archname-thread"
3142 echo "...setting architecture name to $archname." >&4
3147 case "$usemultiplicity" in
3149 echo "Multiplicity selected." >&4
3151 *-multi*) echo "...and architecture name already has -multi." >&4
3153 *) archname="$archname-multi"
3154 echo "...setting architecture name to $archname." >&4
3159 case "$use64bits" in
3161 echo "Explicit 64-bitness selected." >&4
3162 case "$archname64" in
3167 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3169 *) archname="$archname-$archname64"
3170 echo "...setting architecture name to $archname." >&4
3177 : decide how portable to be. Allow command line overrides.
3178 case "$d_portable" in
3180 *) d_portable="$define" ;;
3183 : set up shell script to do ~ expansion
3189 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3192 if $test -f /bin/csh; then
3193 /bin/csh -f -c "glob \$1"
3198 name=\`$expr x\$1 : '..\([^/]*\)'\`
3199 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3200 if $test ! -d "\$dir"; then
3202 echo "\$me: can't locate home directory for: \$name" >&2
3207 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3223 : now set up to get a file name
3227 cat <<'EOSC' >>getfile
3243 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3244 fn=`echo $fn | sed 's/(.*)//'`
3250 loc_file=`expr $fn : '.*:\(.*\)'`
3251 fn=`expr $fn : '\(.*\):.*'`
3259 */*) fullpath=true;;
3268 *e*) exp_file=true;;
3271 *p*) nopath_ok=true;;
3276 *d*) type='Directory';;
3277 *l*) type='Locate';;
3282 Locate) what='File';;
3287 case "$d_portable" in
3295 while test "$type"; do
3300 true) rp="$rp (~name ok)";;
3303 if test -f UU/getfile.ok && \
3304 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3323 value=`UU/filexp $ans`
3326 if test "$ans" != "$value"; then
3327 echo "(That expands to $value on this system.)"
3341 /*) value="$ansexp" ;;
3346 echo "I shall only accept a full path name, as in /bin/ls." >&4
3347 echo "Use a ! shell escape if you wish to check pathnames." >&4
3350 echo "Please give a full path name, starting with slash." >&4
3353 echo "Note that using ~name is ok provided it expands well." >&4
3366 for fp in $gfpth; do
3367 if test "X$fp" = X.; then
3372 if test -f "$pf"; then
3374 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3376 echo "($value is not a plain file, but that's ok.)"
3379 if test X"$type" = X; then
3386 for fp in $gfpth; do
3387 if test "X$fp" = X.; then
3392 if test -d "$pf"; then
3400 if test -d "$ansexp"; then
3401 echo "(Looking for $loc_file in directory $value.)"
3402 value="$value/$loc_file"
3403 ansexp="$ansexp/$loc_file"
3405 if test -f "$ansexp"; then
3408 case "$nopath_ok" in
3409 true) case "$value" in
3411 *) echo "Assuming $value will be in people's path."
3427 if test "$fastread" = yes; then
3432 rp="$what $value doesn't exist. Use that name anyway?"
3451 test "X$gfpthkeep" != Xy && gfpth=""
3454 : determine root of directory hierarchy where package will be installed.
3457 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3465 By default, $package will be installed in $dflt/bin, manual pages
3466 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3467 installation directories. Typically this is something like /usr/local.
3468 If you wish to have binaries under /usr/bin but other parts of the
3469 installation under /usr/local, that's ok: you will be prompted
3470 separately for each of the installation directories, the prefix being
3471 only used to set the defaults.
3475 rp='Installation prefix to use?'
3483 *) oldprefix="$prefix";;
3493 $define|true) afs=true ;;
3494 $undef|false) afs=false ;;
3495 *) if test -d /afs; then
3503 echo "AFS may be running... I'll be extra cautious then..." >&4
3505 echo "AFS does not seem to be running..." >&4
3508 : determine installation prefix for where package is to be installed.
3512 Since you are running AFS, I need to distinguish the directory in which
3513 files will reside from the directory in which they are installed (and from
3514 which they are presumably copied to the former directory by occult means).
3517 case "$installprefix" in
3518 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3519 *) dflt="$installprefix";;
3524 In some special cases, particularly when building $package for distribution,
3525 it is convenient to distinguish between the directory in which files should
3526 be installed from the directory ($prefix) in which they
3527 will eventually reside. For most users, these two directories are the same.
3530 case "$installprefix" in
3532 *) dflt=$installprefix;;
3536 rp='What installation prefix should I use for installing files?'
3538 installprefix="$ans"
3539 installprefixexp="$ansexp"
3541 : set the prefixit variable, to compute a suitable default value
3542 prefixit='case "$3" in
3544 case "$oldprefix" in
3545 "") eval "$1=\"\$$2\"";;
3552 ""|" ") eval "$1=\"\$$2\"";;
3558 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3560 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3561 /*-$oldprefix/*|\~*-$oldprefix/*)
3562 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3563 *) eval "$1=\"\$$2\"";;
3567 : set the base revision
3570 : get the patchlevel
3572 echo "Getting the current patchlevel..." >&4
3573 if $test -r $rsrc/patchlevel.h;then
3574 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3575 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3580 $echo $n "(You have $package" $c
3583 *) $echo $n " $baserev" $c ;;
3585 $echo $n " patchlevel $patchlevel" $c
3586 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3589 if test 0 -eq "$subversion"; then
3590 version=`LC_ALL=C; export LC_ALL; \
3591 echo $baserev $patchlevel | \
3592 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3594 version=`LC_ALL=C; export LC_ALL; \
3595 echo $baserev $patchlevel $subversion | \
3596 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3598 : Figure out perl API version. Perhaps this should be in patchlevel.h
3599 if test "$subversion" -lt 50; then
3600 apiversion=`LC_ALL=C; export LC_ALL; \
3601 LANGUAGE=C; export LANGUAGE; \
3602 echo $baserev $patchlevel | \
3603 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3605 apiversion="$version"
3608 : determine installation style
3609 : For now, try to deduce it from prefix unless it is already set.
3610 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3611 case "$installstyle" in
3612 '') case "$prefix" in
3613 *perl*) dflt='lib';;
3614 *) dflt='lib/perl5' ;;
3617 *) dflt='lib/perl5' ;;
3619 : Probably not worth prompting for this since we prompt for all
3620 : the directories individually, and the prompt would be too long and
3624 : determine where private library files go
3625 : Usual default is /usr/local/lib/perl5/$version.
3626 : Also allow things like /opt/perl/lib/$version, since
3627 : /opt/perl/lib/perl5... would be redundant.
3628 : The default "style" setting is made in installstyle.U
3629 case "$installstyle" in
3630 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3631 *) set dflt privlib lib/$version ;;
3636 There are some auxiliary files for $package that need to be put into a
3637 private library directory that is accessible by everyone.
3641 rp='Pathname where the private library files will reside?'
3644 privlibexp="$ansexp"
3645 : Change installation prefix, if necessary.
3646 if $test X"$prefix" != X"$installprefix"; then
3647 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3649 installprivlib="$privlibexp"
3652 : set the prefixup variable, to restore leading tilda escape
3653 prefixup='case "$prefixexp" in
3655 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3658 : determine where public architecture dependent libraries go
3661 : privlib default is /usr/local/lib/$package/$version
3662 : archlib default is /usr/local/lib/$package/$version/$archname
3663 : privlib may have an optional trailing /share.
3664 tdflt=`echo $privlib | $sed 's,/share$,,'`
3665 tdflt=$tdflt/$archname
3674 $spackage contains architecture-dependent library files. If you are
3675 sharing libraries in a heterogeneous environment, you might store
3676 these files in a separate location. Otherwise, you can just include
3677 them with the rest of the public library files.
3681 rp='Where do you want to put the public architecture-dependent libraries?'
3684 archlibexp="$ansexp"
3685 if $test X"$archlib" = X"$privlib"; then
3690 : Change installation prefix, if necessary.
3691 if $test X"$prefix" != X"$installprefix"; then
3692 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3694 installarchlib="$archlibexp"
3698 : Binary compatibility with 5.005 is not possible for builds
3699 : with advanced features
3700 case "$usethreads$usemultiplicity" in
3702 bincompat5005="$undef"
3703 d_bincompat5005="$undef"
3707 Perl 5.006 can be compiled for binary compatibility with 5.005.
3708 If you decide to do so, you will be able to continue using most
3709 of the extensions that were compiled for Perl 5.005.
3712 case "$bincompat5005$d_bincompat5005" in
3713 *"$undef"*) dflt=n ;;
3716 rp='Binary compatibility with Perl 5.005?'
3719 y*) val="$define" ;;
3724 case "$d_bincompat5005" in
3726 bincompat5005="$define"
3728 *) bincompat5005="$undef"
3729 d_bincompat5005="$undef"
3736 : see if setuid scripts can be secure
3739 Some kernels have a bug that prevents setuid #! scripts from being
3740 secure. Some sites have disabled setuid #! scripts because of this.
3742 First let's decide if your kernel supports secure setuid #! scripts.
3743 (If setuid #! scripts would be secure but have been disabled anyway,
3744 don't say that they are secure if asked.)
3749 if $test -d /dev/fd; then
3750 echo "#!$ls" >reflect
3751 chmod +x,u+s reflect
3752 ./reflect >flect 2>&1
3753 if $contains "/dev/fd" flect >/dev/null; then
3754 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3758 If you are not sure if they are secure, I can check but I'll need a
3759 username and password different from the one you are using right now.
3760 If you don't have such a username or don't want me to test, simply
3764 rp='Other username to test security of setuid scripts with?'
3769 case "$d_suidsafe" in
3770 '') echo "I'll assume setuid scripts are *not* secure." >&4
3773 echo "Well, the $hint value is *not* secure." >&4
3775 *) echo "Well, the $hint value *is* secure." >&4
3780 $rm -f reflect flect
3781 echo "#!$ls" >reflect
3782 chmod +x,u+s reflect
3785 echo '"su" will (probably) prompt you for '"$ans's password."
3786 su $ans -c './reflect >flect'
3787 if $contains "/dev/fd" flect >/dev/null; then
3788 echo "Okay, it looks like setuid scripts are secure." >&4
3791 echo "I don't think setuid scripts are secure." >&4
3796 rp='Does your kernel have *secure* setuid scripts?'
3799 [yY]*) val="$define";;
3804 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3805 echo "(That's for file descriptors, not floppy disks.)"
3811 $rm -f reflect flect
3813 : now see if they want to do setuid emulation
3816 case "$d_suidsafe" in
3819 echo "No need to emulate SUID scripts since they are secure here." >& 4
3823 Some systems have disabled setuid scripts, especially systems where
3824 setuid scripts cannot be secure. On systems where setuid scripts have
3825 been disabled, the setuid/setgid bits on scripts are currently
3826 useless. It is possible for $package to detect those bits and emulate
3827 setuid/setgid in a secure fashion. This emulation will only work if
3828 setuid scripts have been disabled in your kernel.
3832 "$define") dflt=y ;;
3835 rp="Do you want to do setuid/setgid emulation?"
3838 [yY]*) val="$define";;
3846 : What should the include directory be ?
3848 $echo $n "Hmm... $c"
3852 if $test -f /bin/mips && /bin/mips; then
3853 echo "Looks like a MIPS system..."
3854 $cat >usr.c <<'EOCP'
3855 #ifdef SYSTYPE_BSD43
3859 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3860 dflt='/bsd43/usr/include'
3864 mips_type='System V'
3866 $rm -f usr.c usr.out
3867 echo "and you're compiling with the $mips_type compiler and libraries."
3871 echo "Doesn't look like a MIPS system."
3881 case "$xxx_prompt" in
3884 rp='Where are the include files you want to use?'
3892 : see how we invoke the C preprocessor
3894 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3895 cat <<'EOT' >testcpp.c
3901 if test ! -f cppstdin; then
3902 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3903 # AIX cc -E doesn't show the absolute headerfile
3904 # locations but we'll cheat by using the -M flag.
3905 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
3907 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3910 echo "Keeping your $hint cppstdin wrapper."
3913 wrapper=`pwd`/cppstdin
3917 if $test "X$cppstdin" != "X" && \
3918 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3919 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3921 echo "You used to use $cppstdin $cppminus so we'll use that again."
3923 '') echo "But let's see if we can live without a wrapper..." ;;
3925 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3926 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3928 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3931 echo "(However, $cpprun $cpplast does not work, let's see...)"
3939 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3946 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3947 $cc -E <testcpp.c >testcpp.out 2>&1; \
3948 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3949 echo "Yup, it does."
3952 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3953 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3954 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3955 echo "Yup, it does."
3958 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3959 $cc -P <testcpp.c >testcpp.out 2>&1; \
3960 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3961 echo "Yipee, that works!"
3964 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3965 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3966 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3967 echo "At long last!"
3970 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3971 $cpp <testcpp.c >testcpp.out 2>&1; \
3972 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3976 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3977 $cpp - <testcpp.c >testcpp.out 2>&1; \
3978 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3979 echo "Hooray, it works! I was beginning to wonder."
3982 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3983 $wrapper <testcpp.c >testcpp.out 2>&1; \
3984 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3990 rp="No dice. I can't find a C preprocessor. Name one:"
3994 $x_cpp <testcpp.c >testcpp.out 2>&1
3995 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3996 echo "OK, that will do." >&4
3998 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4013 echo "Perhaps can we force $cc -E using a wrapper..."
4014 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4015 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4021 echo "Nope, we'll have to live without it..."
4035 "$wrapper"|'cppstdin') ;;
4036 *) $rm -f $wrapper;;
4038 $rm -f testcpp.c testcpp.out
4040 : Set private lib path
4043 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4048 '') dlist="$loclibpth $plibpth $glibpth";;
4049 *) dlist="$libpth";;
4052 : Now check and see which directories actually exist, avoiding duplicates
4056 if $test -d $xxx; then
4059 *) libpth="$libpth $xxx";;
4065 Some systems have incompatible or broken versions of libraries. Among
4066 the directories listed in the question below, please remove any you
4067 know not to be holding relevant libraries, and add any that are needed.
4068 Say "none" for none.
4079 rp="Directories to use for library searches?"
4086 : compute shared library extension
4089 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4099 On some systems, shared libraries may be available. Answer 'none' if
4100 you want to suppress searching of shared libraries for the remaining
4101 of this configuration.
4104 rp='What is the file extension used for shared libraries?'
4108 : Define several unixisms.
4109 : Hints files or command line option can be used to override them.
4110 : The convoluted testing is in case hints files set either the old
4113 '') case "$exe_ext" in
4115 *) _exe="$exe_ext" ;;
4120 '') case "$lib_ext" in
4127 '') case "$obj_ext" in
4134 '') case "$path_sep" in
4145 : Which makefile gets called first. This is used by make depend.
4146 case "$firstmakefile" in
4147 '') firstmakefile='makefile';;
4152 Perl can be built to use the SOCKS proxy protocol library. To do so,
4153 Configure must be run with -Dusesocks.
4155 Normally you do not need this and you should answer no.
4159 $define|true|[yY]*) dflt='y';;
4162 rp='Build Perl for SOCKS?'
4165 y|Y) val="$define" ;;
4171 : Looking for optional libraries
4173 echo "Checking for optional libraries..." >&4
4178 case "$libswanted" in
4179 '') libswanted='c_s';;
4183 libswanted="$libswanted socks5 socks5_sh"
4186 for thislib in $libswanted; do
4188 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4189 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4190 echo "Found -l$thislib (shared)."
4193 *) dflt="$dflt -l$thislib";;
4195 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4196 echo "Found -l$thislib (shared)."
4199 *) dflt="$dflt -l$thislib";;
4201 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4202 echo "Found -l$thislib."
4205 *) dflt="$dflt -l$thislib";;
4207 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4208 echo "Found -l$thislib."
4211 *) dflt="$dflt -l$thislib";;
4213 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4214 echo "Found -l${thislib}_s."
4217 *) dflt="$dflt -l${thislib}_s";;
4219 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4220 echo "Found -l$thislib."
4223 *) dflt="$dflt -l$thislib";;
4226 echo "No -l$thislib."
4237 ' '|'') dflt='none';;
4242 In order to compile $package on your machine, a number of libraries
4243 are usually needed. Include any other special libraries here as well.
4244 Say "none" for none. The default list is almost always right.
4248 rp="What libraries to use?"
4255 : determine optimization, if desired, or use for debug flag also
4257 ' '|$undef) dflt='none';;
4259 *) dflt="$optimize";;
4263 By default, $package compiles with the -O flag to use the optimizer.
4264 Alternately, you might want to use the symbolic debugger, which uses
4265 the -g flag (on traditional Unix systems). Either flag can be
4266 specified here. To use neither flag, specify the word "none".
4269 rp="What optimizer/debugger flag should be used?"
4273 'none') optimize=" ";;
4277 : We will not override a previous value, but we might want to
4278 : augment a hint file
4280 default|recommended)
4281 case "$gccversion" in
4282 1*) dflt='-fpcc-struct-return' ;;
4285 *-g*) dflt="$dflt -DDEBUGGING";;
4287 case "$gccversion" in
4288 2*) if test -d /etc/conf/kconfig.d &&
4289 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4295 case "$gccversion" in
4299 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4300 echo 'int main(void) { return 0; }' > gcctest.c
4301 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4302 echo "Yes, it does." 2>&1
4305 echo "Leaving current flags $ccflags alone." 2>&1
4307 *) dflt="$dflt -fno-strict-aliasing" ;;
4310 echo "Nope, it doesn't, but that's ok." 2>&1
4317 case "$mips_type" in
4318 *BSD*|'') inclwanted="$locincpth $usrinc";;
4319 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4321 for thisincl in $inclwanted; do
4322 if $test -d $thisincl; then
4323 if $test x$thisincl != x$usrinc; then
4326 *) dflt="$dflt -I$thisincl";;
4332 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4334 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4342 *) dflt="$dflt -D$2";;
4346 set signal.h LANGUAGE_C; eval $inctest
4350 ccflags="$ccflags -DSOCKS"
4355 default|recommended) dflt="$ccflags $dflt" ;;
4356 *) dflt="$ccflags";;
4364 Your C compiler may want other flags. For this question you should include
4365 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4366 but you should NOT include libraries or ld flags like -lwhatever. If you
4367 want $package to honor its debug switch, you should include -DDEBUGGING here.
4368 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4370 To use no flags, specify the word "none".
4376 rp="Any additional cc flags?"
4383 : the following weeds options from ccflags that are of no interest to cpp
4385 case "$gccversion" in
4386 1*) cppflags="$cppflags -D__GNUC__"
4388 case "$mips_type" in
4390 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4396 echo "Let me guess what the preprocessor flags are..." >&4
4410 *) ftry="$previous $flag";;
4412 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4413 >cpp1.out 2>/dev/null && \
4414 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4415 >cpp2.out 2>/dev/null && \
4416 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4417 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4419 cppflags="$cppflags $ftry"
4429 *-*) echo "They appear to be: $cppflags";;
4431 $rm -f cpp.c cpp?.out
4435 : flags used in final linking phase
4437 '') if ./venix; then
4443 *-posix*) dflt="$dflt -posix" ;;
4446 *) dflt="$ldflags";;
4449 : Try to guess additional flags to pick up local libraries.
4450 for thislibdir in $libpth; do
4451 case " $loclibpth " in
4454 *"-L$thislibdir "*) ;;
4455 *) dflt="$dflt -L$thislibdir" ;;
4467 Your C linker may need flags. For this question you should
4468 include -L/whatever and any other flags used by the C linker, but you
4469 should NOT include libraries like -lwhatever.
4471 Make sure you include the appropriate -L/path flags if your C linker
4472 does not normally search all of the directories you specified above,
4475 To use no flags, specify the word "none".
4479 rp="Any additional ld flags (NOT including libraries)?"
4485 rmlist="$rmlist pdp11"
4489 echo "Checking your choice of C compiler and flags for coherency..." >&4
4490 $cat > try.c <<'EOF'
4492 int main() { printf("Ok\n"); exit(0); }
4494 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4496 $cat >try.msg <<'EOM'
4497 I've tried to compile and run the following simple program:
4500 $cat try.c >> try.msg
4502 $cat >> try.msg <<EOM
4509 and I got the following output:
4513 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4514 if sh -c './try' >>try.msg 2>&1; then
4518 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4521 cat >> try.msg <<'EOQS'
4522 If $libs contains -lsfio, and sfio is mis-configured, then it
4523 sometimes (apparently) runs and exits with a 0 status, but with no
4524 output! It may have to do with sfio's use of _exit vs. exit.
4527 rp="You have a big problem. Shall I abort Configure"
4534 echo "The program compiled OK, but exited with status $?." >>try.msg
4535 rp="You have a problem. Shall I abort Configure"
4539 echo "I can't compile the test program." >>try.msg
4540 rp="You have a BIG problem. Shall I abort Configure"
4546 case "$knowitall" in
4548 echo "(The supplied flags or libraries might be incorrect.)"
4556 *) echo "Ok. Stopping Configure." >&4
4561 n) echo "OK, that should do.";;
4563 $rm -f try try.* core
4565 : determine filename position in cpp output
4567 echo "Computing filename position in cpp output for #include directives..." >&4
4568 echo '#include <stdio.h>' > foo.c
4571 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4572 $grep '^[ ]*#.*stdio\.h' | \
4573 while read cline; do
4576 while $test \$# -gt 0; do
4577 if $test -r \`echo \$1 | $tr -d '"'\`; then
4582 pos=\`expr \$pos + 1\`
4594 *) pos="${fieldn}th";;
4596 echo "Your cpp writes the filename in the $pos field of the line."
4598 : locate header file
4603 for usrincdir in $usrinc
4605 if test -f \$usrincdir/\$wanted; then
4606 echo "\$usrincdir/\$wanted"
4610 awkprg='{ print \$$fieldn }'
4611 echo "#include <\$wanted>" > foo\$\$.c
4612 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4613 $grep "^[ ]*#.*\$wanted" | \
4614 while read cline; do
4615 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4617 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4618 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4623 # status = 0: grep returned 0 lines, case statement not executed
4624 # status = 1: headerfile found
4625 # status = 2: while loop executed, no headerfile found
4629 if test \$status -eq 1; then
4636 : define an alternate in-header-list? function
4637 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4638 cont=true; xxf="echo \"<\$1> found.\" >&4";
4639 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4640 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4642 case $# in 4) instead=instead;; *) instead="at last";; esac;
4643 while $test "$cont"; do
4645 var=$2; eval "was=\$$2";
4646 if $test "$xxx" && $test -r "$xxx";
4648 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4651 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4652 set $yyy; shift; shift; yyy=$@;
4653 case $# in 0) cont="";;
4654 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4655 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4656 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4657 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4661 do set $yyy; var=$2; eval "was=\$$2";
4662 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4663 set $yyy; shift; shift; yyy=$@;
4666 : see if this is a malloc.h system
4667 set malloc.h i_malloc
4670 : see if stdlib is available
4671 set stdlib.h i_stdlib
4674 : determine which malloc to compile in
4676 case "$usemymalloc" in
4677 ''|[yY]*|true|$define) dflt='y' ;;
4680 rp="Do you wish to attempt to use the malloc that comes with $package?"
4686 mallocsrc='malloc.c'
4687 mallocobj="malloc$_o"
4688 d_mymalloc="$define"
4691 : Remove malloc from list of libraries to use
4692 echo "Removing unneeded -lmalloc from library list" >&4
4693 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4696 echo "libs = $libs" >&4
4708 : compute the return types of malloc and free
4710 $cat >malloc.c <<END
4714 #include <sys/types.h>
4728 case "$malloctype" in
4730 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4737 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4741 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4748 echo "Your system uses $freetype free(), it would seem." >&4
4752 The installation process will also create a directory for
4753 vendor-supplied add-ons. Vendors who supply perl with their system
4754 may find it convenient to place all vendor-supplied files in this
4755 directory rather than in the main distribution directory. This will
4756 ease upgrades between binary-compatible maintenance versions of perl.
4758 Of course you may also use these directories in whatever way you see
4759 fit. For example, you might use them to access modules shared over a
4760 company-wide network.
4762 The default answer should be fine for most people.
4763 This causes further questions about vendor add-ons to be skipped
4764 and no vendor-specific directories will be configured for perl.
4767 rp='Do you want to configure vendor-specific add-on directories?'
4768 case "$usevendorprefix" in
4769 define|true|[yY]*) dflt=y ;;
4775 rp='Installation prefix to use for vendor-supplied add-ons?'
4776 case "$vendorprefix" in
4778 *) dflt=$vendorprefix ;;
4782 case "$vendorprefix" in
4786 *) oldvendorprefix="$prefix";;
4790 usevendorprefix="$define"
4792 vendorprefixexp="$ansexp"
4794 *) usevendorprefix="$undef"
4800 case "$vendorprefix" in
4801 '') d_vendorlib="$undef"
4805 *) d_vendorlib="$define"
4806 : determine where vendor-supplied modules go.
4807 : Usual default is /usr/local/lib/perl5/vendor_perl
4808 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4809 case "$installstyle" in
4810 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4811 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4814 rp='Pathname for the vendor-supplied library files?'
4817 vendorlibexp="$ansexp"
4818 : Change installation prefix, if necessary.
4819 if $test X"$prefix" != X"$installprefix"; then
4820 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4822 installvendorlib="$vendorlibexp"
4827 : Cruising for prototypes
4829 echo "Checking out function prototypes..." >&4
4830 $cat >prototype.c <<'EOCP'
4831 int main(int argc, char *argv[]) {
4834 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4835 echo "Your C compiler appears to support function prototypes."
4838 echo "Your C compiler doesn't seem to understand function prototypes."
4845 case "$prototype" in
4847 *) ansi2knr='ansi2knr'
4852 This version of $package can only be compiled by a compiler that
4853 understands function prototypes. Unfortunately, your C compiler
4855 doesn't seem to understand them. Sorry about that.
4857 If GNU cc is available for your system, perhaps you could try that instead.
4859 Eventually, we hope to support building Perl with pre-ANSI compilers.
4860 If you would like to help in that effort, please contact <perlbug@perl.org>.
4862 Aborting Configure now.
4868 : determine where public executables go
4873 rp='Pathname where the public executables will reside?'
4875 if $test "X$ansexp" != "X$binexp"; then
4880 : Change installation prefix, if necessary.
4881 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4882 if $test X"$prefix" != X"$installprefix"; then
4883 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4885 installbin="$binexp"
4888 : determine whether to install perl also as /usr/bin/perl
4891 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4893 Many scripts expect to perl to be installed as /usr/bin/perl.
4894 I can install the perl you are about to compile also as /usr/bin/perl
4895 (in addition to $installbin/perl).
4897 case "$installusrbinperl" in
4898 "$undef"|[nN]*) dflt='n';;
4901 rp="Do you want to install perl as /usr/bin/perl?"
4904 [yY]*) val="$define";;
4910 set installusrbinperl
4913 : define a shorthand compile call
4917 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4918 : define a shorthand compile call for compilations that should be ok.
4922 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4925 echo "Checking for GNU C Library..." >&4
4926 cat >gnulibc.c <<EOM
4938 if eval $compile_ok && ./gnulibc; then
4940 echo "You are using the GNU C Library"
4943 echo "You are not using the GNU C Library"
4949 : see if nm is to be used to determine whether a symbol is defined or not
4953 case "$d_gnulibc" in
4956 echo "nm probably won't work on the GNU C Library." >&4
4962 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4964 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4965 echo "'nm' won't be sufficient on this sytem." >&4
4971 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4972 if $test $dflt -gt 20; then
4982 true|$define) dflt=y;;
4989 I can use $nm to extract the symbols from your C libraries. This
4990 is a time consuming task which may generate huge output on the disk (up
4991 to 3 megabytes) but that should make the symbols extraction faster. The
4992 alternative is to skip the 'nm' extraction part and to compile a small
4993 test program instead to determine whether each symbol is present. If
4994 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4995 this may be the best solution.
4997 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5000 rp="Shall I use $nm to extract C symbols from the libraries?"
5003 [Nn]*) usenm=false;;
5012 : nm options which may be necessary
5014 '') if $test -f /mach_boot; then
5016 elif $test -d /usr/ccs/lib; then
5017 nm_opt='-p' # Solaris (and SunOS?)
5018 elif $test -f /dgux; then
5020 elif $test -f /lib64/rld; then
5021 nm_opt='-p' # 64-bit Irix
5027 : nm options which may be necessary for shared libraries but illegal
5028 : for archive libraries. Thank you, Linux.
5029 case "$nm_so_opt" in
5030 '') case "$myuname" in
5032 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5033 nm_so_opt='--dynamic'
5042 : get list of predefined functions in a handy place
5047 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5054 *) for thislib in $libs; do
5057 : Handle C library specially below.
5060 thislib=`echo $thislib | $sed -e 's/^-l//'`
5061 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5063 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5065 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5067 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5069 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5071 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5073 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5078 libnames="$libnames $try"
5080 *) libnames="$libnames $thislib" ;;
5089 for xxx in $libpth; do
5090 $test -r $1 || set $xxx/libc.$so
5091 : The messy sed command sorts on library version numbers.
5093 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5094 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5096 s/[0-9][0-9]*/0000&/g
5097 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5100 sort | $sed -e 's/^.* //'`
5103 $test -r $1 || set /usr/ccs/lib/libc.$so
5104 $test -r $1 || set /lib/libsys_s$_a
5110 if $test -r "$1"; then
5111 echo "Your (shared) C library seems to be in $1."
5113 elif $test -r /lib/libc && $test -r /lib/clib; then
5114 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5116 libc='/lib/clib /lib/libc'
5117 if $test -r /lib/syslib; then
5118 echo "(Your math library is in /lib/syslib.)"
5119 libc="$libc /lib/syslib"
5121 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5122 echo "Your C library seems to be in $libc, as you said before."
5123 elif $test -r $incpath/usr/lib/libc$_a; then
5124 libc=$incpath/usr/lib/libc$_a;
5125 echo "Your C library seems to be in $libc. That's fine."
5126 elif $test -r /lib/libc$_a; then
5128 echo "Your C library seems to be in $libc. You're normal."
5130 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5132 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5133 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5134 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5136 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5138 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5141 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5143 if $test -r "$tans"; then
5144 echo "Your C library seems to be in $tans, of all places."
5150 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5154 If the guess above is wrong (which it might be if you're using a strange
5155 compiler, or your machine supports multiple models), you can override it here.
5160 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5162 I can't seem to find your C library. I've looked in the following places:
5165 $sed 's/^/ /' libpath
5168 None of these seems to contain your C library. I need to get its name...
5173 rp='Where is your C library?'
5178 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5179 set X `cat libnames`
5182 case $# in 1) xxx=file; esac
5183 echo "Extracting names from the following $xxx for later perusal:" >&4
5185 $sed 's/^/ /' libnames >&4
5187 $echo $n "This may take a while...$c" >&4
5191 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5192 *) $nm $nm_opt $file 2>/dev/null;;
5197 $grep fprintf libc.tmp > libc.ptf
5198 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5199 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5201 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5203 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5205 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5207 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5209 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5211 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5213 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5215 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5217 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5219 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5221 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5223 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5225 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5226 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5228 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5230 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5232 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5234 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5236 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5238 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5240 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5242 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5244 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5246 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5248 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5250 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5252 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5254 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5256 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5259 $nm -p $* 2>/dev/null >libc.tmp
5260 $grep fprintf libc.tmp > libc.ptf
5261 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5262 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5268 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5270 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5271 for thisname in $libnames $libc; do
5272 $ar t $thisname >>libc.tmp
5274 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5276 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5277 # Repeat libc to extract forwarders to DLL entries too
5278 for thisname in $libnames $libc; do
5279 $ar tv $thisname >>libc.tmp
5280 # Revision 50 of EMX has bug in $ar.
5281 # it will not extract forwarders to DLL entries
5282 # Use emximp which will extract exactly them.
5283 emximp -o tmp.imp $thisname \
5285 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5286 < tmp.imp >>libc.tmp
5289 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5292 echo "$ar didn't seem to work right." >&4
5293 echo "Maybe this is a Cray...trying bld instead..." >&4
5294 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5296 for thisname in $libnames; do
5298 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5299 $ar t $thisname >>libc.tmp
5303 echo "That didn't work either. Giving up." >&4
5310 if $test -f /lib/syscalls.exp; then
5312 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5313 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5317 $rm -f libnames libpath
5319 : see if dld is available
5323 : is a C symbol defined?
5326 -v) tf=libc.tmp; tc=""; tdc="";;
5327 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5328 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5331 case "$reuseval-$4" in
5333 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5339 if $contains $tlook $tf >/dev/null 2>&1;
5344 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5345 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5353 $define) tval=true;;
5359 : define an is-in-libc? function
5360 inlibc='echo " "; td=$define; tu=$undef;
5361 sym=$1; var=$2; eval "was=\$$2";
5363 case "$reuseval$was" in
5373 echo "$sym() found." >&4;
5374 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5376 echo "$sym() NOT found." >&4;
5377 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5381 $define) echo "$sym() found." >&4;;
5382 *) echo "$sym() NOT found." >&4;;
5386 : see if dlopen exists
5393 : determine which dynamic loading, if any, to compile in
5395 dldir="ext/DynaLoader"
5408 $define) dflt='y' ;;
5411 $define) dflt='y' ;;
5413 : Does a dl_xxx.xs file exist for this operating system
5414 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5417 rp="Do you wish to use dynamic loading?"
5424 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5425 dflt="$dldir/dl_${osname}.xs"
5426 elif $test "$d_dlopen" = "$define" ; then
5427 dflt="$dldir/dl_dlopen.xs"
5428 elif $test "$i_dld" = "$define" ; then
5429 dflt="$dldir/dl_dld.xs"
5434 *) dflt="$dldir/$dlsrc"
5437 echo "The following dynamic loading files are available:"
5438 : Can not go over to $dldir because getfile has path hard-coded in.
5439 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5440 rp="Source file to use for dynamic loading"
5446 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5450 Some systems may require passing special flags to $cc -c to
5451 compile modules that will be used to create a shared library.
5452 To use no flags, say "none".
5455 case "$cccdlflags" in
5456 '') case "$gccversion" in
5457 '') case "$osname" in
5459 next) dflt='none' ;;
5460 irix*) dflt='-KPIC' ;;
5461 svr4*|esix*|solaris) dflt='-KPIC' ;;
5462 sunos) dflt='-pic' ;;
5466 *) case "$osname" in
5467 svr4*|esix*|solaris) dflt='-fPIC' ;;
5472 *) dflt="$cccdlflags" ;;
5474 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5477 none) cccdlflags=' ' ;;
5478 *) cccdlflags="$ans" ;;
5483 Some systems use ld to create libraries that can be dynamically loaded,
5484 while other systems (such as those using ELF) use $cc.
5488 '') $cat >try.c <<'EOM'
5489 /* Test for whether ELF binaries are produced */
5494 int i = open("a.out",O_RDONLY);
5497 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5498 exit(0); /* succeed (yes, it's ELF) */
5503 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5505 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5509 echo "I'll use ld to build dynamic libraries."
5518 rp="What command should be used to create dynamic libraries?"
5524 Some systems may require passing special flags to $ld to create a
5525 library that can be dynamically loaded. If your ld flags include
5526 -L/other/path options to locate libraries outside your loader's normal
5527 search path, you may need to specify those -L options here as well. To
5528 use no flags, say "none".
5531 case "$lddlflags" in
5532 '') case "$osname" in
5533 beos) dflt='-nostart' ;;
5535 linux|irix*) dflt='-shared' ;;
5536 next) dflt='none' ;;
5537 solaris) dflt='-G' ;;
5538 sunos) dflt='-assert nodefinitions' ;;
5539 svr4*|esix*) dflt="-G $ldflags" ;;
5543 *) dflt="$lddlflags" ;;
5546 : Try to guess additional flags to pick up local libraries.
5547 : Be careful not to append to a plain 'none'
5551 for thisflag in $ldflags; do
5556 *) dflt="$dflt $thisflag" ;;
5563 ''|' ') dflt='none' ;;
5566 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5569 none) lddlflags=' ' ;;
5570 *) lddlflags="$ans" ;;
5575 Some systems may require passing special flags to $cc to indicate that
5576 the resulting executable will use dynamic linking. To use no flags,
5580 case "$ccdlflags" in
5581 '') case "$osname" in
5582 hpux) dflt='-Wl,-E' ;;
5583 linux) dflt='-rdynamic' ;;
5584 next) dflt='none' ;;
5585 sunos) dflt='none' ;;
5589 *) dflt="$ccdlflags" ;;
5591 rp="Any special flags to pass to $cc to use dynamic loading?"
5594 none) ccdlflags=' ' ;;
5595 *) ccdlflags="$ans" ;;
5609 # No dynamic loading being used, so don't bother even to prompt.
5612 *) case "$useshrplib" in
5613 '') case "$osname" in
5614 svr4*|dgux|dynixptx|esix|powerux|beos)
5616 also='Building a shared libperl is required for dynamic loading to work on your system.'
5621 also='Building a shared libperl is needed for MAB support.'
5639 The perl executable is normally obtained by linking perlmain.c with
5640 libperl${_a}, any static extensions (usually just DynaLoader), and
5641 any other libraries needed on this system (such as -lm, etc.). Since
5642 your system supports dynamic loading, it is probably possible to build
5643 a shared libperl.$so. If you will have more than one executable linked
5644 to libperl.$so, this will significantly reduce the size of each
5645 executable, but it may have a noticeable affect on performance. The
5646 default is probably sensible for your system.
5650 rp="Build a shared libperl.$so (y/n)"
5654 useshrplib='true' ;;
5655 *) useshrplib='false' ;;
5660 case "$useshrplib" in
5664 # Figure out a good name for libperl.so. Since it gets stored in
5665 # a version-specific architecture-dependent library, the version
5666 # number isn't really that important, except for making cc/ld happy.
5668 # A name such as libperl.so.3.1
5669 majmin="libperl.$so.$patchlevel.$subversion"
5670 # A name such as libperl.so.301
5671 majonly=`echo $patchlevel $subversion |
5672 $awk '{printf "%d%02d", $1, $2}'`
5673 majonly=libperl.$so.$majonly
5674 # I'd prefer to keep the os-specific stuff here to a minimum, and
5675 # rely on figuring it out from the naming of libc.
5676 case "${osname}${osvers}" in
5679 # XXX How handle the --version stuff for MAB?
5681 linux*) # ld won't link with a bare -lperl otherwise.
5684 *) # Try to guess based on whether libc has major.minor.
5686 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5687 *libc.$so.[0-9]*) dflt=$majonly ;;
5688 *) dflt=libperl.$so ;;
5698 I need to select a good name for the shared libperl. If your system uses
5699 library names with major and minor numbers, then you might want something
5700 like $majmin. Alternatively, if your system uses a single version
5701 number for shared libraries, then you might want to use $majonly.
5702 Or, your system might be quite happy with a simple libperl.$so.
5704 Since the shared libperl will get installed into a version-specific
5705 architecture-dependent directory, the version number of the shared perl
5706 library probably isn't important, so the default should be o.k.
5709 rp='What name do you want to give to the shared libperl?'
5712 echo "Ok, I'll use $libperl"
5715 libperl="libperl${_a}"
5719 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5723 WARNING: Use of the shrpdir variable for the installation location of
5724 the shared $libperl is not supported. It was never documented and
5725 will not work in this version. Let me (perlbug@perl.com)
5726 know of any problems this may cause.
5732 But your current setting of $shrpdir is
5733 the default anyway, so it's harmless.
5738 Further, your current attempted setting of $shrpdir
5739 conflicts with the value of $archlibexp/CORE
5740 that installperl will use.
5747 # How will the perl executable find the installed shared $libperl?
5748 # Add $xxx to ccdlflags.
5749 # If we can't figure out a command-line option, use $shrpenv to
5750 # set env LD_RUN_PATH. The main perl makefile uses this.
5751 shrpdir=$archlibexp/CORE
5754 if "$useshrplib"; then
5757 # We'll set it in Makefile.SH...
5763 xxx="-Wl,-R$shrpdir"
5765 linux|irix*|dec_osf)
5766 xxx="-Wl,-rpath,$shrpdir"
5769 # next doesn't like the default...
5772 # beos doesn't like the default, either.
5775 # hpux doesn't like the default, either.
5776 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5779 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5785 # Only add $xxx if it isn't already in ccdlflags.
5786 case " $ccdlflags " in
5788 *) ccdlflags="$ccdlflags $xxx"
5791 Adding $xxx to the flags
5792 passed to $ld so that the perl executable will find the
5793 installed shared $libperl.
5801 # Fix ccdlflags in AIX for building external extensions.
5802 # (For building Perl itself bare -bE:perl.exp is needed,
5803 # Makefile.SH takes care of this.)
5805 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5807 # Respect a hint or command-line value.
5809 '') shrpenv="$tmp_shrpenv" ;;
5811 case "$ldlibpthname" in
5812 '') ldlibpthname=LD_LIBRARY_PATH ;;
5813 none) ldlibpthname='' ;;
5816 : determine where manual pages go
5817 set man1dir man1dir none
5821 $spackage has manual pages available in source form.
5825 echo "However, you don't have nroff, so they're probably useless to you."
5827 '') man1dir="none";;
5830 echo "If you don't want the manual sources installed, answer 'none'."
5835 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5836 lookpath="$lookpath $prefixexp/man/p_man/man1"
5837 lookpath="$lookpath $prefixexp/man/u_man/man1"
5838 lookpath="$lookpath $prefixexp/man/man.1"
5840 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5841 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5851 rp="Where do the main $spackage manual pages (source) go?"
5853 if $test "X$man1direxp" != "X$ansexp"; then
5857 man1direxp="$ansexp"
5863 : Change installation prefix, if necessary.
5864 if $test X"$prefix" != X"$installprefix"; then
5865 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5867 installman1dir="$man1direxp"
5870 : What suffix to use on installed man pages
5877 rp="What suffix should be used for the main $spackage man pages?"
5879 '') case "$man1dir" in
5893 *) dflt="$man1ext";;
5900 : see if we can have long filenames
5902 rmlist="$rmlist /tmp/cf$$"
5903 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5904 first=123456789abcdef
5905 second=/tmp/cf$$/$first
5906 $rm -f $first $second
5907 if (echo hi >$first) 2>/dev/null; then
5908 if $test -f 123456789abcde; then
5909 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5912 if (echo hi >$second) 2>/dev/null; then
5913 if $test -f /tmp/cf$$/123456789abcde; then
5915 That's peculiar... You can have filenames longer than 14 characters, but only
5916 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5917 I shall consider your system cannot support long filenames at all.
5921 echo 'You can have filenames longer than 14 characters.' >&4
5926 How confusing! Some of your filesystems are sane enough to allow filenames
5927 longer than 14 characters but some others like /tmp can't even think about them.
5928 So, for now on, I shall assume your kernel does not allow them at all.
5935 You can't have filenames longer than 14 chars. You can't even think about them!
5941 $rm -rf /tmp/cf$$ 123456789abcde*
5943 : determine where library module manual pages go
5944 set man3dir man3dir none
5948 $spackage has manual pages for many of the library modules.
5954 However, you don't have nroff, so they're probably useless to you.
5957 '') man3dir="none";;
5961 case "$d_flexfnam" in
5964 However, your system can't handle the long file names like File::Basename.3.
5967 '') man3dir="none";;
5971 echo "If you don't want the manual sources installed, answer 'none'."
5972 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5974 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5975 if $test -d "$privlib/man/man3"; then
5978 WARNING: Previous versions of perl installed man3 pages into
5979 $privlib/man/man3. This version will suggest a
5980 new default of $dflt.
5984 rp='Do you wish to preserve the old behavior?(y/n)'
5987 y*) dflt="$privlib/man/man3" ;;
5993 *) dflt="$man3dir" ;;
5997 rp="Where do the $package library man pages (source) go?"
6000 man3direxp="$ansexp"
6006 : Change installation prefix, if necessary.
6007 if $test X"$prefix" != X"$installprefix"; then
6008 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6010 installman3dir="$man3direxp"
6013 : What suffix to use on installed man pages
6019 rp="What suffix should be used for the $package library man pages?"
6021 '') case "$man3dir" in
6035 *) dflt="$man3ext";;
6042 : see if we have to deal with yellow pages, now NIS.
6043 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6044 if $test -f /usr/etc/nibindd; then
6046 echo "I'm fairly confident you're on a NeXT."
6048 rp='Do you get the hosts file via NetInfo?'
6057 y*) hostcat='nidump hosts .';;
6058 *) case "$hostcat" in
6059 nidump*) hostcat='';;
6069 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6077 rp='Are you getting the hosts file via yellow pages?'
6080 y*) hostcat='ypcat hosts';;
6081 *) hostcat='cat /etc/hosts';;
6087 '') hostcat='cat /etc/hosts';;
6090 '') groupcat='cat /etc/group';;
6093 '') passcat='cat /etc/passwd';;
6096 : now get the host name
6098 echo "Figuring out host name..." >&4
6099 case "$myhostname" in
6101 echo 'Maybe "hostname" will work...'
6102 if tans=`sh -c hostname 2>&1` ; then
6110 if $test "$cont"; then
6112 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6113 if tans=`cat /etc/systemid 2>&1` ; then
6115 phostname='cat /etc/systemid'
6116 echo "Whadyaknow. Xenix always was a bit strange..."
6119 elif $test -r /etc/systemid; then
6120 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6123 if $test "$cont"; then
6124 echo 'No, maybe "uuname -l" will work...'
6125 if tans=`sh -c 'uuname -l' 2>&1` ; then
6127 phostname='uuname -l'
6129 echo 'Strange. Maybe "uname -n" will work...'
6130 if tans=`sh -c 'uname -n' 2>&1` ; then
6132 phostname='uname -n'
6134 echo 'Oh well, maybe I can mine it out of whoami.h...'
6135 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6136 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6137 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6139 case "$myhostname" in
6140 '') echo "Does this machine have an identity crisis or something?"
6143 echo "Well, you said $myhostname before..."
6144 phostname='echo $myhostname';;
6150 : you do not want to know about this
6155 if $test "$myhostname" ; then
6157 rp='Your host name appears to be "'$myhostname'".'" Right?"
6165 : bad guess or no guess
6166 while $test "X$myhostname" = X ; do
6168 rp="Please type the (one word) name of your host:"
6173 : translate upper to lower if necessary
6174 case "$myhostname" in
6176 echo "(Normalizing case in your host name)"
6177 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6181 case "$myhostname" in
6183 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6184 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6185 echo "(Trimming domain name from host name--host name is now $myhostname)"
6187 *) case "$mydomain" in
6190 test "X$hostcat" = "Xypcat hosts" &&
6191 ypmatch "$myhostname" hosts 2>/dev/null |\
6192 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6195 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6196 /[ ]$myhostname[ . ]/p" > hosts
6199 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6200 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6201 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6202 hosts | $sort | $uniq | \
6203 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6204 case `$echo X$dflt` in
6205 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6208 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6213 tans=`./loc resolv.conf X /etc /usr/etc`
6214 if $test -f "$tans"; then
6215 echo "(Attempting domain name extraction from $tans)"
6216 dflt=.`$sed -n -e 's/ / /g' \
6217 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6218 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6220 .) dflt=.`$sed -n -e 's/ / /g' \
6221 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6222 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6229 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6230 dflt=.`sh -c domainname 2>/dev/null`
6233 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6238 .) echo "(Lost all hope -- silly guess then)"
6244 *) dflt="$mydomain";;
6248 rp="What is your domain name?"
6258 : translate upper to lower if necessary
6261 echo "(Normalizing case in your domain name)"
6262 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6266 : a little sanity check here
6267 case "$phostname" in
6270 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6271 $myhostname$mydomain|$myhostname) ;;
6273 case "$phostname" in
6275 echo "(That doesn't agree with your whoami.h file, by the way.)"
6278 echo "(That doesn't agree with your $phostname command, by the way.)"
6288 I need to get your e-mail address in Internet format if possible, i.e.
6289 something like user@host.domain. Please answer accurately since I have
6290 no easy means to double check it. The default value provided below
6291 is most probably close to the reality but may not be valid from outside
6292 your organization...
6296 while test "$cont"; do
6298 '') dflt="$cf_by@$myhostname$mydomain";;
6299 *) dflt="$cf_email";;
6301 rp='What is your e-mail address?'
6307 rp='Address does not look like an Internet one. Use it anyway?'
6323 If you or somebody else will be maintaining perl at your site, please
6324 fill in the correct e-mail address here so that they may be contacted
6325 if necessary. Currently, the "perlbug" program included with perl
6326 will send mail to this address in addition to perlbug@perl.com. You may
6327 enter "none" for no administrator.
6330 case "$perladmin" in
6331 '') dflt="$cf_email";;
6332 *) dflt="$perladmin";;
6334 rp='Perl administrator e-mail address'
6338 : figure out how to guarantee perl startup
6339 case "$startperl" in
6341 case "$sharpbang" in
6345 I can use the #! construct to start perl on your system. This will
6346 make startup of perl scripts faster, but may cause problems if you
6347 want to share those scripts and perl is not in a standard place
6348 ($binexp/perl) on all your platforms. The alternative is to force
6349 a shell by starting the script with a single ':' character.
6353 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6356 none) startperl=": # use perl";;
6357 *) startperl="#!$ans"
6358 if $test 30 -lt `echo "$ans" | wc -c`; then
6361 WARNING: Some systems limit the #! command to 32 characters.
6362 If you experience difficulty running Perl scripts with #!, try
6363 installing Perl in a directory with a shorter pathname.
6369 *) startperl=": # use perl"
6374 echo "I'll use $startperl to start perl scripts."
6376 : figure best path for perl in scripts
6379 perlpath="$binexp/perl"
6380 case "$startperl" in
6385 I will use the "eval 'exec'" idiom to start Perl on your system.
6386 I can use the full path of your Perl binary for this purpose, but
6387 doing so may cause problems if you want to share those scripts and
6388 Perl is not always in a standard place ($binexp/perl).
6392 rp="What path shall I use in \"eval 'exec'\"?"
6399 case "$startperl" in
6401 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6404 : determine where public executable scripts go
6405 set scriptdir scriptdir
6407 case "$scriptdir" in
6410 : guess some guesses
6411 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6412 $test -d /usr/share/bin && dflt=/usr/share/bin
6413 $test -d /usr/local/script && dflt=/usr/local/script
6414 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6415 $test -d $prefixexp/script && dflt=$prefixexp/script
6419 *) dflt="$scriptdir"
6424 Some installations have a separate directory just for executable scripts so
6425 that they can mount it across multiple architectures but keep the scripts in
6426 one spot. You might, for example, have a subdirectory of /usr/share for this.
6427 Or you might just lump your scripts in with all your other executables.
6431 rp='Where do you keep publicly executable scripts?'
6433 if $test "X$ansexp" != "X$scriptdirexp"; then
6437 scriptdirexp="$ansexp"
6438 : Change installation prefix, if necessary.
6439 if $test X"$prefix" != X"$installprefix"; then
6440 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6442 installscript="$scriptdirexp"
6447 After $package is installed, you may wish to install various
6448 add-on modules and utilities. Typically, these add-ons will
6449 be installed under $prefix with the rest
6450 of this package. However, you may wish to install such add-ons
6451 elsewhere under a different prefix.
6453 If you do not wish to put everything under a single prefix, that's
6454 ok. You will be prompted for the individual locations; this siteprefix
6455 is only used to suggest the defaults.
6457 The default should be fine for most people.
6461 rp='Installation prefix to use for add-on modules and utilities?'
6462 : XXX Here might be another good place for an installstyle setting.
6463 case "$siteprefix" in
6465 *) dflt=$siteprefix ;;
6469 case "$siteprefix" in
6474 *) oldsiteprefix="$prefix";;
6479 siteprefixexp="$ansexp"
6481 : determine where site specific libraries go.
6482 : Usual default is /usr/local/lib/perl5/site_perl
6483 : The default "style" setting is made in installstyle.U
6484 : XXX No longer works with Prefixit stuff.
6485 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6486 case "$installstyle" in
6487 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6488 *) dflt=$siteprefix/lib/site_$prog ;;
6492 The installation process will create a directory for
6493 site-specific extensions and modules. Most users find it convenient
6494 to place all site-specific files in this directory rather than in the
6495 main distribution directory.
6499 rp='Pathname for the site-specific library files?'
6502 sitelibexp="$ansexp"
6503 : Change installation prefix, if necessary.
6504 if $test X"$prefix" != X"$installprefix"; then
6505 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6507 installsitelib="$sitelibexp"
6510 : determine where site specific architecture-dependent libraries go.
6511 : sitelib default is /usr/local/lib/perl5/site_perl/
6512 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6513 : sitelib may have an optional trailing /share.
6514 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6515 tdflt="$tdflt/$apiversion/$archname"
6516 set sitearch sitearch none
6519 '') dflt="$tdflt" ;;
6520 *) dflt="$sitearch" ;;
6524 The installation process will also create a directory for
6525 architecture-dependent site-specific extensions and modules.
6529 rp='Pathname for the site-specific architecture-dependent library files?'
6532 sitearchexp="$ansexp"
6533 : Change installation prefix, if necessary.
6534 if $test X"$prefix" != X"$installprefix"; then
6535 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6537 installsitearch="$sitearchexp"
6542 Perl can be built to take advantage of long doubles which
6543 (if available) may give more accuracy and range for floating point
6544 numbers. To do so, Configure must be run with -Duselongdouble.
6546 If this doesn't make any sense to you, just accept the default 'n'.
6548 case "$uselongdouble" in
6549 $define|true|[yY]*) dflt='y';;
6552 rp='Try to use long doubles if available?'
6555 y|Y) val="$define" ;;
6561 case "$uselongdouble" in
6562 "$define"|true|[yY]*)
6563 : Look for a hint-file generated 'call-back-unit'. If the
6564 : user has specified that long doubles should be used,
6565 : we may need to set or change some other defaults.
6566 if $test -f uselongdouble.cbu; then
6567 echo "Your platform has some specific hints for long doubles, using them..."
6568 . ./uselongdouble.cbu
6571 (Your platform doesn't have any specific hints for long doubles.)
6579 Previous version of $package used the standard IO mechanisms as defined
6580 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6581 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6582 the default. This abstraction layer can use AT&T's sfio (if you already
6583 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6584 problems with some extension modules. Using PerlIO with stdio is safe,
6585 but it is slower than plain stdio and therefore is not the default.
6587 If this doesn't make any sense to you, just accept the default 'n'.
6589 case "$useperlio" in
6590 $define|true|[yY]*) dflt='y';;
6593 rp='Use the experimental PerlIO abstraction layer?'
6600 echo "Ok, doing things the stdio way"
6607 : Check how to convert floats to strings.
6608 if test "X$d_Gconvert" = X; then
6610 echo "Checking for an efficient way to convert floats to strings."
6613 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6614 char *myname = "gconvert";
6617 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6618 char *myname = "gcvt";
6621 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6622 char *myname = "sprintf";
6628 checkit(expect, got)
6632 if (strcmp(expect, got)) {
6633 printf("%s oddity: Expected %s, got %s\n",
6634 myname, expect, got);
6644 /* This must be 1st test on (which?) platform */
6645 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6646 Gconvert(0.1, 8, 0, buf);
6647 checkit("0.1", buf);
6649 Gconvert(1.0, 8, 0, buf);
6652 Gconvert(0.0, 8, 0, buf);
6655 Gconvert(-1.0, 8, 0, buf);
6658 /* Some Linux gcvt's give 1.e+5 here. */
6659 Gconvert(100000.0, 8, 0, buf);
6660 checkit("100000", buf);
6662 /* Some Linux gcvt's give -1.e+5 here. */
6663 Gconvert(-100000.0, 8, 0, buf);
6664 checkit("-100000", buf);
6669 case "$d_Gconvert" in
6670 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6671 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6672 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6673 *) xxx_list='gconvert gcvt sprintf' ;;
6676 for xxx_convert in $xxx_list; do
6677 echo "Trying $xxx_convert"
6679 set try -DTRY_$xxx_convert
6680 if eval $compile; then
6681 echo "$xxx_convert" found. >&4
6683 echo "I'll use $xxx_convert to convert floats into a string." >&4
6686 echo "...But $xxx_convert didn't work as I expected."
6689 echo "$xxx_convert NOT found." >&4
6693 case "$xxx_convert" in
6694 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6695 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6696 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6700 : see if inttypes.h is available
6701 : we want a real compile instead of Inhdr because some systems
6702 : have an inttypes.h which includes non-existent headers
6705 #include <inttypes.h>
6707 static int32_t foo32 = 0x12345678;
6711 if eval $compile; then
6712 echo "<inttypes.h> found." >&4
6715 echo "<inttypes.h> NOT found." >&4
6723 case "$use64bits" in
6726 echo $n "Checking to see if your system supports int64_t...$c" >&4
6728 #include <sys/types.h>
6729 #$i_inttypes I_INTTYPES
6731 #include <inttypes.h>
6733 int64_t foo() { int64_t x; x = 7; return x; }
6735 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6737 echo " Yup, it does." >&4
6740 echo " Nope, it doesn't." >&4
6751 : check for lengths of integral types
6755 echo "Checking to see how big your integers are..." >&4
6756 $cat >intsize.c <<'EOCP'
6760 printf("intsize=%d;\n", sizeof(int));
6761 printf("longsize=%d;\n", sizeof(long));
6762 printf("shortsize=%d;\n", sizeof(short));
6767 if eval $compile_ok && ./intsize > /dev/null; then
6769 echo "Your integers are $intsize bytes long."
6770 echo "Your long integers are $longsize bytes long."
6771 echo "Your short integers are $shortsize bytes long."
6775 Help! I can't compile and run the intsize test program: please enlighten me!
6776 (This is probably a misconfiguration in your system or libraries, and
6777 you really ought to fix it. Still, I'll try anyway.)
6781 rp="What is the size of an integer (in bytes)?"
6785 rp="What is the size of a long integer (in bytes)?"
6789 rp="What is the size of a short integer (in bytes)?"
6795 $rm -f intsize intsize.*
6797 : check for long long
6799 echo $n "Checking to see if your system supports long long...$c" >&4
6800 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6801 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6803 echo " Yup, it does." >&4
6806 echo " Nope, it doesn't." >&4
6812 : check for length of long long
6813 case "${d_longlong}${longlongsize}" in
6816 $echo $n "Checking to see how big your long longs are...$c" >&4
6817 $cat >try.c <<'EOCP'
6821 printf("%d\n", sizeof(long long));
6825 if eval $compile_ok; then
6826 longlongsize=`./try`
6827 $echo " $longlongsize bytes." >&4
6831 echo "(I can't seem to compile the test program. Guessing...)"
6832 rp="What is the size of a long long (in bytes)?"
6836 if $test "X$longsize" = "X$longlongsize"; then
6837 echo "(That isn't any different from an ordinary long.)"
6845 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6847 echo "Checking how to print 64-bit integers..." >&4
6849 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6851 $cat >try.c <<'EOCP'
6852 #include <sys/types.h>
6855 int q = 12345678901;
6860 if eval $compile; then
6864 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6865 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6866 echo "We will use %d."
6872 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6874 $cat >try.c <<'EOCP'
6875 #include <sys/types.h>
6878 long q = 12345678901;
6883 if eval $compile; then
6887 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6888 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6889 echo "We will use %ld."
6895 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6897 $cat >try.c <<'EOCP'
6898 #include <sys/types.h>
6899 #include <inttypes.h>
6902 int64_t q = 12345678901;
6903 printf("%" PRId64 "\n", q);
6907 if eval $compile; then
6911 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6912 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6913 echo "We will use the C9X style."
6919 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6921 $cat >try.c <<'EOCP'
6922 #include <sys/types.h>
6925 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6926 printf("%lld\n", q);
6930 if eval $compile; then
6934 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6935 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6936 echo "We will use the %lld style."
6942 if $test X"$sPRId64" = X -a X"$quad" != X; then
6944 #include <sys/types.h>
6947 $quad q = 12345678901;
6952 if eval $compile; then
6956 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
6957 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
6958 echo "We will use %lld."
6964 if $test X"$sPRId64" = X -a X"$quad" != X; then
6966 #include <sys/types.h>
6969 $quad q = 12345678901;
6974 if eval $compile; then
6978 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
6979 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
6980 echo "We will use %qd."
6986 if $test X"$sPRId64" = X; then
6987 echo "Cannot figure out how to print 64-bit integers." >&4
6992 fi # intsize -o longsize -o d_int64t -o d_longlong
6995 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
6996 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
6998 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
6999 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
7003 : check for length of double
7005 case "$doublesize" in
7007 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7008 $cat >try.c <<'EOCP'
7012 printf("%d\n", sizeof(double));
7016 if eval $compile_ok; then
7018 $echo " $doublesize bytes." >&4
7021 echo "(I can't seem to compile the test program. Guessing...)"
7022 rp="What is the size of a double precision number (in bytes)?"
7030 : check for long doubles
7032 echo $n "Checking to see if your system supports long double...$c" >&4
7033 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7034 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7036 echo " Yup, it does." >&4
7039 echo " Nope, it doesn't." >&4
7045 : check for length of long double
7046 case "${d_longdbl}${longdblsize}" in
7049 $echo $n "Checking to see how big your long doubles are...$c" >&4
7050 $cat >try.c <<'EOCP'
7054 printf("%d\n", sizeof(long double));
7058 if eval $compile; then
7060 $echo " $longdblsize bytes." >&4
7064 echo "(I can't seem to compile the test program. Guessing...)" >&4
7065 rp="What is the size of a long double (in bytes)?"
7069 if $test "X$doublesize" = "X$longdblsize"; then
7070 echo "(That isn't any different from an ordinary double.)"
7078 if $test X"$d_longdbl" = X"$define"; then
7080 echo "Checking how to print long doubles..." >&4
7082 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7083 $cat >try.c <<'EOCP'
7084 #include <sys/types.h>
7088 printf("%.3f\n", d);
7092 if eval $compile; then
7096 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7097 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7098 echo "We will use %f."
7104 if $test X"$sPRIfldbl" = X; then
7105 $cat >try.c <<'EOCP'
7106 #include <sys/types.h>
7109 long double d = 123.456;
7110 printf("%.3llf\n", d);
7114 if eval $compile; then
7118 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7119 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7120 echo "We will use %llf."
7126 if $test X"$sPRIfldbl" = X; then
7127 $cat >try.c <<'EOCP'
7128 #include <sys/types.h>
7131 long double d = 123.456;
7132 printf("%.3Lf\n", d);
7136 if eval $compile; then
7140 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7141 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7142 echo "We will use %Lf."
7148 if $test X"$sPRIfldbl" = X; then
7149 $cat >try.c <<'EOCP'
7150 #include <sys/types.h>
7153 long double d = 123.456;
7154 printf("%.3lf\n", d);
7158 if eval $compile; then
7162 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7163 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7164 echo "We will use %lf."
7170 if $test X"$sPRIfldbl" = X; then
7171 echo "Cannot figure out how to print long doubles." >&4
7178 case "$sPRIfldbl" in
7179 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7180 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7182 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7183 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7187 : Initialize h_fcntl
7190 : Initialize h_sysfile
7193 : access call always available on UNIX
7197 : locate the flags for 'access()'
7201 $cat >access.c <<'EOCP'
7202 #include <sys/types.h>
7207 #include <sys/file.h>
7216 : check sys/file.h first, no particular reason here
7217 if $test `./findhdr sys/file.h` && \
7218 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7220 echo "<sys/file.h> defines the *_OK access constants." >&4
7221 elif $test `./findhdr fcntl.h` && \
7222 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7224 echo "<fcntl.h> defines the *_OK access constants." >&4
7225 elif $test `./findhdr unistd.h` && \
7226 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7227 echo "<unistd.h> defines the *_OK access constants." >&4
7229 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7235 : see if accessx exists
7236 set accessx d_accessx
7239 : see if alarm exists
7243 : see if atolf exists
7247 : see if atoll exists
7251 : Look for GNU-cc style attribute checking
7253 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7254 $cat >attrib.c <<'EOCP'
7256 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7258 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7259 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7260 echo "Your C compiler doesn't fully support __attribute__."
7263 echo "Your C compiler supports __attribute__."
7267 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7274 : see if bcmp exists
7278 : see if bcopy exists
7282 : see if this is a unistd.h system
7283 set unistd.h i_unistd
7286 : see if getpgrp exists
7287 set getpgrp d_getpgrp
7290 case "$d_getpgrp" in
7293 echo "Checking to see which flavor of getpgrp is in use..."
7296 #include <sys/types.h>
7298 # include <unistd.h>
7302 if (getuid() == 0) {
7303 printf("(I see you are running Configure as super-user...)\n");
7307 if (getpgrp(1) == 0)
7316 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7317 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7319 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7320 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7323 echo "I can't seem to compile and run the test program."
7325 xxx="a USG one, i.e. you use getpgrp()."
7327 # SVR4 systems can appear rather BSD-ish.
7330 xxx="a BSD one, i.e. you use getpgrp(pid)."
7334 xxx="probably a USG one, i.e. you use getpgrp()."
7339 echo "Assuming your getpgrp is $xxx" >&4
7348 : see if setpgrp exists
7349 set setpgrp d_setpgrp
7352 case "$d_setpgrp" in
7355 echo "Checking to see which flavor of setpgrp is in use..."
7358 #include <sys/types.h>
7360 # include <unistd.h>
7364 if (getuid() == 0) {
7365 printf("(I see you are running Configure as super-user...)\n");
7369 if (-1 == setpgrp(1, 1))
7372 if (setpgrp() != -1)
7378 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7379 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7381 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7382 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7385 echo "(I can't seem to compile and run the test program.)"
7387 xxx="a USG one, i.e. you use setpgrp()."
7389 # SVR4 systems can appear rather BSD-ish.
7392 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7396 xxx="probably a USG one, i.e. you use setpgrp()."
7401 echo "Assuming your setpgrp is $xxx" >&4
7409 : see if bzero exists
7413 : see if signal is declared as pointer to function returning int or void
7415 xxx=`./findhdr signal.h`
7416 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7417 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7418 echo "You have int (*signal())() instead of void." >&4
7420 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7421 echo "You have void (*signal())()." >&4
7423 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7424 echo "You have int (*signal())() instead of void." >&4
7426 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7427 echo "You have void (*signal())()." >&4
7430 case "$d_voidsig" in
7432 echo "I can't determine whether signal handler returns void or int..." >&4
7434 rp="What type does your signal handler return?"
7441 echo "As you already told me, signal handler returns void." >&4
7444 *) echo "As you already told me, signal handler returns int." >&4
7451 case "$d_voidsig" in
7452 "$define") signal_t="void";;
7457 : check for ability to cast large floats to 32-bit ints.
7459 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7460 if $test "$intsize" -ge 4; then
7467 #include <sys/types.h>
7469 $signal_t blech(s) int s; { exit(3); }
7476 signal(SIGFPE, blech);
7478 /* Don't let compiler optimize the test away. Store the number
7479 in a writable string for gcc to pass to sscanf under HP/UX.
7481 sprintf(str, "2147483647");
7482 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7486 /* x86 processors will probably give 0x8000 0000, which is a
7487 sign change. We don't want that. We want to mimic SPARC
7488 behavior here, which is to preserve the sign and give
7491 if (i32 != ($xxx) f)
7497 if eval $compile_ok; then
7501 echo "(I can't seem to compile the test program--assuming it can't)"
7509 echo "Nope, it can't."
7516 : check for ability to cast negative floats to unsigned
7518 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7521 #include <sys/types.h>
7523 $signal_t blech(s) int s; { exit(7); }
7524 $signal_t blech_in_list(s) int s; { exit(4); }
7525 unsigned long dummy_long(p) unsigned long p; { return p; }
7526 unsigned int dummy_int(p) unsigned int p; { return p; }
7527 unsigned short dummy_short(p) unsigned short p; { return p; }
7531 unsigned long along;
7533 unsigned short ashort;
7537 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7538 a direct f = -123. assignment. gcc-2.8.0 reportedly
7539 optimized the whole file away
7541 /* Store the number in a writable string for gcc to pass to
7544 sprintf(str, "-123");
7545 sscanf(str, "%lf", &f); /* f = -123.; */
7547 signal(SIGFPE, blech);
7548 along = (unsigned long)f;
7549 aint = (unsigned int)f;
7550 ashort = (unsigned short)f;
7551 if (along != (unsigned long)-123)
7553 if (aint != (unsigned int)-123)
7555 if (ashort != (unsigned short)-123)
7557 sprintf(str, "1073741824.");
7558 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7561 along = (unsigned long)f;
7562 if (along != 0x80000000)
7566 along = (unsigned long)f;
7567 if (along != 0x7fffffff)
7571 along = (unsigned long)f;
7572 if (along != 0x80000001)
7576 signal(SIGFPE, blech_in_list);
7577 sprintf(str, "123.");
7578 sscanf(str, "%lf", &f); /* f = 123.; */
7579 along = dummy_long((unsigned long)f);
7580 aint = dummy_int((unsigned int)f);
7581 ashort = dummy_short((unsigned short)f);
7582 if (along != (unsigned long)123)
7584 if (aint != (unsigned int)123)
7586 if (ashort != (unsigned short)123)
7593 if eval $compile_ok; then
7597 echo "(I can't seem to compile the test program--assuming it can't)"
7600 case "$castflags" in
7605 echo "Nope, it can't."
7612 : see if vprintf exists
7614 if set vprintf val -f d_vprintf; eval $csym; $val; then
7615 echo 'vprintf() found.' >&4
7617 $cat >vprintf.c <<'EOF'
7618 #include <varargs.h>
7620 int main() { xxx("foo"); }
7629 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7633 if eval $compile && ./vprintf; then
7634 echo "Your vsprintf() returns (int)." >&4
7637 echo "Your vsprintf() returns (char*)." >&4
7641 echo 'vprintf() NOT found.' >&4
7651 : see if chown exists
7655 : see if chroot exists
7659 : see if chsize exists
7663 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7664 while $test $# -ge 2; do
7666 $define) echo "#include <$2>";;
7670 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
7671 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7680 : see if this is a sys/uio.h system
7681 set sys/uio.h i_sysuio
7684 echo "Checking to see if your system supports struct iovec..." >&4
7685 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7687 case "$d_iovec_s" in
7688 "$define") echo "Yup, it does." >&4
7690 *) echo "Nope, it doesn't." >&4
7696 : see whether socket exists
7698 $echo $n "Hmm... $c" >&4
7699 if set socket val -f d_socket; eval $csym; $val; then
7700 echo "Looks like you have Berkeley networking support." >&4
7702 if set setsockopt val -f; eval $csym; $val; then
7705 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7709 if $contains socklib libc.list >/dev/null 2>&1; then
7710 echo "Looks like you have Berkeley networking support." >&4
7712 : we will have to assume that it supports the 4.2 BSD interface
7715 echo "You don't have Berkeley networking in libc$_a..." >&4
7716 if test "X$d_socket" = "X$define"; then
7717 echo "...but you seem to believe that you have sockets." >&4
7719 for net in net socket
7721 if test -f /usr/lib/lib$net$_a; then
7722 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7723 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7724 if $contains socket libc.list >/dev/null 2>&1; then
7729 echo "...but the Wollongong group seems to have hacked it in." >&4
7730 sockethdr="-I/usr/netinclude"
7733 echo "Found Berkeley sockets interface in lib$net." >& 4
7734 if $contains setsockopt libc.list >/dev/null 2>&1; then
7737 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7744 if test "X$d_socket" != "X$define"; then
7745 echo "or anywhere else I see." >&4
7753 : see if socketpair exists
7754 set socketpair d_sockpair
7759 echo "Checking the availability of certain socket constants..." >& 4
7760 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7761 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7763 #include <sys/types.h>
7764 #include <sys/socket.h>
7770 set try; if eval $compile; then
7773 set d_${enum}; eval $setvar
7777 set sendmsg d_sendmsg
7780 set recvmsg d_recvmsg
7784 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7785 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7787 case "$d_msghdr_s" in
7788 "$define") echo "Yup, it does." >&4
7790 *) echo "Nope, it doesn't." >&4
7794 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7795 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7797 case "$d_cmsghdr_s" in
7798 "$define") echo "Yup, it does." >&4
7800 *) echo "Nope, it doesn't." >&4
7804 : check for const keyword
7806 echo 'Checking to see if your C compiler knows about "const"...' >&4
7807 $cat >const.c <<'EOCP'
7808 typedef struct spug { int drokk; } spug;
7815 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7817 echo "Yup, it does."
7820 echo "Nope, it doesn't."
7825 : see if crypt exists
7827 if set crypt val -f d_crypt; eval $csym; $val; then
7828 echo 'crypt() found.' >&4
7832 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7833 if $test -z "$cryptlib"; then
7834 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7838 if $test -z "$cryptlib"; then
7839 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7843 if $test -z "$cryptlib"; then
7844 cryptlib=`./loc libcrypt$_a "" $libpth`
7848 if $test -z "$cryptlib"; then
7849 echo 'crypt() NOT found.' >&4
7858 : get csh whereabouts
7860 'csh') val="$undef" ;;
7865 : Respect a hint or command line value for full_csh.
7867 '') full_csh=$csh ;;
7870 : see if cuserid exists
7871 set cuserid d_cuserid
7874 : see if this is a limits.h system
7875 set limits.h i_limits
7878 : see if this is a float.h system
7882 : See if number of significant digits in a double precision number is known
7884 $cat >dbl_dig.c <<EOM
7894 printf("Contains DBL_DIG");
7897 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7898 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7899 echo "DBL_DIG found." >&4
7902 echo "DBL_DIG NOT found." >&4
7909 : see if difftime exists
7910 set difftime d_difftime
7913 : see if this is a dirent system
7915 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7917 echo "<dirent.h> found." >&4
7920 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7921 echo "<sys/dir.h> found." >&4
7924 xinc=`./findhdr sys/ndir.h`
7926 echo "<dirent.h> NOT found." >&4
7931 : Look for type of directory structure.
7933 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7935 case "$direntrytype" in
7938 $define) guess1='struct dirent' ;;
7939 *) guess1='struct direct' ;;
7942 *) guess1="$direntrytype"
7947 'struct dirent') guess2='struct direct' ;;
7948 *) guess2='struct dirent' ;;
7951 if $contains "$guess1" try.c >/dev/null 2>&1; then
7952 direntrytype="$guess1"
7953 echo "Your directory entries are $direntrytype." >&4
7954 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7955 direntrytype="$guess2"
7956 echo "Your directory entries seem to be $direntrytype." >&4
7958 echo "I don't recognize your system's directory entries." >&4
7959 rp="What type is used for directory entries on this system?"
7967 : see if the directory entry stores field length
7969 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7970 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7971 echo "Good, your directory entry keeps length information in d_namlen." >&4
7974 echo "Your directory entry does not know about the d_namlen field." >&4
7981 : see if dlerror exists
7984 set dlerror d_dlerror
7988 : see if dlfcn is available
7996 On a few systems, the dynamically loaded modules that perl generates and uses
7997 will need a different extension than shared libs. The default will probably
8005 rp='What is the extension of dynamically loaded modules'
8014 : Check if dlsym need a leading underscore
8020 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8021 $cat >dyna.c <<'EOM'
8030 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8032 #include <sys/types.h>
8046 int mode = RTLD_LAZY ;
8048 handle = dlopen("./dyna.$dlext", mode) ;
8049 if (handle == NULL) {
8054 symbol = dlsym(handle, "fred") ;
8055 if (symbol == NULL) {
8056 /* try putting a leading underscore */
8057 symbol = dlsym(handle, "_fred") ;
8058 if (symbol == NULL) {
8071 : Call the object file tmp-dyna.o in case dlext=o.
8072 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8073 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8074 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8075 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8078 1) echo "Test program failed using dlopen." >&4
8079 echo "Perhaps you should not use dynamic loading." >&4;;
8080 2) echo "Test program failed using dlsym." >&4
8081 echo "Perhaps you should not use dynamic loading." >&4;;
8082 3) echo "dlsym needs a leading underscore" >&4
8084 4) echo "dlsym doesn't need a leading underscore." >&4;;
8087 echo "I can't compile and run the test program." >&4
8088 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8093 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8098 hasproto='varname=$1; func=$2; shift; shift;
8099 while $test $# -ge 2; do
8101 $define) echo "#include <$2>";;
8105 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8106 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8107 echo "$func() prototype found.";
8110 echo "$func() prototype NOT found.";
8115 $rm -f try.c tryout.c'
8117 : see if prototype for drand48 is available
8119 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8122 : see if dup2 exists
8126 : see if eaccess exists
8127 set eaccess d_eaccess
8130 : see if endgrent exists
8131 set endgrent d_endgrent
8134 : see if endhostent exists
8135 set endhostent d_endhent
8138 : see if endnetent exists
8139 set endnetent d_endnent
8142 : see if endprotoent exists
8143 set endprotoent d_endpent
8146 : see if endpwent exists
8147 set endpwent d_endpwent
8150 : see if endservent exists
8151 set endservent d_endsent
8154 : see if endspent exists
8155 set endspent d_endspent
8158 : Locate the flags for 'open()'
8160 $cat >open3.c <<'EOCP'
8161 #include <sys/types.h>
8166 #include <sys/file.h>
8177 : check sys/file.h first to get FREAD on Sun
8178 if $test `./findhdr sys/file.h` && \
8179 set open3 -DI_SYS_FILE && eval $compile; then
8181 echo "<sys/file.h> defines the O_* constants..." >&4
8183 echo "and you have the 3 argument form of open()." >&4
8186 echo "but not the 3 argument form of open(). Oh, well." >&4
8189 elif $test `./findhdr fcntl.h` && \
8190 set open3 -DI_FCNTL && eval $compile; then
8192 echo "<fcntl.h> defines the O_* constants..." >&4
8194 echo "and you have the 3 argument form of open()." >&4
8197 echo "but not the 3 argument form of open(). Oh, well." >&4
8202 echo "I can't find the O_* constant definitions! You got problems." >&4
8208 : check for non-blocking I/O stuff
8209 case "$h_sysfile" in
8210 true) echo "#include <sys/file.h>" > head.c;;
8213 true) echo "#include <fcntl.h>" > head.c;;
8214 *) echo "#include <sys/fcntl.h>" > head.c;;
8219 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8220 case "$o_nonblock" in
8223 $cat >>try.c <<'EOCP'
8226 printf("O_NONBLOCK\n");
8230 printf("O_NDELAY\n");
8234 printf("FNDELAY\n");
8241 if eval $compile_ok; then
8243 case "$o_nonblock" in
8244 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8245 *) echo "Seems like we can use $o_nonblock.";;
8248 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8251 *) echo "Using $hint value $o_nonblock.";;
8253 $rm -f try try.* .out core
8256 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8262 #include <sys/types.h>
8264 #define MY_O_NONBLOCK $o_nonblock
8265 #ifndef errno /* XXX need better Configure test */
8268 $signal_t blech(x) int x; { exit(3); }
8270 $cat >> try.c <<'EOCP'
8278 pipe(pd); /* Down: child -> parent */
8279 pipe(pu); /* Up: parent -> child */
8282 close(pd[1]); /* Parent reads from pd[0] */
8283 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8284 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8286 signal(SIGALRM, blech);
8288 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8290 sprintf(string, "%d\n", ret);
8291 write(2, string, strlen(string));
8294 if (errno == EAGAIN) {
8300 if (errno == EWOULDBLOCK)
8301 printf("EWOULDBLOCK\n");
8304 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8305 sleep(2); /* Give it time to close our pipe */
8307 ret = read(pd[0], buf, 1); /* Should read EOF */
8309 sprintf(string, "%d\n", ret);
8310 write(3, string, strlen(string));
8314 close(pd[0]); /* We write to pd[1] */
8315 close(pu[1]); /* We read from pu[0] */
8316 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8317 close(pd[1]); /* Pipe pd is now fully closed! */
8318 exit(0); /* Bye bye, thank you for playing! */
8322 if eval $compile_ok; then
8323 echo "$startsh" >mtry
8324 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8326 ./mtry >/dev/null 2>&1
8328 0) eagain=`$cat try.out`;;
8329 1) echo "Could not perform non-blocking setting!";;
8330 2) echo "I did a successful read() for something that was not there!";;
8331 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8332 *) echo "Something terribly wrong happened during testing.";;
8334 rd_nodata=`$cat try.ret`
8335 echo "A read() system call with no data present returns $rd_nodata."
8336 case "$rd_nodata" in
8339 echo "(That's peculiar, fixing that to be -1.)"
8345 echo "Forcing errno EAGAIN on read() with no data available."
8349 echo "Your read() sets errno to $eagain when no data is available."
8352 status=`$cat try.err`
8354 0) echo "And it correctly returns 0 to signal EOF.";;
8355 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8356 *) echo "However, your read() returns '$status' on EOF??";;
8359 if test "$status" = "$rd_nodata"; then
8360 echo "WARNING: you can't distinguish between EOF and no data!"
8364 echo "I can't compile the test program--assuming errno EAGAIN will do."
8371 echo "Using $hint value $eagain."
8372 echo "Your read() returns $rd_nodata when no data is present."
8373 case "$d_eofnblk" in
8374 "$define") echo "And you can see EOF because read() returns 0.";;
8375 "$undef") echo "But you can't see EOF status from read() returned value.";;
8377 echo "(Assuming you can't see EOF status from read anyway.)"
8383 $rm -f try try.* .out core head.c mtry
8385 : see if fchmod exists
8389 : see if fchown exists
8393 : see if this is an fcntl system
8397 : see if sys/select.h has to be included
8398 set sys/select.h i_sysselct
8401 : see if we should include time.h, sys/time.h, or both
8403 if test "X$timeincl" = X; then
8404 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8405 $echo $n "I'm now running the test program...$c"
8406 $cat >try.c <<'EOCP'
8407 #include <sys/types.h>
8412 #ifdef SYSTIMEKERNEL
8415 #include <sys/time.h>
8418 #include <sys/select.h>
8427 struct timezone tzp;
8429 if (foo.tm_sec == foo.tm_sec)
8432 if (bar.tv_sec == bar.tv_sec)
8439 for s_timezone in '-DS_TIMEZONE' ''; do
8441 for s_timeval in '-DS_TIMEVAL' ''; do
8442 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8443 for i_time in '' '-DI_TIME'; do
8444 for i_systime in '-DI_SYSTIME' ''; do
8447 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8448 if eval $compile; then
8449 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8453 $echo $n "Succeeded with $flags$c"
8465 *SYSTIMEKERNEL*) i_systimek="$define"
8466 timeincl=`./findhdr sys/time.h`
8467 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8468 *) i_systimek="$undef";;
8471 *I_TIME*) i_time="$define"
8472 timeincl=`./findhdr time.h`" $timeincl"
8473 echo "We'll include <time.h>." >&4;;
8474 *) i_time="$undef";;
8477 *I_SYSTIME*) i_systime="$define"
8478 timeincl=`./findhdr sys/time.h`" $timeincl"
8479 echo "We'll include <sys/time.h>." >&4;;
8480 *) i_systime="$undef";;
8485 : check for fd_set items
8488 Checking to see how well your C compiler handles fd_set and friends ...
8490 $cat >fd_set.c <<EOCP
8491 #$i_systime I_SYS_TIME
8492 #$i_sysselct I_SYS_SELECT
8493 #$d_socket HAS_SOCKET
8494 #include <sys/types.h>
8496 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8499 #include <sys/time.h>
8502 #include <sys/select.h>
8511 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8518 set fd_set -DTRYBITS
8519 if eval $compile; then
8520 d_fds_bits="$define"
8522 echo "Well, your system knows about the normal fd_set typedef..." >&4
8524 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8525 d_fd_macros="$define"
8528 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8530 d_fd_macros="$undef"
8534 Hmm, your compiler has some difficulty with fd_set. Checking further...
8537 if eval $compile; then
8540 echo "Well, your system has some sort of fd_set available..." >&4
8542 echo "and you have the normal fd_set macros." >&4
8543 d_fd_macros="$define"
8546 but not the normal fd_set macros! Gross! More work for me...
8548 d_fd_macros="$undef"
8551 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8554 d_fd_macros="$undef"
8559 : see if fgetpos exists
8560 set fgetpos d_fgetpos
8563 : see if flock exists
8567 : see if fork exists
8571 : see if pathconf exists
8572 set pathconf d_pathconf
8575 : see if fpathconf exists
8576 set fpathconf d_fpathconf
8580 : see if llseek exists
8586 echo $n "Checking to see if your system supports off64_t...$c" >&4
8588 #include <sys/types.h>
8590 off64_t foo() { off64_t x; x = 7; return x; }'
8592 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8594 echo " Yup, it does." >&4
8597 echo " Nope, it doesn't." >&4
8603 : check for fpos64_t
8605 echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8607 #include <sys/stdio.h>
8608 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8610 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8612 echo " Yup, it does." >&4
8615 echo " Nope, it doesn't." >&4
8621 : see if fseeko exists
8625 : see if fsetpos exists
8626 set fsetpos d_fsetpos
8629 : see if this is a sys/param system
8630 set sys/param.h i_sysparam
8633 : see if this is a sys/mount.h system
8634 set sys/mount.h i_sysmount
8638 : see if statfs exists
8642 : see if fstatfs exists
8643 set fstatfs d_fstatfs
8646 : see if statfs knows about mount flags
8647 set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8651 : see if statvfs exists
8652 set statvfs d_statvfs
8655 : see if fstatvfs exists
8656 set fstatvfs d_fstatvfs
8660 : see if ftello exists
8664 : see if getgrent exists
8665 set getgrent d_getgrent
8668 : see if gethostbyaddr exists
8669 set gethostbyaddr d_gethbyaddr
8672 : see if gethostbyname exists
8673 set gethostbyname d_gethbyname
8676 : see if gethostent exists
8677 set gethostent d_gethent
8680 : see how we will look up host name
8683 if set gethostname val -f d_gethname; eval $csym; $val; then
8684 echo 'gethostname() found.' >&4
8685 d_gethname="$define"
8688 if set uname val -f d_uname; eval $csym; $val; then
8691 uname() was found, but you're running xenix, and older versions of xenix
8692 have a broken uname(). If you don't really know whether your xenix is old
8693 enough to have a broken system call, use the default answer.
8700 rp='Is your uname() broken?'
8703 n*) d_uname="$define"; call=uname;;
8706 echo 'uname() found.' >&4
8713 case "$d_gethname" in
8714 '') d_gethname="$undef";;
8717 '') d_uname="$undef";;
8719 case "$d_uname$d_gethname" in
8724 Every now and then someone has a $call() that lies about the hostname
8725 but can't be fixed for political or economic reasons. If you wish, I can
8726 pretend $call() isn't there and maybe compute hostname at run-time
8727 thanks to the '$phostname' command.
8730 rp="Shall I ignore $call() from now on?"
8733 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8736 case "$phostname" in
8738 *) case "$aphostname" in
8744 file=`./loc $file $file $pth`
8745 aphostname=`echo $file $*`
8750 case "$d_uname$d_gethname" in
8753 case "$phostname" in
8755 echo "There will be no way for $package to get your hostname." >&4;;
8757 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8761 case "$d_phostname" in
8762 '') d_phostname="$undef";;
8765 : see if this is a netdb.h system
8769 : see if prototypes for various gethostxxx netdb.h functions are available
8771 set d_gethostprotos gethostent $i_netdb netdb.h
8774 : see if getlogin exists
8775 set getlogin d_getlogin
8778 : see if getmntent exists
8779 set getmntent d_getmntent
8782 : see if getnetbyaddr exists
8783 set getnetbyaddr d_getnbyaddr
8786 : see if getnetbyname exists
8787 set getnetbyname d_getnbyname
8790 : see if getnetent exists
8791 set getnetent d_getnent
8794 : see if prototypes for various getnetxxx netdb.h functions are available
8796 set d_getnetprotos getnetent $i_netdb netdb.h
8800 : see if getprotobyname exists
8801 set getprotobyname d_getpbyname
8804 : see if getprotobynumber exists
8805 set getprotobynumber d_getpbynumber
8808 : see if getprotoent exists
8809 set getprotoent d_getpent
8812 : see if getpgid exists
8813 set getpgid d_getpgid
8816 : see if getpgrp2 exists
8817 set getpgrp2 d_getpgrp2
8820 : see if getppid exists
8821 set getppid d_getppid
8824 : see if getpriority exists
8825 set getpriority d_getprior
8828 : see if prototypes for various getprotoxxx netdb.h functions are available
8830 set d_getprotoprotos getprotoent $i_netdb netdb.h
8833 : see if getpwent exists
8834 set getpwent d_getpwent
8838 : see if getservbyname exists
8839 set getservbyname d_getsbyname
8842 : see if getservbyport exists
8843 set getservbyport d_getsbyport
8846 : see if getservent exists
8847 set getservent d_getsent
8850 : see if prototypes for various getservxxx netdb.h functions are available
8852 set d_getservprotos getservent $i_netdb netdb.h
8855 : see if getspent exists
8856 set getspent d_getspent
8859 : see if getspnam exists
8860 set getspnam d_getspnam
8863 : see if gettimeofday or ftime exists
8864 set gettimeofday d_gettimeod
8866 case "$d_gettimeod" in
8872 val="$undef"; set d_ftime; eval $setvar
8875 case "$d_gettimeod$d_ftime" in
8878 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8882 : see if this is an grp system
8888 xxx=`./findhdr grp.h`
8889 $cppstdin $cppflags $cppminus < $xxx >$$.h
8891 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8903 set d_grpasswd; eval $setvar
8907 : see if hasmntopt exists
8908 set hasmntopt d_hasmntopt
8911 : see if this is a netinet/in.h or sys/in.h system
8912 set netinet/in.h i_niin sys/in.h i_sysin
8915 : see if arpa/inet.h has to be included
8916 set arpa/inet.h i_arpainet
8919 : see if htonl --and friends-- exists
8924 : Maybe they are macros.
8929 #include <sys/types.h>
8930 #$i_niin I_NETINET_IN
8932 #$i_arpainet I_ARPA_INET
8934 #include <netinet/in.h>
8940 #include <arpa/inet.h>
8943 printf("Defined as a macro.");
8946 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8947 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8949 echo "But it seems to be defined as a macro." >&4
8957 : see which of string.h or strings.h is needed
8959 strings=`./findhdr string.h`
8960 if $test "$strings" && $test -r "$strings"; then
8961 echo "Using <string.h> instead of <strings.h>." >&4
8965 strings=`./findhdr strings.h`
8966 if $test "$strings" && $test -r "$strings"; then
8967 echo "Using <strings.h> instead of <string.h>." >&4
8969 echo "No string header found -- You'll surely have problems." >&4
8975 "$undef") strings=`./findhdr strings.h`;;
8976 *) strings=`./findhdr string.h`;;
8981 if set index val -f; eval $csym; $val; then
8982 if set strchr val -f d_strchr; eval $csym; $val; then
8983 if $contains strchr "$strings" >/dev/null 2>&1 ; then
8986 echo "strchr() found." >&4
8990 echo "index() found." >&4
8995 echo "index() found." >&4
8998 if set strchr val -f d_strchr; eval $csym; $val; then
9001 echo "strchr() found." >&4
9003 echo "No index() or strchr() found!" >&4
9008 set d_strchr; eval $setvar
9010 set d_index; eval $setvar
9012 : check whether inet_aton exists
9013 set inet_aton d_inetaton
9018 $cat >isascii.c <<'EOCP'
9030 if eval $compile; then
9031 echo "isascii() found." >&4
9034 echo "isascii() NOT found." >&4
9041 : see if killpg exists
9045 : see if lchown exists
9047 $cat > try.c <<'EOCP'
9048 /* System header to define __stub macros and hopefully few prototypes,
9049 which can conflict with char lchown(); below. */
9051 /* Override any gcc2 internal prototype to avoid an error. */
9052 /* We use char because int might match the return type of a gcc2
9053 builtin and then its argument prototype would still apply. */
9056 /* The GNU C library defines this for functions which it implements
9057 to always fail with ENOSYS. Some functions are actually named
9058 something starting with __ and the normal name is an alias. */
9059 #if defined (__stub_lchown) || defined (__stub___lchown)
9067 if eval $compile; then
9068 $echo "lchown() found." >&4
9071 $echo "lchown() NOT found." >&4
9077 : See if number of significant digits in a double precision number is known
9079 $cat >ldbl_dig.c <<EOM
9089 printf("Contains LDBL_DIG");
9092 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9093 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9094 echo "LDBL_DIG found." >&4
9097 echo "LDBL_DIG NOT found." >&4
9104 : see if link exists
9108 : see if localeconv exists
9109 set localeconv d_locconv
9112 : see if lockf exists
9116 : see if lstat exists
9120 : see if madvise exists
9121 set madvise d_madvise
9124 : see if mblen exists
9128 : see if mbstowcs exists
9129 set mbstowcs d_mbstowcs
9132 : see if mbtowc exists
9136 : see if memchr exists
9140 : see if memcmp exists
9144 : see if memcpy exists
9148 : see if memmove exists
9149 set memmove d_memmove
9152 : see if memset exists
9156 : see if mkdir exists
9160 : see if mkfifo exists
9164 : see if mktime exists
9168 : see if this is a sys/mman.h system
9169 set sys/mman.h i_sysmman
9172 : see if mmap exists
9175 : see what shmat returns
9176 : default to something harmless
9178 case "$i_sysmman$d_mmap" in
9180 $cat >mmap.c <<'END'
9181 #include <sys/mman.h>
9184 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9189 echo "and it returns ($mmaptype)." >&4
9195 : see if mprotect exists
9196 set mprotect d_mprotect
9199 : see if msgctl exists
9203 : see if msgget exists
9207 : see if msgsnd exists
9211 : see if msgrcv exists
9215 : see how much of the 'msg*(2)' library is present.
9218 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9219 *"$undef"*) h_msg=false;;
9223 case "`ipcs 2>&1`" in
9224 "SVID messages"*"not configured"*)
9225 echo "Your $osname does not have the msg*(2) configured." >&4
9240 : we could also check for sys/ipc.h ...
9241 if $h_msg && $test `./findhdr sys/msg.h`; then
9242 echo "You have the full msg*(2) library." >&4
9245 echo "You don't have the full msg*(2) library." >&4
9251 : see if msync exists
9255 : see if munmap exists
9259 : see if nice exists
9263 : see if POSIX threads are available
9264 set pthread.h i_pthread
9270 : how to create joinable pthreads
9271 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9273 echo "Checking what constant to use for creating joinable pthreads..." >&4
9274 $cat >try.c <<'EOCP'
9275 #include <pthread.h>
9277 int detachstate = JOINABLE;
9280 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9281 if eval $compile; then
9282 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9283 val="$undef" # Yes, undef.
9284 set d_old_pthread_create_joinable
9287 set old_pthread_create_joinable
9290 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9291 if eval $compile; then
9292 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9294 set d_old_pthread_create_joinable
9296 val=PTHREAD_CREATE_UNDETACHED
9297 set old_pthread_create_joinable
9300 set try -DJOINABLE=__UNDETACHED
9301 if eval $compile; then
9302 echo "You seem to use __UNDETACHED." >&4
9304 set d_old_pthread_create_joinable
9307 set old_pthread_create_joinable
9310 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9312 set d_old_pthread_create_joinable
9315 set old_pthread_create_joinable
9322 d_old_pthread_create_joinable="$undef"
9323 old_pthread_create_joinable=""
9326 : see if pause exists
9330 : see if pipe exists
9334 : see if poll exists
9339 : see whether the various POSIXish _yields exist
9341 #include <pthread.h>
9347 #ifdef PTHREAD_YIELD
9350 #ifdef PTHREAD_YIELD_NULL
9351 pthread_yield(NULL);
9357 : see if sched_yield exists
9358 set try -DSCHED_YIELD
9359 if eval $compile; then
9361 sched_yield='sched_yield()'
9365 case "$usethreads" in
9368 $define) echo 'sched_yield() found.' >&4 ;;
9369 *) echo 'sched_yield() NOT found.' >&4 ;;
9375 : see if pthread_yield exists
9376 set try -DPTHREAD_YIELD
9377 if eval $compile; then
9379 case "$sched_yield" in
9380 '') sched_yield='pthread_yield()' ;;
9383 set try -DPTHREAD_YIELD_NULL
9384 if eval $compile; then
9386 case "$sched_yield" in
9387 '') sched_yield='pthread_yield(NULL)' ;;
9393 case "$usethreads" in
9396 $define) echo 'pthread_yield() found.' >&4 ;;
9397 *) echo 'pthread_yield() NOT found.' >&4 ;;
9404 case "$sched_yield" in
9405 '') sched_yield=undef ;;
9410 : see if this is a pwd.h system
9416 xxx=`./findhdr pwd.h`
9417 $cppstdin $cppflags $cppminus < $xxx >$$.h
9419 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9427 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9435 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9443 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9451 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9459 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9467 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9475 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9487 set d_pwquota; eval $setvar
9488 set d_pwage; eval $setvar
9489 set d_pwchange; eval $setvar
9490 set d_pwclass; eval $setvar
9491 set d_pwexpire; eval $setvar
9492 set d_pwcomment; eval $setvar
9493 set d_pwgecos; eval $setvar
9494 set d_pwpasswd; eval $setvar
9498 : see if readdir and friends exist
9499 set readdir d_readdir
9501 set seekdir d_seekdir
9503 set telldir d_telldir
9505 set rewinddir d_rewinddir
9508 : see if readlink exists
9509 set readlink d_readlink
9512 : see if readv exists
9516 : see if rename exists
9520 : see if rmdir exists
9524 : see if memory.h is available.
9529 : See if it conflicts with string.h
9535 $cppstdin $cppflags $cppminus < $strings > mem.h
9536 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9538 echo "We won't be including <memory.h>."
9548 : can bcopy handle overlapping blocks?
9553 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9560 $cat >>try.c <<'EOCP'
9563 # include <memory.h>
9566 # include <stdlib.h>
9569 # include <string.h>
9571 # include <strings.h>
9574 # include <unistd.h> /* Needed for NetBSD */
9578 char buf[128], abc[128];
9584 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9586 for (align = 7; align >= 0; align--) {
9587 for (len = 36; len; len--) {
9590 for (off = 1; off <= len; off++) {
9591 bcopy(b, b+off, len);
9592 bcopy(b+off, b, len);
9593 if (bcmp(b, abc, len))
9602 if eval $compile_ok; then
9603 if ./try 2>/dev/null; then
9607 echo "It can't, sorry."
9608 case "$d_memmove" in
9609 "$define") echo "But that's Ok since you have memmove()." ;;
9613 echo "(I can't compile the test program, so we'll assume not...)"
9614 case "$d_memmove" in
9615 "$define") echo "But that's Ok since you have memmove()." ;;
9620 $rm -f try.* try core
9624 : can memcpy handle overlapping blocks?
9629 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9636 $cat >>try.c <<'EOCP'
9639 # include <memory.h>
9642 # include <stdlib.h>
9645 # include <string.h>
9647 # include <strings.h>
9650 # include <unistd.h> /* Needed for NetBSD */
9654 char buf[128], abc[128];
9660 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9661 try to store the string in read-only memory. */
9662 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9664 for (align = 7; align >= 0; align--) {
9665 for (len = 36; len; len--) {
9667 memcpy(b, abc, len);
9668 for (off = 1; off <= len; off++) {
9669 memcpy(b+off, b, len);
9670 memcpy(b, b+off, len);
9671 if (memcmp(b, abc, len))
9680 if eval $compile_ok; then
9681 if ./try 2>/dev/null; then
9685 echo "It can't, sorry."
9686 case "$d_memmove" in
9687 "$define") echo "But that's Ok since you have memmove()." ;;
9691 echo "(I can't compile the test program, so we'll assume not...)"
9692 case "$d_memmove" in
9693 "$define") echo "But that's Ok since you have memmove()." ;;
9698 $rm -f try.* try core
9702 : can memcmp be trusted to compare relative magnitude?
9707 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9714 $cat >>try.c <<'EOCP'
9717 # include <memory.h>
9720 # include <stdlib.h>
9723 # include <string.h>
9725 # include <strings.h>
9728 # include <unistd.h> /* Needed for NetBSD */
9734 if ((a < b) && memcmp(&a, &b, 1) < 0)
9740 if eval $compile_ok; then
9741 if ./try 2>/dev/null; then
9745 echo "No, it can't (it uses signed chars)."
9748 echo "(I can't compile the test program, so we'll assume not...)"
9752 $rm -f try.* try core
9756 : see if select exists
9760 : see if semctl exists
9764 : see if semget exists
9768 : see if semop exists
9772 : see how much of the 'sem*(2)' library is present.
9775 case "$d_semctl$d_semget$d_semop" in
9776 *"$undef"*) h_sem=false;;
9780 case "`ipcs 2>&1`" in
9781 "SVID messages"*"not configured"*)
9782 echo "Your $osname does not have the sem*(2) configured." >&4
9795 : we could also check for sys/ipc.h ...
9796 if $h_sem && $test `./findhdr sys/sem.h`; then
9797 echo "You have the full sem*(2) library." >&4
9800 echo "You don't have the full sem*(2) library." >&4
9806 : see whether sys/sem.h defines union semun
9808 $cat > try.c <<'END'
9809 #include <sys/types.h>
9810 #include <sys/ipc.h>
9811 #include <sys/sem.h>
9812 int main () { union semun semun; semun.buf = 0; }
9815 if eval $compile; then
9816 echo "You have union semun in <sys/sem.h>." >&4
9819 echo "You do not have union semun in <sys/sem.h>." >&4
9822 $rm -f try try.c try.h
9826 : see how to do semctl IPC_STAT
9829 : see whether semctl IPC_STAT can use union semun
9834 # define S_IRUSR S_IREAD
9835 # define S_IWUSR S_IWRITE
9836 # define S_IXUSR S_IEXEC
9838 # define S_IRUSR 0400
9839 # define S_IWUSR 0200
9840 # define S_IXUSR 0100
9842 # define S_IRGRP (S_IRUSR>>3)
9843 # define S_IWGRP (S_IWUSR>>3)
9844 # define S_IXGRP (S_IXUSR>>3)
9845 # define S_IROTH (S_IRUSR>>6)
9846 # define S_IWOTH (S_IWUSR>>6)
9847 # define S_IXOTH (S_IXUSR>>6)
9850 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9851 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9852 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9857 #include <sys/types.h>
9858 #include <sys/ipc.h>
9859 #include <sys/sem.h>
9860 #include <sys/stat.h>
9867 #$d_union_semun HAS_UNION_SEMUN
9870 #ifndef HAS_UNION_SEMUN
9873 struct semid_ds *buf;
9874 unsigned short *array;
9880 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9881 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9883 struct semid_ds argbuf;
9886 st = semctl(sem, 0, IPC_STAT, arg);
9890 # endif /* IPC_STAT */
9891 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9893 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9894 # endif /* IPC_RMID */
9895 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9897 #endif /* IPC_PRIVATE && ... */
9898 printf("semget failed: errno = %d\n", errno);
9904 if eval $compile; then
9907 semun) val="$define" ;;
9913 case "$d_semctl_semun" in
9915 echo "You can use union semun for semctl IPC_STAT." >&4
9918 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9923 : see whether semctl IPC_STAT can use struct semid_ds pointer
9924 $cat > try.c <<'END'
9925 #include <sys/types.h>
9926 #include <sys/ipc.h>
9927 #include <sys/sem.h>
9928 #include <sys/stat.h>
9936 struct semid_ds arg;
9939 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9940 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9943 st = semctl(sem, 0, IPC_STAT, &arg);
9945 printf("semid_ds\n");
9947 # endif /* IPC_STAT */
9948 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9950 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9951 # endif /* IPC_RMID */
9952 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9954 #endif /* IPC_PRIVATE && ... */
9955 printf("semget failed: errno = %d\n", errno);
9962 if eval $compile; then
9965 semid_ds) val="$define" ;;
9969 set d_semctl_semid_ds
9971 case "$d_semctl_semid_ds" in
9973 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9975 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9982 # We do not have the full sem*(2) library, so assume we can not
9988 set d_semctl_semid_ds
9993 : see if setegid exists
9994 set setegid d_setegid
9997 : see if seteuid exists
9998 set seteuid d_seteuid
10001 : see if setgrent exists
10002 set setgrent d_setgrent
10005 : see if sethostent exists
10006 set sethostent d_sethent
10009 : see if setlinebuf exists
10010 set setlinebuf d_setlinebuf
10013 : see if setlocale exists
10014 set setlocale d_setlocale
10017 : see if setnetent exists
10018 set setnetent d_setnent
10021 : see if setprotoent exists
10022 set setprotoent d_setpent
10025 : see if setpgid exists
10026 set setpgid d_setpgid
10029 : see if setpgrp2 exists
10030 set setpgrp2 d_setpgrp2
10033 : see if setpriority exists
10034 set setpriority d_setprior
10037 : see if setpwent exists
10038 set setpwent d_setpwent
10041 : see if setregid exists
10042 set setregid d_setregid
10044 set setresgid d_setresgid
10047 : see if setreuid exists
10048 set setreuid d_setreuid
10050 set setresuid d_setresuid
10053 : see if setrgid exists
10054 set setrgid d_setrgid
10057 : see if setruid exists
10058 set setruid d_setruid
10061 : see if setservent exists
10062 set setservent d_setsent
10065 : see if setsid exists
10066 set setsid d_setsid
10069 : see if setspent exists
10070 set setspent d_setspent
10073 : see if setvbuf exists
10074 set setvbuf d_setvbuf
10077 : see if sfio.h is available
10082 : see if sfio library is available
10093 : Ok, but do we want to use it.
10097 true|$define|[yY]*) dflt='y';;
10100 echo "$package can use the sfio library, but it is experimental."
10101 rp="You seem to have sfio available, do you want to try using it?"
10105 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10107 : Remove sfio from list of libraries to use
10108 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10111 echo "libs = $libs" >&4
10115 *) case "$usesfio" in
10116 true|$define|[yY]*)
10117 echo "Sorry, cannot find sfio on this machine" >&4
10118 echo "Ignoring your setting of usesfio=$usesfio" >&4
10126 $define) usesfio='true';;
10127 *) usesfio='false';;
10130 : see if shmctl exists
10131 set shmctl d_shmctl
10134 : see if shmget exists
10135 set shmget d_shmget
10138 : see if shmat exists
10141 : see what shmat returns
10144 $cat >shmat.c <<'END'
10145 #include <sys/shm.h>
10148 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10153 echo "and it returns ($shmattype)." >&4
10154 : see if a prototype for shmat is available
10155 xxx=`./findhdr sys/shm.h`
10156 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10157 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10168 set d_shmatprototype
10171 : see if shmdt exists
10175 : see how much of the 'shm*(2)' library is present.
10178 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10179 *"$undef"*) h_shm=false;;
10183 case "`ipcs 2>&1`" in
10184 "SVID shared memory"*"not configured"*)
10185 echo "Your $osname does not have the shm*(2) configured." >&4
10188 set shmctl d_shmctl
10190 set shmget d_shmget
10200 : we could also check for sys/ipc.h ...
10201 if $h_shm && $test `./findhdr sys/shm.h`; then
10202 echo "You have the full shm*(2) library." >&4
10205 echo "You don't have the full shm*(2) library." >&4
10212 : see if we have sigaction
10213 if set sigaction val -f d_sigaction; eval $csym; $val; then
10214 echo 'sigaction() found.' >&4
10215 $cat > try.c <<'EOP'
10217 #include <sys/types.h>
10218 #include <signal.h>
10221 struct sigaction act, oact;
10223 oact.sa_handler = 0;
10227 if eval $compile_ok; then
10230 echo "But you don't seem to have a useable struct sigaction." >&4
10234 echo 'sigaction NOT found.' >&4
10237 set d_sigaction; eval $setvar
10238 $rm -f try try$_o try.c
10240 : see if sigsetjmp exists
10242 case "$d_sigsetjmp" in
10244 $cat >try.c <<'EOP'
10245 #include <setjmp.h>
10250 if (sigsetjmp(env,1))
10253 siglongjmp(env, 1);
10258 if eval $compile; then
10259 if ./try >/dev/null 2>&1; then
10260 echo "POSIX sigsetjmp found." >&4
10264 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10270 echo "sigsetjmp not found." >&4
10274 *) val="$d_sigsetjmp"
10275 case "$d_sigsetjmp" in
10276 $define) echo "POSIX sigsetjmp found." >&4;;
10277 $undef) echo "sigsetjmp not found." >&4;;
10285 : see if sys/stat.h is available
10286 set sys/stat.h i_sysstat
10289 : see if stat knows about block sizes
10291 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10294 : see if _ptr and _cnt from stdio act std
10296 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10297 echo "(Looks like you have stdio.h from Linux.)"
10298 case "$stdio_ptr" in
10299 '') stdio_ptr='((fp)->_IO_read_ptr)'
10302 *) ptr_lval=$d_stdio_ptr_lval;;
10304 case "$stdio_cnt" in
10305 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10308 *) cnt_lval=$d_stdio_cnt_lval;;
10310 case "$stdio_base" in
10311 '') stdio_base='((fp)->_IO_read_base)';;
10313 case "$stdio_bufsiz" in
10314 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10317 case "$stdio_ptr" in
10318 '') stdio_ptr='((fp)->_ptr)'
10321 *) ptr_lval=$d_stdio_ptr_lval;;
10323 case "$stdio_cnt" in
10324 '') stdio_cnt='((fp)->_cnt)'
10327 *) cnt_lval=$d_stdio_cnt_lval;;
10329 case "$stdio_base" in
10330 '') stdio_base='((fp)->_base)';;
10332 case "$stdio_bufsiz" in
10333 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10336 : test whether _ptr and _cnt really work
10337 echo "Checking how std your stdio is..." >&4
10340 #define FILE_ptr(fp) $stdio_ptr
10341 #define FILE_cnt(fp) $stdio_cnt
10343 FILE *fp = fopen("try.c", "r");
10346 18 <= FILE_cnt(fp) &&
10347 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10355 if eval $compile; then
10357 echo "Your stdio acts pretty std."
10360 echo "Your stdio isn't very std."
10363 echo "Your stdio doesn't appear very std."
10369 : Can _ptr be used as an lvalue?
10370 case "$d_stdstdio$ptr_lval" in
10371 $define$define) val=$define ;;
10374 set d_stdio_ptr_lval
10377 : Can _cnt be used as an lvalue?
10378 case "$d_stdstdio$cnt_lval" in
10379 $define$define) val=$define ;;
10382 set d_stdio_cnt_lval
10385 : see if _base is also standard
10387 case "$d_stdstdio" in
10391 #define FILE_base(fp) $stdio_base
10392 #define FILE_bufsiz(fp) $stdio_bufsiz
10394 FILE *fp = fopen("try.c", "r");
10397 19 <= FILE_bufsiz(fp) &&
10398 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10405 if eval $compile; then
10407 echo "And its _base field acts std."
10410 echo "But its _base field isn't std."
10413 echo "However, it seems to be lacking the _base field."
10422 Checking how to access stdio streams by file descriptor number...
10424 case "$stdio_stream_array" in
10425 '') $cat >try.c <<EOCP
10428 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10432 for s in _iob __iob __sF
10434 set try -DSTDIO_STREAM_ARRAY=$s
10435 if eval $compile; then
10436 case "`./try$exe_ext`" in
10437 yes) stdio_stream_array=$s; break ;;
10441 $rm -f try.* try$exe_ext
10443 case "$stdio_stream_array" in
10445 I can't figure out how to access stdio streams by file descriptor number.
10447 d_stdio_stream_array="$undef"
10450 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10452 d_stdio_stream_array="$define"
10456 : see if strcoll exists
10457 set strcoll d_strcoll
10460 : check for structure copying
10462 echo "Checking to see if your C compiler can copy structs..." >&4
10463 $cat >try.c <<'EOCP'
10473 if $cc -c try.c >/dev/null 2>&1 ; then
10475 echo "Yup, it can."
10478 echo "Nope, it can't."
10484 : see if strerror and/or sys_errlist[] exist
10486 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10487 if set strerror val -f d_strerror; eval $csym; $val; then
10488 echo 'strerror() found.' >&4
10489 d_strerror="$define"
10490 d_strerrm='strerror(e)'
10491 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10492 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10493 d_syserrlst="$define"
10495 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10496 d_syserrlst="$undef"
10498 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10499 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10500 echo 'strerror() found in string header.' >&4
10501 d_strerror="$define"
10502 d_strerrm='strerror(e)'
10503 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10504 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10505 d_syserrlst="$define"
10507 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10508 d_syserrlst="$undef"
10510 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10511 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10512 d_strerror="$undef"
10513 d_syserrlst="$define"
10514 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10516 echo 'strerror() and sys_errlist[] NOT found.' >&4
10517 d_strerror="$undef"
10518 d_syserrlst="$undef"
10519 d_strerrm='"unknown"'
10523 : see if strtod exists
10524 set strtod d_strtod
10527 : see if strtol exists
10528 set strtol d_strtol
10531 : see if strtoul exists
10532 set strtoul d_strtoul
10535 : see if strtoull exists
10536 set strtoull d_strtoull
10539 : see if strxfrm exists
10540 set strxfrm d_strxfrm
10543 : see if symlink exists
10544 set symlink d_symlink
10547 : see if syscall exists
10548 set syscall d_syscall
10551 : see if sysconf exists
10552 set sysconf d_sysconf
10555 : see if system exists
10556 set system d_system
10559 : see if tcgetpgrp exists
10560 set tcgetpgrp d_tcgetpgrp
10563 : see if tcsetpgrp exists
10564 set tcsetpgrp d_tcsetpgrp
10567 : see if sys/types.h has to be included
10568 set sys/types.h i_systypes
10571 : see if prototype for telldir is available
10573 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10576 : define an is-a-typedef? function
10577 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10579 "") inclist="sys/types.h";;
10581 eval "varval=\$$var";
10585 for inc in $inclist; do
10586 echo "#include <$inc>" >>temp.c;
10588 echo "#ifdef $type" >> temp.c;
10589 echo "printf(\"We have $type\");" >> temp.c;
10590 echo "#endif" >> temp.c;
10591 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10592 if $contains $type temp.E >/dev/null 2>&1; then
10593 eval "$var=\$type";
10598 *) eval "$var=\$varval";;
10601 : define an is-a-typedef? function that prompts if the type is not available.
10602 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10604 "") inclist="sys/types.h";;
10606 eval "varval=\$$var";
10610 for inc in $inclist; do
10611 echo "#include <$inc>" >>temp.c;
10613 echo "#ifdef $type" >> temp.c;
10614 echo "printf(\"We have $type\");" >> temp.c;
10615 echo "#endif" >> temp.c;
10616 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10618 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10619 if $contains $type temp.E >/dev/null 2>&1; then
10620 echo "$type found." >&4;
10621 eval "$var=\$type";
10623 echo "$type NOT found." >&4;
10629 *) eval "$var=\$varval";;
10632 : see if this is a sys/times.h system
10633 set sys/times.h i_systimes
10636 : see if times exists
10638 if set times val -f d_times; eval $csym; $val; then
10639 echo 'times() found.' >&4
10642 case "$i_systimes" in
10643 "$define") inc='sys/times.h';;
10645 rp="What is the type returned by times() on this system?"
10646 set clock_t clocktype long stdio.h sys/types.h $inc
10649 echo 'times() NOT found, hope that will do.' >&4
10654 : see if truncate exists
10655 set truncate d_truncate
10658 : see if tzname[] exists
10660 if set tzname val -a d_tzname; eval $csym; $val; then
10662 echo 'tzname[] found.' >&4
10665 echo 'tzname[] NOT found.' >&4
10670 : see if umask exists
10674 : backward compatibility for d_hvfork
10675 if test X$d_hvfork != X; then
10676 d_vfork="$d_hvfork"
10679 : see if there is a vfork
10684 : Ok, but do we want to use it. vfork is reportedly unreliable in
10685 : perl on Solaris 2.x, and probably elsewhere.
10689 case "$usevfork" in
10695 Perl can only use a vfork() that doesn't suffer from strict
10696 restrictions on calling functions or modifying global data in
10697 the child. For example, glibc-2.1 contains such a vfork()
10698 that is unsuitable. If your system provides a proper fork()
10699 call, chances are that you do NOT want perl to use vfork().
10702 rp="Do you still want to use vfork()?"
10707 echo "Ok, we won't use vfork()."
10716 $define) usevfork='true';;
10717 *) usevfork='false';;
10720 : see if this is an sysdir system
10721 set sys/dir.h i_sysdir
10724 : see if this is an sysndir system
10725 set sys/ndir.h i_sysndir
10728 : see if closedir exists
10729 set closedir d_closedir
10732 case "$d_closedir" in
10735 echo "Checking whether closedir() returns a status..." >&4
10736 cat > closedir.c <<EOM
10737 #$i_dirent I_DIRENT /**/
10738 #$i_sysdir I_SYS_DIR /**/
10739 #$i_sysndir I_SYS_NDIR /**/
10740 #$i_systypes I_SYS_TYPES /**/
10742 #if defined(I_SYS_TYPES)
10743 #include <sys/types.h>
10745 #if defined(I_DIRENT)
10746 #include <dirent.h>
10747 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10748 #include <sys/dir.h>
10752 #include <sys/ndir.h>
10756 #include <ndir.h> /* may be wrong in the future */
10758 #include <sys/dir.h>
10763 int main() { return closedir(opendir(".")); }
10766 if eval $compile_ok; then
10767 if ./closedir > /dev/null 2>&1 ; then
10768 echo "Yes, it does."
10771 echo "No, it doesn't."
10775 echo "(I can't seem to compile the test program--assuming it doesn't)"
10783 set d_void_closedir
10786 : check for volatile keyword
10788 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10789 $cat >try.c <<'EOCP'
10792 typedef struct _goo_struct goo_struct;
10793 goo_struct * volatile goo = ((goo_struct *)0);
10794 struct _goo_struct {
10799 typedef unsigned short foo_t;
10800 char *volatile foo;
10802 volatile foo_t blech;
10806 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10808 echo "Yup, it does."
10811 echo "Nope, it doesn't."
10817 : see if there is a wait4
10821 : see if waitpid exists
10822 set waitpid d_waitpid
10825 : see if wcstombs exists
10826 set wcstombs d_wcstombs
10829 : see if wctomb exists
10830 set wctomb d_wctomb
10833 : see if writev exists
10834 set writev d_writev
10837 : preserve RCS keywords in files with variable substitution, grrr
10842 Revision='$Revision'
10844 case "$crosscompile" in
10845 ''|[nN]*) crosscompile="$undef" ;;
10849 next|rhapsody) multiarch="$define" ;;
10851 case "$multiarch" in
10852 ''|[nN]*) multiarch="$undef" ;;
10855 : check for alignment requirements
10857 case "$crosscompile$multiarch" in
10860 You seem to be either cross-compiling or doing a multiarchitecture build,
10861 skipping the memory alignment check.
10864 case "$alignbytes" in
10865 '') alignbytes=8 ;;
10869 case "$alignbytes" in
10870 '') echo "Checking alignment constraints..." >&4
10871 $cat >try.c <<'EOCP'
10878 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10882 if eval $compile_ok; then
10886 echo "(I can't seem to compile the test program...)"
10889 *) dflt="$alignbytes"
10892 rp="Doubles must be aligned on a how-many-byte boundary?"
10900 : check for ordering of bytes in a long
10902 case "$crosscompile$multiarch" in
10905 You seem to be either cross-compiling or doing a multiarchitecture build,
10906 skipping the byteorder check.
10912 case "$byteorder" in
10915 In the following, larger digits indicate more significance. A big-endian
10916 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10917 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10918 machines may have weird orders like 3412. A Cray will report 87654321,
10919 an Alpha will report 12345678. If the test program works the default is
10921 I'm now running the test program...
10923 $cat >try.c <<'EOCP'
10930 char c[sizeof(long)];
10933 if (sizeof(long) > 4)
10934 u.l = (0x08070605L << 32) | 0x04030201L;
10937 for (i = 0; i < sizeof(long); i++)
10938 printf("%c", u.c[i]+'0');
10945 if eval $compile && ./try > /dev/null; then
10948 [1-4][1-4][1-4][1-4]|12345678|87654321)
10949 echo "(The test program ran ok.)"
10950 echo "byteorder=$dflt"
10953 ????|????????) echo "(The test program ran ok.)" ;;
10954 *) echo "(The test program didn't run right for some reason.)" ;;
10959 (I can't seem to compile the test program. Guessing big-endian...)
10962 case "$xxx_prompt" in
10964 rp="What is the order of bytes in a long?"
10978 : how do we catenate cpp tokens here?
10980 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
10981 $cat >cpp_stuff.c <<'EOCP'
10982 #define RCAT(a,b)a/**/b
10983 #define ACAT(a,b)a ## b
10987 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
10988 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
10989 echo "Oh! Smells like ANSI's been here." >&4
10990 echo "We can catify or stringify, separately or together!"
10992 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
10993 echo "Ah, yes! The good old days!" >&4
10994 echo "However, in the good old days we don't know how to stringify and"
10995 echo "catify at the same time."
10999 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11000 to have to edit the values of CAT[2-5] in config.h...
11002 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11006 : see if this is a db.h system
11012 : Check db version.
11014 echo "Checking Berkeley DB version ..." >&4
11020 #include <sys/types.h>
11025 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11026 int Major, Minor, Patch ;
11027 unsigned long Version ;
11028 (void)db_version(&Major, &Minor, &Patch) ;
11029 printf("You have Berkeley DB Version 2 or greater\n");
11031 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11032 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11033 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11034 Major, Minor, Patch) ;
11036 /* check that db.h & libdb are compatible */
11037 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11038 printf("db.h and libdb are incompatible\n") ;
11042 printf("db.h and libdb are compatible\n") ;
11044 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11045 + DB_VERSION_PATCH ;
11047 /* needs to be >= 2.3.4 */
11048 if (Version < 2003004) {
11049 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11050 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11056 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11057 printf("You have Berkeley DB Version 1\n");
11058 exit(0); /* DB version < 2: the coast is clear. */
11060 exit(1); /* <db.h> not Berkeley DB? */
11066 if eval $compile && ./try; then
11067 echo 'Looks OK.' >&4
11069 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11073 : Remove db from list of libraries to use
11074 echo "Removing unusable -ldb from library list" >&4
11075 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11078 echo "libs = $libs" >&4
11088 : Check the return type needed for hash
11090 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11096 #include <sys/types.h>
11099 #ifndef DB_VERSION_MAJOR
11100 u_int32_t hash_cb (ptr, size)
11108 info.hash = hash_cb;
11112 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11113 if $contains warning try.out >>/dev/null 2>&1 ; then
11116 db_hashtype='u_int32_t'
11119 : XXX Maybe we should just give up here.
11120 db_hashtype=u_int32_t
11122 echo "Help: I can't seem to compile the db test program." >&4
11123 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11126 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11128 *) db_hashtype=u_int32_t
11133 : Check the return type needed for prefix
11135 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11141 #include <sys/types.h>
11144 #ifndef DB_VERSION_MAJOR
11145 size_t prefix_cb (key1, key2)
11153 info.prefix = prefix_cb;
11157 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11158 if $contains warning try.out >>/dev/null 2>&1 ; then
11159 db_prefixtype='int'
11161 db_prefixtype='size_t'
11164 db_prefixtype='size_t'
11165 : XXX Maybe we should just give up here.
11167 echo "Help: I can't seem to compile the db test program." >&4
11168 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11171 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11173 *) db_prefixtype='size_t'
11177 : check for void type
11179 echo "Checking to see how well your C compiler groks the void type..." >&4
11180 case "$voidflags" in
11182 $cat >try.c <<'EOCP'
11188 extern void moo(); /* function returning void */
11189 void (*goo)(); /* ptr to func returning void */
11191 void *hue; /* generic ptr */
11204 int main() { sub(); }
11206 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11207 voidflags=$defvoidused
11208 echo "Good. It appears to support void to the level $package wants.">&4
11209 if $contains warning .out >/dev/null 2>&1; then
11210 echo "However, you might get some warnings that look like this:"
11214 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11215 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11216 echo "It supports 1..."
11217 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11218 echo "It also supports 2..."
11219 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11221 echo "And it supports 4 but not 8 definitely."
11223 echo "It doesn't support 4..."
11224 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11226 echo "But it supports 8."
11229 echo "Neither does it support 8."
11233 echo "It does not support 2..."
11234 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11236 echo "But it supports 4 and 8."
11238 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11240 echo "And it supports 4 but has not heard about 8."
11242 echo "However it supports 8 but not 4."
11247 echo "There is no support at all for void."
11252 case "$voidflags" in
11254 *) $cat >&4 <<'EOM'
11255 Support flag bits are:
11256 1: basic void declarations.
11257 2: arrays of pointers to functions returning void.
11258 4: operations between pointers to and addresses of void functions.
11259 8: generic void pointers.
11262 rp="Your void support flags add up to what?"
11270 : How can we generate normalized random numbers ?
11272 echo "Looking for a random number function..." >&4
11273 case "$randfunc" in
11275 if set drand48 val -f; eval $csym; $val; then
11277 echo "Good, found drand48()." >&4
11278 elif set random val -f; eval $csym; $val; then
11280 echo "OK, found random()." >&4
11283 echo "Yick, looks like I have to use rand()." >&4
11294 *-Dmy_rand=*|*-Dmy_srand=*)
11295 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11296 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11297 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11298 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11302 while $test "$cont"; do
11303 rp="Use which function to generate random numbers?"
11305 if $test "$ans" = "$dflt"; then
11311 if set $ans val -f; eval $csym; $val; then
11315 rp="I cannot find function $ans. Use that name anyway?"
11324 case "$randfunc" in
11326 drand01="drand48()"
11332 case "$randbits" in
11334 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11336 #$i_unistd I_UNISTD
11337 #$i_stdlib I_STDLIB
11340 # include <unistd.h>
11343 # include <stdlib.h>
11348 register unsigned long tmp;
11349 register unsigned long max = 0L;
11351 for (i = 1000; i; i--) {
11352 tmp = (unsigned long) $randfunc();
11353 if (tmp > max) max = tmp;
11355 for (i = 0; max; i++)
11361 if eval $compile_ok; then
11365 echo "(I can't seem to compile the test program...)"
11372 rp="How many bits does your $randfunc() function produce?"
11376 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11377 seedfunc="s$randfunc"
11378 randseedtype=unsigned
11382 rp="How many bits does your $randfunc() function produce?"
11385 seedfunc="s$randfunc"
11386 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11387 if set $seedfunc val -f; eval $csym; $val; then
11388 echo "(Using $seedfunc() to seed random generator)"
11390 echo "(Warning: no $seedfunc() to seed random generator)"
11393 randseedtype=unsigned
11401 echo "Determining whether or not we are on an EBCDIC system..." >&4
11402 $cat >tebcdic.c <<'EOM'
11405 if ('M'==0xd4) return 0;
11412 if eval $compile_ok; then
11414 echo "You have EBCDIC." >&4
11417 echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
11420 echo "I'm unable to compile the test program." >&4
11421 echo "I'll assume ASCII or some ISO Latin." >&4
11423 $rm -f tebcdic.c tebcdic
11429 Checking how to flush all pending stdio output...
11431 # I only know how to find the first 32 possibly open files on SunOS.
11432 # See also hints/sunos_4_1.sh and util.c --AD
11434 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11436 $cat >>try.c <<EOCP
11438 #$i_unistd I_UNISTD
11440 # include <unistd.h>
11442 #$d_sysconf HAS_SYSCONF
11443 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11444 #ifdef HAS_STDIO_STREAM_ARRAY
11445 # define STDIO_STREAM_ARRAY $stdio_stream_array
11448 FILE* p = fopen("try.out", "w");
11452 # ifdef TRY_FPRINTF
11456 #ifdef TRY_FFLUSH_NULL
11459 #ifdef TRY_FFLUSH_ALL
11461 long open_max = -1;
11462 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11463 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11465 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11466 open_max = sysconf(_SC_OPEN_MAX);
11469 open_max = FOPEN_MAX;
11472 open_max = OPEN_MAX;
11481 # ifdef HAS_STDIO_STREAM_ARRAY
11482 if (open_max > 0) {
11484 for (i = 0; i < open_max; i++)
11485 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11486 STDIO_STREAM_ARRAY[i]._file < open_max &&
11487 STDIO_STREAM_ARRAY[i]._flag)
11488 fflush(&STDIO_STREAM_ARRAY[i]);
11496 : first we have to find out how _not_ to flush
11497 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11499 set try -DTRY_FPUTC
11500 if eval $compile; then
11502 ./try$exe_ext 2>/dev/null
11503 if $test ! -s try.out -a "X$?" = X42; then
11509 set try -DTRY_FPRINTF
11511 if eval $compile; then
11513 ./try$exe_ext 2>/dev/null
11514 if $test ! -s try.out -a "X$?" = X42; then
11515 output=-DTRY_FPRINTF
11521 : check for fflush NULL behaviour
11522 case "$fflushNULL" in
11523 '') set try -DTRY_FFLUSH_NULL $output
11524 if eval $compile; then
11526 ./try$exe_ext 2>/dev/null
11528 if $test -s try.out -a "X$code" = X42; then
11529 fflushNULL="`$cat try.out`"
11531 if $test "X$code" != X42; then
11533 (If this test failed, don't worry, we'll try another method shortly.)
11538 $rm -f core try.core core.try.*
11539 case "$fflushNULL" in
11541 Your fflush(NULL) works okay.
11543 fflushNULL="$define"
11546 Your fflush(NULL) isn't working (contrary to ANSI C).
11548 fflushNULL="$undef"
11551 Cannot figure out whether your fflush(NULL) works or not.
11552 I'm assuming it doesn't (contrary to ANSI C).
11554 fflushNULL="$undef"
11558 $define|true|[yY]*)
11559 fflushNULL="$define"
11562 fflushNULL="$undef"
11565 : check explicit looping only if NULL did not work
11566 case "$fflushNULL" in
11568 : check for fflush all behaviour
11569 case "$fflushall" in
11570 '') set try -DTRY_FFLUSH_ALL $output
11571 if eval $compile; then
11573 (Now testing the other method--but note that also this may fail.)
11576 ./try$exe_ext 2>/dev/null
11577 if $test -s try.out -a "X$?" = X42; then
11578 fflushall="`$cat try.out`"
11581 $rm -f core try.core core.try.*
11582 case "$fflushall" in
11584 Whew. Flushing explicitly all the stdio streams works.
11586 fflushall="$define"
11589 Sigh. Flushing explicitly all the stdio streams doesn't work.
11594 Cannot figure out whether flushing stdio streams explicitly works or not.
11595 I'm assuming it doesn't.
11601 "$define"|true|[yY]*)
11602 fflushall="$define"
11609 *) fflushall="$undef"
11612 case "$fflushNULL$fflushall" in
11615 I cannot figure out how to flush pending stdio output.
11619 $rm -f try.* try$exe_ext
11621 : see what type file positions are declared as in the library
11622 rp="What is the type for file position used by fsetpos()?"
11623 set fpos_t fpostype long stdio.h sys/types.h
11626 : Store the full pathname to the ar program for use in the C program
11627 : Respect a hint or command line value for full_ar.
11632 : Store the full pathname to the sed program for use in the C program
11635 : see what type gids are declared as in the kernel
11637 echo "Looking for the type for group ids returned by getgid()."
11638 set gid_t gidtype xxx stdio.h sys/types.h
11642 xxx=`./findhdr sys/user.h`
11643 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11645 unsigned) dflt="$1 $2" ;;
11649 *) dflt="$gidtype";;
11652 gid_t) echo "gid_t found." ;;
11653 *) rp="What is the type for group ids returned by getgid()?"
11659 : see if getgroups exists
11660 set getgroups d_getgrps
11663 : see if setgroups exists
11664 set setgroups d_setgrps
11668 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11670 case "$d_getgrps$d_setgrps" in
11672 case "$groupstype" in
11673 '') dflt="$gidtype" ;;
11674 *) dflt="$groupstype" ;;
11677 What type of pointer is the second argument to getgroups() and setgroups()?
11678 Usually this is the same as group ids, $gidtype, but not always.
11681 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11685 *) groupstype="$gidtype";;
11688 : see what type lseek is declared as in the kernel
11689 rp="What is the type used for lseek's offset on this system?"
11690 set off_t lseektype long stdio.h sys/types.h
11694 $echo $n "Checking to see how big your file offsets are...$c" >&4
11696 #include <sys/types.h>
11700 printf("%d\n", sizeof($lseektype));
11704 if eval $compile_ok; then
11706 $echo " $lseeksize bytes." >&4
11710 echo "(I can't seem to compile the test program. Guessing...)"
11711 rp="What is the size of your file offsets (in bytes)?"
11718 echo "Checking if your $make program sets \$(MAKE)..." >&4
11719 case "$make_set_make" in
11721 $sed 's/^X //' > testmake.mak << 'EOF'
11723 X @echo 'maketemp="$(MAKE)"'
11725 case "`$make -f testmake.mak 2>/dev/null`" in
11726 *maketemp=*) make_set_make='#' ;;
11727 *) make_set_make="MAKE=$make" ;;
11729 $rm -f testmake.mak
11732 case "$make_set_make" in
11733 '#') echo "Yup, it does.";;
11734 *) echo "Nope, it doesn't.";;
11737 : see what type is used for mode_t
11738 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11739 set mode_t modetype int stdio.h sys/types.h
11742 : define a fucntion to check prototypes
11743 $cat > protochk <<EOSH
11746 optimize="$optimize"
11748 prototype="$prototype"
11753 $cat >> protochk <<'EOSH'
11758 while test $# -ge 2; do
11760 $define) echo "#include <$2>" >> try.c ;;
11761 literal) echo "$2" >> try.c ;;
11765 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11766 cat >> try.c <<'EOCP'
11767 #ifdef CAN_PROTOTYPE
11768 #define _(args) args
11773 echo "$foo" >> try.c
11774 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11775 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11781 $eunicefix protochk
11783 : see what type is used for size_t
11784 rp="What is the type used for the length parameter for string functions?"
11785 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11788 : check for type of arguments to gethostbyaddr.
11789 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11790 case "$d_gethbyaddr" in
11794 Checking to see what type of arguments are accepted by gethostbyaddr().
11796 hdrs="$define sys/types.h
11797 $d_socket sys/socket.h
11798 $i_niin netinet/in.h
11800 $i_unistd unistd.h"
11801 : The first arg can 'char *' or 'void *'
11802 : The second arg is some of integral type
11803 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11804 for yyy in size_t long int; do
11805 case "$netdb_host_type" in
11806 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11807 if ./protochk "$try" $hdrs; then
11808 echo "Your system accepts $xxx for the first arg."
11809 echo "...and $yyy for the second arg."
11810 netdb_host_type="$xxx"
11811 netdb_hlen_type="$yyy"
11817 : In case none of those worked, prompt the user.
11818 case "$netdb_host_type" in
11819 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11822 netdb_host_type=$ans
11823 rp='What is the type for the 2nd argument to gethostbyaddr?'
11826 netdb_hlen_type=$ans
11830 *) : no gethostbyaddr, so pick harmless defaults
11831 netdb_host_type='char *'
11832 netdb_hlen_type="$sizetype"
11835 # Remove the "const" if needed. -- but then we'll have a
11837 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11840 : check for type of argument to gethostbyname.
11841 if test "X$netdb_name_type" = X ; then
11842 case "$d_gethbyname" in
11846 Checking to see what type of argument is accepted by gethostbyname().
11848 hdrs="$define sys/types.h
11849 $d_socket sys/socket.h
11850 $i_niin netinet/in.h
11852 $i_unistd unistd.h"
11853 for xxx in "const char *" "char *"; do
11854 case "$netdb_name_type" in
11855 '') try="extern struct hostent *gethostbyname($xxx);"
11856 if ./protochk "$try" $hdrs; then
11857 echo "Your system accepts $xxx."
11858 netdb_name_type="$xxx"
11863 : In case none of those worked, prompt the user.
11864 case "$netdb_name_type" in
11865 '') rp='What is the type for the 1st argument to gethostbyname?'
11868 netdb_name_type=$ans
11872 *) : no gethostbyname, so pick harmless default
11873 netdb_name_type='char *'
11878 : check for type of 1st argument to getnetbyaddr.
11879 if test "X$netdb_net_type" = X ; then
11880 case "$d_getnbyaddr" in
11884 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11886 hdrs="$define sys/types.h
11887 $d_socket sys/socket.h
11888 $i_niin netinet/in.h
11890 $i_unistd unistd.h"
11891 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11892 case "$netdb_net_type" in
11893 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11894 if ./protochk "$try" $hdrs; then
11895 echo "Your system accepts $xxx."
11896 netdb_net_type="$xxx"
11901 : In case none of those worked, prompt the user.
11902 case "$netdb_net_type" in
11903 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11906 netdb_net_type=$ans
11910 *) : no getnetbyaddr, so pick harmless default
11911 netdb_net_type='long'
11915 : locate the preferred pager for this system
11929 '') dflt=/usr/ucb/more;;
11936 rp='What pager is used on your system?'
11940 : see what type pids are declared as in the kernel
11941 rp="What is the type of process ids on this system?"
11942 set pid_t pidtype int stdio.h sys/types.h
11945 : check for length of pointer
11949 $echo $n "Checking to see how big your pointers are...$c" >&4
11950 if test "$voidflags" -gt 7; then
11951 echo '#define VOID_PTR char *' > try.c
11953 echo '#define VOID_PTR void *' > try.c
11955 $cat >>try.c <<'EOCP'
11959 printf("%d\n", sizeof(VOID_PTR));
11964 if eval $compile_ok; then
11966 $echo " $ptrsize bytes." >&4
11969 echo "(I can't seem to compile the test program. Guessing...)" >&4
11970 rp="What is the size of a pointer (in bytes)?"
11978 : see if ar generates random libraries by itself
11980 echo "Checking how to generate random libraries on your machine..." >&4
11981 echo 'int bar1() { return bar2(); }' > bar1.c
11982 echo 'int bar2() { return 2; }' > bar2.c
11983 $cat > foo.c <<'EOP'
11984 int main() { printf("%d\n", bar1()); exit(0); }
11986 $cc $ccflags -c bar1.c >/dev/null 2>&1
11987 $cc $ccflags -c bar2.c >/dev/null 2>&1
11988 $cc $ccflags -c foo.c >/dev/null 2>&1
11989 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
11990 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11991 ./foobar >/dev/null 2>&1; then
11992 echo "$ar appears to generate random libraries itself."
11995 elif $ar ts bar$_a >/dev/null 2>&1 &&
11996 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
11997 ./foobar >/dev/null 2>&1; then
11998 echo "a table of contents needs to be added with '$ar ts'."
12005 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12006 $test -f $ranlib || ranlib=''
12009 if $test -n "$ranlib"; then
12010 echo "your system has '$ranlib'; we'll use that."
12013 echo "your system doesn't seem to support random libraries"
12014 echo "so we'll use lorder and tsort to order the libraries."
12021 : check for type of arguments to select.
12022 case "$selecttype" in
12023 '') case "$d_select" in
12026 Checking to see what type of arguments are accepted by select().
12028 hdrs="$define sys/types.h
12029 $i_systime sys/time.h
12030 $i_sysselct sys/select.h
12031 $d_socket sys/socket.h"
12032 : The first arg can be int, unsigned, or size_t
12033 : The last arg may or may not be 'const'
12035 : void pointer has been seen but using that
12036 : breaks the selectminbits test
12037 for xxx in 'fd_set *' 'int *'; do
12038 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12039 for tmo in 'struct timeval *' 'const struct timeval *'; do
12041 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12042 if ./protochk "$try" $hdrs; then
12043 echo "Your system accepts $xxx."
12052 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12053 case "$d_fd_set" in
12054 $define) dflt="fd_set *" ;;
12063 *) : no select, so pick a harmless default
12070 : check for the select 'width'
12071 case "$selectminbits" in
12072 '') case "$d_select" in
12076 Checking to see on how many bits at a time your select() operates...
12079 #include <sys/types.h>
12081 #$i_systime I_SYS_TIME
12082 #$i_systimek I_SYS_TIME_KERNEL
12087 # ifdef I_SYS_TIME_KERNEL
12090 # include <sys/time.h>
12091 # ifdef I_SYS_TIME_KERNEL
12095 #$i_sysselct I_SYS_SELECT
12096 #ifdef I_SYS_SELECT
12097 #include <sys/select.h>
12099 #$d_socket HAS_SOCKET
12101 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12105 #define S sizeof(*(b))
12107 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12108 #define NBITS (NBYTES * 8)
12117 fp = fopen("try.c", "r");
12123 b = ($selecttype)s;
12124 for (i = 0; i < NBITS; i++)
12128 select(fd + 1, b, 0, 0, &t);
12129 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12130 printf("%d\n", i + 1);
12135 if eval $compile_ok; then
12136 selectminbits=`./try`
12137 case "$selectminbits" in
12139 Cannot figure out on how many bits at a time your select() operates.
12140 I'll play safe and guess it is 32 bits.
12146 *) bits="$selectminbits bits" ;;
12148 echo "Your select() operates on $bits at a time." >&4
12150 rp='What is the minimum number of bits your select() operates on?'
12151 case "$byteorder" in
12152 1234|12345678) dflt=32 ;;
12157 selectminbits="$val"
12161 *) : no select, so pick a harmless default
12168 : Trace out the files included by signal.h, then look for SIGxxx names.
12169 : Remove SIGARRAYSIZE used by HPUX.
12170 : Remove SIGSTKSIZE used by Linux.
12171 : Remove SIGSTKSZ used by Posix.
12172 : Remove SIGTYP void lines used by OS2.
12173 xxx=`echo '#include <signal.h>' |
12174 $cppstdin $cppminus $cppflags 2>/dev/null |
12175 $grep '^[ ]*#.*include' |
12176 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12177 : Check this list of files to be sure we have parsed the cpp output ok.
12178 : This will also avoid potentially non-existent files, such
12181 for xx in $xxx /dev/null ; do
12182 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12184 : If we have found no files, at least try signal.h
12185 case "$xxxfiles" in
12186 '') xxxfiles=`./findhdr signal.h` ;;
12189 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12190 print substr($2, 4, 20)
12192 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12193 print substr($3, 4, 20)
12195 : Append some common names just in case the awk scan failed.
12196 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12197 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12198 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12199 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12200 : generate a few handy files for later
12201 $cat > signal.c <<'EOCP'
12202 #include <sys/types.h>
12203 #include <signal.h>
12207 /* Strange style to avoid deeply-nested #if/#else/#endif */
12210 # define NSIG (_NSIG)
12216 # define NSIG (SIGMAX+1)
12222 # define NSIG (SIG_MAX+1)
12228 # define NSIG (MAXSIG+1)
12234 # define NSIG (MAX_SIG+1)
12239 # ifdef SIGARRAYSIZE
12240 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12246 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12250 /* Default to some arbitrary number that's big enough to get most
12251 of the common signals.
12257 printf("NSIG %d\n", NSIG);
12263 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12265 printf "#ifdef SIG"; printf $1; printf "\n"
12266 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12267 printf $1; printf ");\n"
12271 printf "#endif /* JUST_NSIG */\n";
12275 $cat >signal.awk <<'EOP'
12276 BEGIN { ndups = 0 }
12277 $1 ~ /^NSIG$/ { nsig = $2 }
12278 ($1 !~ /^NSIG$/) && (NF == 2) {
12279 if ($2 > maxsig) { maxsig = $2 }
12280 if (sig_name[$2]) {
12281 dup_name[ndups] = $1
12282 dup_num[ndups] = $2
12294 printf("NSIG %d\n", nsig);
12295 for (n = 1; n < nsig; n++) {
12297 printf("%s %d\n", sig_name[n], sig_num[n])
12300 printf("NUM%d %d\n", n, n)
12303 for (n = 0; n < ndups; n++) {
12304 printf("%s %d\n", dup_name[n], dup_num[n])
12308 $cat >signal_cmd <<EOS
12310 if $test -s signal.lst; then
12311 echo "Using your existing signal.lst file"
12316 $cat >>signal_cmd <<'EOS'
12319 if eval $compile_ok; then
12320 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12322 echo "(I can't seem be able to compile the whole test program)" >&4
12323 echo "(I'll try it in little pieces.)" >&4
12324 set signal -DJUST_NSIG
12325 if eval $compile_ok; then
12326 ./signal$_exe > signal.nsg
12329 echo "I can't seem to figure out how many signals you have." >&4
12330 echo "Guessing 50." >&4
12331 echo 'NSIG 50' > signal.nsg
12333 : Now look at all the signal names, one at a time.
12334 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12335 $cat > signal.c <<EOCP
12336 #include <sys/types.h>
12337 #include <signal.h>
12340 printf("$xx %d\n", SIG${xx});
12345 if eval $compile; then
12346 echo "SIG${xx} found."
12347 ./signal$_exe >> signal.ls1
12349 echo "SIG${xx} NOT found."
12352 if $test -s signal.ls1; then
12353 $cat signal.nsg signal.ls1 |
12354 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12358 if $test -s signal.lst; then
12361 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12362 echo 'kill -l' >signal
12363 set X `csh -f <signal`
12367 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12369 echo $@ | $tr ' ' $trnl | \
12370 $awk '{ printf "%s %d\n", $1, ++s; }
12371 END { printf "NSIG %d\n", ++s }' >signal.lst
12373 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12375 chmod a+x signal_cmd
12376 $eunicefix signal_cmd
12378 : generate list of signal names
12380 case "$sig_name_init" in
12382 *) case "$sig_num_init" in
12383 ''|*,*) doinit=yes ;;
12388 echo "Generating a list of signal names and numbers..." >&4
12390 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12391 sig_name=`$awk 'BEGIN { printf "ZERO " }
12392 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12393 sig_num=`$awk 'BEGIN { printf "0 " }
12394 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12395 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12396 !/^NSIG/ { printf "\"%s\", ", $1 }
12397 END { printf "0\n" }' signal.lst`
12398 sig_num_init=`$awk 'BEGIN { printf "0, " }
12399 !/^NSIG/ { printf "%d, ", $2}
12400 END { printf "0\n"}' signal.lst`
12403 echo "The following $sig_count signals are available:"
12405 echo $sig_name | $awk \
12406 'BEGIN { linelen = 0 }
12408 for (i = 1; i <= NF; i++) {
12409 name = "SIG" $i " "
12410 linelen = linelen + length(name)
12411 if (linelen > 70) {
12413 linelen = length(name)
12419 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12421 : see what type is used for signed size_t
12422 set ssize_t ssizetype int stdio.h sys/types.h
12425 $cat > ssize.c <<EOM
12427 #include <sys/types.h>
12428 #define Size_t $sizetype
12429 #define SSize_t $dflt
12432 if (sizeof(Size_t) == sizeof(SSize_t))
12434 else if (sizeof(Size_t) == sizeof(int))
12443 if eval $compile_ok && ./ssize > /dev/null; then
12444 ssizetype=`./ssize`
12445 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12448 Help! I can't compile and run the ssize_t test program: please enlighten me!
12449 (This is probably a misconfiguration in your system or libraries, and
12450 you really ought to fix it. Still, I'll try anyway.)
12452 I need a type that is the same size as $sizetype, but is guaranteed to
12453 be signed. Common values are ssize_t, int and long.
12456 rp="What signed type is the same size as $sizetype?"
12460 $rm -f ssize ssize.*
12462 : see what type of char stdio uses.
12464 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12465 echo "Your stdio uses unsigned chars." >&4
12466 stdchar="unsigned char"
12468 echo "Your stdio uses signed chars." >&4
12472 : see if time exists
12474 if test "X$d_time" = X -o X"$timetype" = X; then
12475 if set time val -f d_time; eval $csym; $val; then
12476 echo 'time() found.' >&4
12478 rp="What is the type returned by time() on this system?"
12479 set time_t timetype long stdio.h sys/types.h
12482 echo 'time() not found, hope that will do.' >&4
12490 : see what type uids are declared as in the kernel
12492 echo "Looking for the type for user ids returned by getuid()."
12493 set uid_t uidtype xxx stdio.h sys/types.h
12497 xxx=`./findhdr sys/user.h`
12498 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12500 unsigned) dflt="$1 $2" ;;
12504 *) dflt="$uidtype";;
12507 uid_t) echo "uid_t found." ;;
12508 *) rp="What is the type for user ids returned by getuid()?"
12514 : see if dbm.h is available
12515 : see if dbmclose exists
12516 set dbmclose d_dbmclose
12519 case "$d_dbmclose" in
12529 *) set rpcsvc/dbm.h i_rpcsvcdbm
12534 *) echo "We won't be including <dbm.h>"
12544 : see if this is a sys/file.h system
12549 : do we need to include sys/file.h ?
12553 if $h_sysfile; then
12555 echo "We'll be including <sys/file.h>." >&4
12558 echo "We won't be including <sys/file.h>." >&4
12568 : see if fcntl.h is there
12573 : see if we can include fcntl.h
12579 echo "We'll be including <fcntl.h>." >&4
12582 if $h_sysfile; then
12583 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12585 echo "We won't be including <fcntl.h>." >&4
12597 : see if locale.h is available
12598 set locale.h i_locale
12601 : see if mach cthreads are available
12602 if test "X$usethreads" = "X$define"; then
12603 set mach/cthreads.h i_machcthr
12606 i_machcthr="$undef"
12611 : see if this is a math.h system
12615 : see if this is a mntent.h system
12616 set mntent.h i_mntent
12619 : see if ndbm.h is available
12624 : see if dbm_open exists
12625 set dbm_open d_dbm_open
12627 case "$d_dbm_open" in
12630 echo "We won't be including <ndbm.h>"
12639 : see if net/errno.h is available
12641 set net/errno.h val
12644 : Unfortunately, it causes problems on some systems. Arrgh.
12647 cat > try.c <<'EOM'
12650 #include <net/errno.h>
12656 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12657 echo "We'll be including <net/errno.h>." >&4
12659 echo "We won't be including <net/errno.h>." >&4
12668 : see if netinet/tcp.h is available
12669 set netinet/tcp.h i_netinettcp
12672 : see if this is a poll.h system
12676 : get C preprocessor symbols handy
12678 $echo $n "Hmm... $c"
12679 echo $al | $tr ' ' $trnl >Cppsym.know
12680 $cat <<EOSS >Cppsym
12688 case "\$list\$#" in
12691 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12693 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12696 unknown="\$unknown \$sym"
12706 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12708 exit 0; _ _ _ _\1\\ \1\\
12711 echo "exit 1; _ _ _" >>Cppsym\$\$
12712 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12714 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12720 $rm -f Cppsym\$\$ Cppsym2\$\$
12725 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12727 : now check the C compiler for additional symbols
12728 postprocess_cc_v=''
12730 aix) postprocess_cc_v="|$tr , ' '" ;;
12737 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12740 -D*) echo "\$i" | $sed 's/^-D//';;
12741 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12746 postprocess_cc_v=''
12749 ./ccsym > ccsym1.raw
12750 if $test -s ccsym1.raw; then
12751 $sort ccsym1.raw | $uniq >ccsym.raw
12753 mv ccsym1.raw ccsym.raw
12756 $awk '/\=/ { print $0; next }
12757 { print $0"=1" }' ccsym.raw >ccsym.list
12758 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12759 $comm -13 ccsym.true ccsym.list >ccsym.own
12760 $comm -12 ccsym.true ccsym.list >ccsym.com
12761 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12763 if $test -z ccsym.raw; then
12764 echo "Your C compiler doesn't seem to define any symbols!" >&4
12766 echo "However, your C preprocessor defines the following symbols:"
12769 cppsymbols=`$cat Cppsym.true`
12770 cppsymbols=`echo $cppsymbols`
12771 cppccsymbols="$cppsymbols"
12773 if $test -s ccsym.com; then
12774 echo "Your C compiler and pre-processor define these symbols:"
12775 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12778 cppccsymbols=`$cat ccsym.com`
12779 cppccsymbols=`echo $cppccsymbols`
12780 $test "$silent" || sleep 1
12782 if $test -s ccsym.cpp; then
12783 $test "$also" && echo " "
12784 echo "Your C pre-processor ${also}defines the following symbols:"
12785 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12787 cppsymbols=`$cat ccsym.cpp`
12788 cppsymbols=`echo $cppsymbols`
12789 $test "$silent" || sleep 1
12791 if $test -s ccsym.own; then
12792 $test "$also" && echo " "
12793 echo "Your C compiler ${also}defines the following cpp symbols:"
12794 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12795 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12796 ccsymbols=`$cat ccsym.own`
12797 ccsymbols=`echo $ccsymbols`
12798 $test "$silent" || sleep 1
12803 : see if this is a termio system
12807 if $test `./findhdr termios.h`; then
12808 set tcsetattr i_termios
12814 "$define") echo "You have POSIX termios.h... good!" >&4;;
12815 *) if ./Cppsym pyr; then
12816 case "`/bin/universe`" in
12817 ucb) if $test `./findhdr sgtty.h`; then
12819 echo "<sgtty.h> found." >&4
12821 echo "System is pyramid with BSD universe."
12822 echo "<sgtty.h> not found--you could have problems." >&4
12824 *) if $test `./findhdr termio.h`; then
12826 echo "<termio.h> found." >&4
12828 echo "System is pyramid with USG universe."
12829 echo "<termio.h> not found--you could have problems." >&4
12833 if $test `./findhdr termio.h`; then
12834 echo "<termio.h> found." >&4
12836 elif $test `./findhdr sgtty.h`; then
12837 echo "<sgtty.h> found." >&4
12840 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12843 if $test `./findhdr sgtty.h`; then
12844 echo "<sgtty.h> found." >&4
12846 elif $test `./findhdr termio.h`; then
12847 echo "<termio.h> found." >&4
12850 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12854 set i_termio; eval $setvar
12855 val=$val2; set i_sgtty; eval $setvar
12856 val=$val3; set i_termios; eval $setvar
12858 : see if this is a shadow.h system
12859 set shadow.h i_shadow
12862 : see if this is a socks.h system
12863 set socks.h i_socks
12866 : see if stdarg is available
12868 if $test `./findhdr stdarg.h`; then
12869 echo "<stdarg.h> found." >&4
12872 echo "<stdarg.h> NOT found." >&4
12876 : see if varags is available
12878 if $test `./findhdr varargs.h`; then
12879 echo "<varargs.h> found." >&4
12881 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12884 : set up the varargs testing programs
12885 $cat > varargs.c <<EOP
12887 #include <stdarg.h>
12890 #include <varargs.h>
12894 int f(char *p, ...)
12908 p = va_arg(ap, char *);
12913 $cat > varargs <<EOP
12915 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12924 : now check which varargs header should be included
12929 if `./varargs I_STDARG`; then
12931 elif `./varargs I_VARARGS`; then
12936 if `./varargs I_VARARGS`; then
12943 echo "I could not find the definition for va_dcl... You have problems..." >&4
12944 val="$undef"; set i_stdarg; eval $setvar
12945 val="$undef"; set i_varargs; eval $setvar
12950 case "$i_varhdr" in
12952 val="$define"; set i_stdarg; eval $setvar
12953 val="$undef"; set i_varargs; eval $setvar
12956 val="$undef"; set i_stdarg; eval $setvar
12957 val="$define"; set i_varargs; eval $setvar
12960 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
12964 : see if stddef is available
12965 set stddef.h i_stddef
12968 : see if sys/access.h is available
12969 set sys/access.h i_sysaccess
12972 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
12973 set sys/filio.h i_sysfilio
12976 if $test `./findhdr sys/ioctl.h`; then
12978 echo '<sys/ioctl.h> found.' >&4
12981 if $test $i_sysfilio = "$define"; then
12982 echo '<sys/ioctl.h> NOT found.' >&4
12984 $test $i_sgtty = "$define" && xxx="sgtty.h"
12985 $test $i_termio = "$define" && xxx="termio.h"
12986 $test $i_termios = "$define" && xxx="termios.h"
12987 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
12993 : see if sys/resource.h has to be included
12994 set sys/resource.h i_sysresrc
12997 : see if sys/security.h is available
12998 set sys/security.h i_syssecrt
13001 : see if this is a sys/statvfs.h system
13002 set sys/statvfs.h i_sysstatvfs
13005 : see if this is a sys/un.h system
13006 set sys/un.h i_sysun
13009 : see if this is a syswait system
13010 set sys/wait.h i_syswait
13013 : see if this is an utime system
13014 set utime.h i_utime
13017 : see if this is a values.h system
13018 set values.h i_values
13021 : see if this is a vfork system
13024 set vfork.h i_vfork
13032 : see if gdbm.h is available
13037 : see if gdbm_open exists
13038 set gdbm_open d_gdbm_open
13040 case "$d_gdbm_open" in
13043 echo "We won't be including <gdbm.h>"
13053 echo "Looking for extensions..." >&4
13054 : If we are using the old config.sh, known_extensions may contain
13055 : old or inaccurate or duplicate values.
13056 known_extensions=''
13057 nonxs_extensions=''
13058 : We do not use find because it might not be available.
13059 : We do not just use MANIFEST because the user may have dropped
13060 : some additional extensions into the source tree and expect them
13063 : Function to recursively find available extensions, ignoring DynaLoader
13064 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13068 DynaLoader|dynaload) ;;
13070 if $test -f $xxx/$xxx.xs; then
13071 known_extensions="$known_extensions $1$xxx";
13072 elif $test -f $xxx/Makefile.PL; then
13073 nonxs_extensions="$nonxs_extensions $1$xxx";
13075 if $test -d $xxx -a $# -lt 10; then
13078 eval $find_extensions;
13090 eval $find_extensions
13091 set X $nonxs_extensions
13093 nonxs_extensions="$*"
13094 set X $known_extensions
13096 known_extensions="$*"
13099 : Now see which are supported on this system.
13101 for xxx in $known_extensions ; do
13105 $define) avail_ext="$avail_ext $xxx" ;;
13108 GDBM_File|gdbm_fil)
13110 $define) avail_ext="$avail_ext $xxx" ;;
13113 NDBM_File|ndbm_fil)
13115 $define) avail_ext="$avail_ext $xxx" ;;
13118 ODBM_File|odbm_fil)
13119 case "${i_dbm}${i_rpcsvcdbm}" in
13120 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13124 case "$useposix" in
13125 true|define|y) avail_ext="$avail_ext $xxx" ;;
13129 case "$useopcode" in
13130 true|define|y) avail_ext="$avail_ext $xxx" ;;
13134 case "$d_socket" in
13135 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13139 case "$usethreads" in
13140 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13144 : XXX Do we need a useipcsysv variable here
13145 case "${d_msg}${d_sem}${d_shm}" in
13146 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13149 *) avail_ext="$avail_ext $xxx"
13158 : Now see which nonxs extensions are supported on this system.
13159 : For now assume all are.
13161 for xxx in $nonxs_extensions ; do
13163 *) nonxs_ext="$nonxs_ext $xxx"
13175 A number of extensions are supplied with $package. You may choose to
13176 compile these extensions for dynamic loading (the default), compile
13177 them into the $package executable (static loading), or not include
13178 them at all. Answer "none" to include no extensions.
13179 Note that DynaLoader is always built and need not be mentioned here.
13182 case "$dynamic_ext" in
13183 '') dflt="$avail_ext" ;;
13184 *) dflt="$dynamic_ext"
13185 # Perhaps we are reusing an old out-of-date config.sh.
13188 if test X"$dynamic_ext" != X"$avail_ext"; then
13190 NOTICE: Your previous config.sh list may be incorrect.
13191 The extensions now available to you are
13193 but the default list from your previous config.sh is
13205 rp="What extensions do you wish to load dynamically?"
13208 none) dynamic_ext=' ' ;;
13209 *) dynamic_ext="$ans" ;;
13212 case "$static_ext" in
13214 : Exclude those already listed in dynamic linking
13216 for xxx in $avail_ext; do
13217 case " $dynamic_ext " in
13219 *) dflt="$dflt $xxx" ;;
13226 *) dflt="$static_ext"
13233 rp="What extensions do you wish to load statically?"
13236 none) static_ext=' ' ;;
13237 *) static_ext="$ans" ;;
13242 A number of extensions are supplied with $package. Answer "none"
13243 to include no extensions.
13244 Note that DynaLoader is always built and need not be mentioned here.
13247 case "$static_ext" in
13248 '') dflt="$avail_ext" ;;
13249 *) dflt="$static_ext"
13250 # Perhaps we are reusing an old out-of-date config.sh.
13253 if test X"$static_ext" != X"$avail_ext"; then
13255 NOTICE: Your previous config.sh list may be incorrect.
13256 The extensions now available to you are
13258 but the default list from your previous config.sh is
13267 : Exclude those that are not xs extensions
13271 rp="What extensions do you wish to include?"
13274 none) static_ext=' ' ;;
13275 *) static_ext="$ans" ;;
13280 set X $dynamic_ext $static_ext $nonxs_ext
13284 : Remove build directory name from cppstdin so it can be used from
13285 : either the present location or the final installed location.
13287 : Get out of the UU directory to get correct path name.
13289 case "$cppstdin" in
13291 echo "Stripping down cppstdin path name"
13297 : end of configuration questions
13299 echo "End of configuration questions."
13302 : back to where it started
13303 if test -d ../UU; then
13307 : configuration may be patched via a 'config.over' file
13308 if $test -f config.over; then
13311 rp='I see a config.over file. Do you wish to load it?'
13314 n*) echo "OK, I'll ignore it.";;
13316 echo "Configuration override changes have been loaded."
13321 : in case they want portability, strip down executable paths
13322 case "$d_portable" in
13325 echo "Stripping down executable paths..." >&4
13326 for file in $loclist $trylist; do
13328 eval $file=`basename $temp`
13333 : create config.sh file
13335 echo "Creating config.sh..." >&4
13336 $spitshell <<EOT >config.sh
13339 # This file was produced by running the Configure script. It holds all the
13340 # definitions figured out by Configure. Should you modify one of these values,
13341 # do not forget to propagate your changes by running "Configure -der". You may
13342 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13345 # Package name : $package
13346 # Source directory : $src
13347 # Configuration time: $cf_time
13348 # Configured by : $cf_by
13349 # Target system : $myuname
13359 Revision='$Revision'
13366 alignbytes='$alignbytes'
13367 ansi2knr='$ansi2knr'
13368 aphostname='$aphostname'
13369 apiversion='$apiversion'
13372 archlibexp='$archlibexp'
13373 archname64='$archname64'
13374 archname='$archname'
13375 archobjs='$archobjs'
13380 bincompat5005='$bincompat5005'
13384 byteorder='$byteorder'
13386 castflags='$castflags'
13389 cccdlflags='$cccdlflags'
13390 ccdlflags='$ccdlflags'
13392 ccsymbols='$ccsymbols'
13394 cf_email='$cf_email'
13399 clocktype='$clocktype'
13401 compress='$compress'
13402 contains='$contains'
13406 cpp_stuff='$cpp_stuff'
13407 cppccsymbols='$cppccsymbols'
13408 cppflags='$cppflags'
13410 cppminus='$cppminus'
13412 cppstdin='$cppstdin'
13413 cppsymbols='$cppsymbols'
13414 crosscompile='$crosscompile'
13415 cryptlib='$cryptlib'
13417 d_Gconvert='$d_Gconvert'
13418 d_PRIEldbl='$d_PRIEldbl'
13419 d_PRIFldbl='$d_PRIFldbl'
13420 d_PRIGldbl='$d_PRIGldbl'
13421 d_PRIX64='$d_PRIX64'
13422 d_PRId64='$d_PRId64'
13423 d_PRIeldbl='$d_PRIeldbl'
13424 d_PRIfldbl='$d_PRIfldbl'
13425 d_PRIgldbl='$d_PRIgldbl'
13426 d_PRIi64='$d_PRIi64'
13427 d_PRIo64='$d_PRIo64'
13428 d_PRIu64='$d_PRIu64'
13429 d_PRIx64='$d_PRIx64'
13430 d_access='$d_access'
13431 d_accessx='$d_accessx'
13433 d_archlib='$d_archlib'
13436 d_attribut='$d_attribut'
13439 d_bincompat5005='$d_bincompat5005'
13441 d_bsdgetpgrp='$d_bsdgetpgrp'
13442 d_bsdsetpgrp='$d_bsdsetpgrp'
13444 d_casti32='$d_casti32'
13445 d_castneg='$d_castneg'
13446 d_charvspr='$d_charvspr'
13448 d_chroot='$d_chroot'
13449 d_chsize='$d_chsize'
13450 d_closedir='$d_closedir'
13451 d_cmsghdr_s='$d_cmsghdr_s'
13455 d_cuserid='$d_cuserid'
13456 d_dbl_dig='$d_dbl_dig'
13457 d_difftime='$d_difftime'
13458 d_dirnamlen='$d_dirnamlen'
13459 d_dlerror='$d_dlerror'
13460 d_dlopen='$d_dlopen'
13461 d_dlsymun='$d_dlsymun'
13462 d_dosuid='$d_dosuid'
13463 d_drand48proto='$d_drand48proto'
13465 d_eaccess='$d_eaccess'
13466 d_endgrent='$d_endgrent'
13467 d_endhent='$d_endhent'
13468 d_endnent='$d_endnent'
13469 d_endpent='$d_endpent'
13470 d_endpwent='$d_endpwent'
13471 d_endsent='$d_endsent'
13472 d_endspent='$d_endspent'
13473 d_eofnblk='$d_eofnblk'
13474 d_eunice='$d_eunice'
13475 d_fchmod='$d_fchmod'
13476 d_fchown='$d_fchown'
13478 d_fd_macros='$d_fd_macros'
13479 d_fd_set='$d_fd_set'
13480 d_fds_bits='$d_fds_bits'
13481 d_fgetpos='$d_fgetpos'
13482 d_flexfnam='$d_flexfnam'
13485 d_fpathconf='$d_fpathconf'
13486 d_fpos64_t='$d_fpos64_t'
13487 d_fseeko='$d_fseeko'
13488 d_fsetpos='$d_fsetpos'
13489 d_fstatfs='$d_fstatfs'
13490 d_fstatvfs='$d_fstatvfs'
13491 d_ftello='$d_ftello'
13493 d_getgrent='$d_getgrent'
13494 d_getgrps='$d_getgrps'
13495 d_gethbyaddr='$d_gethbyaddr'
13496 d_gethbyname='$d_gethbyname'
13497 d_gethent='$d_gethent'
13498 d_gethname='$d_gethname'
13499 d_gethostprotos='$d_gethostprotos'
13500 d_getlogin='$d_getlogin'
13501 d_getmntent='$d_getmntent'
13502 d_getnbyaddr='$d_getnbyaddr'
13503 d_getnbyname='$d_getnbyname'
13504 d_getnent='$d_getnent'
13505 d_getnetprotos='$d_getnetprotos'
13506 d_getpbyname='$d_getpbyname'
13507 d_getpbynumber='$d_getpbynumber'
13508 d_getpent='$d_getpent'
13509 d_getpgid='$d_getpgid'
13510 d_getpgrp2='$d_getpgrp2'
13511 d_getpgrp='$d_getpgrp'
13512 d_getppid='$d_getppid'
13513 d_getprior='$d_getprior'
13514 d_getprotoprotos='$d_getprotoprotos'
13515 d_getpwent='$d_getpwent'
13516 d_getsbyname='$d_getsbyname'
13517 d_getsbyport='$d_getsbyport'
13518 d_getsent='$d_getsent'
13519 d_getservprotos='$d_getservprotos'
13520 d_getspent='$d_getspent'
13521 d_getspnam='$d_getspnam'
13522 d_gettimeod='$d_gettimeod'
13523 d_gnulibc='$d_gnulibc'
13524 d_grpasswd='$d_grpasswd'
13525 d_hasmntopt='$d_hasmntopt'
13528 d_inetaton='$d_inetaton'
13529 d_int64t='$d_int64t'
13530 d_iovec_s='$d_iovec_s'
13531 d_isascii='$d_isascii'
13532 d_killpg='$d_killpg'
13533 d_lchown='$d_lchown'
13534 d_ldbl_dig='$d_ldbl_dig'
13536 d_llseek='$d_llseek'
13537 d_locconv='$d_locconv'
13539 d_longdbl='$d_longdbl'
13540 d_longlong='$d_longlong'
13542 d_madvise='$d_madvise'
13544 d_mbstowcs='$d_mbstowcs'
13545 d_mbtowc='$d_mbtowc'
13546 d_memchr='$d_memchr'
13547 d_memcmp='$d_memcmp'
13548 d_memcpy='$d_memcpy'
13549 d_memmove='$d_memmove'
13550 d_memset='$d_memset'
13552 d_mkfifo='$d_mkfifo'
13553 d_mktime='$d_mktime'
13555 d_mprotect='$d_mprotect'
13557 d_msg_ctrunc='$d_msg_ctrunc'
13558 d_msg_dontroute='$d_msg_dontroute'
13559 d_msg_oob='$d_msg_oob'
13560 d_msg_peek='$d_msg_peek'
13561 d_msg_proxy='$d_msg_proxy'
13562 d_msgctl='$d_msgctl'
13563 d_msgget='$d_msgget'
13564 d_msghdr_s='$d_msghdr_s'
13565 d_msgrcv='$d_msgrcv'
13566 d_msgsnd='$d_msgsnd'
13568 d_munmap='$d_munmap'
13569 d_mymalloc='$d_mymalloc'
13571 d_off64_t='$d_off64_t'
13572 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13573 d_oldpthreads='$d_oldpthreads'
13574 d_oldsock='$d_oldsock'
13576 d_pathconf='$d_pathconf'
13578 d_phostname='$d_phostname'
13581 d_portable='$d_portable'
13582 d_pthread_yield='$d_pthread_yield'
13584 d_pwchange='$d_pwchange'
13585 d_pwclass='$d_pwclass'
13586 d_pwcomment='$d_pwcomment'
13587 d_pwexpire='$d_pwexpire'
13588 d_pwgecos='$d_pwgecos'
13589 d_pwpasswd='$d_pwpasswd'
13590 d_pwquota='$d_pwquota'
13591 d_readdir='$d_readdir'
13592 d_readlink='$d_readlink'
13594 d_recvmsg='$d_recvmsg'
13595 d_rename='$d_rename'
13596 d_rewinddir='$d_rewinddir'
13598 d_safebcpy='$d_safebcpy'
13599 d_safemcpy='$d_safemcpy'
13600 d_sanemcmp='$d_sanemcmp'
13601 d_sched_yield='$d_sched_yield'
13602 d_scm_rights='$d_scm_rights'
13603 d_seekdir='$d_seekdir'
13604 d_select='$d_select'
13606 d_semctl='$d_semctl'
13607 d_semctl_semid_ds='$d_semctl_semid_ds'
13608 d_semctl_semun='$d_semctl_semun'
13609 d_semget='$d_semget'
13611 d_sendmsg='$d_sendmsg'
13612 d_setegid='$d_setegid'
13613 d_seteuid='$d_seteuid'
13614 d_setgrent='$d_setgrent'
13615 d_setgrps='$d_setgrps'
13616 d_sethent='$d_sethent'
13617 d_setlinebuf='$d_setlinebuf'
13618 d_setlocale='$d_setlocale'
13619 d_setnent='$d_setnent'
13620 d_setpent='$d_setpent'
13621 d_setpgid='$d_setpgid'
13622 d_setpgrp2='$d_setpgrp2'
13623 d_setpgrp='$d_setpgrp'
13624 d_setprior='$d_setprior'
13625 d_setpwent='$d_setpwent'
13626 d_setregid='$d_setregid'
13627 d_setresgid='$d_setresgid'
13628 d_setresuid='$d_setresuid'
13629 d_setreuid='$d_setreuid'
13630 d_setrgid='$d_setrgid'
13631 d_setruid='$d_setruid'
13632 d_setsent='$d_setsent'
13633 d_setsid='$d_setsid'
13634 d_setspent='$d_setspent'
13635 d_setvbuf='$d_setvbuf'
13639 d_shmatprototype='$d_shmatprototype'
13640 d_shmctl='$d_shmctl'
13642 d_shmget='$d_shmget'
13643 d_sigaction='$d_sigaction'
13644 d_sigsetjmp='$d_sigsetjmp'
13645 d_socket='$d_socket'
13646 d_sockpair='$d_sockpair'
13647 d_statblks='$d_statblks'
13648 d_statfs='$d_statfs'
13649 d_statfsflags='$d_statfsflags'
13650 d_statvfs='$d_statvfs'
13651 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13652 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13653 d_stdio_stream_array='$d_stdio_stream_array'
13654 d_stdiobase='$d_stdiobase'
13655 d_stdstdio='$d_stdstdio'
13656 d_strchr='$d_strchr'
13657 d_strcoll='$d_strcoll'
13658 d_strctcpy='$d_strctcpy'
13659 d_strerrm='$d_strerrm'
13660 d_strerror='$d_strerror'
13661 d_strtod='$d_strtod'
13662 d_strtol='$d_strtol'
13663 d_strtoul='$d_strtoul'
13664 d_strtoull='$d_strtoull'
13665 d_strxfrm='$d_strxfrm'
13666 d_suidsafe='$d_suidsafe'
13667 d_symlink='$d_symlink'
13668 d_syscall='$d_syscall'
13669 d_sysconf='$d_sysconf'
13670 d_sysernlst='$d_sysernlst'
13671 d_syserrlst='$d_syserrlst'
13672 d_system='$d_system'
13673 d_tcgetpgrp='$d_tcgetpgrp'
13674 d_tcsetpgrp='$d_tcsetpgrp'
13675 d_telldir='$d_telldir'
13676 d_telldirproto='$d_telldirproto'
13679 d_truncate='$d_truncate'
13680 d_tzname='$d_tzname'
13683 d_union_semun='$d_union_semun'
13684 d_vendorlib='$d_vendorlib'
13686 d_void_closedir='$d_void_closedir'
13687 d_voidsig='$d_voidsig'
13688 d_voidtty='$d_voidtty'
13689 d_volatile='$d_volatile'
13690 d_vprintf='$d_vprintf'
13692 d_waitpid='$d_waitpid'
13693 d_wcstombs='$d_wcstombs'
13694 d_wctomb='$d_wctomb'
13695 d_writev='$d_writev'
13698 db_hashtype='$db_hashtype'
13699 db_prefixtype='$db_prefixtype'
13700 defvoidused='$defvoidused'
13701 direntrytype='$direntrytype'
13704 doublesize='$doublesize'
13706 dynamic_ext='$dynamic_ext'
13712 eunicefix='$eunicefix'
13715 extensions='$extensions'
13716 fflushNULL='$fflushNULL'
13717 fflushall='$fflushall'
13719 firstmakefile='$firstmakefile'
13721 fpostype='$fpostype'
13722 freetype='$freetype'
13724 full_csh='$full_csh'
13725 full_sed='$full_sed'
13726 gccversion='$gccversion'
13730 groupcat='$groupcat'
13731 groupstype='$groupstype'
13734 h_sysfile='$h_sysfile'
13738 i_arpainet='$i_arpainet'
13739 i_bsdioctl='$i_bsdioctl'
13742 i_dirent='$i_dirent'
13749 i_inttypes='$i_inttypes'
13750 i_limits='$i_limits'
13751 i_locale='$i_locale'
13752 i_machcthr='$i_machcthr'
13753 i_malloc='$i_malloc'
13755 i_memory='$i_memory'
13756 i_mntent='$i_mntent'
13759 i_neterrno='$i_neterrno'
13760 i_netinettcp='$i_netinettcp'
13763 i_pthread='$i_pthread'
13765 i_rpcsvcdbm='$i_rpcsvcdbm'
13768 i_shadow='$i_shadow'
13770 i_stdarg='$i_stdarg'
13771 i_stddef='$i_stddef'
13772 i_stdlib='$i_stdlib'
13773 i_string='$i_string'
13774 i_sysaccess='$i_sysaccess'
13775 i_sysdir='$i_sysdir'
13776 i_sysfile='$i_sysfile'
13777 i_sysfilio='$i_sysfilio'
13779 i_sysioctl='$i_sysioctl'
13780 i_sysmman='$i_sysmman'
13781 i_sysmount='$i_sysmount'
13782 i_sysndir='$i_sysndir'
13783 i_sysparam='$i_sysparam'
13784 i_sysresrc='$i_sysresrc'
13785 i_syssecrt='$i_syssecrt'
13786 i_sysselct='$i_sysselct'
13787 i_syssockio='$i_syssockio'
13788 i_sysstat='$i_sysstat'
13789 i_sysstatvfs='$i_sysstatvfs'
13790 i_systime='$i_systime'
13791 i_systimek='$i_systimek'
13792 i_systimes='$i_systimes'
13793 i_systypes='$i_systypes'
13794 i_sysuio='$i_sysuio'
13796 i_syswait='$i_syswait'
13797 i_termio='$i_termio'
13798 i_termios='$i_termios'
13800 i_unistd='$i_unistd'
13802 i_values='$i_values'
13803 i_varargs='$i_varargs'
13804 i_varhdr='$i_varhdr'
13806 ignore_versioned_solibs='$ignore_versioned_solibs'
13809 installarchlib='$installarchlib'
13810 installbin='$installbin'
13811 installman1dir='$installman1dir'
13812 installman3dir='$installman3dir'
13813 installprefix='$installprefix'
13814 installprefixexp='$installprefixexp'
13815 installprivlib='$installprivlib'
13816 installscript='$installscript'
13817 installsitearch='$installsitearch'
13818 installsitelib='$installsitelib'
13819 installstyle='$installstyle'
13820 installusrbinperl='$installusrbinperl'
13821 installvendorlib='$installvendorlib'
13823 known_extensions='$known_extensions'
13827 lddlflags='$lddlflags'
13829 ldlibpthname='$ldlibpthname'
13836 libswanted='$libswanted'
13842 locincpth='$locincpth'
13843 loclibpth='$loclibpth'
13844 longdblsize='$longdblsize'
13845 longlongsize='$longlongsize'
13846 longsize='$longsize'
13850 lseeksize='$lseeksize'
13851 lseektype='$lseektype'
13855 make_set_make='$make_set_make'
13856 mallocobj='$mallocobj'
13857 mallocsrc='$mallocsrc'
13858 malloctype='$malloctype'
13860 man1direxp='$man1direxp'
13863 man3direxp='$man3direxp'
13867 mips_type='$mips_type'
13869 mmaptype='$mmaptype'
13871 modetype='$modetype'
13873 multiarch='$multiarch'
13875 myarchname='$myarchname'
13876 mydomain='$mydomain'
13877 myhostname='$myhostname'
13880 netdb_hlen_type='$netdb_hlen_type'
13881 netdb_host_type='$netdb_host_type'
13882 netdb_name_type='$netdb_name_type'
13883 netdb_net_type='$netdb_net_type'
13886 nm_so_opt='$nm_so_opt'
13887 nonxs_ext='$nonxs_ext'
13889 o_nonblock='$o_nonblock'
13891 old_pthread_create_joinable='$old_pthread_create_joinable'
13892 optimize='$optimize'
13893 orderlib='$orderlib'
13899 patchlevel='$patchlevel'
13900 path_sep='$path_sep'
13902 perladmin='$perladmin'
13903 perlpath='$perlpath'
13905 phostname='$phostname'
13911 prefixexp='$prefixexp'
13913 privlibexp='$privlibexp'
13914 prototype='$prototype'
13916 randbits='$randbits'
13917 randfunc='$randfunc'
13918 randseedtype='$randseedtype'
13920 rd_nodata='$rd_nodata'
13924 sPRIEldbl='$sPRIEldbl'
13925 sPRIFldbl='$sPRIFldbl'
13926 sPRIGldbl='$sPRIGldbl'
13929 sPRIeldbl='$sPRIeldbl'
13930 sPRIfldbl='$sPRIfldbl'
13931 sPRIgldbl='$sPRIgldbl'
13936 sched_yield='$sched_yield'
13937 scriptdir='$scriptdir'
13938 scriptdirexp='$scriptdirexp'
13940 seedfunc='$seedfunc'
13941 selectminbits='$selectminbits'
13942 selecttype='$selecttype'
13943 sendmail='$sendmail'
13946 sharpbang='$sharpbang'
13947 shmattype='$shmattype'
13948 shortsize='$shortsize'
13951 sig_count='$sig_count'
13952 sig_name='$sig_name'
13953 sig_name_init='$sig_name_init'
13955 sig_num_init='$sig_num_init'
13956 signal_t='$signal_t'
13957 sitearch='$sitearch'
13958 sitearchexp='$sitearchexp'
13960 sitelibexp='$sitelibexp'
13961 siteprefix='$siteprefix'
13962 siteprefixexp='$siteprefixexp'
13963 sizetype='$sizetype'
13968 sockethdr='$sockethdr'
13969 socketlib='$socketlib'
13971 spackage='$spackage'
13972 spitshell='$spitshell'
13975 ssizetype='$ssizetype'
13976 startperl='$startperl'
13978 static_ext='$static_ext'
13980 stdio_base='$stdio_base'
13981 stdio_bufsiz='$stdio_bufsiz'
13982 stdio_cnt='$stdio_cnt'
13983 stdio_filbuf='$stdio_filbuf'
13984 stdio_ptr='$stdio_ptr'
13985 stdio_stream_array='$stdio_stream_array'
13988 subversion='$subversion'
13995 timeincl='$timeincl'
13996 timetype='$timetype'
14004 use64bits='$use64bits'
14007 uselongdouble='$uselongdouble'
14008 usemorebits='$usemorebits'
14009 usemultiplicity='$usemultiplicity'
14010 usemymalloc='$usemymalloc'
14012 useopcode='$useopcode'
14013 useperlio='$useperlio'
14014 useposix='$useposix'
14016 useshrplib='$useshrplib'
14017 usesocks='$usesocks'
14018 usethreads='$usethreads'
14019 usevendorprefix='$usevendorprefix'
14020 usevfork='$usevfork'
14023 vendorlib='$vendorlib'
14024 vendorlibexp='$vendorlibexp'
14025 vendorprefix='$vendorprefix'
14026 vendorprefixexp='$vendorprefixexp'
14029 voidflags='$voidflags'
14035 : Add in command line options if available
14036 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14038 : add special variables
14039 $test -f $src/patchlevel.h && \
14040 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14041 echo "CONFIGDOTSH=true" >>config.sh
14043 : propagate old symbols
14044 if $test -f UU/config.sh; then
14045 <UU/config.sh sort | uniq >UU/oldconfig.sh
14046 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14047 sort | uniq -u >UU/oldsyms
14048 set X `cat UU/oldsyms`
14054 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14056 echo "# Variables propagated from previous config.sh file." >>config.sh
14057 for sym in `cat UU/oldsyms`; do
14058 echo " Propagating $hint variable "'$'"$sym..."
14059 eval 'tmp="$'"${sym}"'"'
14061 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14067 : Finish up by extracting the .SH files
14081 If you'd like to make any changes to the config.sh file before I begin
14082 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14085 rp="Press return or use a shell escape to edit config.sh:"
14090 *) : in case they cannot read
14091 sh 1>&4 -c "$ans";;
14096 : if this fails, just run all the .SH files by hand
14103 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14110 Now you need to generate make dependencies by running "$make depend".
14111 You might prefer to run it in background: "$make depend > makedepend.out &"
14112 It can take a while, so you might not want to run it right now.
14117 rp="Run $make depend now?"
14121 $make depend && echo "Now you must run a $make."
14124 echo "You must run '$make depend' then '$make'."
14127 elif test -f [Mm]akefile; then
14129 echo "Now you must run a $make."
14134 if $test -f Policy.sh; then
14137 If you compile $package on a different machine or from a different object
14138 directory, copy the Policy.sh file from this object directory to the
14139 new one before you run Configure -- this will help you with most of
14140 the policy defaults.
14144 if $test -f config.msg; then
14145 echo "Hmm. I also noted the following information while running:"
14147 $cat config.msg >&4
14150 $rm -f kit*isdone ark*isdone