3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Tue Oct 26 13:10:37 EET DST 1999 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
442 d_old_pthread_create_joinable=''
443 old_pthread_create_joinable=''
693 ignore_versioned_solibs=''
817 d_stdio_stream_array=''
818 stdio_stream_array=''
861 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
864 : We must find out about Eunice early
866 if test -f /etc/unixtovms; then
867 eunicefix=/etc/unixtovms
869 if test -f /etc/unixtovms.exe; then
870 eunicefix=/etc/unixtovms.exe
874 : Possible local include directories to search.
875 : Set locincpth to "" in a hint file to defeat local include searches.
876 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
877 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
879 : no include file wanted by default
882 : list of known cpp symbols, sorted alphabetically
883 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
884 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
885 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
886 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
887 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
888 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
889 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
890 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
891 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
892 al="$al VMS Xenix286"
893 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
894 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
895 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
896 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
897 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
898 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
899 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
900 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
901 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
902 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
903 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
904 al="$al __SVR4_2__ __UMAXV__"
905 al="$al ____386BSD____ __alpha __alpha__ __amiga"
906 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
907 al="$al __host_mips__"
908 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
909 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
910 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
911 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
912 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
913 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
914 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
915 al="$al __mc88100 __mc88100__ __mips __mips__"
916 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
917 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
918 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
919 al="$al _host_mips _mips _unix"
920 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
921 al="$al apollo ardent att386 att3b"
922 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
923 al="$al cadmus clipper concurrent convex cray ctix"
924 al="$al dmert encore gcos gcx gimpel gould"
925 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
926 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
927 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
928 al="$al i186 i286 i386 i486 i8086"
929 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
930 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
931 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
932 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
933 al="$al mc88000 mc88100 merlin mert mips mvs n16"
934 al="$al ncl_el ncl_mr"
935 al="$al news1500 news1700 news1800 news1900 news3700"
936 al="$al news700 news800 news900 ns16000 ns32000"
937 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
938 al="$al parisc pc532 pdp11 plexus posix pyr"
939 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
940 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
941 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
942 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
943 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
944 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
947 : Trailing extension. Override this in a hint file, if needed.
949 : Extra object files, if any, needed on this platform.
952 : change the next line if compiling for Xenix/286 on Xenix/386
953 xlibpth='/usr/lib/386 /lib/386'
955 : Possible local library directories to search.
956 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
957 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
959 : general looking path for locating libraries
960 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
961 glibpth="$glibpth /lib /usr/lib $xlibpth"
962 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
963 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
965 : Private path used by Configure to find libraries. Its value
966 : is prepended to libpth. This variable takes care of special
967 : machines, like the mips. Usually, it should be empty.
970 : default library list
972 : some systems want to use only the non-versioned libso:s
973 ignore_versioned_solibs=''
974 : full support for void wanted by default
977 : set useposix=false in your hint file to disable the POSIX extension.
979 : set useopcode=false in your hint file to disable the Opcode extension.
981 : set usemultiplicity on the Configure command line to enable multiplicity.
982 : set usesocks on the Configure command line to enable socks.
983 : set usethreads on the Configure command line to enable threads.
984 : List of libraries we want.
985 : If anyone needs -lnet, put it in a hint file.
986 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
987 libswanted="$libswanted dld ld sun m c cposix posix"
988 libswanted="$libswanted ndir dir crypt sec"
989 libswanted="$libswanted ucb bsd BSD PW x"
990 : We probably want to search /usr/shlib before most other libraries.
991 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
992 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
993 glibpth="/usr/shlib $glibpth"
994 : Do not use vfork unless overridden by a hint file.
997 : Find the basic shell for Bourne shell scripts
1001 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1004 if test -f "$xxx"; then
1007 : Build up a list and do a single loop so we can 'break' out.
1008 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1009 for xxx in sh bash ksh pdksh ash; do
1011 try="$try ${p}/${xxx}"
1015 if test -f "$xxx"; then
1018 elif test -f "$xxx.exe"; then
1029 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1031 Usually it's in /bin/sh. How did you even get this far?
1032 Please contact me (Perl Maintainers) at perlbug@perl.com and
1033 we'll try to straighten this all out.
1039 : see if sh knows # comments
1040 if `$sh -c '#' >/dev/null 2>&1`; then
1044 test -f $xcat || xcat=/usr/bin/cat
1049 if test -s today; then
1052 echo "#! $xcat" > try
1056 if test -s today; then
1064 echo "Your $sh doesn't grok # comments--I will strip them later on."
1067 echo "exec grep -v '^[ ]*#'" >spitshell
1069 $eunicefix spitshell
1070 spitshell=`pwd`/spitshell
1072 echo "I presume that if # doesn't work, #! won't work either!"
1077 : figure out how to guarantee sh startup
1079 '') startsh=${sharpbang}${sh} ;;
1091 : echo "Yup, it does."
1093 echo "Hmm... '$startsh' does not guarantee sh startup..."
1094 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1099 : Save command line options in file UU/cmdline.opt for later use in
1100 : generating config.sh.
1101 cat > cmdline.opt <<EOSH
1102 # Configure command line arguments.
1109 cat >>cmdline.opt <<EOSH
1110 config_arg$argn='$arg'
1112 argn=`expr $argn + 1`
1115 : produce awk script to parse command line options
1116 cat >options.awk <<'EOF'
1118 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1120 len = length(optstr);
1121 for (i = 1; i <= len; i++) {
1122 c = substr(optstr, i, 1);
1123 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1134 if (substr(str, 1, 1) != "-") {
1135 printf("'%s'\n", str);
1139 for (i = 2; i <= len; i++) {
1140 c = substr(str, i, 1);
1142 printf("-%s\n", substr(str, i));
1148 printf("'%s'\n", substr(str, i + 1));
1161 : process the command line options
1162 set X `for arg in "$@"; do echo "X$arg"; done |
1163 sed -e s/X// | awk -f options.awk`
1168 : set up default values
1178 rm -f optdef.sh posthint.sh
1179 cat >optdef.sh <<EOS
1185 while test $# -gt 0; do
1187 -d) shift; fastread=yes;;
1188 -e) shift; alldone=cont;;
1192 if test -r "$1"; then
1195 echo "$me: cannot read config file $1." >&2
1200 -h) shift; error=true;;
1201 -r) shift; reuseval=true;;
1202 -s) shift; silent=true; realsilent=true;;
1203 -E) shift; alldone=exit;;
1204 -K) shift; knowitall=true;;
1205 -O) shift; override=true;;
1206 -S) shift; silent=true; extractsh=true;;
1211 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1212 echo "$me: ignoring -D $1" >&2
1215 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1216 *) echo "$1='define'" >> optdef.sh;;
1223 *=) echo "$1" >> optdef.sh;;
1225 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1226 echo "$me: ignoring -U $1" >&2
1228 *) echo "$1='undef'" >> optdef.sh;;
1239 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1243 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1244 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1250 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1251 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1252 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1253 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1254 *) xxx=`echo $yyy|sed 's!:.*!!'`
1255 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1261 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1263 echo "$yyy=''" >> posthint.sh ;;
1268 echo "$yyy='$zzz'" >> posthint.sh ;;
1270 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1272 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1277 echo "$yyy=$zzz" >> posthint.sh ;;
1278 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1281 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1284 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1292 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1293 [-U symbol] [-U symbol=] [-A command:symbol...]
1294 -d : use defaults for all answers.
1295 -e : go on without questioning past the production of config.sh.
1296 -f : specify an alternate default configuration file.
1297 -h : print this help message and exit (with an error status).
1298 -r : reuse C symbols value if possible (skips costly nm extraction).
1299 -s : silent mode, only echoes questions and essential information.
1300 -D : define symbol to have some value:
1301 -D symbol symbol gets the value 'define'
1302 -D symbol=value symbol gets the value 'value'
1303 -E : stop at the end of questions, after having produced config.sh.
1304 -K : do not use unless you know what you are doing.
1305 -O : let -D and -U override definitions from loaded configuration file.
1306 -S : perform variable substitutions on all .SH files (can mix with -f)
1307 -U : undefine symbol:
1308 -U symbol symbol gets the value 'undef'
1309 -U symbol= symbol gets completely empty
1310 -A : manipulate symbol after the platform specific hints have been applied:
1311 -A symbol=value append " "value to symbol
1312 -A append:symbol=value append value to symbol
1313 -A define:symbol=value define symbol to have value
1314 -A clear:symbol define symbol to be ''
1315 -A define:symbol define symbol to be 'define'
1316 -A eval:symbol=value define symbol to be eval of value
1317 -A prepend:symbol=value prepend value to symbol
1318 -A undef:symbol define symbol to be 'undef'
1319 -A undef:symbol= define symbol to be ''
1320 -V : print version number and exit (with a zero status).
1327 case "$fastread$alldone" in
1330 if test ! -t 0; then
1331 echo "Say 'sh Configure', not 'sh <Configure'"
1339 true) exec 1>/dev/null;;
1342 : run the defines and the undefines, if any, but leave the file out there...
1345 : create the posthint manipulation script and leave the file out there...
1350 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1351 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1352 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1353 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1354 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1357 : Some greps do not return status, grrr.
1358 echo "grimblepritz" >grimble
1359 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1361 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1367 : the following should work in any shell
1371 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1372 cat >contains <<'EOSS'
1373 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1378 : Find the path to the source tree
1381 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1384 *) src=`cd ../$src && pwd` ;;
1397 if test -f $rsrc/Configure && \
1398 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1400 : found it, so we are ok.
1403 for src in . .. ../.. ../../.. ../../../..; do
1404 if test -f ../$src/Configure && \
1405 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1416 Sorry, I can't seem to locate the source dir for $package. Please start
1417 Configure with an explicit path -- i.e. /some/path/Configure.
1425 echo "Sources for $package found in \"$src\"." >&4
1429 : script used to extract .SH files with variable substitutions
1430 cat >extract <<'EOS'
1432 echo "Doing variable substitutions on .SH files..."
1433 if test -f $src/MANIFEST; then
1434 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1436 echo "(Looking for .SH files under the source directory.)"
1437 set x `(cd $src; find . -name "*.SH" -print)`
1441 0) set x `(cd $src; echo *.SH)`; shift;;
1443 if test ! -f $src/$1; then
1449 while test $name; do
1450 if test ! -d "$name"; then
1451 create="$name $create";
1452 name=`echo $name | sed -e "s|^[^/]*$||"`;
1453 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1458 for file in $create; do
1467 dir=`expr X$file : 'X\(.*\)/'`
1468 file=`expr X$file : 'X.*/\(.*\)'`
1469 (cd $dir && . ./$file)
1479 dir=`expr X$file : 'X\(.*\)/'`
1480 file=`expr X$file : 'X.*/\(.*\)'`
1481 (set x $dir; shift; eval $mkdir_p)
1491 if test -f $src/config_h.SH; then
1492 if test ! -f config.h; then
1493 : oops, they left it out of MANIFEST, probably, so do it anyway.
1499 : extract files and exit if asked to do so
1500 case "$extractsh" in
1502 case "$realsilent" in
1506 case "$config_sh" in
1507 '') config_sh='config.sh';;
1510 echo "Fetching answers from $config_sh..."
1513 test "$override" && . ./optdef.sh
1522 : Eunice requires " " instead of "", can you believe it
1525 echo "Beginning of configuration questions for $package."
1527 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1529 : first determine how to suppress newline on echo command
1531 echo "Checking echo to see how to suppress newlines..."
1532 (echo "hi there\c" ; echo " ") >.echotmp
1533 if $contains c .echotmp >/dev/null 2>&1 ; then
1544 echo $n "The star should be here-->$c"
1548 : Now test for existence of everything in MANIFEST
1550 if test -f $rsrc/MANIFEST; then
1551 echo "First let's make sure your kit is complete. Checking..." >&4
1552 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1555 for filelist in x??; do
1556 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1558 if test -s missing; then
1562 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1564 You have the option of continuing the configuration process, despite the
1565 distinct possibility that your kit is damaged, by typing 'y'es. If you
1566 do, don't blame me if something goes wrong. I advise you to type 'n'o
1567 and contact the author (perlbug@perl.com).
1570 echo $n "Continue? [n] $c" >&4
1574 echo "Continuing..." >&4
1578 echo "ABORTING..." >&4
1583 echo "Looks good..."
1586 echo "There is no MANIFEST file. I hope your kit is complete !"
1591 : Find the appropriate value for a newline for tr
1592 if test -n "$DJGPP"; then
1595 if test X"$trnl" = X; then
1596 case "`echo foo|tr '\n' x 2>/dev/null`" in
1600 if test X"$trnl" = X; then
1601 case "`echo foo|tr '\012' x 2>/dev/null`" in
1602 foox) trnl='\012' ;;
1605 if test X"$trnl" = X; then
1608 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1614 : compute the number of columns on the terminal for proper question formatting
1619 : set up the echo used in my read
1620 myecho="case \"\$xxxm\" in
1621 '') echo $n \"\$rp $c\" >&4;;
1623 '') echo $n \"[\$xxxm] $c\";;
1625 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1627 echo $n \"[\$xxxm] $c\" >&4
1629 echo $n \"\$rp [\$xxxm] $c\" >&4
1635 : now set up to do reads with possible shell escape and default assignment
1641 case "\$fastread" in
1642 yes) case "\$dflt" in
1645 case "\$silent-\$rp" in
1650 *) case "\$silent" in
1651 true) case "\$rp" in
1656 while expr "X\$ans" : "X!" >/dev/null; do
1660 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1668 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1677 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1682 echo "(OK, I'll run with -d after this question.)" >&4
1685 echo "*** Sorry, \$1 not supported yet." >&4
1695 echo "*** Substitution done -- please confirm."
1697 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1702 echo "*** Error -- try again."
1709 case "\$ans\$xxxm\$nostick" in
1721 : create .config dir to save info across Configure sessions
1722 test -d ../.config || mkdir ../.config
1723 cat >../.config/README <<EOF
1724 This directory created by Configure to save information that should
1725 persist across sessions for $package.
1727 You may safely delete it if you wish.
1730 : general instructions
1733 user=`(logname) 2>/dev/null`
1735 '') user=`whoami 2>&1`;;
1737 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1740 rp='Would you like to see the instructions?'
1751 This installation shell script will examine your system and ask you questions
1752 to determine how the perl5 package should be installed. If you get
1753 stuck on a question, you may use a ! shell escape to start a subshell or
1754 execute a command. Many of the questions will have default answers in square
1755 brackets; typing carriage return will give you the default.
1757 On some of the questions which ask for file or directory names you are allowed
1758 to use the ~name construct to specify the login directory belonging to "name",
1759 even if you don't have a shell which knows about that. Questions where this is
1760 allowed will be marked "(~name ok)".
1764 dflt='Type carriage return to continue'
1768 The prompter used in this script allows you to use shell variables and
1769 backticks in your answers. You may use $1, $2, etc... to refer to the words
1770 in the default answer, as if the default line was a set of arguments given to a
1771 script shell. This means you may also use $* to repeat the whole default line,
1772 so you do not have to re-type everything to add something to the default.
1774 Everytime there is a substitution, you will have to confirm. If there is an
1775 error (e.g. an unmatched backtick), the default answer will remain unchanged
1776 and you will be prompted again.
1778 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1779 the questions and use the computed defaults (or the previous answers if there
1780 was already a config.sh file). Type 'Configure -h' for a list of options.
1781 You may also start interactively and then answer '& -d' at any prompt to turn
1782 on the non-interactive behaviour for the remainder of the execution.
1788 Much effort has been expended to ensure that this shell script will run on any
1789 Unix system. If despite that it blows up on yours, your best bet is to edit
1790 Configure and run it again. If you can't run Configure for some reason,
1791 you'll have to generate a config.sh file by hand. Whatever problems you
1792 have, let me (perlbug@perl.com) know how I blew it.
1794 This installation script affects things in two ways:
1796 1) it may do direct variable substitutions on some of the files included
1798 2) it builds a config.h file for inclusion in C programs. You may edit
1799 any of these files as the need arises after running this script.
1801 If you make a mistake on a question, there is no easy way to back up to it
1802 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1803 files. Configure will offer to let you do this before it runs the SH files.
1806 dflt='Type carriage return to continue'
1808 case "$firsttime" in
1809 true) echo $user >>../.config/instruct;;
1813 : find out where common programs are
1815 echo "Locating common programs..." >&4
1828 if test -d \$dir/\$thing; then
1834 for thisthing in \$dir/\$thing; do
1835 : just loop through to pick last item
1837 if test -f \$thisthing; then
1840 elif test -f \$dir/\$thing.exe; then
1841 if test -n "$DJGPP"; then
1842 echo \$dir/\$thing.exe
1844 : on Eunice apparently
1894 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1895 pth="$pth /lib /usr/lib"
1896 for file in $loclist; do
1900 if test -f "$xxx"; then
1903 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1904 xxx=`./loc $file $file $pth`
1907 '') xxx=`./loc $file $file $pth`;;
1908 *) xxx=`./loc $xxx $xxx $pth`;;
1914 echo $file is in $xxx.
1917 echo $file is in $xxx.
1920 echo "I don't know where '$file' is, and my life depends on it." >&4
1921 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1927 echo "Don't worry if any of the following aren't found..."
1929 for file in $trylist; do
1933 if test -f "$xxx"; then
1936 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1937 xxx=`./loc $file $file $pth`
1940 '') xxx=`./loc $file $file $pth`;;
1941 *) xxx=`./loc $xxx $xxx $pth`;;
1947 echo $file is in $xxx.
1950 echo $file is in $xxx.
1953 echo "I don't see $file out there, $say."
1960 echo "Substituting grep for egrep."
1966 echo "Substituting cp for ln."
1972 echo "Hopefully test is built into your sh."
1975 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1976 echo "Using the test built into your sh."
1984 echo "Hopefully echo is built into your sh."
1989 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1990 $echo $n "hi there$c" >foo1
1991 echo $n "hi there$c" >foo2
1992 if cmp foo1 foo2 >/dev/null 2>&1; then
1993 echo "They are compatible. In fact, they may be identical."
2000 They are not compatible! You are probably running ksh on a non-USG system.
2001 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2002 have echo built in and we may have to run some Bourne shell scripts. That
2003 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2006 $echo $n "The star should be here-->$c"
2013 : determine whether symbolic links are supported
2016 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2017 echo "Symbolic links are supported." >&4
2020 echo "Symbolic links are NOT supported." >&4
2025 : see whether [:lower:] and [:upper:] are supported character classes
2027 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2029 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2033 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2034 # (0xc9 and 0xd1), therefore that is a nice testing point.
2035 if test "X$up" = X -o "X$low" = X; then
2036 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2042 if test "X$up" = X -o "X$low" = X; then
2043 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2049 if test "X$up" = X -o "X$low" = X; then
2050 case "`echo IJ | od -x 2>/dev/null`" in
2052 echo "Hey, this might be EBCDIC." >&4
2053 if test "X$up" = X -o "X$low" = X; then
2054 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2055 ij) up='[A-IJ-RS-Z]'
2060 if test "X$up" = X -o "X$low" = X; then
2061 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2071 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2073 echo "Using $up and $low to convert case." >&4
2076 echo "I don't know how to translate letters from upper to lower case." >&4
2077 echo "Your tr is not acting any way I know of." >&4
2081 : set up the translation script tr, must be called with ./tr of course
2085 '[A-Z][a-z]') exec $tr '$up' '$low';;
2086 '[a-z][A-Z]') exec $tr '$low' '$up';;
2093 : Try to determine whether config.sh was made on this system
2094 case "$config_sh" in
2096 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2097 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2098 # because the A-Z/a-z are not consecutive.
2099 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2100 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2101 newmyuname="$myuname"
2103 case "$knowitall" in
2105 if test -f ../config.sh; then
2106 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2107 eval "`grep myuname= ../config.sh`"
2109 if test "X$myuname" = "X$newmyuname"; then
2117 : Get old answers from old config file if Configure was run on the
2118 : same system, otherwise use the hints.
2121 if test -f config.sh; then
2123 rp="I see a config.sh file. Shall I use it to set the defaults?"
2126 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2127 *) echo "Fetching default answers from your old config.sh file..." >&4
2135 : Older versions did not always set $sh. Catch re-use of such
2144 if test ! -f config.sh; then
2147 First time through, eh? I have some defaults handy for some systems
2148 that need some extra help getting the Configure answers right:
2151 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2153 : Half the following guesses are probably wrong... If you have better
2154 : tests or hints, please send them to perlbug@perl.com
2155 : The metaconfig authors would also appreciate a copy...
2156 $test -f /irix && osname=irix
2157 $test -f /xenix && osname=sco_xenix
2158 $test -f /dynix && osname=dynix
2159 $test -f /dnix && osname=dnix
2160 $test -f /lynx.os && osname=lynxos
2161 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2162 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2163 $test -f /bin/mips && /bin/mips && osname=mips
2164 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2165 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2166 $test -d /usr/apollo/bin && osname=apollo
2167 $test -f /etc/saf/_sactab && osname=svr4
2168 $test -d /usr/include/minix && osname=minix
2169 if $test -d /MachTen -o -d /MachTen_Folder; then
2171 if $test -x /sbin/version; then
2172 osvers=`/sbin/version | $awk '{print $2}' |
2173 $sed -e 's/[A-Za-z]$//'`
2174 elif $test -x /usr/etc/version; then
2175 osvers=`/usr/etc/version | $awk '{print $2}' |
2176 $sed -e 's/[A-Za-z]$//'`
2181 $test -f /sys/posix.dll &&
2182 $test -f /usr/bin/what &&
2183 set X `/usr/bin/what /sys/posix.dll` &&
2184 $test "$3" = UWIN &&
2187 if $test -f $uname; then
2195 umips) osname=umips ;;
2198 [23]100) osname=mips ;;
2199 next*) osname=next ;;
2201 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2202 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2205 elif $test -f /etc/kconfig; then
2207 if test "$lns" = "$ln -s"; then
2209 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2211 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2218 if test -n "$DJGPP"; then
2227 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2229 'not found') osvers="$4"."$3" ;;
2230 '<3240'|'<>3240') osvers=3.2.0 ;;
2231 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2232 '=3250'|'>3250') osvers=3.2.5 ;;
2236 *dc.osx) osname=dcosx
2242 domainos) osname=apollo
2248 dynixptx*) osname=dynixptx
2249 osvers=`echo "$4"|sed 's/^v//'`
2251 freebsd) osname=freebsd
2253 genix) osname=genix ;;
2255 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2271 netbsd*) osname=netbsd
2274 news-os) osvers="$3"
2276 4*) osname=newsos4 ;;
2280 bsd386) osname=bsd386
2283 POSIX-BC | posix-bc ) osname=posix-bc
2286 powerux | power_ux | powermax_os | powermaxos | \
2287 powerunix | power_unix) osname=powerux
2290 next*) osname=next ;;
2291 solaris) osname=solaris
2293 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2300 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2304 titanos) osname=titanos
2313 ultrix) osname=ultrix
2316 osf1|mls+) case "$5" in
2319 osvers=`echo "$3" | sed 's/^[xvt]//'`
2321 hp*) osname=hp_osf1 ;;
2322 mips) osname=mips_osf1 ;;
2325 unixware) osname=svr5
2334 $2) case "$osname" in
2338 : svr4.x or possibly later
2348 if test -f /stand/boot ; then
2349 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2350 if test -n "$INITPROG" -a -f "$INITPROG"; then
2351 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2352 if test -n "$isesix"; then
2360 *) if test -f /etc/systemid; then
2362 set `echo $3 | $sed 's/\./ /g'` $4
2363 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2365 elif $test -f $src/hints/sco_$1_$2.sh; then
2367 elif $test -f $src/hints/sco_$1.sh; then
2372 '') : Still unknown. Probably a generic Sys V.
2381 *) case "$osname" in
2382 '') : Still unknown. Probably a generic BSD.
2390 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2391 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2392 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2395 $rm -f UU/kernel.what
2396 elif test -d c:/.; then
2403 : Now look for a hint file osname_osvers, unless one has been
2404 : specified already.
2407 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2408 : Also try without trailing minor version numbers.
2409 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2410 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2411 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2412 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2415 *) case "$osvers" in
2418 *) if $test -f $src/hints/$file.sh ; then
2420 elif $test -f $src/hints/$xfile.sh ; then
2422 elif $test -f $src/hints/$xxfile.sh ; then
2424 elif $test -f $src/hints/$xxxfile.sh ; then
2426 elif $test -f $src/hints/$xxxxfile.sh ; then
2428 elif $test -f "$src/hints/${osname}.sh" ; then
2437 if $test -f Policy.sh ; then
2440 none) dflt="Policy" ;;
2441 *) dflt="Policy $dflt" ;;
2446 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2450 if $test -f Policy.sh ; then
2453 There's also a Policy hint file available, which should make the
2454 site-specific (policy) questions easier to answer.
2461 You may give one or more space-separated answers, or "none" if appropriate.
2462 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2463 is a good thing. DO NOT give a wrong version or a wrong OS.
2467 rp="Which of these apply, if any?"
2470 for file in $tans; do
2471 if $test X$file = XPolicy -a -f Policy.sh; then
2473 $cat Policy.sh >> UU/config.sh
2474 elif $test -f $src/hints/$file.sh; then
2475 . $src/hints/$file.sh
2476 $cat $src/hints/$file.sh >> UU/config.sh
2477 elif $test X$tans = X -o X$tans = Xnone ; then
2480 : Give one chance to correct a possible typo.
2481 echo "$file.sh does not exist"
2483 rp="hint to use instead?"
2485 for file in $ans; do
2486 if $test -f "$src/hints/$file.sh"; then
2487 . $src/hints/$file.sh
2488 $cat $src/hints/$file.sh >> UU/config.sh
2489 elif $test X$ans = X -o X$ans = Xnone ; then
2492 echo "$file.sh does not exist -- ignored."
2499 : Remember our hint file for later.
2500 if $test -f "$src/hints/$file.sh" ; then
2510 echo "Fetching default answers from $config_sh..." >&4
2514 cp $config_sh config.sh 2>/dev/null
2524 test "$override" && . ./optdef.sh
2525 myuname="$newmyuname"
2527 : Restore computed paths
2528 for file in $loclist $trylist; do
2529 eval $file="\$_$file"
2534 Configure uses the operating system name and version to set some defaults.
2535 The default value is probably right if the name rings a bell. Otherwise,
2536 since spelling matters for me, either accept the default or answer "none"
2543 ''|' '|none) dflt=none ;;
2544 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2547 *) dflt="$osname" ;;
2549 rp="Operating system name?"
2553 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2559 ''|' '|none) dflt=none ;;
2560 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2561 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2563 ''|' ') dflt=none ;;
2568 *) dflt="$osvers" ;;
2570 rp="Operating system version?"
2580 : who configured the system
2581 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2582 cf_by=`(logname) 2>/dev/null`
2585 cf_by=`(whoami) 2>/dev/null`
2587 "") cf_by=unknown ;;
2591 : set up the script used to warn in case of inconsistency
2598 echo "*** WHOA THERE!!! ***" >&4
2599 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2600 rp=" Keep the $hint value?"
2603 y) td=$was; tu=$was;;
2607 : function used to set $1 to $val
2608 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2610 $define$undef) . ./whoa; eval "$var=\$td";;
2611 $undef$define) . ./whoa; eval "$var=\$tu";;
2612 *) eval "$var=$val";;
2617 Perl can be built to take advantage of threads, on some systems.
2618 To do so, Configure must be run with -Dusethreads.
2620 Note that threading is a highly experimental feature, and
2621 some known race conditions still remain. If you choose to try
2622 it, be very sure to not actually deploy it for production
2623 purposes. README.threads has more details, and is required
2624 reading if you enable threads.
2626 case "$usethreads" in
2627 $define|true|[yY]*) dflt='y';;
2630 rp='Build a threading Perl?'
2633 y|Y) val="$define" ;;
2639 case "$d_oldpthreads" in
2640 '') : Configure tests would be welcome here. For now, assume undef.
2642 *) val="$d_oldpthreads" ;;
2648 case "$usethreads" in
2649 "$define"|true|[yY]*)
2650 : Look for a hint-file generated 'call-back-unit'. If the
2651 : user has specified that a threading perl is to be built,
2652 : we may need to set or change some other defaults.
2653 if $test -f usethreads.cbu; then
2654 echo "Your platform has some specific hints for threaded builds, using them..."
2658 (Your platform doesn't have any specific hints for threaded builds.
2659 Assuming POSIX threads, then.)
2667 Perl can be built so that multiple Perl interpreters can coexist
2668 within the same Perl executable. To do so, Configure must be run with
2671 Normally you do not need this and you should answer no.
2674 case "$usemultiplicity" in
2675 $define|true|[yY]*) dflt='y';;
2678 rp='Build Perl for multiplicity?'
2681 y|Y) val="$define" ;;
2687 : determine where manual pages are on this system
2691 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2692 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2693 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2694 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2695 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2696 sysman=`./loc . /usr/man/man1 $syspath`
2699 if $test -d "$sysman"; then
2700 echo "System manual is in $sysman." >&4
2702 echo "Could not find manual pages in source form." >&4
2705 : see what memory models we can support
2708 $cat >pdp11.c <<'EOP'
2717 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2718 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2719 dflt='unsplit split'
2721 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2724 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2729 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2732 if $test -d /lib/large || $test -d /usr/lib/large; then
2735 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2744 Some systems have different model sizes. On most systems they are called
2745 small, medium, large, and huge. On the PDP11 they are called unsplit and
2746 split. If your system doesn't support different memory models, say "none".
2747 If you wish to force everything to one memory model, say "none" here and
2748 put the appropriate flags later when it asks you for other cc and ld flags.
2749 Venix systems may wish to put "none" and let the compiler figure things out.
2750 (In the following question multiple model names should be space separated.)
2752 The default for most systems is "none".
2755 rp="Which memory models are supported?"
2770 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2771 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2778 rp="What flag indicates separate I and D space?"
2786 *large*|*small*|*medium*|*huge*)
2793 rp="What flag indicates large model?"
2803 *huge*) case "$huge" in
2807 rp="What flag indicates huge model?"
2817 *medium*) case "$medium" in
2821 rp="What flag indicates medium model?"
2828 *) medium="$large";;
2831 *small*) case "$small" in
2835 rp="What flag indicates small model?"
2846 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2849 $rm -f pdp11.* pdp11
2851 : make some quick guesses about what we are up against
2853 $echo $n "Hmm... $c"
2863 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2864 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2866 echo "Looks kind of like an OSF/1 system, but we'll see..."
2868 elif test `echo abc | tr a-z A-Z` = Abc ; then
2869 xxx=`./loc addbib blurfl $pth`
2870 if $test -f $xxx; then
2871 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2875 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2876 echo "Looks kind of like an extended USG system, but we'll see..."
2878 echo "Looks kind of like a USG system, but we'll see..."
2882 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2883 echo "Looks kind of like a BSD system, but we'll see..."
2887 echo "Looks kind of like a Version 7 system, but we'll see..."
2890 case "$eunicefix" in
2893 There is, however, a strange, musty smell in the air that reminds me of
2894 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2898 : it so happens the Eunice I know will not run shell scripts in Unix format
2902 echo "Congratulations. You aren't running Eunice."
2906 : Detect OS2. The p_ variable is set above in the Head.U unit.
2911 I have the feeling something is not exactly right, however...don't tell me...
2912 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2917 if test -f /xenix; then
2918 echo "Actually, this looks more like a XENIX system..."
2923 echo "It's not Xenix..."
2928 if test -f /venix; then
2929 echo "Actually, this looks more like a VENIX system..."
2936 echo "Nor is it Venix..."
2939 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2940 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2943 : see if we need a special compiler
2951 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2952 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2966 On some older systems the default C compiler will not resolve multiple global
2967 references that happen to have the same name. On some such systems the "Mcc"
2968 command may be used to force these to be resolved. On other systems a "cc -M"
2969 command is required. (Note that the -M flag on other systems indicates a
2970 memory model to use!) If you have the Gnu C compiler, you might wish to use
2976 rp="Use which C compiler?"
2984 rp="Use which C compiler?"
2988 : Look for a hint-file generated 'call-back-unit'. Now that the
2989 : user has specified the compiler, we may need to set or change some
2991 if $test -f cc.cbu; then
2995 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2996 $cat >gccvers.c <<EOM
3001 printf("%s\n", __VERSION__);
3003 printf("%s\n", "1");
3009 if $cc -o gccvers gccvers.c; then
3010 gccversion=`./gccvers`
3011 case "$gccversion" in
3012 '') echo "You are not using GNU cc." ;;
3013 *) echo "You are using GNU cc $gccversion." ;;
3017 echo "*** WHOA THERE!!! ***" >&4
3018 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3019 case "$knowitall" in
3021 echo " You'd better start hunting for one and let me know about it." >&4
3027 case "$gccversion" in
3028 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3032 case "$usemorebits" in
3033 "$define"|true|[yY]*)
3035 uselongdouble="$define"
3036 usemorebits="$define"
3038 *) usemorebits="$undef"
3045 Perl can be built to understand large files (files larger than 2 gigabytes)
3046 on some systems. To do so, Configure must be run with -Duselargefiles.
3048 If this doesn't make any sense to you, just accept the default.
3050 case "$uselargefiles" in
3051 "$define"|true|[yY]*) dflt='y' ;;
3054 rp='Try to understand large files?'
3057 y|Y) val="$define" ;;
3062 case "$uselargefiles" in
3063 "$define") use64bits="$define" ;;
3068 Perl can be built to take advantage of explicit 64-bit interfaces,
3069 on some systems. To do so, Configure must be run with -Duse64bits.
3071 If this doesn't make any sense to you, just accept the default.
3073 case "$use64bits" in
3074 $define|true|[yY]*) dflt='y';;
3077 rp='Try to use explicit 64-bit interfaces, if available?'
3090 case "$archname64" in
3091 '') archname64='' ;; # not a typo
3094 case "$use64bits" in
3095 "$define"|true|[yY]*)
3096 : Look for a hint-file generated 'call-back-unit'. If the
3097 : user has specified that a 64 bit perl is to be built,
3098 : we may need to set or change some other defaults.
3099 if $test -f use64bits.cbu; then
3100 echo "Your platform has some specific hints for 64-bit builds, using them..."
3104 (Your platform doesn't have any specific hints for 64-bit builds.
3105 This is probably okay, especially if your system is a true 64-bit system.)
3107 case "$gccversion" in
3110 But since you seem to be using gcc,
3111 I will now add -DUSE_LONG_LONG to the compilation flags.
3113 ccflags="$ccflags -DUSE_LONG_LONG"
3120 : determine the architecture name
3122 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3123 tarch=`arch`"-$osname"
3124 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3125 if uname -m > tmparch 2>&1 ; then
3126 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3127 -e 's/$/'"-$osname/" tmparch`
3135 case "$myarchname" in
3138 echo "(Your architecture name used to be $myarchname.)"
3145 *) dflt="$archname";;
3147 rp='What is your architecture name'
3150 case "$usethreads" in
3152 echo "Threads selected." >&4
3154 *-thread*) echo "...and architecture name already has -thread." >&4
3156 *) archname="$archname-thread"
3157 echo "...setting architecture name to $archname." >&4
3162 case "$usemultiplicity" in
3164 echo "Multiplicity selected." >&4
3166 *-multi*) echo "...and architecture name already has -multi." >&4
3168 *) archname="$archname-multi"
3169 echo "...setting architecture name to $archname." >&4
3174 case "$use64bits" in
3176 echo "Explicit 64-bitness selected." >&4
3177 case "$archname64" in
3182 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3184 *) archname="$archname-$archname64"
3185 echo "...setting architecture name to $archname." >&4
3192 : decide how portable to be. Allow command line overrides.
3193 case "$d_portable" in
3195 *) d_portable="$define" ;;
3198 : set up shell script to do ~ expansion
3204 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3207 if $test -f /bin/csh; then
3208 /bin/csh -f -c "glob \$1"
3213 name=\`$expr x\$1 : '..\([^/]*\)'\`
3214 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3215 if $test ! -d "\$dir"; then
3217 echo "\$me: can't locate home directory for: \$name" >&2
3222 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3238 : now set up to get a file name
3242 cat <<'EOSC' >>getfile
3258 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3259 fn=`echo $fn | sed 's/(.*)//'`
3265 loc_file=`expr $fn : '.*:\(.*\)'`
3266 fn=`expr $fn : '\(.*\):.*'`
3274 */*) fullpath=true;;
3283 *e*) exp_file=true;;
3286 *p*) nopath_ok=true;;
3291 *d*) type='Directory';;
3292 *l*) type='Locate';;
3297 Locate) what='File';;
3302 case "$d_portable" in
3310 while test "$type"; do
3315 true) rp="$rp (~name ok)";;
3318 if test -f UU/getfile.ok && \
3319 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3338 value=`UU/filexp $ans`
3341 if test "$ans" != "$value"; then
3342 echo "(That expands to $value on this system.)"
3356 /*) value="$ansexp" ;;
3361 echo "I shall only accept a full path name, as in /bin/ls." >&4
3362 echo "Use a ! shell escape if you wish to check pathnames." >&4
3365 echo "Please give a full path name, starting with slash." >&4
3368 echo "Note that using ~name is ok provided it expands well." >&4
3381 for fp in $gfpth; do
3382 if test "X$fp" = X.; then
3387 if test -f "$pf"; then
3389 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3391 echo "($value is not a plain file, but that's ok.)"
3394 if test X"$type" = X; then
3401 for fp in $gfpth; do
3402 if test "X$fp" = X.; then
3407 if test -d "$pf"; then
3415 if test -d "$ansexp"; then
3416 echo "(Looking for $loc_file in directory $value.)"
3417 value="$value/$loc_file"
3418 ansexp="$ansexp/$loc_file"
3420 if test -f "$ansexp"; then
3423 case "$nopath_ok" in
3424 true) case "$value" in
3426 *) echo "Assuming $value will be in people's path."
3442 if test "$fastread" = yes; then
3447 rp="$what $value doesn't exist. Use that name anyway?"
3466 test "X$gfpthkeep" != Xy && gfpth=""
3469 : determine root of directory hierarchy where package will be installed.
3472 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3480 By default, $package will be installed in $dflt/bin, manual pages
3481 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3482 installation directories. Typically this is something like /usr/local.
3483 If you wish to have binaries under /usr/bin but other parts of the
3484 installation under /usr/local, that's ok: you will be prompted
3485 separately for each of the installation directories, the prefix being
3486 only used to set the defaults.
3490 rp='Installation prefix to use?'
3498 *) oldprefix="$prefix";;
3508 $define|true) afs=true ;;
3509 $undef|false) afs=false ;;
3510 *) if test -d /afs; then
3518 echo "AFS may be running... I'll be extra cautious then..." >&4
3520 echo "AFS does not seem to be running..." >&4
3523 : determine installation prefix for where package is to be installed.
3527 Since you are running AFS, I need to distinguish the directory in which
3528 files will reside from the directory in which they are installed (and from
3529 which they are presumably copied to the former directory by occult means).
3532 case "$installprefix" in
3533 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3534 *) dflt="$installprefix";;
3539 In some special cases, particularly when building $package for distribution,
3540 it is convenient to distinguish between the directory in which files should
3541 be installed from the directory ($prefix) in which they
3542 will eventually reside. For most users, these two directories are the same.
3545 case "$installprefix" in
3547 *) dflt=$installprefix;;
3551 rp='What installation prefix should I use for installing files?'
3553 installprefix="$ans"
3554 installprefixexp="$ansexp"
3556 : set the prefixit variable, to compute a suitable default value
3557 prefixit='case "$3" in
3559 case "$oldprefix" in
3560 "") eval "$1=\"\$$2\"";;
3567 ""|" ") eval "$1=\"\$$2\"";;
3573 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3575 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3576 /*-$oldprefix/*|\~*-$oldprefix/*)
3577 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3578 *) eval "$1=\"\$$2\"";;
3582 : set the base revision
3585 : get the patchlevel
3587 echo "Getting the current patchlevel..." >&4
3588 if $test -r $rsrc/patchlevel.h;then
3589 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3590 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3591 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
3597 $echo $n "(You have $package" $c
3600 *) $echo $n " $baserev" $c ;;
3602 $echo $n " patchlevel $patchlevel" $c
3603 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3606 if test 0 -eq "$subversion"; then
3607 version=`LC_ALL=C; export LC_ALL; \
3608 echo $baserev $patchlevel | \
3609 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3611 version=`LC_ALL=C; export LC_ALL; \
3612 echo $baserev $patchlevel $subversion | \
3613 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3616 : determine installation style
3617 : For now, try to deduce it from prefix unless it is already set.
3618 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3619 case "$installstyle" in
3620 '') case "$prefix" in
3621 *perl*) dflt='lib';;
3622 *) dflt='lib/perl5' ;;
3625 *) dflt='lib/perl5' ;;
3627 : Probably not worth prompting for this since we prompt for all
3628 : the directories individually, and the prompt would be too long and
3632 : determine where private library files go
3633 : Usual default is /usr/local/lib/perl5/$version.
3634 : Also allow things like /opt/perl/lib/$version, since
3635 : /opt/perl/lib/perl5... would be redundant.
3636 : The default "style" setting is made in installstyle.U
3637 case "$installstyle" in
3638 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3639 *) set dflt privlib lib/$version ;;
3644 There are some auxiliary files for $package that need to be put into a
3645 private library directory that is accessible by everyone.
3649 rp='Pathname where the private library files will reside?'
3652 privlibexp="$ansexp"
3653 : Change installation prefix, if necessary.
3654 if $test X"$prefix" != X"$installprefix"; then
3655 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3657 installprivlib="$privlibexp"
3660 : set the prefixup variable, to restore leading tilda escape
3661 prefixup='case "$prefixexp" in
3663 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3666 : determine where public architecture dependent libraries go
3669 : privlib default is /usr/local/lib/$package/$version
3670 : archlib default is /usr/local/lib/$package/$version/$archname
3671 : privlib may have an optional trailing /share.
3672 tdflt=`echo $privlib | $sed 's,/share$,,'`
3673 tdflt=$tdflt/$archname
3682 $spackage contains architecture-dependent library files. If you are
3683 sharing libraries in a heterogeneous environment, you might store
3684 these files in a separate location. Otherwise, you can just include
3685 them with the rest of the public library files.
3689 rp='Where do you want to put the public architecture-dependent libraries?'
3692 archlibexp="$ansexp"
3693 if $test X"$archlib" = X"$privlib"; then
3698 : Change installation prefix, if necessary.
3699 if $test X"$prefix" != X"$installprefix"; then
3700 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3702 installarchlib="$archlibexp"
3706 : Binary compatibility with 5.005 is not possible for builds
3707 : with advanced features
3708 case "$usethreads$usemultiplicity" in
3710 bincompat5005="$undef"
3711 d_bincompat5005="$undef"
3715 Perl 5.006 can be compiled for binary compatibility with 5.005.
3716 If you decide to do so, you will be able to continue using most
3717 of the extensions that were compiled for Perl 5.005.
3720 case "$bincompat5005$d_bincompat5005" in
3721 *"$undef"*) dflt=n ;;
3724 rp='Binary compatibility with Perl 5.005?'
3727 y*) val="$define" ;;
3732 case "$d_bincompat5005" in
3734 bincompat5005="$define"
3736 *) bincompat5005="$undef"
3737 d_bincompat5005="$undef"
3744 : see if setuid scripts can be secure
3747 Some kernels have a bug that prevents setuid #! scripts from being
3748 secure. Some sites have disabled setuid #! scripts because of this.
3750 First let's decide if your kernel supports secure setuid #! scripts.
3751 (If setuid #! scripts would be secure but have been disabled anyway,
3752 don't say that they are secure if asked.)
3757 if $test -d /dev/fd; then
3758 echo "#!$ls" >reflect
3759 chmod +x,u+s reflect
3760 ./reflect >flect 2>&1
3761 if $contains "/dev/fd" flect >/dev/null; then
3762 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3766 If you are not sure if they are secure, I can check but I'll need a
3767 username and password different from the one you are using right now.
3768 If you don't have such a username or don't want me to test, simply
3772 rp='Other username to test security of setuid scripts with?'
3777 case "$d_suidsafe" in
3778 '') echo "I'll assume setuid scripts are *not* secure." >&4
3781 echo "Well, the $hint value is *not* secure." >&4
3783 *) echo "Well, the $hint value *is* secure." >&4
3788 $rm -f reflect flect
3789 echo "#!$ls" >reflect
3790 chmod +x,u+s reflect
3793 echo '"su" will (probably) prompt you for '"$ans's password."
3794 su $ans -c './reflect >flect'
3795 if $contains "/dev/fd" flect >/dev/null; then
3796 echo "Okay, it looks like setuid scripts are secure." >&4
3799 echo "I don't think setuid scripts are secure." >&4
3804 rp='Does your kernel have *secure* setuid scripts?'
3807 [yY]*) val="$define";;
3812 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3813 echo "(That's for file descriptors, not floppy disks.)"
3819 $rm -f reflect flect
3821 : now see if they want to do setuid emulation
3824 case "$d_suidsafe" in
3827 echo "No need to emulate SUID scripts since they are secure here." >& 4
3831 Some systems have disabled setuid scripts, especially systems where
3832 setuid scripts cannot be secure. On systems where setuid scripts have
3833 been disabled, the setuid/setgid bits on scripts are currently
3834 useless. It is possible for $package to detect those bits and emulate
3835 setuid/setgid in a secure fashion. This emulation will only work if
3836 setuid scripts have been disabled in your kernel.
3840 "$define") dflt=y ;;
3843 rp="Do you want to do setuid/setgid emulation?"
3846 [yY]*) val="$define";;
3854 : What should the include directory be ?
3856 $echo $n "Hmm... $c"
3860 if $test -f /bin/mips && /bin/mips; then
3861 echo "Looks like a MIPS system..."
3862 $cat >usr.c <<'EOCP'
3863 #ifdef SYSTYPE_BSD43
3867 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3868 dflt='/bsd43/usr/include'
3872 mips_type='System V'
3874 $rm -f usr.c usr.out
3875 echo "and you're compiling with the $mips_type compiler and libraries."
3879 echo "Doesn't look like a MIPS system."
3889 case "$xxx_prompt" in
3892 rp='Where are the include files you want to use?'
3900 : see how we invoke the C preprocessor
3902 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3903 cat <<'EOT' >testcpp.c
3909 if test ! -f cppstdin; then
3910 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3911 # AIX cc -E doesn't show the absolute headerfile
3912 # locations but we'll cheat by using the -M flag.
3913 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
3915 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3918 echo "Keeping your $hint cppstdin wrapper."
3921 wrapper=`pwd`/cppstdin
3925 if $test "X$cppstdin" != "X" && \
3926 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3927 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3929 echo "You used to use $cppstdin $cppminus so we'll use that again."
3931 '') echo "But let's see if we can live without a wrapper..." ;;
3933 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3934 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3936 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3939 echo "(However, $cpprun $cpplast does not work, let's see...)"
3947 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3954 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3955 $cc -E <testcpp.c >testcpp.out 2>&1; \
3956 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3957 echo "Yup, it does."
3960 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3961 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3962 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3963 echo "Yup, it does."
3966 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3967 $cc -P <testcpp.c >testcpp.out 2>&1; \
3968 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3969 echo "Yipee, that works!"
3972 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3973 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3974 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3975 echo "At long last!"
3978 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3979 $cpp <testcpp.c >testcpp.out 2>&1; \
3980 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3984 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3985 $cpp - <testcpp.c >testcpp.out 2>&1; \
3986 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3987 echo "Hooray, it works! I was beginning to wonder."
3990 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3991 $wrapper <testcpp.c >testcpp.out 2>&1; \
3992 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3998 rp="No dice. I can't find a C preprocessor. Name one:"
4002 $x_cpp <testcpp.c >testcpp.out 2>&1
4003 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4004 echo "OK, that will do." >&4
4006 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4021 echo "Perhaps can we force $cc -E using a wrapper..."
4022 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4023 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4029 echo "Nope, we'll have to live without it..."
4043 "$wrapper"|'cppstdin') ;;
4044 *) $rm -f $wrapper;;
4046 $rm -f testcpp.c testcpp.out
4048 : Set private lib path
4051 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4056 '') dlist="$loclibpth $plibpth $glibpth";;
4057 *) dlist="$libpth";;
4060 : Now check and see which directories actually exist, avoiding duplicates
4064 if $test -d $xxx; then
4067 *) libpth="$libpth $xxx";;
4073 Some systems have incompatible or broken versions of libraries. Among
4074 the directories listed in the question below, please remove any you
4075 know not to be holding relevant libraries, and add any that are needed.
4076 Say "none" for none.
4087 rp="Directories to use for library searches?"
4094 : compute shared library extension
4097 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4107 On some systems, shared libraries may be available. Answer 'none' if
4108 you want to suppress searching of shared libraries for the remaining
4109 of this configuration.
4112 rp='What is the file extension used for shared libraries?'
4116 : Define several unixisms.
4117 : Hints files or command line option can be used to override them.
4118 : The convoluted testing is in case hints files set either the old
4121 '') case "$exe_ext" in
4123 *) _exe="$exe_ext" ;;
4128 '') case "$lib_ext" in
4135 '') case "$obj_ext" in
4142 '') case "$path_sep" in
4153 : Which makefile gets called first. This is used by make depend.
4154 case "$firstmakefile" in
4155 '') firstmakefile='makefile';;
4160 Perl can be built to use the SOCKS proxy protocol library. To do so,
4161 Configure must be run with -Dusesocks.
4163 Normally you do not need this and you should answer no.
4167 $define|true|[yY]*) dflt='y';;
4170 rp='Build Perl for SOCKS?'
4173 y|Y) val="$define" ;;
4179 : Looking for optional libraries
4181 echo "Checking for optional libraries..." >&4
4186 case "$libswanted" in
4187 '') libswanted='c_s';;
4191 libswanted="$libswanted socks5 socks5_sh"
4194 for thislib in $libswanted; do
4196 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4197 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4198 echo "Found -l$thislib (shared)."
4201 *) dflt="$dflt -l$thislib";;
4203 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4204 echo "Found -l$thislib (shared)."
4207 *) dflt="$dflt -l$thislib";;
4209 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4210 echo "Found -l$thislib."
4213 *) dflt="$dflt -l$thislib";;
4215 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4216 echo "Found -l$thislib."
4219 *) dflt="$dflt -l$thislib";;
4221 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4222 echo "Found -l${thislib}_s."
4225 *) dflt="$dflt -l${thislib}_s";;
4227 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4228 echo "Found -l$thislib."
4231 *) dflt="$dflt -l$thislib";;
4234 echo "No -l$thislib."
4245 ' '|'') dflt='none';;
4250 In order to compile $package on your machine, a number of libraries
4251 are usually needed. Include any other special libraries here as well.
4252 Say "none" for none. The default list is almost always right.
4256 rp="What libraries to use?"
4263 : determine optimization, if desired, or use for debug flag also
4265 ' '|$undef) dflt='none';;
4267 *) dflt="$optimize";;
4271 By default, $package compiles with the -O flag to use the optimizer.
4272 Alternately, you might want to use the symbolic debugger, which uses
4273 the -g flag (on traditional Unix systems). Either flag can be
4274 specified here. To use neither flag, specify the word "none".
4277 rp="What optimizer/debugger flag should be used?"
4281 'none') optimize=" ";;
4285 : We will not override a previous value, but we might want to
4286 : augment a hint file
4288 default|recommended)
4289 case "$gccversion" in
4290 1*) dflt='-fpcc-struct-return' ;;
4293 *-g*) dflt="$dflt -DDEBUGGING";;
4295 case "$gccversion" in
4296 2*) if test -d /etc/conf/kconfig.d &&
4297 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4303 case "$gccversion" in
4307 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4308 echo 'int main(void) { return 0; }' > gcctest.c
4309 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4310 echo "Yes, it does." 2>&1
4313 echo "Leaving current flags $ccflags alone." 2>&1
4315 *) dflt="$dflt -fno-strict-aliasing" ;;
4318 echo "Nope, it doesn't, but that's ok." 2>&1
4325 case "$mips_type" in
4326 *BSD*|'') inclwanted="$locincpth $usrinc";;
4327 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4329 for thisincl in $inclwanted; do
4330 if $test -d $thisincl; then
4331 if $test x$thisincl != x$usrinc; then
4334 *) dflt="$dflt -I$thisincl";;
4340 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4342 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4350 *) dflt="$dflt -D$2";;
4354 set signal.h LANGUAGE_C; eval $inctest
4358 ccflags="$ccflags -DSOCKS"
4363 default|recommended) dflt="$ccflags $dflt" ;;
4364 *) dflt="$ccflags";;
4372 Your C compiler may want other flags. For this question you should include
4373 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4374 but you should NOT include libraries or ld flags like -lwhatever. If you
4375 want $package to honor its debug switch, you should include -DDEBUGGING here.
4376 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4378 To use no flags, specify the word "none".
4384 rp="Any additional cc flags?"
4391 : the following weeds options from ccflags that are of no interest to cpp
4393 case "$gccversion" in
4394 1*) cppflags="$cppflags -D__GNUC__"
4396 case "$mips_type" in
4398 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4404 echo "Let me guess what the preprocessor flags are..." >&4
4418 *) ftry="$previous $flag";;
4420 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4421 >cpp1.out 2>/dev/null && \
4422 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4423 >cpp2.out 2>/dev/null && \
4424 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4425 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4427 cppflags="$cppflags $ftry"
4437 *-*) echo "They appear to be: $cppflags";;
4439 $rm -f cpp.c cpp?.out
4443 : flags used in final linking phase
4445 '') if ./venix; then
4451 *-posix*) dflt="$dflt -posix" ;;
4454 *) dflt="$ldflags";;
4457 : Try to guess additional flags to pick up local libraries.
4458 for thislibdir in $libpth; do
4459 case " $loclibpth " in
4462 *"-L$thislibdir "*) ;;
4463 *) dflt="$dflt -L$thislibdir" ;;
4475 Your C linker may need flags. For this question you should
4476 include -L/whatever and any other flags used by the C linker, but you
4477 should NOT include libraries like -lwhatever.
4479 Make sure you include the appropriate -L/path flags if your C linker
4480 does not normally search all of the directories you specified above,
4483 To use no flags, specify the word "none".
4487 rp="Any additional ld flags (NOT including libraries)?"
4493 rmlist="$rmlist pdp11"
4497 echo "Checking your choice of C compiler and flags for coherency..." >&4
4498 $cat > try.c <<'EOF'
4500 int main() { printf("Ok\n"); exit(0); }
4502 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4504 $cat >try.msg <<'EOM'
4505 I've tried to compile and run the following simple program:
4508 $cat try.c >> try.msg
4510 $cat >> try.msg <<EOM
4517 and I got the following output:
4521 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4522 if sh -c './try' >>try.msg 2>&1; then
4526 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4529 cat >> try.msg <<'EOQS'
4530 If $libs contains -lsfio, and sfio is mis-configured, then it
4531 sometimes (apparently) runs and exits with a 0 status, but with no
4532 output! It may have to do with sfio's use of _exit vs. exit.
4535 rp="You have a big problem. Shall I abort Configure"
4542 echo "The program compiled OK, but exited with status $?." >>try.msg
4543 rp="You have a problem. Shall I abort Configure"
4547 echo "I can't compile the test program." >>try.msg
4548 rp="You have a BIG problem. Shall I abort Configure"
4554 case "$knowitall" in
4556 echo "(The supplied flags or libraries might be incorrect.)"
4564 *) echo "Ok. Stopping Configure." >&4
4569 n) echo "OK, that should do.";;
4571 $rm -f try try.* core
4573 : determine filename position in cpp output
4575 echo "Computing filename position in cpp output for #include directives..." >&4
4576 echo '#include <stdio.h>' > foo.c
4579 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4580 $grep '^[ ]*#.*stdio\.h' | \
4581 while read cline; do
4584 while $test \$# -gt 0; do
4585 if $test -r \`echo \$1 | $tr -d '"'\`; then
4590 pos=\`expr \$pos + 1\`
4602 *) pos="${fieldn}th";;
4604 echo "Your cpp writes the filename in the $pos field of the line."
4606 : locate header file
4611 for usrincdir in $usrinc
4613 if test -f \$usrincdir/\$wanted; then
4614 echo "\$usrincdir/\$wanted"
4618 awkprg='{ print \$$fieldn }'
4619 echo "#include <\$wanted>" > foo\$\$.c
4620 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4621 $grep "^[ ]*#.*\$wanted" | \
4622 while read cline; do
4623 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4625 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4626 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4631 # status = 0: grep returned 0 lines, case statement not executed
4632 # status = 1: headerfile found
4633 # status = 2: while loop executed, no headerfile found
4637 if test \$status -eq 1; then
4644 : define an alternate in-header-list? function
4645 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4646 cont=true; xxf="echo \"<\$1> found.\" >&4";
4647 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4648 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4650 case $# in 4) instead=instead;; *) instead="at last";; esac;
4651 while $test "$cont"; do
4653 var=$2; eval "was=\$$2";
4654 if $test "$xxx" && $test -r "$xxx";
4656 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4659 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4660 set $yyy; shift; shift; yyy=$@;
4661 case $# in 0) cont="";;
4662 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4663 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4664 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4665 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4669 do set $yyy; var=$2; eval "was=\$$2";
4670 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4671 set $yyy; shift; shift; yyy=$@;
4674 : see if this is a malloc.h system
4675 set malloc.h i_malloc
4678 : see if stdlib is available
4679 set stdlib.h i_stdlib
4682 : determine which malloc to compile in
4684 case "$usemymalloc" in
4685 ''|[yY]*|true|$define) dflt='y' ;;
4688 rp="Do you wish to attempt to use the malloc that comes with $package?"
4694 mallocsrc='malloc.c'
4695 mallocobj="malloc$_o"
4696 d_mymalloc="$define"
4699 : Remove malloc from list of libraries to use
4700 echo "Removing unneeded -lmalloc from library list" >&4
4701 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4704 echo "libs = $libs" >&4
4716 : compute the return types of malloc and free
4718 $cat >malloc.c <<END
4722 #include <sys/types.h>
4736 case "$malloctype" in
4738 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4745 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4749 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4756 echo "Your system uses $freetype free(), it would seem." >&4
4760 The installation process will also create a directory for
4761 vendor-supplied add-ons. Vendors who supply perl with their system
4762 may find it convenient to place all vendor-supplied files in this
4763 directory rather than in the main distribution directory. This will
4764 ease upgrades between binary-compatible maintenance versions of perl.
4766 Of course you may also use these directories in whatever way you see
4767 fit. For example, you might use them to access modules shared over a
4768 company-wide network.
4770 The default answer should be fine for most people.
4771 This causes further questions about vendor add-ons to be skipped
4772 and no vendor-specific directories will be configured for perl.
4775 rp='Do you want to configure vendor-specific add-on directories?'
4776 case "$usevendorprefix" in
4777 define|true|[yY]*) dflt=y ;;
4783 rp='Installation prefix to use for vendor-supplied add-ons?'
4784 case "$vendorprefix" in
4786 *) dflt=$vendorprefix ;;
4790 case "$vendorprefix" in
4794 *) oldvendorprefix="$prefix";;
4798 usevendorprefix="$define"
4800 vendorprefixexp="$ansexp"
4802 *) usevendorprefix="$undef"
4808 case "$vendorprefix" in
4809 '') d_vendorlib="$undef"
4813 *) d_vendorlib="$define"
4814 : determine where vendor-supplied modules go.
4815 : Usual default is /usr/local/lib/perl5/vendor_perl
4816 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4817 case "$installstyle" in
4818 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4819 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4822 rp='Pathname for the vendor-supplied library files?'
4825 vendorlibexp="$ansexp"
4826 : Change installation prefix, if necessary.
4827 if $test X"$prefix" != X"$installprefix"; then
4828 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4830 installvendorlib="$vendorlibexp"
4835 : Cruising for prototypes
4837 echo "Checking out function prototypes..." >&4
4838 $cat >prototype.c <<'EOCP'
4839 int main(int argc, char *argv[]) {
4842 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4843 echo "Your C compiler appears to support function prototypes."
4846 echo "Your C compiler doesn't seem to understand function prototypes."
4853 case "$prototype" in
4855 *) ansi2knr='ansi2knr'
4860 This version of $package can only be compiled by a compiler that
4861 understands function prototypes. Unfortunately, your C compiler
4863 doesn't seem to understand them. Sorry about that.
4865 If GNU cc is available for your system, perhaps you could try that instead.
4867 Eventually, we hope to support building Perl with pre-ANSI compilers.
4868 If you would like to help in that effort, please contact <perlbug@perl.org>.
4870 Aborting Configure now.
4876 : determine where public executables go
4881 rp='Pathname where the public executables will reside?'
4883 if $test "X$ansexp" != "X$binexp"; then
4888 : Change installation prefix, if necessary.
4889 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4890 if $test X"$prefix" != X"$installprefix"; then
4891 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4893 installbin="$binexp"
4896 : determine whether to install perl also as /usr/bin/perl
4899 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4901 Many scripts expect to perl to be installed as /usr/bin/perl.
4902 I can install the perl you are about to compile also as /usr/bin/perl
4903 (in addition to $installbin/perl).
4905 case "$installusrbinperl" in
4906 "$undef"|[nN]*) dflt='n';;
4909 rp="Do you want to install perl as /usr/bin/perl?"
4912 [yY]*) val="$define";;
4918 set installusrbinperl
4921 : define a shorthand compile call
4925 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4926 : define a shorthand compile call for compilations that should be ok.
4930 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4933 echo "Checking for GNU C Library..." >&4
4934 cat >gnulibc.c <<EOM
4946 if eval $compile_ok && ./gnulibc; then
4948 echo "You are using the GNU C Library"
4951 echo "You are not using the GNU C Library"
4957 : see if nm is to be used to determine whether a symbol is defined or not
4961 case "$d_gnulibc" in
4964 echo "nm probably won't work on the GNU C Library." >&4
4970 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4972 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4973 echo "'nm' won't be sufficient on this sytem." >&4
4979 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4980 if $test $dflt -gt 20; then
4990 true|$define) dflt=y;;
4997 I can use $nm to extract the symbols from your C libraries. This
4998 is a time consuming task which may generate huge output on the disk (up
4999 to 3 megabytes) but that should make the symbols extraction faster. The
5000 alternative is to skip the 'nm' extraction part and to compile a small
5001 test program instead to determine whether each symbol is present. If
5002 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5003 this may be the best solution.
5005 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5008 rp="Shall I use $nm to extract C symbols from the libraries?"
5011 [Nn]*) usenm=false;;
5020 : nm options which may be necessary
5022 '') if $test -f /mach_boot; then
5024 elif $test -d /usr/ccs/lib; then
5025 nm_opt='-p' # Solaris (and SunOS?)
5026 elif $test -f /dgux; then
5028 elif $test -f /lib64/rld; then
5029 nm_opt='-p' # 64-bit Irix
5035 : nm options which may be necessary for shared libraries but illegal
5036 : for archive libraries. Thank you, Linux.
5037 case "$nm_so_opt" in
5038 '') case "$myuname" in
5040 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5041 nm_so_opt='--dynamic'
5050 : get list of predefined functions in a handy place
5055 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5062 *) for thislib in $libs; do
5065 : Handle C library specially below.
5068 thislib=`echo $thislib | $sed -e 's/^-l//'`
5069 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5071 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5073 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5075 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5077 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5079 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5081 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5086 libnames="$libnames $try"
5088 *) libnames="$libnames $thislib" ;;
5097 for xxx in $libpth; do
5098 $test -r $1 || set $xxx/libc.$so
5099 : The messy sed command sorts on library version numbers.
5101 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5102 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5104 s/[0-9][0-9]*/0000&/g
5105 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5108 sort | $sed -e 's/^.* //'`
5111 $test -r $1 || set /usr/ccs/lib/libc.$so
5112 $test -r $1 || set /lib/libsys_s$_a
5118 if $test -r "$1"; then
5119 echo "Your (shared) C library seems to be in $1."
5121 elif $test -r /lib/libc && $test -r /lib/clib; then
5122 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5124 libc='/lib/clib /lib/libc'
5125 if $test -r /lib/syslib; then
5126 echo "(Your math library is in /lib/syslib.)"
5127 libc="$libc /lib/syslib"
5129 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5130 echo "Your C library seems to be in $libc, as you said before."
5131 elif $test -r $incpath/usr/lib/libc$_a; then
5132 libc=$incpath/usr/lib/libc$_a;
5133 echo "Your C library seems to be in $libc. That's fine."
5134 elif $test -r /lib/libc$_a; then
5136 echo "Your C library seems to be in $libc. You're normal."
5138 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5140 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5141 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5142 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5144 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5146 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5149 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5151 if $test -r "$tans"; then
5152 echo "Your C library seems to be in $tans, of all places."
5158 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5162 If the guess above is wrong (which it might be if you're using a strange
5163 compiler, or your machine supports multiple models), you can override it here.
5168 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5170 I can't seem to find your C library. I've looked in the following places:
5173 $sed 's/^/ /' libpath
5176 None of these seems to contain your C library. I need to get its name...
5181 rp='Where is your C library?'
5186 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5187 set X `cat libnames`
5190 case $# in 1) xxx=file; esac
5191 echo "Extracting names from the following $xxx for later perusal:" >&4
5193 $sed 's/^/ /' libnames >&4
5195 $echo $n "This may take a while...$c" >&4
5199 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5200 *) $nm $nm_opt $file 2>/dev/null;;
5205 $grep fprintf libc.tmp > libc.ptf
5206 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5207 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5209 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5211 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5213 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5215 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5217 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5219 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5221 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5223 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5225 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5227 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5229 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5231 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5233 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5234 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5236 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5238 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5240 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5242 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5244 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5246 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5248 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5250 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5252 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5254 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5256 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5258 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5260 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5262 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5264 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5267 $nm -p $* 2>/dev/null >libc.tmp
5268 $grep fprintf libc.tmp > libc.ptf
5269 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5270 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5276 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5278 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5279 for thisname in $libnames $libc; do
5280 $ar t $thisname >>libc.tmp
5282 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5284 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5285 # Repeat libc to extract forwarders to DLL entries too
5286 for thisname in $libnames $libc; do
5287 $ar tv $thisname >>libc.tmp
5288 # Revision 50 of EMX has bug in $ar.
5289 # it will not extract forwarders to DLL entries
5290 # Use emximp which will extract exactly them.
5291 emximp -o tmp.imp $thisname \
5293 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5294 < tmp.imp >>libc.tmp
5297 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5300 echo "$ar didn't seem to work right." >&4
5301 echo "Maybe this is a Cray...trying bld instead..." >&4
5302 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5304 for thisname in $libnames; do
5306 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5307 $ar t $thisname >>libc.tmp
5311 echo "That didn't work either. Giving up." >&4
5318 if $test -f /lib/syscalls.exp; then
5320 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5321 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5325 $rm -f libnames libpath
5327 : see if dld is available
5331 : is a C symbol defined?
5334 -v) tf=libc.tmp; tc=""; tdc="";;
5335 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5336 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5339 case "$reuseval-$4" in
5341 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5347 if $contains $tlook $tf >/dev/null 2>&1;
5352 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5353 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5361 $define) tval=true;;
5367 : define an is-in-libc? function
5368 inlibc='echo " "; td=$define; tu=$undef;
5369 sym=$1; var=$2; eval "was=\$$2";
5371 case "$reuseval$was" in
5381 echo "$sym() found." >&4;
5382 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5384 echo "$sym() NOT found." >&4;
5385 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5389 $define) echo "$sym() found." >&4;;
5390 *) echo "$sym() NOT found." >&4;;
5394 : see if dlopen exists
5401 : determine which dynamic loading, if any, to compile in
5403 dldir="ext/DynaLoader"
5416 $define) dflt='y' ;;
5419 $define) dflt='y' ;;
5421 : Does a dl_xxx.xs file exist for this operating system
5422 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5425 rp="Do you wish to use dynamic loading?"
5432 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5433 dflt="$dldir/dl_${osname}.xs"
5434 elif $test "$d_dlopen" = "$define" ; then
5435 dflt="$dldir/dl_dlopen.xs"
5436 elif $test "$i_dld" = "$define" ; then
5437 dflt="$dldir/dl_dld.xs"
5442 *) dflt="$dldir/$dlsrc"
5445 echo "The following dynamic loading files are available:"
5446 : Can not go over to $dldir because getfile has path hard-coded in.
5447 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5448 rp="Source file to use for dynamic loading"
5454 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5458 Some systems may require passing special flags to $cc -c to
5459 compile modules that will be used to create a shared library.
5460 To use no flags, say "none".
5463 case "$cccdlflags" in
5464 '') case "$gccversion" in
5465 '') case "$osname" in
5467 next) dflt='none' ;;
5468 irix*) dflt='-KPIC' ;;
5469 svr4*|esix*|solaris) dflt='-KPIC' ;;
5470 sunos) dflt='-pic' ;;
5474 *) case "$osname" in
5475 svr4*|esix*|solaris) dflt='-fPIC' ;;
5480 *) dflt="$cccdlflags" ;;
5482 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5485 none) cccdlflags=' ' ;;
5486 *) cccdlflags="$ans" ;;
5491 Some systems use ld to create libraries that can be dynamically loaded,
5492 while other systems (such as those using ELF) use $cc.
5496 '') $cat >try.c <<'EOM'
5497 /* Test for whether ELF binaries are produced */
5502 int i = open("a.out",O_RDONLY);
5505 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5506 exit(0); /* succeed (yes, it's ELF) */
5511 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5513 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5517 echo "I'll use ld to build dynamic libraries."
5526 rp="What command should be used to create dynamic libraries?"
5532 Some systems may require passing special flags to $ld to create a
5533 library that can be dynamically loaded. If your ld flags include
5534 -L/other/path options to locate libraries outside your loader's normal
5535 search path, you may need to specify those -L options here as well. To
5536 use no flags, say "none".
5539 case "$lddlflags" in
5540 '') case "$osname" in
5541 beos) dflt='-nostart' ;;
5543 linux|irix*) dflt='-shared' ;;
5544 next) dflt='none' ;;
5545 solaris) dflt='-G' ;;
5546 sunos) dflt='-assert nodefinitions' ;;
5547 svr4*|esix*) dflt="-G $ldflags" ;;
5551 *) dflt="$lddlflags" ;;
5554 : Try to guess additional flags to pick up local libraries.
5555 : Be careful not to append to a plain 'none'
5559 for thisflag in $ldflags; do
5564 *) dflt="$dflt $thisflag" ;;
5571 ''|' ') dflt='none' ;;
5574 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5577 none) lddlflags=' ' ;;
5578 *) lddlflags="$ans" ;;
5583 Some systems may require passing special flags to $cc to indicate that
5584 the resulting executable will use dynamic linking. To use no flags,
5588 case "$ccdlflags" in
5589 '') case "$osname" in
5590 hpux) dflt='-Wl,-E' ;;
5591 linux) dflt='-rdynamic' ;;
5592 next) dflt='none' ;;
5593 sunos) dflt='none' ;;
5597 *) dflt="$ccdlflags" ;;
5599 rp="Any special flags to pass to $cc to use dynamic loading?"
5602 none) ccdlflags=' ' ;;
5603 *) ccdlflags="$ans" ;;
5617 # No dynamic loading being used, so don't bother even to prompt.
5620 *) case "$useshrplib" in
5621 '') case "$osname" in
5622 svr4*|dgux|dynixptx|esix|powerux|beos)
5624 also='Building a shared libperl is required for dynamic loading to work on your system.'
5629 also='Building a shared libperl is needed for MAB support.'
5647 The perl executable is normally obtained by linking perlmain.c with
5648 libperl${_a}, any static extensions (usually just DynaLoader), and
5649 any other libraries needed on this system (such as -lm, etc.). Since
5650 your system supports dynamic loading, it is probably possible to build
5651 a shared libperl.$so. If you will have more than one executable linked
5652 to libperl.$so, this will significantly reduce the size of each
5653 executable, but it may have a noticeable affect on performance. The
5654 default is probably sensible for your system.
5658 rp="Build a shared libperl.$so (y/n)"
5662 useshrplib='true' ;;
5663 *) useshrplib='false' ;;
5668 case "$useshrplib" in
5672 # Figure out a good name for libperl.so. Since it gets stored in
5673 # a version-specific architecture-dependent library, the version
5674 # number isn't really that important, except for making cc/ld happy.
5676 # A name such as libperl.so.3.1
5677 majmin="libperl.$so.$patchlevel.$subversion"
5678 # A name such as libperl.so.301
5679 majonly=`echo $patchlevel $subversion |
5680 $awk '{printf "%d%02d", $1, $2}'`
5681 majonly=libperl.$so.$majonly
5682 # I'd prefer to keep the os-specific stuff here to a minimum, and
5683 # rely on figuring it out from the naming of libc.
5684 case "${osname}${osvers}" in
5687 # XXX How handle the --version stuff for MAB?
5689 linux*) # ld won't link with a bare -lperl otherwise.
5692 *) # Try to guess based on whether libc has major.minor.
5694 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5695 *libc.$so.[0-9]*) dflt=$majonly ;;
5696 *) dflt=libperl.$so ;;
5706 I need to select a good name for the shared libperl. If your system uses
5707 library names with major and minor numbers, then you might want something
5708 like $majmin. Alternatively, if your system uses a single version
5709 number for shared libraries, then you might want to use $majonly.
5710 Or, your system might be quite happy with a simple libperl.$so.
5712 Since the shared libperl will get installed into a version-specific
5713 architecture-dependent directory, the version number of the shared perl
5714 library probably isn't important, so the default should be o.k.
5717 rp='What name do you want to give to the shared libperl?'
5720 echo "Ok, I'll use $libperl"
5723 libperl="libperl${_a}"
5727 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5731 WARNING: Use of the shrpdir variable for the installation location of
5732 the shared $libperl is not supported. It was never documented and
5733 will not work in this version. Let me (perlbug@perl.com)
5734 know of any problems this may cause.
5740 But your current setting of $shrpdir is
5741 the default anyway, so it's harmless.
5746 Further, your current attempted setting of $shrpdir
5747 conflicts with the value of $archlibexp/CORE
5748 that installperl will use.
5755 # How will the perl executable find the installed shared $libperl?
5756 # Add $xxx to ccdlflags.
5757 # If we can't figure out a command-line option, use $shrpenv to
5758 # set env LD_RUN_PATH. The main perl makefile uses this.
5759 shrpdir=$archlibexp/CORE
5762 if "$useshrplib"; then
5765 # We'll set it in Makefile.SH...
5771 xxx="-Wl,-R$shrpdir"
5773 linux|irix*|dec_osf)
5774 xxx="-Wl,-rpath,$shrpdir"
5777 # next doesn't like the default...
5780 # beos doesn't like the default, either.
5783 # hpux doesn't like the default, either.
5784 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5787 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5793 # Only add $xxx if it isn't already in ccdlflags.
5794 case " $ccdlflags " in
5796 *) ccdlflags="$ccdlflags $xxx"
5799 Adding $xxx to the flags
5800 passed to $ld so that the perl executable will find the
5801 installed shared $libperl.
5809 # Fix ccdlflags in AIX for building external extensions.
5810 # (For building Perl itself bare -bE:perl.exp is needed,
5811 # Makefile.SH takes care of this.)
5813 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5815 # Respect a hint or command-line value.
5817 '') shrpenv="$tmp_shrpenv" ;;
5819 case "$ldlibpthname" in
5820 '') ldlibpthname=LD_LIBRARY_PATH ;;
5821 none) ldlibpthname='' ;;
5824 : determine where manual pages go
5825 set man1dir man1dir none
5829 $spackage has manual pages available in source form.
5833 echo "However, you don't have nroff, so they're probably useless to you."
5835 '') man1dir="none";;
5838 echo "If you don't want the manual sources installed, answer 'none'."
5843 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5844 lookpath="$lookpath $prefixexp/man/p_man/man1"
5845 lookpath="$lookpath $prefixexp/man/u_man/man1"
5846 lookpath="$lookpath $prefixexp/man/man.1"
5848 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5849 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5859 rp="Where do the main $spackage manual pages (source) go?"
5861 if $test "X$man1direxp" != "X$ansexp"; then
5865 man1direxp="$ansexp"
5871 : Change installation prefix, if necessary.
5872 if $test X"$prefix" != X"$installprefix"; then
5873 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5875 installman1dir="$man1direxp"
5878 : What suffix to use on installed man pages
5885 rp="What suffix should be used for the main $spackage man pages?"
5887 '') case "$man1dir" in
5901 *) dflt="$man1ext";;
5908 : see if we can have long filenames
5910 rmlist="$rmlist /tmp/cf$$"
5911 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5912 first=123456789abcdef
5913 second=/tmp/cf$$/$first
5914 $rm -f $first $second
5915 if (echo hi >$first) 2>/dev/null; then
5916 if $test -f 123456789abcde; then
5917 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5920 if (echo hi >$second) 2>/dev/null; then
5921 if $test -f /tmp/cf$$/123456789abcde; then
5923 That's peculiar... You can have filenames longer than 14 characters, but only
5924 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5925 I shall consider your system cannot support long filenames at all.
5929 echo 'You can have filenames longer than 14 characters.' >&4
5934 How confusing! Some of your filesystems are sane enough to allow filenames
5935 longer than 14 characters but some others like /tmp can't even think about them.
5936 So, for now on, I shall assume your kernel does not allow them at all.
5943 You can't have filenames longer than 14 chars. You can't even think about them!
5949 $rm -rf /tmp/cf$$ 123456789abcde*
5951 : determine where library module manual pages go
5952 set man3dir man3dir none
5956 $spackage has manual pages for many of the library modules.
5962 However, you don't have nroff, so they're probably useless to you.
5965 '') man3dir="none";;
5969 case "$d_flexfnam" in
5972 However, your system can't handle the long file names like File::Basename.3.
5975 '') man3dir="none";;
5979 echo "If you don't want the manual sources installed, answer 'none'."
5980 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5982 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5983 if $test -d "$privlib/man/man3"; then
5986 WARNING: Previous versions of perl installed man3 pages into
5987 $privlib/man/man3. This version will suggest a
5988 new default of $dflt.
5992 rp='Do you wish to preserve the old behavior?(y/n)'
5995 y*) dflt="$privlib/man/man3" ;;
6001 *) dflt="$man3dir" ;;
6005 rp="Where do the $package library man pages (source) go?"
6008 man3direxp="$ansexp"
6014 : Change installation prefix, if necessary.
6015 if $test X"$prefix" != X"$installprefix"; then
6016 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6018 installman3dir="$man3direxp"
6021 : What suffix to use on installed man pages
6027 rp="What suffix should be used for the $package library man pages?"
6029 '') case "$man3dir" in
6043 *) dflt="$man3ext";;
6050 : see if we have to deal with yellow pages, now NIS.
6051 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6052 if $test -f /usr/etc/nibindd; then
6054 echo "I'm fairly confident you're on a NeXT."
6056 rp='Do you get the hosts file via NetInfo?'
6065 y*) hostcat='nidump hosts .';;
6066 *) case "$hostcat" in
6067 nidump*) hostcat='';;
6077 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6085 rp='Are you getting the hosts file via yellow pages?'
6088 y*) hostcat='ypcat hosts';;
6089 *) hostcat='cat /etc/hosts';;
6095 '') hostcat='cat /etc/hosts';;
6098 '') groupcat='cat /etc/group';;
6101 '') passcat='cat /etc/passwd';;
6104 : now get the host name
6106 echo "Figuring out host name..." >&4
6107 case "$myhostname" in
6109 echo 'Maybe "hostname" will work...'
6110 if tans=`sh -c hostname 2>&1` ; then
6118 if $test "$cont"; then
6120 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6121 if tans=`cat /etc/systemid 2>&1` ; then
6123 phostname='cat /etc/systemid'
6124 echo "Whadyaknow. Xenix always was a bit strange..."
6127 elif $test -r /etc/systemid; then
6128 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6131 if $test "$cont"; then
6132 echo 'No, maybe "uuname -l" will work...'
6133 if tans=`sh -c 'uuname -l' 2>&1` ; then
6135 phostname='uuname -l'
6137 echo 'Strange. Maybe "uname -n" will work...'
6138 if tans=`sh -c 'uname -n' 2>&1` ; then
6140 phostname='uname -n'
6142 echo 'Oh well, maybe I can mine it out of whoami.h...'
6143 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6144 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6145 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6147 case "$myhostname" in
6148 '') echo "Does this machine have an identity crisis or something?"
6151 echo "Well, you said $myhostname before..."
6152 phostname='echo $myhostname';;
6158 : you do not want to know about this
6163 if $test "$myhostname" ; then
6165 rp='Your host name appears to be "'$myhostname'".'" Right?"
6173 : bad guess or no guess
6174 while $test "X$myhostname" = X ; do
6176 rp="Please type the (one word) name of your host:"
6181 : translate upper to lower if necessary
6182 case "$myhostname" in
6184 echo "(Normalizing case in your host name)"
6185 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6189 case "$myhostname" in
6191 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6192 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6193 echo "(Trimming domain name from host name--host name is now $myhostname)"
6195 *) case "$mydomain" in
6198 test "X$hostcat" = "Xypcat hosts" &&
6199 ypmatch "$myhostname" hosts 2>/dev/null |\
6200 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6203 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6204 /[ ]$myhostname[ . ]/p" > hosts
6207 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6208 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6209 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6210 hosts | $sort | $uniq | \
6211 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6212 case `$echo X$dflt` in
6213 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6216 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6221 tans=`./loc resolv.conf X /etc /usr/etc`
6222 if $test -f "$tans"; then
6223 echo "(Attempting domain name extraction from $tans)"
6224 dflt=.`$sed -n -e 's/ / /g' \
6225 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6226 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6228 .) dflt=.`$sed -n -e 's/ / /g' \
6229 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6230 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6237 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6238 dflt=.`sh -c domainname 2>/dev/null`
6241 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6246 .) echo "(Lost all hope -- silly guess then)"
6252 *) dflt="$mydomain";;
6256 rp="What is your domain name?"
6266 : translate upper to lower if necessary
6269 echo "(Normalizing case in your domain name)"
6270 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6274 : a little sanity check here
6275 case "$phostname" in
6278 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6279 $myhostname$mydomain|$myhostname) ;;
6281 case "$phostname" in
6283 echo "(That doesn't agree with your whoami.h file, by the way.)"
6286 echo "(That doesn't agree with your $phostname command, by the way.)"
6296 I need to get your e-mail address in Internet format if possible, i.e.
6297 something like user@host.domain. Please answer accurately since I have
6298 no easy means to double check it. The default value provided below
6299 is most probably close to the reality but may not be valid from outside
6300 your organization...
6304 while test "$cont"; do
6306 '') dflt="$cf_by@$myhostname$mydomain";;
6307 *) dflt="$cf_email";;
6309 rp='What is your e-mail address?'
6315 rp='Address does not look like an Internet one. Use it anyway?'
6331 If you or somebody else will be maintaining perl at your site, please
6332 fill in the correct e-mail address here so that they may be contacted
6333 if necessary. Currently, the "perlbug" program included with perl
6334 will send mail to this address in addition to perlbug@perl.com. You may
6335 enter "none" for no administrator.
6338 case "$perladmin" in
6339 '') dflt="$cf_email";;
6340 *) dflt="$perladmin";;
6342 rp='Perl administrator e-mail address'
6346 : figure out how to guarantee perl startup
6347 case "$startperl" in
6349 case "$sharpbang" in
6353 I can use the #! construct to start perl on your system. This will
6354 make startup of perl scripts faster, but may cause problems if you
6355 want to share those scripts and perl is not in a standard place
6356 ($binexp/perl) on all your platforms. The alternative is to force
6357 a shell by starting the script with a single ':' character.
6361 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6364 none) startperl=": # use perl";;
6365 *) startperl="#!$ans"
6366 if $test 30 -lt `echo "$ans" | wc -c`; then
6369 WARNING: Some systems limit the #! command to 32 characters.
6370 If you experience difficulty running Perl scripts with #!, try
6371 installing Perl in a directory with a shorter pathname.
6377 *) startperl=": # use perl"
6382 echo "I'll use $startperl to start perl scripts."
6384 : figure best path for perl in scripts
6387 perlpath="$binexp/perl"
6388 case "$startperl" in
6393 I will use the "eval 'exec'" idiom to start Perl on your system.
6394 I can use the full path of your Perl binary for this purpose, but
6395 doing so may cause problems if you want to share those scripts and
6396 Perl is not always in a standard place ($binexp/perl).
6400 rp="What path shall I use in \"eval 'exec'\"?"
6407 case "$startperl" in
6409 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6412 : determine where public executable scripts go
6413 set scriptdir scriptdir
6415 case "$scriptdir" in
6418 : guess some guesses
6419 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6420 $test -d /usr/share/bin && dflt=/usr/share/bin
6421 $test -d /usr/local/script && dflt=/usr/local/script
6422 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6423 $test -d $prefixexp/script && dflt=$prefixexp/script
6427 *) dflt="$scriptdir"
6432 Some installations have a separate directory just for executable scripts so
6433 that they can mount it across multiple architectures but keep the scripts in
6434 one spot. You might, for example, have a subdirectory of /usr/share for this.
6435 Or you might just lump your scripts in with all your other executables.
6439 rp='Where do you keep publicly executable scripts?'
6441 if $test "X$ansexp" != "X$scriptdirexp"; then
6445 scriptdirexp="$ansexp"
6446 : Change installation prefix, if necessary.
6447 if $test X"$prefix" != X"$installprefix"; then
6448 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6450 installscript="$scriptdirexp"
6455 After $package is installed, you may wish to install various
6456 add-on modules and utilities. Typically, these add-ons will
6457 be installed under $prefix with the rest
6458 of this package. However, you may wish to install such add-ons
6459 elsewhere under a different prefix.
6461 If you do not wish to put everything under a single prefix, that's
6462 ok. You will be prompted for the individual locations; this siteprefix
6463 is only used to suggest the defaults.
6465 The default should be fine for most people.
6469 rp='Installation prefix to use for add-on modules and utilities?'
6470 : XXX Here might be another good place for an installstyle setting.
6471 case "$siteprefix" in
6473 *) dflt=$siteprefix ;;
6477 case "$siteprefix" in
6482 *) oldsiteprefix="$prefix";;
6487 siteprefixexp="$ansexp"
6489 : determine where site specific libraries go.
6490 : Usual default is /usr/local/lib/perl5/site_perl
6491 : The default "style" setting is made in installstyle.U
6492 : XXX No longer works with Prefixit stuff.
6493 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6494 case "$installstyle" in
6495 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6496 *) dflt=$siteprefix/lib/site_$prog ;;
6500 The installation process will create a directory for
6501 site-specific extensions and modules. Most users find it convenient
6502 to place all site-specific files in this directory rather than in the
6503 main distribution directory.
6507 rp='Pathname for the site-specific library files?'
6510 sitelibexp="$ansexp"
6511 : Change installation prefix, if necessary.
6512 if $test X"$prefix" != X"$installprefix"; then
6513 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6515 installsitelib="$sitelibexp"
6518 : determine where site specific architecture-dependent libraries go.
6519 : sitelib default is /usr/local/lib/perl5/site_perl/
6520 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6521 : sitelib may have an optional trailing /share.
6522 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6523 tdflt="$tdflt/$apiversion/$archname"
6524 set sitearch sitearch none
6527 '') dflt="$tdflt" ;;
6528 *) dflt="$sitearch" ;;
6532 The installation process will also create a directory for
6533 architecture-dependent site-specific extensions and modules.
6537 rp='Pathname for the site-specific architecture-dependent library files?'
6540 sitearchexp="$ansexp"
6541 : Change installation prefix, if necessary.
6542 if $test X"$prefix" != X"$installprefix"; then
6543 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6545 installsitearch="$sitearchexp"
6548 : determine where add-on public executables go
6550 '') dflt=$siteprefix/bin ;;
6554 rp='Pathname where the add-on public executables should be installed?'
6557 sitebinexp="$ansexp"
6558 : Change installation prefix, if necessary.
6559 if $test X"$prefix" != X"$installprefix"; then
6560 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6562 installsitebin="$sitebinexp"
6567 Perl can be built to take advantage of long doubles which
6568 (if available) may give more accuracy and range for floating point
6569 numbers. To do so, Configure must be run with -Duselongdouble.
6571 If this doesn't make any sense to you, just accept the default 'n'.
6573 case "$uselongdouble" in
6574 $define|true|[yY]*) dflt='y';;
6577 rp='Try to use long doubles if available?'
6580 y|Y) val="$define" ;;
6586 case "$uselongdouble" in
6587 "$define"|true|[yY]*)
6588 : Look for a hint-file generated 'call-back-unit'. If the
6589 : user has specified that long doubles should be used,
6590 : we may need to set or change some other defaults.
6591 if $test -f uselongdouble.cbu; then
6592 echo "Your platform has some specific hints for long doubles, using them..."
6593 . ./uselongdouble.cbu
6596 (Your platform doesn't have any specific hints for long doubles.)
6604 Previous version of $package used the standard IO mechanisms as defined
6605 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6606 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6607 the default. This abstraction layer can use AT&T's sfio (if you already
6608 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6609 problems with some extension modules. Using PerlIO with stdio is safe,
6610 but it is slower than plain stdio and therefore is not the default.
6612 If this doesn't make any sense to you, just accept the default 'n'.
6614 case "$useperlio" in
6615 $define|true|[yY]*) dflt='y';;
6618 rp='Use the experimental PerlIO abstraction layer?'
6625 echo "Ok, doing things the stdio way"
6632 case "$vendorprefix" in
6633 '') d_vendorbin="$undef"
6637 *) d_vendorbin="$define"
6638 : determine where vendor-supplied executables go.
6639 dflt=$vendorprefix/bin
6641 rp='Pathname for the vendor-supplied executables directory?'
6644 vendorbinexp="$ansexp"
6645 : Change installation prefix, if necessary.
6646 if $test X"$prefix" != X"$installprefix"; then
6647 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
6649 installvendorbin="$vendorbinexp"
6654 : Check how to convert floats to strings.
6655 if test "X$d_Gconvert" = X; then
6657 echo "Checking for an efficient way to convert floats to strings."
6660 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6661 char *myname = "gconvert";
6664 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6665 char *myname = "gcvt";
6668 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6669 char *myname = "sprintf";
6675 checkit(expect, got)
6679 if (strcmp(expect, got)) {
6680 printf("%s oddity: Expected %s, got %s\n",
6681 myname, expect, got);
6691 /* This must be 1st test on (which?) platform */
6692 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6693 Gconvert(0.1, 8, 0, buf);
6694 checkit("0.1", buf);
6696 Gconvert(1.0, 8, 0, buf);
6699 Gconvert(0.0, 8, 0, buf);
6702 Gconvert(-1.0, 8, 0, buf);
6705 /* Some Linux gcvt's give 1.e+5 here. */
6706 Gconvert(100000.0, 8, 0, buf);
6707 checkit("100000", buf);
6709 /* Some Linux gcvt's give -1.e+5 here. */
6710 Gconvert(-100000.0, 8, 0, buf);
6711 checkit("-100000", buf);
6716 case "$d_Gconvert" in
6717 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6718 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6719 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6720 *) xxx_list='gconvert gcvt sprintf' ;;
6723 for xxx_convert in $xxx_list; do
6724 echo "Trying $xxx_convert"
6726 set try -DTRY_$xxx_convert
6727 if eval $compile; then
6728 echo "$xxx_convert" found. >&4
6730 echo "I'll use $xxx_convert to convert floats into a string." >&4
6733 echo "...But $xxx_convert didn't work as I expected."
6736 echo "$xxx_convert NOT found." >&4
6740 case "$xxx_convert" in
6741 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6742 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6743 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6747 : see if inttypes.h is available
6748 : we want a real compile instead of Inhdr because some systems
6749 : have an inttypes.h which includes non-existent headers
6752 #include <inttypes.h>
6754 static int32_t foo32 = 0x12345678;
6758 if eval $compile; then
6759 echo "<inttypes.h> found." >&4
6762 echo "<inttypes.h> NOT found." >&4
6770 case "$use64bits" in
6773 $echo $n "Checking to see if your system supports int64_t...$c" >&4
6775 #include <sys/types.h>
6776 #$i_inttypes I_INTTYPES
6778 #include <inttypes.h>
6780 int64_t foo() { int64_t x; x = 7; return x; }
6782 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6784 echo " Yup, it does." >&4
6787 echo " Nope, it doesn't." >&4
6798 : check for lengths of integral types
6802 echo "Checking to see how big your integers are..." >&4
6803 $cat >intsize.c <<'EOCP'
6807 printf("intsize=%d;\n", sizeof(int));
6808 printf("longsize=%d;\n", sizeof(long));
6809 printf("shortsize=%d;\n", sizeof(short));
6814 if eval $compile_ok && ./intsize > /dev/null; then
6816 echo "Your integers are $intsize bytes long."
6817 echo "Your long integers are $longsize bytes long."
6818 echo "Your short integers are $shortsize bytes long."
6822 Help! I can't compile and run the intsize test program: please enlighten me!
6823 (This is probably a misconfiguration in your system or libraries, and
6824 you really ought to fix it. Still, I'll try anyway.)
6828 rp="What is the size of an integer (in bytes)?"
6832 rp="What is the size of a long integer (in bytes)?"
6836 rp="What is the size of a short integer (in bytes)?"
6842 $rm -f intsize intsize.*
6844 : check for long long
6846 $echo $n "Checking to see if your system supports long long...$c" >&4
6847 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6848 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6850 echo " Yup, it does." >&4
6853 echo " Nope, it doesn't." >&4
6859 : check for length of long long
6860 case "${d_longlong}${longlongsize}" in
6863 $echo $n "Checking to see how big your long longs are...$c" >&4
6864 $cat >try.c <<'EOCP'
6868 printf("%d\n", sizeof(long long));
6872 if eval $compile_ok; then
6873 longlongsize=`./try`
6874 $echo " $longlongsize bytes." >&4
6878 echo "(I can't seem to compile the test program. Guessing...)"
6879 rp="What is the size of a long long (in bytes)?"
6883 if $test "X$longsize" = "X$longlongsize"; then
6884 echo "(That isn't any different from an ordinary long.)"
6892 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6894 echo "Checking how to print 64-bit integers..." >&4
6896 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6898 $cat >try.c <<'EOCP'
6899 #include <sys/types.h>
6902 int q = 12345678901;
6907 if eval $compile; then
6911 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6912 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6913 echo "We will use %d."
6919 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6921 $cat >try.c <<'EOCP'
6922 #include <sys/types.h>
6925 long q = 12345678901;
6930 if eval $compile; then
6934 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6935 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6936 echo "We will use %ld."
6942 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6944 $cat >try.c <<'EOCP'
6945 #include <sys/types.h>
6946 #include <inttypes.h>
6949 int64_t q = 12345678901;
6950 printf("%" PRId64 "\n", q);
6954 if eval $compile; then
6958 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6959 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6960 echo "We will use the C9X style."
6966 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6968 $cat >try.c <<'EOCP'
6969 #include <sys/types.h>
6972 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6973 printf("%lld\n", q);
6977 if eval $compile; then
6981 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6982 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6983 echo "We will use the %lld style."
6989 if $test X"$sPRId64" = X -a X"$quad" != X; then
6991 #include <sys/types.h>
6994 $quad q = 12345678901;
6999 if eval $compile; then
7003 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
7004 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
7005 echo "We will use %lld."
7011 if $test X"$sPRId64" = X -a X"$quad" != X; then
7013 #include <sys/types.h>
7016 $quad q = 12345678901;
7021 if eval $compile; then
7025 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
7026 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
7027 echo "We will use %qd."
7033 if $test X"$sPRId64" = X; then
7034 echo "Cannot figure out how to print 64-bit integers." >&4
7039 fi # intsize -o longsize -o d_int64t -o d_longlong
7042 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
7043 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
7045 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
7046 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
7050 : check for length of double
7052 case "$doublesize" in
7054 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7055 $cat >try.c <<'EOCP'
7059 printf("%d\n", sizeof(double));
7063 if eval $compile_ok; then
7065 $echo " $doublesize bytes." >&4
7068 echo "(I can't seem to compile the test program. Guessing...)"
7069 rp="What is the size of a double precision number (in bytes)?"
7077 : check for long doubles
7079 $echo $n "Checking to see if your system supports long double...$c" >&4
7080 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7081 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7083 echo " Yup, it does." >&4
7086 echo " Nope, it doesn't." >&4
7092 : check for length of long double
7093 case "${d_longdbl}${longdblsize}" in
7096 $echo $n "Checking to see how big your long doubles are...$c" >&4
7097 $cat >try.c <<'EOCP'
7101 printf("%d\n", sizeof(long double));
7105 if eval $compile; then
7107 $echo " $longdblsize bytes." >&4
7111 echo "(I can't seem to compile the test program. Guessing...)" >&4
7112 rp="What is the size of a long double (in bytes)?"
7116 if $test "X$doublesize" = "X$longdblsize"; then
7117 echo "(That isn't any different from an ordinary double.)"
7125 if $test X"$d_longdbl" = X"$define"; then
7127 echo "Checking how to print long doubles..." >&4
7129 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7130 $cat >try.c <<'EOCP'
7131 #include <sys/types.h>
7135 printf("%.3f\n", d);
7139 if eval $compile; then
7143 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7144 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7145 echo "We will use %f."
7151 if $test X"$sPRIfldbl" = X; then
7152 $cat >try.c <<'EOCP'
7153 #include <sys/types.h>
7156 long double d = 123.456;
7157 printf("%.3llf\n", d);
7161 if eval $compile; then
7165 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7166 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7167 echo "We will use %llf."
7173 if $test X"$sPRIfldbl" = X; then
7174 $cat >try.c <<'EOCP'
7175 #include <sys/types.h>
7178 long double d = 123.456;
7179 printf("%.3Lf\n", d);
7183 if eval $compile; then
7187 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7188 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7189 echo "We will use %Lf."
7195 if $test X"$sPRIfldbl" = X; then
7196 $cat >try.c <<'EOCP'
7197 #include <sys/types.h>
7200 long double d = 123.456;
7201 printf("%.3lf\n", d);
7205 if eval $compile; then
7209 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7210 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7211 echo "We will use %lf."
7217 if $test X"$sPRIfldbl" = X; then
7218 echo "Cannot figure out how to print long doubles." >&4
7225 case "$sPRIfldbl" in
7226 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7227 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7229 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7230 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7234 : Initialize h_fcntl
7237 : Initialize h_sysfile
7240 : access call always available on UNIX
7244 : locate the flags for 'access()'
7248 $cat >access.c <<'EOCP'
7249 #include <sys/types.h>
7254 #include <sys/file.h>
7263 : check sys/file.h first, no particular reason here
7264 if $test `./findhdr sys/file.h` && \
7265 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7267 echo "<sys/file.h> defines the *_OK access constants." >&4
7268 elif $test `./findhdr fcntl.h` && \
7269 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7271 echo "<fcntl.h> defines the *_OK access constants." >&4
7272 elif $test `./findhdr unistd.h` && \
7273 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7274 echo "<unistd.h> defines the *_OK access constants." >&4
7276 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7282 : see if accessx exists
7283 set accessx d_accessx
7286 : see if alarm exists
7290 : see if atolf exists
7294 : see if atoll exists
7298 : Look for GNU-cc style attribute checking
7300 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7301 $cat >attrib.c <<'EOCP'
7303 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7305 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7306 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7307 echo "Your C compiler doesn't fully support __attribute__."
7310 echo "Your C compiler supports __attribute__."
7314 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7321 : see if bcmp exists
7325 : see if bcopy exists
7329 : see if this is a unistd.h system
7330 set unistd.h i_unistd
7333 : see if getpgrp exists
7334 set getpgrp d_getpgrp
7337 case "$d_getpgrp" in
7340 echo "Checking to see which flavor of getpgrp is in use..."
7343 #include <sys/types.h>
7345 # include <unistd.h>
7349 if (getuid() == 0) {
7350 printf("(I see you are running Configure as super-user...)\n");
7354 if (getpgrp(1) == 0)
7363 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7364 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7366 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7367 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7370 echo "I can't seem to compile and run the test program."
7372 xxx="a USG one, i.e. you use getpgrp()."
7374 # SVR4 systems can appear rather BSD-ish.
7377 xxx="a BSD one, i.e. you use getpgrp(pid)."
7381 xxx="probably a USG one, i.e. you use getpgrp()."
7386 echo "Assuming your getpgrp is $xxx" >&4
7395 : see if setpgrp exists
7396 set setpgrp d_setpgrp
7399 case "$d_setpgrp" in
7402 echo "Checking to see which flavor of setpgrp is in use..."
7405 #include <sys/types.h>
7407 # include <unistd.h>
7411 if (getuid() == 0) {
7412 printf("(I see you are running Configure as super-user...)\n");
7416 if (-1 == setpgrp(1, 1))
7419 if (setpgrp() != -1)
7425 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7426 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7428 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7429 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7432 echo "(I can't seem to compile and run the test program.)"
7434 xxx="a USG one, i.e. you use setpgrp()."
7436 # SVR4 systems can appear rather BSD-ish.
7439 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7443 xxx="probably a USG one, i.e. you use setpgrp()."
7448 echo "Assuming your setpgrp is $xxx" >&4
7456 : see if bzero exists
7460 : see if signal is declared as pointer to function returning int or void
7462 xxx=`./findhdr signal.h`
7463 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7464 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7465 echo "You have int (*signal())() instead of void." >&4
7467 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7468 echo "You have void (*signal())()." >&4
7470 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7471 echo "You have int (*signal())() instead of void." >&4
7473 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7474 echo "You have void (*signal())()." >&4
7477 case "$d_voidsig" in
7479 echo "I can't determine whether signal handler returns void or int..." >&4
7481 rp="What type does your signal handler return?"
7488 echo "As you already told me, signal handler returns void." >&4
7491 *) echo "As you already told me, signal handler returns int." >&4
7498 case "$d_voidsig" in
7499 "$define") signal_t="void";;
7504 : check for ability to cast large floats to 32-bit ints.
7506 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7507 if $test "$intsize" -ge 4; then
7514 #include <sys/types.h>
7516 $signal_t blech(s) int s; { exit(3); }
7523 signal(SIGFPE, blech);
7525 /* Don't let compiler optimize the test away. Store the number
7526 in a writable string for gcc to pass to sscanf under HP/UX.
7528 sprintf(str, "2147483647");
7529 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7533 /* x86 processors will probably give 0x8000 0000, which is a
7534 sign change. We don't want that. We want to mimic SPARC
7535 behavior here, which is to preserve the sign and give
7538 if (i32 != ($xxx) f)
7544 if eval $compile_ok; then
7548 echo "(I can't seem to compile the test program--assuming it can't)"
7556 echo "Nope, it can't."
7563 : check for ability to cast negative floats to unsigned
7565 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7568 #include <sys/types.h>
7570 $signal_t blech(s) int s; { exit(7); }
7571 $signal_t blech_in_list(s) int s; { exit(4); }
7572 unsigned long dummy_long(p) unsigned long p; { return p; }
7573 unsigned int dummy_int(p) unsigned int p; { return p; }
7574 unsigned short dummy_short(p) unsigned short p; { return p; }
7578 unsigned long along;
7580 unsigned short ashort;
7584 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7585 a direct f = -123. assignment. gcc-2.8.0 reportedly
7586 optimized the whole file away
7588 /* Store the number in a writable string for gcc to pass to
7591 sprintf(str, "-123");
7592 sscanf(str, "%lf", &f); /* f = -123.; */
7594 signal(SIGFPE, blech);
7595 along = (unsigned long)f;
7596 aint = (unsigned int)f;
7597 ashort = (unsigned short)f;
7598 if (along != (unsigned long)-123)
7600 if (aint != (unsigned int)-123)
7602 if (ashort != (unsigned short)-123)
7604 sprintf(str, "1073741824.");
7605 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7608 along = (unsigned long)f;
7609 if (along != 0x80000000)
7613 along = (unsigned long)f;
7614 if (along != 0x7fffffff)
7618 along = (unsigned long)f;
7619 if (along != 0x80000001)
7623 signal(SIGFPE, blech_in_list);
7624 sprintf(str, "123.");
7625 sscanf(str, "%lf", &f); /* f = 123.; */
7626 along = dummy_long((unsigned long)f);
7627 aint = dummy_int((unsigned int)f);
7628 ashort = dummy_short((unsigned short)f);
7629 if (along != (unsigned long)123)
7631 if (aint != (unsigned int)123)
7633 if (ashort != (unsigned short)123)
7640 if eval $compile_ok; then
7644 echo "(I can't seem to compile the test program--assuming it can't)"
7647 case "$castflags" in
7652 echo "Nope, it can't."
7659 : see if vprintf exists
7661 if set vprintf val -f d_vprintf; eval $csym; $val; then
7662 echo 'vprintf() found.' >&4
7664 $cat >vprintf.c <<'EOF'
7665 #include <varargs.h>
7667 int main() { xxx("foo"); }
7676 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7680 if eval $compile && ./vprintf; then
7681 echo "Your vsprintf() returns (int)." >&4
7684 echo "Your vsprintf() returns (char*)." >&4
7688 echo 'vprintf() NOT found.' >&4
7698 : see if chown exists
7702 : see if chroot exists
7706 : see if chsize exists
7710 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
7711 while $test $# -ge 2; do
7713 $define) echo "#include <$2>";;
7717 echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
7718 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7727 : see if this is a sys/uio.h system
7728 set sys/uio.h i_sysuio
7731 echo "Checking to see if your system supports struct iovec..." >&4
7732 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
7734 case "$d_iovec_s" in
7735 "$define") echo "Yup, it does." >&4
7737 *) echo "Nope, it doesn't." >&4
7743 : see whether socket exists
7745 $echo $n "Hmm... $c" >&4
7746 if set socket val -f d_socket; eval $csym; $val; then
7747 echo "Looks like you have Berkeley networking support." >&4
7749 if set setsockopt val -f; eval $csym; $val; then
7752 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
7756 if $contains socklib libc.list >/dev/null 2>&1; then
7757 echo "Looks like you have Berkeley networking support." >&4
7759 : we will have to assume that it supports the 4.2 BSD interface
7762 echo "You don't have Berkeley networking in libc$_a..." >&4
7763 if test "X$d_socket" = "X$define"; then
7764 echo "...but you seem to believe that you have sockets." >&4
7766 for net in net socket
7768 if test -f /usr/lib/lib$net$_a; then
7769 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
7770 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
7771 if $contains socket libc.list >/dev/null 2>&1; then
7776 echo "...but the Wollongong group seems to have hacked it in." >&4
7777 sockethdr="-I/usr/netinclude"
7780 echo "Found Berkeley sockets interface in lib$net." >& 4
7781 if $contains setsockopt libc.list >/dev/null 2>&1; then
7784 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
7791 if test "X$d_socket" != "X$define"; then
7792 echo "or anywhere else I see." >&4
7800 : see if socketpair exists
7801 set socketpair d_sockpair
7806 echo "Checking the availability of certain socket constants..." >& 4
7807 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
7808 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
7810 #include <sys/types.h>
7811 #include <sys/socket.h>
7817 set try; if eval $compile; then
7820 set d_${enum}; eval $setvar
7824 set sendmsg d_sendmsg
7827 set recvmsg d_recvmsg
7831 $echo $n "Checking to see if your system supports struct msghdr...$c" >&4
7832 set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7834 case "$d_msghdr_s" in
7835 "$define") echo "Yup, it does." >&4
7837 *) echo "Nope, it doesn't." >&4
7841 $echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4
7842 set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
7844 case "$d_cmsghdr_s" in
7845 "$define") echo "Yup, it does." >&4
7847 *) echo "Nope, it doesn't." >&4
7851 : check for const keyword
7853 echo 'Checking to see if your C compiler knows about "const"...' >&4
7854 $cat >const.c <<'EOCP'
7855 typedef struct spug { int drokk; } spug;
7862 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7864 echo "Yup, it does."
7867 echo "Nope, it doesn't."
7872 : see if crypt exists
7874 if set crypt val -f d_crypt; eval $csym; $val; then
7875 echo 'crypt() found.' >&4
7879 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7880 if $test -z "$cryptlib"; then
7881 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7885 if $test -z "$cryptlib"; then
7886 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7890 if $test -z "$cryptlib"; then
7891 cryptlib=`./loc libcrypt$_a "" $libpth`
7895 if $test -z "$cryptlib"; then
7896 echo 'crypt() NOT found.' >&4
7905 : get csh whereabouts
7907 'csh') val="$undef" ;;
7912 : Respect a hint or command line value for full_csh.
7914 '') full_csh=$csh ;;
7917 : see if cuserid exists
7918 set cuserid d_cuserid
7921 : see if this is a limits.h system
7922 set limits.h i_limits
7925 : see if this is a float.h system
7929 : See if number of significant digits in a double precision number is known
7931 $cat >dbl_dig.c <<EOM
7941 printf("Contains DBL_DIG");
7944 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7945 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7946 echo "DBL_DIG found." >&4
7949 echo "DBL_DIG NOT found." >&4
7956 : see if difftime exists
7957 set difftime d_difftime
7960 : see if this is a dirent system
7962 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7964 echo "<dirent.h> found." >&4
7967 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7968 echo "<sys/dir.h> found." >&4
7971 xinc=`./findhdr sys/ndir.h`
7973 echo "<dirent.h> NOT found." >&4
7978 : Look for type of directory structure.
7980 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7982 case "$direntrytype" in
7985 $define) guess1='struct dirent' ;;
7986 *) guess1='struct direct' ;;
7989 *) guess1="$direntrytype"
7994 'struct dirent') guess2='struct direct' ;;
7995 *) guess2='struct dirent' ;;
7998 if $contains "$guess1" try.c >/dev/null 2>&1; then
7999 direntrytype="$guess1"
8000 echo "Your directory entries are $direntrytype." >&4
8001 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8002 direntrytype="$guess2"
8003 echo "Your directory entries seem to be $direntrytype." >&4
8005 echo "I don't recognize your system's directory entries." >&4
8006 rp="What type is used for directory entries on this system?"
8014 : see if the directory entry stores field length
8016 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8017 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8018 echo "Good, your directory entry keeps length information in d_namlen." >&4
8021 echo "Your directory entry does not know about the d_namlen field." >&4
8028 : see if dlerror exists
8031 set dlerror d_dlerror
8035 : see if dlfcn is available
8043 On a few systems, the dynamically loaded modules that perl generates and uses
8044 will need a different extension than shared libs. The default will probably
8052 rp='What is the extension of dynamically loaded modules'
8061 : Check if dlsym need a leading underscore
8067 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8068 $cat >dyna.c <<'EOM'
8077 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8079 #include <sys/types.h>
8093 int mode = RTLD_LAZY ;
8095 handle = dlopen("./dyna.$dlext", mode) ;
8096 if (handle == NULL) {
8101 symbol = dlsym(handle, "fred") ;
8102 if (symbol == NULL) {
8103 /* try putting a leading underscore */
8104 symbol = dlsym(handle, "_fred") ;
8105 if (symbol == NULL) {
8118 : Call the object file tmp-dyna.o in case dlext=o.
8119 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8120 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8121 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8122 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8125 1) echo "Test program failed using dlopen." >&4
8126 echo "Perhaps you should not use dynamic loading." >&4;;
8127 2) echo "Test program failed using dlsym." >&4
8128 echo "Perhaps you should not use dynamic loading." >&4;;
8129 3) echo "dlsym needs a leading underscore" >&4
8131 4) echo "dlsym doesn't need a leading underscore." >&4;;
8134 echo "I can't compile and run the test program." >&4
8135 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8140 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8145 hasproto='varname=$1; func=$2; shift; shift;
8146 while $test $# -ge 2; do
8148 $define) echo "#include <$2>";;
8152 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8153 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8154 echo "$func() prototype found.";
8157 echo "$func() prototype NOT found.";
8162 $rm -f try.c tryout.c'
8164 : see if prototype for drand48 is available
8166 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8169 : see if dup2 exists
8173 : see if eaccess exists
8174 set eaccess d_eaccess
8177 : see if endgrent exists
8178 set endgrent d_endgrent
8181 : see if endhostent exists
8182 set endhostent d_endhent
8185 : see if endnetent exists
8186 set endnetent d_endnent
8189 : see if endprotoent exists
8190 set endprotoent d_endpent
8193 : see if endpwent exists
8194 set endpwent d_endpwent
8197 : see if endservent exists
8198 set endservent d_endsent
8201 : see if endspent exists
8202 set endspent d_endspent
8205 : Locate the flags for 'open()'
8207 $cat >open3.c <<'EOCP'
8208 #include <sys/types.h>
8213 #include <sys/file.h>
8224 : check sys/file.h first to get FREAD on Sun
8225 if $test `./findhdr sys/file.h` && \
8226 set open3 -DI_SYS_FILE && eval $compile; then
8228 echo "<sys/file.h> defines the O_* constants..." >&4
8230 echo "and you have the 3 argument form of open()." >&4
8233 echo "but not the 3 argument form of open(). Oh, well." >&4
8236 elif $test `./findhdr fcntl.h` && \
8237 set open3 -DI_FCNTL && eval $compile; then
8239 echo "<fcntl.h> defines the O_* constants..." >&4
8241 echo "and you have the 3 argument form of open()." >&4
8244 echo "but not the 3 argument form of open(). Oh, well." >&4
8249 echo "I can't find the O_* constant definitions! You got problems." >&4
8255 : check for non-blocking I/O stuff
8256 case "$h_sysfile" in
8257 true) echo "#include <sys/file.h>" > head.c;;
8260 true) echo "#include <fcntl.h>" > head.c;;
8261 *) echo "#include <sys/fcntl.h>" > head.c;;
8266 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8267 case "$o_nonblock" in
8270 $cat >>try.c <<'EOCP'
8273 printf("O_NONBLOCK\n");
8277 printf("O_NDELAY\n");
8281 printf("FNDELAY\n");
8288 if eval $compile_ok; then
8290 case "$o_nonblock" in
8291 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8292 *) echo "Seems like we can use $o_nonblock.";;
8295 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8298 *) echo "Using $hint value $o_nonblock.";;
8300 $rm -f try try.* .out core
8303 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8309 #include <sys/types.h>
8311 #define MY_O_NONBLOCK $o_nonblock
8312 #ifndef errno /* XXX need better Configure test */
8315 $signal_t blech(x) int x; { exit(3); }
8317 $cat >> try.c <<'EOCP'
8325 pipe(pd); /* Down: child -> parent */
8326 pipe(pu); /* Up: parent -> child */
8329 close(pd[1]); /* Parent reads from pd[0] */
8330 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8331 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8333 signal(SIGALRM, blech);
8335 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8337 sprintf(string, "%d\n", ret);
8338 write(2, string, strlen(string));
8341 if (errno == EAGAIN) {
8347 if (errno == EWOULDBLOCK)
8348 printf("EWOULDBLOCK\n");
8351 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8352 sleep(2); /* Give it time to close our pipe */
8354 ret = read(pd[0], buf, 1); /* Should read EOF */
8356 sprintf(string, "%d\n", ret);
8357 write(3, string, strlen(string));
8361 close(pd[0]); /* We write to pd[1] */
8362 close(pu[1]); /* We read from pu[0] */
8363 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8364 close(pd[1]); /* Pipe pd is now fully closed! */
8365 exit(0); /* Bye bye, thank you for playing! */
8369 if eval $compile_ok; then
8370 echo "$startsh" >mtry
8371 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8373 ./mtry >/dev/null 2>&1
8375 0) eagain=`$cat try.out`;;
8376 1) echo "Could not perform non-blocking setting!";;
8377 2) echo "I did a successful read() for something that was not there!";;
8378 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8379 *) echo "Something terribly wrong happened during testing.";;
8381 rd_nodata=`$cat try.ret`
8382 echo "A read() system call with no data present returns $rd_nodata."
8383 case "$rd_nodata" in
8386 echo "(That's peculiar, fixing that to be -1.)"
8392 echo "Forcing errno EAGAIN on read() with no data available."
8396 echo "Your read() sets errno to $eagain when no data is available."
8399 status=`$cat try.err`
8401 0) echo "And it correctly returns 0 to signal EOF.";;
8402 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8403 *) echo "However, your read() returns '$status' on EOF??";;
8406 if test "$status" = "$rd_nodata"; then
8407 echo "WARNING: you can't distinguish between EOF and no data!"
8411 echo "I can't compile the test program--assuming errno EAGAIN will do."
8418 echo "Using $hint value $eagain."
8419 echo "Your read() returns $rd_nodata when no data is present."
8420 case "$d_eofnblk" in
8421 "$define") echo "And you can see EOF because read() returns 0.";;
8422 "$undef") echo "But you can't see EOF status from read() returned value.";;
8424 echo "(Assuming you can't see EOF status from read anyway.)"
8430 $rm -f try try.* .out core head.c mtry
8432 : see if fchmod exists
8436 : see if fchown exists
8440 : see if this is an fcntl system
8444 : see if sys/select.h has to be included
8445 set sys/select.h i_sysselct
8448 : see if we should include time.h, sys/time.h, or both
8450 if test "X$timeincl" = X; then
8451 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8452 $echo $n "I'm now running the test program...$c"
8453 $cat >try.c <<'EOCP'
8454 #include <sys/types.h>
8459 #ifdef SYSTIMEKERNEL
8462 #include <sys/time.h>
8465 #include <sys/select.h>
8474 struct timezone tzp;
8476 if (foo.tm_sec == foo.tm_sec)
8479 if (bar.tv_sec == bar.tv_sec)
8486 for s_timezone in '-DS_TIMEZONE' ''; do
8488 for s_timeval in '-DS_TIMEVAL' ''; do
8489 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8490 for i_time in '' '-DI_TIME'; do
8491 for i_systime in '-DI_SYSTIME' ''; do
8494 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8495 if eval $compile; then
8496 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8500 $echo $n "Succeeded with $flags$c"
8512 *SYSTIMEKERNEL*) i_systimek="$define"
8513 timeincl=`./findhdr sys/time.h`
8514 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8515 *) i_systimek="$undef";;
8518 *I_TIME*) i_time="$define"
8519 timeincl=`./findhdr time.h`" $timeincl"
8520 echo "We'll include <time.h>." >&4;;
8521 *) i_time="$undef";;
8524 *I_SYSTIME*) i_systime="$define"
8525 timeincl=`./findhdr sys/time.h`" $timeincl"
8526 echo "We'll include <sys/time.h>." >&4;;
8527 *) i_systime="$undef";;
8532 : check for fd_set items
8535 Checking to see how well your C compiler handles fd_set and friends ...
8537 $cat >fd_set.c <<EOCP
8538 #$i_systime I_SYS_TIME
8539 #$i_sysselct I_SYS_SELECT
8540 #$d_socket HAS_SOCKET
8541 #include <sys/types.h>
8543 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8546 #include <sys/time.h>
8549 #include <sys/select.h>
8558 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8565 set fd_set -DTRYBITS
8566 if eval $compile; then
8567 d_fds_bits="$define"
8569 echo "Well, your system knows about the normal fd_set typedef..." >&4
8571 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8572 d_fd_macros="$define"
8575 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8577 d_fd_macros="$undef"
8581 Hmm, your compiler has some difficulty with fd_set. Checking further...
8584 if eval $compile; then
8587 echo "Well, your system has some sort of fd_set available..." >&4
8589 echo "and you have the normal fd_set macros." >&4
8590 d_fd_macros="$define"
8593 but not the normal fd_set macros! Gross! More work for me...
8595 d_fd_macros="$undef"
8598 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8601 d_fd_macros="$undef"
8606 : see if fgetpos exists
8607 set fgetpos d_fgetpos
8610 : see if flock exists
8614 : see if fork exists
8618 : see if pathconf exists
8619 set pathconf d_pathconf
8622 : see if fpathconf exists
8623 set fpathconf d_fpathconf
8627 : see if llseek exists
8633 $echo $n "Checking to see if your system supports off64_t...$c" >&4
8635 #include <sys/types.h>
8637 off64_t foo() { off64_t x; x = 7; return x; }'
8639 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8641 echo " Yup, it does." >&4
8644 echo " Nope, it doesn't." >&4
8650 : check for fpos64_t
8652 $echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8654 #include <sys/stdio.h>
8655 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8657 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8659 echo " Yup, it does." >&4
8662 echo " Nope, it doesn't." >&4
8668 : see if fseeko exists
8672 : see if fsetpos exists
8673 set fsetpos d_fsetpos
8676 : see if this is a sys/param system
8677 set sys/param.h i_sysparam
8680 : see if this is a sys/mount.h system
8681 set sys/mount.h i_sysmount
8685 : see if statfs exists
8689 : see if fstatfs exists
8690 set fstatfs d_fstatfs
8693 : see if statfs knows about mount flags
8695 define) set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h
8705 : see if statvfs exists
8706 set statvfs d_statvfs
8709 : see if fstatvfs exists
8710 set fstatvfs d_fstatvfs
8714 : see if ftello exists
8718 : see if getgrent exists
8719 set getgrent d_getgrent
8722 : see if gethostbyaddr exists
8723 set gethostbyaddr d_gethbyaddr
8726 : see if gethostbyname exists
8727 set gethostbyname d_gethbyname
8730 : see if gethostent exists
8731 set gethostent d_gethent
8734 : see how we will look up host name
8737 if set gethostname val -f d_gethname; eval $csym; $val; then
8738 echo 'gethostname() found.' >&4
8739 d_gethname="$define"
8742 if set uname val -f d_uname; eval $csym; $val; then
8745 uname() was found, but you're running xenix, and older versions of xenix
8746 have a broken uname(). If you don't really know whether your xenix is old
8747 enough to have a broken system call, use the default answer.
8754 rp='Is your uname() broken?'
8757 n*) d_uname="$define"; call=uname;;
8760 echo 'uname() found.' >&4
8767 case "$d_gethname" in
8768 '') d_gethname="$undef";;
8771 '') d_uname="$undef";;
8773 case "$d_uname$d_gethname" in
8778 Every now and then someone has a $call() that lies about the hostname
8779 but can't be fixed for political or economic reasons. If you wish, I can
8780 pretend $call() isn't there and maybe compute hostname at run-time
8781 thanks to the '$phostname' command.
8784 rp="Shall I ignore $call() from now on?"
8787 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8790 case "$phostname" in
8792 *) case "$aphostname" in
8798 file=`./loc $file $file $pth`
8799 aphostname=`echo $file $*`
8804 case "$d_uname$d_gethname" in
8807 case "$phostname" in
8809 echo "There will be no way for $package to get your hostname." >&4;;
8811 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8815 case "$d_phostname" in
8816 '') d_phostname="$undef";;
8819 : see if this is a netdb.h system
8823 : see if prototypes for various gethostxxx netdb.h functions are available
8825 set d_gethostprotos gethostent $i_netdb netdb.h
8828 : see if getlogin exists
8829 set getlogin d_getlogin
8832 : see if getmnt exists
8836 : see if getmntent exists
8837 set getmntent d_getmntent
8840 : see if getnetbyaddr exists
8841 set getnetbyaddr d_getnbyaddr
8844 : see if getnetbyname exists
8845 set getnetbyname d_getnbyname
8848 : see if getnetent exists
8849 set getnetent d_getnent
8852 : see if prototypes for various getnetxxx netdb.h functions are available
8854 set d_getnetprotos getnetent $i_netdb netdb.h
8858 : see if getprotobyname exists
8859 set getprotobyname d_getpbyname
8862 : see if getprotobynumber exists
8863 set getprotobynumber d_getpbynumber
8866 : see if getprotoent exists
8867 set getprotoent d_getpent
8870 : see if getpgid exists
8871 set getpgid d_getpgid
8874 : see if getpgrp2 exists
8875 set getpgrp2 d_getpgrp2
8878 : see if getppid exists
8879 set getppid d_getppid
8882 : see if getpriority exists
8883 set getpriority d_getprior
8886 : see if prototypes for various getprotoxxx netdb.h functions are available
8888 set d_getprotoprotos getprotoent $i_netdb netdb.h
8891 : see if getpwent exists
8892 set getpwent d_getpwent
8896 : see if getservbyname exists
8897 set getservbyname d_getsbyname
8900 : see if getservbyport exists
8901 set getservbyport d_getsbyport
8904 : see if getservent exists
8905 set getservent d_getsent
8908 : see if prototypes for various getservxxx netdb.h functions are available
8910 set d_getservprotos getservent $i_netdb netdb.h
8913 : see if getspent exists
8914 set getspent d_getspent
8917 : see if getspnam exists
8918 set getspnam d_getspnam
8921 : see if gettimeofday or ftime exists
8922 set gettimeofday d_gettimeod
8924 case "$d_gettimeod" in
8930 val="$undef"; set d_ftime; eval $setvar
8933 case "$d_gettimeod$d_ftime" in
8936 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8940 : see if this is an grp system
8946 xxx=`./findhdr grp.h`
8947 $cppstdin $cppflags $cppminus < $xxx >$$.h
8949 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8961 set d_grpasswd; eval $setvar
8965 : see if hasmntopt exists
8966 set hasmntopt d_hasmntopt
8969 : see if this is a netinet/in.h or sys/in.h system
8970 set netinet/in.h i_niin sys/in.h i_sysin
8973 : see if arpa/inet.h has to be included
8974 set arpa/inet.h i_arpainet
8977 : see if htonl --and friends-- exists
8982 : Maybe they are macros.
8987 #include <sys/types.h>
8988 #$i_niin I_NETINET_IN
8990 #$i_arpainet I_ARPA_INET
8992 #include <netinet/in.h>
8998 #include <arpa/inet.h>
9001 printf("Defined as a macro.");
9004 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9005 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9007 echo "But it seems to be defined as a macro." >&4
9015 : see which of string.h or strings.h is needed
9017 strings=`./findhdr string.h`
9018 if $test "$strings" && $test -r "$strings"; then
9019 echo "Using <string.h> instead of <strings.h>." >&4
9023 strings=`./findhdr strings.h`
9024 if $test "$strings" && $test -r "$strings"; then
9025 echo "Using <strings.h> instead of <string.h>." >&4
9027 echo "No string header found -- You'll surely have problems." >&4
9033 "$undef") strings=`./findhdr strings.h`;;
9034 *) strings=`./findhdr string.h`;;
9039 if set index val -f; eval $csym; $val; then
9040 if set strchr val -f d_strchr; eval $csym; $val; then
9041 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9044 echo "strchr() found." >&4
9048 echo "index() found." >&4
9053 echo "index() found." >&4
9056 if set strchr val -f d_strchr; eval $csym; $val; then
9059 echo "strchr() found." >&4
9061 echo "No index() or strchr() found!" >&4
9066 set d_strchr; eval $setvar
9068 set d_index; eval $setvar
9070 : check whether inet_aton exists
9071 set inet_aton d_inetaton
9076 $cat >isascii.c <<'EOCP'
9088 if eval $compile; then
9089 echo "isascii() found." >&4
9092 echo "isascii() NOT found." >&4
9099 : see if killpg exists
9103 : see if lchown exists
9105 $cat > try.c <<'EOCP'
9106 /* System header to define __stub macros and hopefully few prototypes,
9107 which can conflict with char lchown(); below. */
9109 /* Override any gcc2 internal prototype to avoid an error. */
9110 /* We use char because int might match the return type of a gcc2
9111 builtin and then its argument prototype would still apply. */
9114 /* The GNU C library defines this for functions which it implements
9115 to always fail with ENOSYS. Some functions are actually named
9116 something starting with __ and the normal name is an alias. */
9117 #if defined (__stub_lchown) || defined (__stub___lchown)
9125 if eval $compile; then
9126 $echo "lchown() found." >&4
9129 $echo "lchown() NOT found." >&4
9135 : See if number of significant digits in a double precision number is known
9137 $cat >ldbl_dig.c <<EOM
9147 printf("Contains LDBL_DIG");
9150 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9151 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9152 echo "LDBL_DIG found." >&4
9155 echo "LDBL_DIG NOT found." >&4
9162 : see if link exists
9166 : see if localeconv exists
9167 set localeconv d_locconv
9170 : see if lockf exists
9174 : see if lstat exists
9178 : see if madvise exists
9179 set madvise d_madvise
9182 : see if mblen exists
9186 : see if mbstowcs exists
9187 set mbstowcs d_mbstowcs
9190 : see if mbtowc exists
9194 : see if memchr exists
9198 : see if memcmp exists
9202 : see if memcpy exists
9206 : see if memmove exists
9207 set memmove d_memmove
9210 : see if memset exists
9214 : see if mkdir exists
9218 : see if mkfifo exists
9222 : see if mktime exists
9226 : see if this is a sys/mman.h system
9227 set sys/mman.h i_sysmman
9230 : see if mmap exists
9233 : see what shmat returns
9234 : default to something harmless
9236 case "$i_sysmman$d_mmap" in
9238 $cat >mmap.c <<'END'
9239 #include <sys/mman.h>
9242 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9247 echo "and it returns ($mmaptype)." >&4
9253 : see if mprotect exists
9254 set mprotect d_mprotect
9257 : see if msgctl exists
9261 : see if msgget exists
9265 : see if msgsnd exists
9269 : see if msgrcv exists
9273 : see how much of the 'msg*(2)' library is present.
9276 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9277 *"$undef"*) h_msg=false;;
9281 case "`ipcs 2>&1`" in
9282 "SVID messages"*"not configured"*)
9283 echo "Your $osname does not have the msg*(2) configured." >&4
9298 : we could also check for sys/ipc.h ...
9299 if $h_msg && $test `./findhdr sys/msg.h`; then
9300 echo "You have the full msg*(2) library." >&4
9303 echo "You don't have the full msg*(2) library." >&4
9309 : see if msync exists
9313 : see if munmap exists
9317 : see if nice exists
9321 : see if POSIX threads are available
9322 set pthread.h i_pthread
9328 : how to create joinable pthreads
9329 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9331 echo "Checking what constant to use for creating joinable pthreads..." >&4
9332 $cat >try.c <<'EOCP'
9333 #include <pthread.h>
9335 int detachstate = JOINABLE;
9338 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9339 if eval $compile; then
9340 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9341 val="$undef" # Yes, undef.
9342 set d_old_pthread_create_joinable
9345 set old_pthread_create_joinable
9348 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9349 if eval $compile; then
9350 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9352 set d_old_pthread_create_joinable
9354 val=PTHREAD_CREATE_UNDETACHED
9355 set old_pthread_create_joinable
9358 set try -DJOINABLE=__UNDETACHED
9359 if eval $compile; then
9360 echo "You seem to use __UNDETACHED." >&4
9362 set d_old_pthread_create_joinable
9365 set old_pthread_create_joinable
9368 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9370 set d_old_pthread_create_joinable
9373 set old_pthread_create_joinable
9380 d_old_pthread_create_joinable="$undef"
9381 old_pthread_create_joinable=""
9384 : see if pause exists
9388 : see if pipe exists
9392 : see if poll exists
9397 : see whether the various POSIXish _yields exist
9399 #include <pthread.h>
9405 #ifdef PTHREAD_YIELD
9408 #ifdef PTHREAD_YIELD_NULL
9409 pthread_yield(NULL);
9415 : see if sched_yield exists
9416 set try -DSCHED_YIELD
9417 if eval $compile; then
9419 sched_yield='sched_yield()'
9423 case "$usethreads" in
9426 $define) echo 'sched_yield() found.' >&4 ;;
9427 *) echo 'sched_yield() NOT found.' >&4 ;;
9433 : see if pthread_yield exists
9434 set try -DPTHREAD_YIELD
9435 if eval $compile; then
9437 case "$sched_yield" in
9438 '') sched_yield='pthread_yield()' ;;
9441 set try -DPTHREAD_YIELD_NULL
9442 if eval $compile; then
9444 case "$sched_yield" in
9445 '') sched_yield='pthread_yield(NULL)' ;;
9451 case "$usethreads" in
9454 $define) echo 'pthread_yield() found.' >&4 ;;
9455 *) echo 'pthread_yield() NOT found.' >&4 ;;
9462 case "$sched_yield" in
9463 '') sched_yield=undef ;;
9468 : see if this is a pwd.h system
9474 xxx=`./findhdr pwd.h`
9475 $cppstdin $cppflags $cppminus < $xxx >$$.h
9477 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9485 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9493 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9501 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9509 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9517 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9525 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9533 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9545 set d_pwquota; eval $setvar
9546 set d_pwage; eval $setvar
9547 set d_pwchange; eval $setvar
9548 set d_pwclass; eval $setvar
9549 set d_pwexpire; eval $setvar
9550 set d_pwcomment; eval $setvar
9551 set d_pwgecos; eval $setvar
9552 set d_pwpasswd; eval $setvar
9556 : see if readdir and friends exist
9557 set readdir d_readdir
9559 set seekdir d_seekdir
9561 set telldir d_telldir
9563 set rewinddir d_rewinddir
9566 : see if readlink exists
9567 set readlink d_readlink
9570 : see if readv exists
9574 : see if rename exists
9578 : see if rmdir exists
9582 : see if memory.h is available.
9587 : See if it conflicts with string.h
9593 $cppstdin $cppflags $cppminus < $strings > mem.h
9594 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9596 echo "We won't be including <memory.h>."
9606 : can bcopy handle overlapping blocks?
9611 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9618 $cat >>try.c <<'EOCP'
9621 # include <memory.h>
9624 # include <stdlib.h>
9627 # include <string.h>
9629 # include <strings.h>
9632 # include <unistd.h> /* Needed for NetBSD */
9636 char buf[128], abc[128];
9642 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9644 for (align = 7; align >= 0; align--) {
9645 for (len = 36; len; len--) {
9648 for (off = 1; off <= len; off++) {
9649 bcopy(b, b+off, len);
9650 bcopy(b+off, b, len);
9651 if (bcmp(b, abc, len))
9660 if eval $compile_ok; then
9661 if ./try 2>/dev/null; then
9665 echo "It can't, sorry."
9666 case "$d_memmove" in
9667 "$define") echo "But that's Ok since you have memmove()." ;;
9671 echo "(I can't compile the test program, so we'll assume not...)"
9672 case "$d_memmove" in
9673 "$define") echo "But that's Ok since you have memmove()." ;;
9678 $rm -f try.* try core
9682 : can memcpy handle overlapping blocks?
9687 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9694 $cat >>try.c <<'EOCP'
9697 # include <memory.h>
9700 # include <stdlib.h>
9703 # include <string.h>
9705 # include <strings.h>
9708 # include <unistd.h> /* Needed for NetBSD */
9712 char buf[128], abc[128];
9718 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9719 try to store the string in read-only memory. */
9720 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9722 for (align = 7; align >= 0; align--) {
9723 for (len = 36; len; len--) {
9725 memcpy(b, abc, len);
9726 for (off = 1; off <= len; off++) {
9727 memcpy(b+off, b, len);
9728 memcpy(b, b+off, len);
9729 if (memcmp(b, abc, len))
9738 if eval $compile_ok; then
9739 if ./try 2>/dev/null; then
9743 echo "It can't, sorry."
9744 case "$d_memmove" in
9745 "$define") echo "But that's Ok since you have memmove()." ;;
9749 echo "(I can't compile the test program, so we'll assume not...)"
9750 case "$d_memmove" in
9751 "$define") echo "But that's Ok since you have memmove()." ;;
9756 $rm -f try.* try core
9760 : can memcmp be trusted to compare relative magnitude?
9765 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9772 $cat >>try.c <<'EOCP'
9775 # include <memory.h>
9778 # include <stdlib.h>
9781 # include <string.h>
9783 # include <strings.h>
9786 # include <unistd.h> /* Needed for NetBSD */
9792 if ((a < b) && memcmp(&a, &b, 1) < 0)
9798 if eval $compile_ok; then
9799 if ./try 2>/dev/null; then
9803 echo "No, it can't (it uses signed chars)."
9806 echo "(I can't compile the test program, so we'll assume not...)"
9810 $rm -f try.* try core
9814 : see if select exists
9818 : see if semctl exists
9822 : see if semget exists
9826 : see if semop exists
9830 : see how much of the 'sem*(2)' library is present.
9833 case "$d_semctl$d_semget$d_semop" in
9834 *"$undef"*) h_sem=false;;
9838 case "`ipcs 2>&1`" in
9839 "SVID messages"*"not configured"*)
9840 echo "Your $osname does not have the sem*(2) configured." >&4
9853 : we could also check for sys/ipc.h ...
9854 if $h_sem && $test `./findhdr sys/sem.h`; then
9855 echo "You have the full sem*(2) library." >&4
9858 echo "You don't have the full sem*(2) library." >&4
9864 : see whether sys/sem.h defines union semun
9866 $cat > try.c <<'END'
9867 #include <sys/types.h>
9868 #include <sys/ipc.h>
9869 #include <sys/sem.h>
9870 int main () { union semun semun; semun.buf = 0; }
9873 if eval $compile; then
9874 echo "You have union semun in <sys/sem.h>." >&4
9877 echo "You do not have union semun in <sys/sem.h>." >&4
9880 $rm -f try try.c try.h
9884 : see how to do semctl IPC_STAT
9887 : see whether semctl IPC_STAT can use union semun
9892 # define S_IRUSR S_IREAD
9893 # define S_IWUSR S_IWRITE
9894 # define S_IXUSR S_IEXEC
9896 # define S_IRUSR 0400
9897 # define S_IWUSR 0200
9898 # define S_IXUSR 0100
9900 # define S_IRGRP (S_IRUSR>>3)
9901 # define S_IWGRP (S_IWUSR>>3)
9902 # define S_IXGRP (S_IXUSR>>3)
9903 # define S_IROTH (S_IRUSR>>6)
9904 # define S_IWOTH (S_IWUSR>>6)
9905 # define S_IXOTH (S_IXUSR>>6)
9908 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9909 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9910 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9915 #include <sys/types.h>
9916 #include <sys/ipc.h>
9917 #include <sys/sem.h>
9918 #include <sys/stat.h>
9925 #$d_union_semun HAS_UNION_SEMUN
9928 #ifndef HAS_UNION_SEMUN
9931 struct semid_ds *buf;
9932 unsigned short *array;
9938 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9939 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9941 struct semid_ds argbuf;
9944 st = semctl(sem, 0, IPC_STAT, arg);
9948 # endif /* IPC_STAT */
9949 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9951 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9952 # endif /* IPC_RMID */
9953 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9955 #endif /* IPC_PRIVATE && ... */
9956 printf("semget failed: errno = %d\n", errno);
9962 if eval $compile; then
9965 semun) val="$define" ;;
9971 case "$d_semctl_semun" in
9973 echo "You can use union semun for semctl IPC_STAT." >&4
9976 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9981 : see whether semctl IPC_STAT can use struct semid_ds pointer
9982 $cat > try.c <<'END'
9983 #include <sys/types.h>
9984 #include <sys/ipc.h>
9985 #include <sys/sem.h>
9986 #include <sys/stat.h>
9994 struct semid_ds arg;
9997 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9998 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10001 st = semctl(sem, 0, IPC_STAT, &arg);
10003 printf("semid_ds\n");
10005 # endif /* IPC_STAT */
10006 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10008 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10009 # endif /* IPC_RMID */
10010 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10012 #endif /* IPC_PRIVATE && ... */
10013 printf("semget failed: errno = %d\n", errno);
10020 if eval $compile; then
10023 semid_ds) val="$define" ;;
10027 set d_semctl_semid_ds
10029 case "$d_semctl_semid_ds" in
10031 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10033 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10040 # We do not have the full sem*(2) library, so assume we can not
10046 set d_semctl_semid_ds
10051 : see if setegid exists
10052 set setegid d_setegid
10055 : see if seteuid exists
10056 set seteuid d_seteuid
10059 : see if setgrent exists
10060 set setgrent d_setgrent
10063 : see if sethostent exists
10064 set sethostent d_sethent
10067 : see if setlinebuf exists
10068 set setlinebuf d_setlinebuf
10071 : see if setlocale exists
10072 set setlocale d_setlocale
10075 : see if setnetent exists
10076 set setnetent d_setnent
10079 : see if setprotoent exists
10080 set setprotoent d_setpent
10083 : see if setpgid exists
10084 set setpgid d_setpgid
10087 : see if setpgrp2 exists
10088 set setpgrp2 d_setpgrp2
10091 : see if setpriority exists
10092 set setpriority d_setprior
10095 : see if setpwent exists
10096 set setpwent d_setpwent
10099 : see if setregid exists
10100 set setregid d_setregid
10102 set setresgid d_setresgid
10105 : see if setreuid exists
10106 set setreuid d_setreuid
10108 set setresuid d_setresuid
10111 : see if setrgid exists
10112 set setrgid d_setrgid
10115 : see if setruid exists
10116 set setruid d_setruid
10119 : see if setservent exists
10120 set setservent d_setsent
10123 : see if setsid exists
10124 set setsid d_setsid
10127 : see if setspent exists
10128 set setspent d_setspent
10131 : see if setvbuf exists
10132 set setvbuf d_setvbuf
10135 : see if sfio.h is available
10140 : see if sfio library is available
10151 : Ok, but do we want to use it.
10155 true|$define|[yY]*) dflt='y';;
10158 echo "$package can use the sfio library, but it is experimental."
10159 rp="You seem to have sfio available, do you want to try using it?"
10163 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10165 : Remove sfio from list of libraries to use
10166 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10169 echo "libs = $libs" >&4
10173 *) case "$usesfio" in
10174 true|$define|[yY]*)
10175 echo "Sorry, cannot find sfio on this machine" >&4
10176 echo "Ignoring your setting of usesfio=$usesfio" >&4
10184 $define) usesfio='true';;
10185 *) usesfio='false';;
10188 : see if shmctl exists
10189 set shmctl d_shmctl
10192 : see if shmget exists
10193 set shmget d_shmget
10196 : see if shmat exists
10199 : see what shmat returns
10202 $cat >shmat.c <<'END'
10203 #include <sys/shm.h>
10206 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10211 echo "and it returns ($shmattype)." >&4
10212 : see if a prototype for shmat is available
10213 xxx=`./findhdr sys/shm.h`
10214 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10215 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10226 set d_shmatprototype
10229 : see if shmdt exists
10233 : see how much of the 'shm*(2)' library is present.
10236 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10237 *"$undef"*) h_shm=false;;
10241 case "`ipcs 2>&1`" in
10242 "SVID shared memory"*"not configured"*)
10243 echo "Your $osname does not have the shm*(2) configured." >&4
10246 set shmctl d_shmctl
10248 set shmget d_shmget
10258 : we could also check for sys/ipc.h ...
10259 if $h_shm && $test `./findhdr sys/shm.h`; then
10260 echo "You have the full shm*(2) library." >&4
10263 echo "You don't have the full shm*(2) library." >&4
10270 : see if we have sigaction
10271 if set sigaction val -f d_sigaction; eval $csym; $val; then
10272 echo 'sigaction() found.' >&4
10273 $cat > try.c <<'EOP'
10275 #include <sys/types.h>
10276 #include <signal.h>
10279 struct sigaction act, oact;
10281 oact.sa_handler = 0;
10285 if eval $compile_ok; then
10288 echo "But you don't seem to have a useable struct sigaction." >&4
10292 echo 'sigaction NOT found.' >&4
10295 set d_sigaction; eval $setvar
10296 $rm -f try try$_o try.c
10298 : see if sigsetjmp exists
10300 case "$d_sigsetjmp" in
10302 $cat >try.c <<'EOP'
10303 #include <setjmp.h>
10308 if (sigsetjmp(env,1))
10311 siglongjmp(env, 1);
10316 if eval $compile; then
10317 if ./try >/dev/null 2>&1; then
10318 echo "POSIX sigsetjmp found." >&4
10322 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10328 echo "sigsetjmp not found." >&4
10332 *) val="$d_sigsetjmp"
10333 case "$d_sigsetjmp" in
10334 $define) echo "POSIX sigsetjmp found." >&4;;
10335 $undef) echo "sigsetjmp not found." >&4;;
10343 : see if sqrtl exists
10347 : see if sys/stat.h is available
10348 set sys/stat.h i_sysstat
10351 : see if stat knows about block sizes
10353 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10356 : see if _ptr and _cnt from stdio act std
10358 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10359 echo "(Looks like you have stdio.h from Linux.)"
10360 case "$stdio_ptr" in
10361 '') stdio_ptr='((fp)->_IO_read_ptr)'
10364 *) ptr_lval=$d_stdio_ptr_lval;;
10366 case "$stdio_cnt" in
10367 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10370 *) cnt_lval=$d_stdio_cnt_lval;;
10372 case "$stdio_base" in
10373 '') stdio_base='((fp)->_IO_read_base)';;
10375 case "$stdio_bufsiz" in
10376 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10379 case "$stdio_ptr" in
10380 '') stdio_ptr='((fp)->_ptr)'
10383 *) ptr_lval=$d_stdio_ptr_lval;;
10385 case "$stdio_cnt" in
10386 '') stdio_cnt='((fp)->_cnt)'
10389 *) cnt_lval=$d_stdio_cnt_lval;;
10391 case "$stdio_base" in
10392 '') stdio_base='((fp)->_base)';;
10394 case "$stdio_bufsiz" in
10395 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10398 : test whether _ptr and _cnt really work
10399 echo "Checking how std your stdio is..." >&4
10402 #define FILE_ptr(fp) $stdio_ptr
10403 #define FILE_cnt(fp) $stdio_cnt
10405 FILE *fp = fopen("try.c", "r");
10408 18 <= FILE_cnt(fp) &&
10409 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10417 if eval $compile; then
10419 echo "Your stdio acts pretty std."
10422 echo "Your stdio isn't very std."
10425 echo "Your stdio doesn't appear very std."
10431 : Can _ptr be used as an lvalue?
10432 case "$d_stdstdio$ptr_lval" in
10433 $define$define) val=$define ;;
10436 set d_stdio_ptr_lval
10439 : Can _cnt be used as an lvalue?
10440 case "$d_stdstdio$cnt_lval" in
10441 $define$define) val=$define ;;
10444 set d_stdio_cnt_lval
10447 : see if _base is also standard
10449 case "$d_stdstdio" in
10453 #define FILE_base(fp) $stdio_base
10454 #define FILE_bufsiz(fp) $stdio_bufsiz
10456 FILE *fp = fopen("try.c", "r");
10459 19 <= FILE_bufsiz(fp) &&
10460 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10467 if eval $compile; then
10469 echo "And its _base field acts std."
10472 echo "But its _base field isn't std."
10475 echo "However, it seems to be lacking the _base field."
10484 Checking how to access stdio streams by file descriptor number...
10486 case "$stdio_stream_array" in
10487 '') $cat >try.c <<EOCP
10490 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10494 for s in _iob __iob __sF
10496 set try -DSTDIO_STREAM_ARRAY=$s
10497 if eval $compile; then
10498 case "`./try$exe_ext`" in
10499 yes) stdio_stream_array=$s; break ;;
10503 $rm -f try.* try$exe_ext
10505 case "$stdio_stream_array" in
10507 I can't figure out how to access stdio streams by file descriptor number.
10509 d_stdio_stream_array="$undef"
10512 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10514 d_stdio_stream_array="$define"
10518 : see if strcoll exists
10519 set strcoll d_strcoll
10522 : check for structure copying
10524 echo "Checking to see if your C compiler can copy structs..." >&4
10525 $cat >try.c <<'EOCP'
10535 if $cc -c try.c >/dev/null 2>&1 ; then
10537 echo "Yup, it can."
10540 echo "Nope, it can't."
10546 : see if strerror and/or sys_errlist[] exist
10548 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10549 if set strerror val -f d_strerror; eval $csym; $val; then
10550 echo 'strerror() found.' >&4
10551 d_strerror="$define"
10552 d_strerrm='strerror(e)'
10553 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10554 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10555 d_syserrlst="$define"
10557 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10558 d_syserrlst="$undef"
10560 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10561 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10562 echo 'strerror() found in string header.' >&4
10563 d_strerror="$define"
10564 d_strerrm='strerror(e)'
10565 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10566 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10567 d_syserrlst="$define"
10569 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10570 d_syserrlst="$undef"
10572 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10573 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10574 d_strerror="$undef"
10575 d_syserrlst="$define"
10576 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10578 echo 'strerror() and sys_errlist[] NOT found.' >&4
10579 d_strerror="$undef"
10580 d_syserrlst="$undef"
10581 d_strerrm='"unknown"'
10585 : see if strtod exists
10586 set strtod d_strtod
10589 : see if strtol exists
10590 set strtol d_strtol
10593 : see if strtoul exists
10594 set strtoul d_strtoul
10597 : see if strtoull exists
10598 set strtoull d_strtoull
10601 : see if strxfrm exists
10602 set strxfrm d_strxfrm
10605 : see if symlink exists
10606 set symlink d_symlink
10609 : see if syscall exists
10610 set syscall d_syscall
10613 : see if sysconf exists
10614 set sysconf d_sysconf
10617 : see if system exists
10618 set system d_system
10621 : see if tcgetpgrp exists
10622 set tcgetpgrp d_tcgetpgrp
10625 : see if tcsetpgrp exists
10626 set tcsetpgrp d_tcsetpgrp
10629 : see if sys/types.h has to be included
10630 set sys/types.h i_systypes
10633 : see if prototype for telldir is available
10635 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10638 : define an is-a-typedef? function
10639 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10641 "") inclist="sys/types.h";;
10643 eval "varval=\$$var";
10647 for inc in $inclist; do
10648 echo "#include <$inc>" >>temp.c;
10650 echo "#ifdef $type" >> temp.c;
10651 echo "printf(\"We have $type\");" >> temp.c;
10652 echo "#endif" >> temp.c;
10653 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10654 if $contains $type temp.E >/dev/null 2>&1; then
10655 eval "$var=\$type";
10660 *) eval "$var=\$varval";;
10663 : define an is-a-typedef? function that prompts if the type is not available.
10664 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10666 "") inclist="sys/types.h";;
10668 eval "varval=\$$var";
10672 for inc in $inclist; do
10673 echo "#include <$inc>" >>temp.c;
10675 echo "#ifdef $type" >> temp.c;
10676 echo "printf(\"We have $type\");" >> temp.c;
10677 echo "#endif" >> temp.c;
10678 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10680 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10681 if $contains $type temp.E >/dev/null 2>&1; then
10682 echo "$type found." >&4;
10683 eval "$var=\$type";
10685 echo "$type NOT found." >&4;
10691 *) eval "$var=\$varval";;
10694 : see if this is a sys/times.h system
10695 set sys/times.h i_systimes
10698 : see if times exists
10700 if set times val -f d_times; eval $csym; $val; then
10701 echo 'times() found.' >&4
10704 case "$i_systimes" in
10705 "$define") inc='sys/times.h';;
10707 rp="What is the type returned by times() on this system?"
10708 set clock_t clocktype long stdio.h sys/types.h $inc
10711 echo 'times() NOT found, hope that will do.' >&4
10716 : see if truncate exists
10717 set truncate d_truncate
10720 : see if tzname[] exists
10722 if set tzname val -a d_tzname; eval $csym; $val; then
10724 echo 'tzname[] found.' >&4
10727 echo 'tzname[] NOT found.' >&4
10732 : see if umask exists
10736 : backward compatibility for d_hvfork
10737 if test X$d_hvfork != X; then
10738 d_vfork="$d_hvfork"
10741 : see if there is a vfork
10746 : Ok, but do we want to use it. vfork is reportedly unreliable in
10747 : perl on Solaris 2.x, and probably elsewhere.
10751 case "$usevfork" in
10757 Perl can only use a vfork() that doesn't suffer from strict
10758 restrictions on calling functions or modifying global data in
10759 the child. For example, glibc-2.1 contains such a vfork()
10760 that is unsuitable. If your system provides a proper fork()
10761 call, chances are that you do NOT want perl to use vfork().
10764 rp="Do you still want to use vfork()?"
10769 echo "Ok, we won't use vfork()."
10778 $define) usevfork='true';;
10779 *) usevfork='false';;
10782 : see if this is an sysdir system
10783 set sys/dir.h i_sysdir
10786 : see if this is an sysndir system
10787 set sys/ndir.h i_sysndir
10790 : see if closedir exists
10791 set closedir d_closedir
10794 case "$d_closedir" in
10797 echo "Checking whether closedir() returns a status..." >&4
10798 cat > closedir.c <<EOM
10799 #$i_dirent I_DIRENT /**/
10800 #$i_sysdir I_SYS_DIR /**/
10801 #$i_sysndir I_SYS_NDIR /**/
10802 #$i_systypes I_SYS_TYPES /**/
10804 #if defined(I_SYS_TYPES)
10805 #include <sys/types.h>
10807 #if defined(I_DIRENT)
10808 #include <dirent.h>
10809 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10810 #include <sys/dir.h>
10814 #include <sys/ndir.h>
10818 #include <ndir.h> /* may be wrong in the future */
10820 #include <sys/dir.h>
10825 int main() { return closedir(opendir(".")); }
10828 if eval $compile_ok; then
10829 if ./closedir > /dev/null 2>&1 ; then
10830 echo "Yes, it does."
10833 echo "No, it doesn't."
10837 echo "(I can't seem to compile the test program--assuming it doesn't)"
10845 set d_void_closedir
10848 : check for volatile keyword
10850 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10851 $cat >try.c <<'EOCP'
10854 typedef struct _goo_struct goo_struct;
10855 goo_struct * volatile goo = ((goo_struct *)0);
10856 struct _goo_struct {
10861 typedef unsigned short foo_t;
10862 char *volatile foo;
10864 volatile foo_t blech;
10868 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10870 echo "Yup, it does."
10873 echo "Nope, it doesn't."
10879 : see if there is a wait4
10883 : see if waitpid exists
10884 set waitpid d_waitpid
10887 : see if wcstombs exists
10888 set wcstombs d_wcstombs
10891 : see if wctomb exists
10892 set wctomb d_wctomb
10895 : see if writev exists
10896 set writev d_writev
10899 : preserve RCS keywords in files with variable substitution, grrr
10904 Revision='$Revision'
10906 case "$crosscompile" in
10907 ''|[nN]*) crosscompile="$undef" ;;
10911 next|rhapsody) multiarch="$define" ;;
10913 case "$multiarch" in
10914 ''|[nN]*) multiarch="$undef" ;;
10917 : check for alignment requirements
10919 case "$crosscompile$multiarch" in
10922 You seem to be either cross-compiling or doing a multiarchitecture build,
10923 skipping the memory alignment check.
10926 case "$alignbytes" in
10927 '') alignbytes=8 ;;
10931 case "$alignbytes" in
10932 '') echo "Checking alignment constraints..." >&4
10933 $cat >try.c <<'EOCP'
10940 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10944 if eval $compile_ok; then
10948 echo "(I can't seem to compile the test program...)"
10951 *) dflt="$alignbytes"
10954 rp="Doubles must be aligned on a how-many-byte boundary?"
10962 : check for ordering of bytes in a long
10964 case "$crosscompile$multiarch" in
10967 You seem to be either cross-compiling or doing a multiarchitecture build,
10968 skipping the byteorder check.
10974 case "$byteorder" in
10977 In the following, larger digits indicate more significance. A big-endian
10978 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10979 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10980 machines may have weird orders like 3412. A Cray will report 87654321,
10981 an Alpha will report 12345678. If the test program works the default is
10983 I'm now running the test program...
10985 $cat >try.c <<'EOCP'
10992 char c[sizeof(long)];
10995 if (sizeof(long) > 4)
10996 u.l = (0x08070605L << 32) | 0x04030201L;
10999 for (i = 0; i < sizeof(long); i++)
11000 printf("%c", u.c[i]+'0');
11007 if eval $compile && ./try > /dev/null; then
11010 [1-4][1-4][1-4][1-4]|12345678|87654321)
11011 echo "(The test program ran ok.)"
11012 echo "byteorder=$dflt"
11015 ????|????????) echo "(The test program ran ok.)" ;;
11016 *) echo "(The test program didn't run right for some reason.)" ;;
11021 (I can't seem to compile the test program. Guessing big-endian...)
11024 case "$xxx_prompt" in
11026 rp="What is the order of bytes in a long?"
11040 : how do we catenate cpp tokens here?
11042 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11043 $cat >cpp_stuff.c <<'EOCP'
11044 #define RCAT(a,b)a/**/b
11045 #define ACAT(a,b)a ## b
11049 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11050 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11051 echo "Oh! Smells like ANSI's been here." >&4
11052 echo "We can catify or stringify, separately or together!"
11054 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11055 echo "Ah, yes! The good old days!" >&4
11056 echo "However, in the good old days we don't know how to stringify and"
11057 echo "catify at the same time."
11061 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11062 to have to edit the values of CAT[2-5] in config.h...
11064 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11068 : see if this is a db.h system
11074 : Check db version.
11076 echo "Checking Berkeley DB version ..." >&4
11082 #include <sys/types.h>
11087 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11088 int Major, Minor, Patch ;
11089 unsigned long Version ;
11090 (void)db_version(&Major, &Minor, &Patch) ;
11091 printf("You have Berkeley DB Version 2 or greater\n");
11093 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11094 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11095 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11096 Major, Minor, Patch) ;
11098 /* check that db.h & libdb are compatible */
11099 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11100 printf("db.h and libdb are incompatible\n") ;
11104 printf("db.h and libdb are compatible\n") ;
11106 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11107 + DB_VERSION_PATCH ;
11109 /* needs to be >= 2.3.4 */
11110 if (Version < 2003004) {
11111 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11112 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11118 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11119 printf("You have Berkeley DB Version 1\n");
11120 exit(0); /* DB version < 2: the coast is clear. */
11122 exit(1); /* <db.h> not Berkeley DB? */
11128 if eval $compile && ./try; then
11129 echo 'Looks OK.' >&4
11131 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11135 : Remove db from list of libraries to use
11136 echo "Removing unusable -ldb from library list" >&4
11137 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11140 echo "libs = $libs" >&4
11150 : Check the return type needed for hash
11152 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11158 #include <sys/types.h>
11161 #ifndef DB_VERSION_MAJOR
11162 u_int32_t hash_cb (ptr, size)
11170 info.hash = hash_cb;
11174 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11175 if $contains warning try.out >>/dev/null 2>&1 ; then
11178 db_hashtype='u_int32_t'
11181 : XXX Maybe we should just give up here.
11182 db_hashtype=u_int32_t
11184 echo "Help: I can't seem to compile the db test program." >&4
11185 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11188 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11190 *) db_hashtype=u_int32_t
11195 : Check the return type needed for prefix
11197 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11203 #include <sys/types.h>
11206 #ifndef DB_VERSION_MAJOR
11207 size_t prefix_cb (key1, key2)
11215 info.prefix = prefix_cb;
11219 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11220 if $contains warning try.out >>/dev/null 2>&1 ; then
11221 db_prefixtype='int'
11223 db_prefixtype='size_t'
11226 db_prefixtype='size_t'
11227 : XXX Maybe we should just give up here.
11229 echo "Help: I can't seem to compile the db test program." >&4
11230 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11233 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11235 *) db_prefixtype='size_t'
11239 : check for void type
11241 echo "Checking to see how well your C compiler groks the void type..." >&4
11242 case "$voidflags" in
11244 $cat >try.c <<'EOCP'
11250 extern void moo(); /* function returning void */
11251 void (*goo)(); /* ptr to func returning void */
11253 void *hue; /* generic ptr */
11266 int main() { sub(); }
11268 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11269 voidflags=$defvoidused
11270 echo "Good. It appears to support void to the level $package wants.">&4
11271 if $contains warning .out >/dev/null 2>&1; then
11272 echo "However, you might get some warnings that look like this:"
11276 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11277 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11278 echo "It supports 1..."
11279 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11280 echo "It also supports 2..."
11281 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11283 echo "And it supports 4 but not 8 definitely."
11285 echo "It doesn't support 4..."
11286 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11288 echo "But it supports 8."
11291 echo "Neither does it support 8."
11295 echo "It does not support 2..."
11296 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11298 echo "But it supports 4 and 8."
11300 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11302 echo "And it supports 4 but has not heard about 8."
11304 echo "However it supports 8 but not 4."
11309 echo "There is no support at all for void."
11314 case "$voidflags" in
11316 *) $cat >&4 <<'EOM'
11317 Support flag bits are:
11318 1: basic void declarations.
11319 2: arrays of pointers to functions returning void.
11320 4: operations between pointers to and addresses of void functions.
11321 8: generic void pointers.
11324 rp="Your void support flags add up to what?"
11332 : How can we generate normalized random numbers ?
11334 echo "Looking for a random number function..." >&4
11335 case "$randfunc" in
11337 if set drand48 val -f; eval $csym; $val; then
11339 echo "Good, found drand48()." >&4
11340 elif set random val -f; eval $csym; $val; then
11342 echo "OK, found random()." >&4
11345 echo "Yick, looks like I have to use rand()." >&4
11356 *-Dmy_rand=*|*-Dmy_srand=*)
11357 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11358 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11359 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11360 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11364 while $test "$cont"; do
11365 rp="Use which function to generate random numbers?"
11367 if $test "$ans" = "$dflt"; then
11373 if set $ans val -f; eval $csym; $val; then
11377 rp="I cannot find function $ans. Use that name anyway?"
11386 case "$randfunc" in
11388 drand01="drand48()"
11394 case "$randbits" in
11396 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11398 #$i_unistd I_UNISTD
11399 #$i_stdlib I_STDLIB
11402 # include <unistd.h>
11405 # include <stdlib.h>
11410 register unsigned long tmp;
11411 register unsigned long max = 0L;
11413 for (i = 1000; i; i--) {
11414 tmp = (unsigned long) $randfunc();
11415 if (tmp > max) max = tmp;
11417 for (i = 0; max; i++)
11423 if eval $compile_ok; then
11427 echo "(I can't seem to compile the test program...)"
11434 rp="How many bits does your $randfunc() function produce?"
11438 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11439 seedfunc="s$randfunc"
11440 randseedtype=unsigned
11444 rp="How many bits does your $randfunc() function produce?"
11447 seedfunc="s$randfunc"
11448 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11449 if set $seedfunc val -f; eval $csym; $val; then
11450 echo "(Using $seedfunc() to seed random generator)"
11452 echo "(Warning: no $seedfunc() to seed random generator)"
11455 randseedtype=unsigned
11463 echo "Determining whether or not we are on an EBCDIC system..." >&4
11464 $cat >tebcdic.c <<'EOM'
11467 if ('M'==0xd4) return 0;
11474 if eval $compile_ok; then
11476 echo "You have EBCDIC." >&4
11479 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11482 echo "I'm unable to compile the test program." >&4
11483 echo "I'll assume ASCII or some ISO Latin." >&4
11485 $rm -f tebcdic.c tebcdic
11491 Checking how to flush all pending stdio output...
11493 # I only know how to find the first 32 possibly open files on SunOS.
11494 # See also hints/sunos_4_1.sh and util.c --AD
11496 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11498 $cat >>try.c <<EOCP
11500 #$i_unistd I_UNISTD
11502 # include <unistd.h>
11504 #$d_sysconf HAS_SYSCONF
11505 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11506 #ifdef HAS_STDIO_STREAM_ARRAY
11507 # define STDIO_STREAM_ARRAY $stdio_stream_array
11510 FILE* p = fopen("try.out", "w");
11514 # ifdef TRY_FPRINTF
11518 #ifdef TRY_FFLUSH_NULL
11521 #ifdef TRY_FFLUSH_ALL
11523 long open_max = -1;
11524 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11525 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11527 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11528 open_max = sysconf(_SC_OPEN_MAX);
11531 open_max = FOPEN_MAX;
11534 open_max = OPEN_MAX;
11543 # ifdef HAS_STDIO_STREAM_ARRAY
11544 if (open_max > 0) {
11546 for (i = 0; i < open_max; i++)
11547 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11548 STDIO_STREAM_ARRAY[i]._file < open_max &&
11549 STDIO_STREAM_ARRAY[i]._flag)
11550 fflush(&STDIO_STREAM_ARRAY[i]);
11558 : first we have to find out how _not_ to flush
11559 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11561 set try -DTRY_FPUTC
11562 if eval $compile; then
11564 ./try$exe_ext 2>/dev/null
11565 if $test ! -s try.out -a "X$?" = X42; then
11571 set try -DTRY_FPRINTF
11573 if eval $compile; then
11575 ./try$exe_ext 2>/dev/null
11576 if $test ! -s try.out -a "X$?" = X42; then
11577 output=-DTRY_FPRINTF
11583 : check for fflush NULL behaviour
11584 case "$fflushNULL" in
11585 '') set try -DTRY_FFLUSH_NULL $output
11586 if eval $compile; then
11588 ./try$exe_ext 2>/dev/null
11590 if $test -s try.out -a "X$code" = X42; then
11591 fflushNULL="`$cat try.out`"
11593 if $test "X$code" != X42; then
11595 (If this test failed, don't worry, we'll try another method shortly.)
11600 $rm -f core try.core core.try.*
11601 case "$fflushNULL" in
11603 Your fflush(NULL) works okay.
11605 fflushNULL="$define"
11608 Your fflush(NULL) isn't working (contrary to ANSI C).
11610 fflushNULL="$undef"
11613 Cannot figure out whether your fflush(NULL) works or not.
11614 I'm assuming it doesn't (contrary to ANSI C).
11616 fflushNULL="$undef"
11620 $define|true|[yY]*)
11621 fflushNULL="$define"
11624 fflushNULL="$undef"
11627 : check explicit looping only if NULL did not work
11628 case "$fflushNULL" in
11630 : check for fflush all behaviour
11631 case "$fflushall" in
11632 '') set try -DTRY_FFLUSH_ALL $output
11633 if eval $compile; then
11635 (Now testing the other method--but note that also this may fail.)
11638 ./try$exe_ext 2>/dev/null
11639 if $test -s try.out -a "X$?" = X42; then
11640 fflushall="`$cat try.out`"
11643 $rm -f core try.core core.try.*
11644 case "$fflushall" in
11646 Whew. Flushing explicitly all the stdio streams works.
11648 fflushall="$define"
11651 Sigh. Flushing explicitly all the stdio streams doesn't work.
11656 Cannot figure out whether flushing stdio streams explicitly works or not.
11657 I'm assuming it doesn't.
11663 "$define"|true|[yY]*)
11664 fflushall="$define"
11671 *) fflushall="$undef"
11674 case "$fflushNULL$fflushall" in
11677 I cannot figure out how to flush pending stdio output.
11681 $rm -f try.* try$exe_ext
11683 : see what type file positions are declared as in the library
11684 rp="What is the type for file position used by fsetpos()?"
11685 set fpos_t fpostype long stdio.h sys/types.h
11688 : Store the full pathname to the ar program for use in the C program
11689 : Respect a hint or command line value for full_ar.
11694 : Store the full pathname to the sed program for use in the C program
11697 : see what type gids are declared as in the kernel
11699 echo "Looking for the type for group ids returned by getgid()."
11700 set gid_t gidtype xxx stdio.h sys/types.h
11704 xxx=`./findhdr sys/user.h`
11705 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11707 unsigned) dflt="$1 $2" ;;
11711 *) dflt="$gidtype";;
11714 gid_t) echo "gid_t found." ;;
11715 *) rp="What is the type for group ids returned by getgid()?"
11721 : see if getgroups exists
11722 set getgroups d_getgrps
11725 : see if setgroups exists
11726 set setgroups d_setgrps
11730 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11732 case "$d_getgrps$d_setgrps" in
11734 case "$groupstype" in
11735 '') dflt="$gidtype" ;;
11736 *) dflt="$groupstype" ;;
11739 What type of pointer is the second argument to getgroups() and setgroups()?
11740 Usually this is the same as group ids, $gidtype, but not always.
11743 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11747 *) groupstype="$gidtype";;
11750 : see what type lseek is declared as in the kernel
11751 rp="What is the type used for lseek's offset on this system?"
11752 set off_t lseektype long stdio.h sys/types.h
11756 $echo $n "Checking to see how big your file offsets are...$c" >&4
11758 #include <sys/types.h>
11762 printf("%d\n", sizeof($lseektype));
11766 if eval $compile_ok; then
11768 $echo " $lseeksize bytes." >&4
11772 echo "(I can't seem to compile the test program. Guessing...)"
11773 rp="What is the size of your file offsets (in bytes)?"
11780 echo "Checking if your $make program sets \$(MAKE)..." >&4
11781 case "$make_set_make" in
11783 $sed 's/^X //' > testmake.mak << 'EOF'
11785 X @echo 'maketemp="$(MAKE)"'
11787 case "`$make -f testmake.mak 2>/dev/null`" in
11788 *maketemp=*) make_set_make='#' ;;
11789 *) make_set_make="MAKE=$make" ;;
11791 $rm -f testmake.mak
11794 case "$make_set_make" in
11795 '#') echo "Yup, it does.";;
11796 *) echo "Nope, it doesn't.";;
11799 : see what type is used for mode_t
11800 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11801 set mode_t modetype int stdio.h sys/types.h
11804 : define a fucntion to check prototypes
11805 $cat > protochk <<EOSH
11808 optimize="$optimize"
11810 prototype="$prototype"
11815 $cat >> protochk <<'EOSH'
11820 while test $# -ge 2; do
11822 $define) echo "#include <$2>" >> try.c ;;
11823 literal) echo "$2" >> try.c ;;
11827 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11828 cat >> try.c <<'EOCP'
11829 #ifdef CAN_PROTOTYPE
11830 #define _(args) args
11835 echo "$foo" >> try.c
11836 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11837 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11843 $eunicefix protochk
11845 : see what type is used for size_t
11846 rp="What is the type used for the length parameter for string functions?"
11847 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11850 : check for type of arguments to gethostbyaddr.
11851 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11852 case "$d_gethbyaddr" in
11856 Checking to see what type of arguments are accepted by gethostbyaddr().
11858 hdrs="$define sys/types.h
11859 $d_socket sys/socket.h
11860 $i_niin netinet/in.h
11862 $i_unistd unistd.h"
11863 : The first arg can 'char *' or 'void *'
11864 : The second arg is some of integral type
11865 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11866 for yyy in size_t long int; do
11867 case "$netdb_host_type" in
11868 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11869 if ./protochk "$try" $hdrs; then
11870 echo "Your system accepts $xxx for the first arg."
11871 echo "...and $yyy for the second arg."
11872 netdb_host_type="$xxx"
11873 netdb_hlen_type="$yyy"
11879 : In case none of those worked, prompt the user.
11880 case "$netdb_host_type" in
11881 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11884 netdb_host_type=$ans
11885 rp='What is the type for the 2nd argument to gethostbyaddr?'
11888 netdb_hlen_type=$ans
11892 *) : no gethostbyaddr, so pick harmless defaults
11893 netdb_host_type='char *'
11894 netdb_hlen_type="$sizetype"
11897 # Remove the "const" if needed. -- but then we'll have a
11899 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11902 : check for type of argument to gethostbyname.
11903 if test "X$netdb_name_type" = X ; then
11904 case "$d_gethbyname" in
11908 Checking to see what type of argument is accepted by gethostbyname().
11910 hdrs="$define sys/types.h
11911 $d_socket sys/socket.h
11912 $i_niin netinet/in.h
11914 $i_unistd unistd.h"
11915 for xxx in "const char *" "char *"; do
11916 case "$netdb_name_type" in
11917 '') try="extern struct hostent *gethostbyname($xxx);"
11918 if ./protochk "$try" $hdrs; then
11919 echo "Your system accepts $xxx."
11920 netdb_name_type="$xxx"
11925 : In case none of those worked, prompt the user.
11926 case "$netdb_name_type" in
11927 '') rp='What is the type for the 1st argument to gethostbyname?'
11930 netdb_name_type=$ans
11934 *) : no gethostbyname, so pick harmless default
11935 netdb_name_type='char *'
11940 : check for type of 1st argument to getnetbyaddr.
11941 if test "X$netdb_net_type" = X ; then
11942 case "$d_getnbyaddr" in
11946 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11948 hdrs="$define sys/types.h
11949 $d_socket sys/socket.h
11950 $i_niin netinet/in.h
11952 $i_unistd unistd.h"
11953 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11954 case "$netdb_net_type" in
11955 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11956 if ./protochk "$try" $hdrs; then
11957 echo "Your system accepts $xxx."
11958 netdb_net_type="$xxx"
11963 : In case none of those worked, prompt the user.
11964 case "$netdb_net_type" in
11965 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11968 netdb_net_type=$ans
11972 *) : no getnetbyaddr, so pick harmless default
11973 netdb_net_type='long'
11977 : locate the preferred pager for this system
11991 '') dflt=/usr/ucb/more;;
11998 rp='What pager is used on your system?'
12002 : see what type pids are declared as in the kernel
12003 rp="What is the type of process ids on this system?"
12004 set pid_t pidtype int stdio.h sys/types.h
12007 : Find earliest binary compatible site_perl subdirectory perl can use.
12008 case "$bincompat5005" in
12009 "$define") xs_apiversion='5.005' ;;
12010 *) xs_apiversion=$apiversion ;; # The current site_perl version.
12012 : Find earliest pure perl site_perl subdirectory perl can use.
12013 : The versioned directories started at 5.005.
12014 pm_apiversion='5.005'
12016 : check for length of pointer
12020 $echo $n "Checking to see how big your pointers are...$c" >&4
12021 if test "$voidflags" -gt 7; then
12022 echo '#define VOID_PTR char *' > try.c
12024 echo '#define VOID_PTR void *' > try.c
12026 $cat >>try.c <<'EOCP'
12030 printf("%d\n", sizeof(VOID_PTR));
12035 if eval $compile_ok; then
12037 $echo " $ptrsize bytes." >&4
12040 echo "(I can't seem to compile the test program. Guessing...)" >&4
12041 rp="What is the size of a pointer (in bytes)?"
12049 : see if ar generates random libraries by itself
12051 echo "Checking how to generate random libraries on your machine..." >&4
12052 echo 'int bar1() { return bar2(); }' > bar1.c
12053 echo 'int bar2() { return 2; }' > bar2.c
12054 $cat > foo.c <<'EOP'
12055 int main() { printf("%d\n", bar1()); exit(0); }
12057 $cc $ccflags -c bar1.c >/dev/null 2>&1
12058 $cc $ccflags -c bar2.c >/dev/null 2>&1
12059 $cc $ccflags -c foo.c >/dev/null 2>&1
12060 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12061 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12062 ./foobar >/dev/null 2>&1; then
12063 echo "$ar appears to generate random libraries itself."
12066 elif $ar ts bar$_a >/dev/null 2>&1 &&
12067 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12068 ./foobar >/dev/null 2>&1; then
12069 echo "a table of contents needs to be added with '$ar ts'."
12076 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12077 $test -f $ranlib || ranlib=''
12080 if $test -n "$ranlib"; then
12081 echo "your system has '$ranlib'; we'll use that."
12084 echo "your system doesn't seem to support random libraries"
12085 echo "so we'll use lorder and tsort to order the libraries."
12092 : check for type of arguments to select.
12093 case "$selecttype" in
12094 '') case "$d_select" in
12097 Checking to see what type of arguments are accepted by select().
12099 hdrs="$define sys/types.h
12100 $i_systime sys/time.h
12101 $i_sysselct sys/select.h
12102 $d_socket sys/socket.h"
12103 : The first arg can be int, unsigned, or size_t
12104 : The last arg may or may not be 'const'
12106 : void pointer has been seen but using that
12107 : breaks the selectminbits test
12108 for xxx in 'fd_set *' 'int *'; do
12109 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12110 for tmo in 'struct timeval *' 'const struct timeval *'; do
12112 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12113 if ./protochk "$try" $hdrs; then
12114 echo "Your system accepts $xxx."
12123 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12124 case "$d_fd_set" in
12125 $define) dflt="fd_set *" ;;
12134 *) : no select, so pick a harmless default
12141 : check for the select 'width'
12142 case "$selectminbits" in
12143 '') case "$d_select" in
12147 Checking to see on how many bits at a time your select() operates...
12150 #include <sys/types.h>
12152 #$i_systime I_SYS_TIME
12153 #$i_systimek I_SYS_TIME_KERNEL
12158 # ifdef I_SYS_TIME_KERNEL
12161 # include <sys/time.h>
12162 # ifdef I_SYS_TIME_KERNEL
12166 #$i_sysselct I_SYS_SELECT
12167 #ifdef I_SYS_SELECT
12168 #include <sys/select.h>
12170 #$d_socket HAS_SOCKET
12172 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12176 #define S sizeof(*(b))
12178 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12179 #define NBITS (NBYTES * 8)
12188 fp = fopen("try.c", "r");
12194 b = ($selecttype)s;
12195 for (i = 0; i < NBITS; i++)
12199 select(fd + 1, b, 0, 0, &t);
12200 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12201 printf("%d\n", i + 1);
12206 if eval $compile_ok; then
12207 selectminbits=`./try`
12208 case "$selectminbits" in
12210 Cannot figure out on how many bits at a time your select() operates.
12211 I'll play safe and guess it is 32 bits.
12217 *) bits="$selectminbits bits" ;;
12219 echo "Your select() operates on $bits at a time." >&4
12221 rp='What is the minimum number of bits your select() operates on?'
12222 case "$byteorder" in
12223 1234|12345678) dflt=32 ;;
12228 selectminbits="$val"
12232 *) : no select, so pick a harmless default
12239 : Trace out the files included by signal.h, then look for SIGxxx names.
12240 : Remove SIGARRAYSIZE used by HPUX.
12241 : Remove SIGSTKSIZE used by Linux.
12242 : Remove SIGSTKSZ used by Posix.
12243 : Remove SIGTYP void lines used by OS2.
12244 xxx=`echo '#include <signal.h>' |
12245 $cppstdin $cppminus $cppflags 2>/dev/null |
12246 $grep '^[ ]*#.*include' |
12247 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12248 : Check this list of files to be sure we have parsed the cpp output ok.
12249 : This will also avoid potentially non-existent files, such
12252 for xx in $xxx /dev/null ; do
12253 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12255 : If we have found no files, at least try signal.h
12256 case "$xxxfiles" in
12257 '') xxxfiles=`./findhdr signal.h` ;;
12260 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12261 print substr($2, 4, 20)
12263 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12264 print substr($3, 4, 20)
12266 : Append some common names just in case the awk scan failed.
12267 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12268 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12269 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12270 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12271 : generate a few handy files for later
12272 $cat > signal.c <<'EOCP'
12273 #include <sys/types.h>
12274 #include <signal.h>
12278 /* Strange style to avoid deeply-nested #if/#else/#endif */
12281 # define NSIG (_NSIG)
12287 # define NSIG (SIGMAX+1)
12293 # define NSIG (SIG_MAX+1)
12299 # define NSIG (MAXSIG+1)
12305 # define NSIG (MAX_SIG+1)
12310 # ifdef SIGARRAYSIZE
12311 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12317 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12321 /* Default to some arbitrary number that's big enough to get most
12322 of the common signals.
12328 printf("NSIG %d\n", NSIG);
12334 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12336 printf "#ifdef SIG"; printf $1; printf "\n"
12337 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12338 printf $1; printf ");\n"
12342 printf "#endif /* JUST_NSIG */\n";
12346 $cat >signal.awk <<'EOP'
12347 BEGIN { ndups = 0 }
12348 $1 ~ /^NSIG$/ { nsig = $2 }
12349 ($1 !~ /^NSIG$/) && (NF == 2) {
12350 if ($2 > maxsig) { maxsig = $2 }
12351 if (sig_name[$2]) {
12352 dup_name[ndups] = $1
12353 dup_num[ndups] = $2
12365 printf("NSIG %d\n", nsig);
12366 for (n = 1; n < nsig; n++) {
12368 printf("%s %d\n", sig_name[n], sig_num[n])
12371 printf("NUM%d %d\n", n, n)
12374 for (n = 0; n < ndups; n++) {
12375 printf("%s %d\n", dup_name[n], dup_num[n])
12379 $cat >signal_cmd <<EOS
12381 if $test -s signal.lst; then
12382 echo "Using your existing signal.lst file"
12387 $cat >>signal_cmd <<'EOS'
12390 if eval $compile_ok; then
12391 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12393 echo "(I can't seem be able to compile the whole test program)" >&4
12394 echo "(I'll try it in little pieces.)" >&4
12395 set signal -DJUST_NSIG
12396 if eval $compile_ok; then
12397 ./signal$_exe > signal.nsg
12400 echo "I can't seem to figure out how many signals you have." >&4
12401 echo "Guessing 50." >&4
12402 echo 'NSIG 50' > signal.nsg
12404 : Now look at all the signal names, one at a time.
12405 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12406 $cat > signal.c <<EOCP
12407 #include <sys/types.h>
12408 #include <signal.h>
12411 printf("$xx %d\n", SIG${xx});
12416 if eval $compile; then
12417 echo "SIG${xx} found."
12418 ./signal$_exe >> signal.ls1
12420 echo "SIG${xx} NOT found."
12423 if $test -s signal.ls1; then
12424 $cat signal.nsg signal.ls1 |
12425 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12429 if $test -s signal.lst; then
12432 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12433 echo 'kill -l' >signal
12434 set X `csh -f <signal`
12438 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12440 echo $@ | $tr ' ' $trnl | \
12441 $awk '{ printf "%s %d\n", $1, ++s; }
12442 END { printf "NSIG %d\n", ++s }' >signal.lst
12444 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12446 chmod a+x signal_cmd
12447 $eunicefix signal_cmd
12449 : generate list of signal names
12451 case "$sig_name_init" in
12453 *) case "$sig_num_init" in
12454 ''|*,*) doinit=yes ;;
12459 echo "Generating a list of signal names and numbers..." >&4
12461 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12462 sig_name=`$awk 'BEGIN { printf "ZERO " }
12463 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12464 sig_num=`$awk 'BEGIN { printf "0 " }
12465 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12466 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12467 !/^NSIG/ { printf "\"%s\", ", $1 }
12468 END { printf "0\n" }' signal.lst`
12469 sig_num_init=`$awk 'BEGIN { printf "0, " }
12470 !/^NSIG/ { printf "%d, ", $2}
12471 END { printf "0\n"}' signal.lst`
12474 echo "The following $sig_count signals are available:"
12476 echo $sig_name | $awk \
12477 'BEGIN { linelen = 0 }
12479 for (i = 1; i <= NF; i++) {
12480 name = "SIG" $i " "
12481 linelen = linelen + length(name)
12482 if (linelen > 70) {
12484 linelen = length(name)
12490 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12492 : see what type is used for signed size_t
12493 set ssize_t ssizetype int stdio.h sys/types.h
12496 $cat > ssize.c <<EOM
12498 #include <sys/types.h>
12499 #define Size_t $sizetype
12500 #define SSize_t $dflt
12503 if (sizeof(Size_t) == sizeof(SSize_t))
12505 else if (sizeof(Size_t) == sizeof(int))
12514 if eval $compile_ok && ./ssize > /dev/null; then
12515 ssizetype=`./ssize`
12516 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12519 Help! I can't compile and run the ssize_t test program: please enlighten me!
12520 (This is probably a misconfiguration in your system or libraries, and
12521 you really ought to fix it. Still, I'll try anyway.)
12523 I need a type that is the same size as $sizetype, but is guaranteed to
12524 be signed. Common values are ssize_t, int and long.
12527 rp="What signed type is the same size as $sizetype?"
12531 $rm -f ssize ssize.*
12533 : see what type of char stdio uses.
12535 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12536 echo "Your stdio uses unsigned chars." >&4
12537 stdchar="unsigned char"
12539 echo "Your stdio uses signed chars." >&4
12543 : see if time exists
12545 if test "X$d_time" = X -o X"$timetype" = X; then
12546 if set time val -f d_time; eval $csym; $val; then
12547 echo 'time() found.' >&4
12549 rp="What is the type returned by time() on this system?"
12550 set time_t timetype long stdio.h sys/types.h
12553 echo 'time() not found, hope that will do.' >&4
12561 : see what type uids are declared as in the kernel
12563 echo "Looking for the type for user ids returned by getuid()."
12564 set uid_t uidtype xxx stdio.h sys/types.h
12568 xxx=`./findhdr sys/user.h`
12569 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12571 unsigned) dflt="$1 $2" ;;
12575 *) dflt="$uidtype";;
12578 uid_t) echo "uid_t found." ;;
12579 *) rp="What is the type for user ids returned by getuid()?"
12587 *_t) zzz="$uidtype" ;;
12590 echo "Checking the sign of $zzz..." >&4
12592 #include <sys/types.h>
12603 if eval $compile; then
12607 echo "(I can't execute the test program--guessing unsigned.)" >&4
12611 1) echo "Your $zzz is unsigned." ;;
12612 -1) echo "Your $zzz is signed." ;;
12618 echo "(I can't compile the test program--guessing unsigned.)" >&4
12622 : see if dbm.h is available
12623 : see if dbmclose exists
12624 set dbmclose d_dbmclose
12627 case "$d_dbmclose" in
12637 *) set rpcsvc/dbm.h i_rpcsvcdbm
12642 *) echo "We won't be including <dbm.h>"
12652 : see if this is a sys/file.h system
12657 : do we need to include sys/file.h ?
12661 if $h_sysfile; then
12663 echo "We'll be including <sys/file.h>." >&4
12666 echo "We won't be including <sys/file.h>." >&4
12676 : see if fcntl.h is there
12681 : see if we can include fcntl.h
12687 echo "We'll be including <fcntl.h>." >&4
12690 if $h_sysfile; then
12691 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12693 echo "We won't be including <fcntl.h>." >&4
12705 : see if locale.h is available
12706 set locale.h i_locale
12709 : see if mach cthreads are available
12710 if test "X$usethreads" = "X$define"; then
12711 set mach/cthreads.h i_machcthr
12714 i_machcthr="$undef"
12719 : see if this is a math.h system
12723 : see if this is a mntent.h system
12724 set mntent.h i_mntent
12727 : see if ndbm.h is available
12732 : see if dbm_open exists
12733 set dbm_open d_dbm_open
12735 case "$d_dbm_open" in
12738 echo "We won't be including <ndbm.h>"
12747 : see if net/errno.h is available
12749 set net/errno.h val
12752 : Unfortunately, it causes problems on some systems. Arrgh.
12755 cat > try.c <<'EOM'
12758 #include <net/errno.h>
12764 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12765 echo "We'll be including <net/errno.h>." >&4
12767 echo "We won't be including <net/errno.h>." >&4
12776 : see if netinet/tcp.h is available
12777 set netinet/tcp.h i_netinettcp
12780 : see if this is a poll.h system
12784 : get C preprocessor symbols handy
12786 $echo $n "Hmm... $c"
12787 echo $al | $tr ' ' $trnl >Cppsym.know
12788 $cat <<EOSS >Cppsym
12796 case "\$list\$#" in
12799 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12801 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12804 unknown="\$unknown \$sym"
12814 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12816 exit 0; _ _ _ _\1\\ \1\\
12819 echo "exit 1; _ _ _" >>Cppsym\$\$
12820 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12822 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12828 $rm -f Cppsym\$\$ Cppsym2\$\$
12833 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12835 : now check the C compiler for additional symbols
12836 postprocess_cc_v=''
12838 aix) postprocess_cc_v="|$tr , ' '" ;;
12845 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12848 -D*) echo "\$i" | $sed 's/^-D//';;
12849 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12854 postprocess_cc_v=''
12857 ./ccsym > ccsym1.raw
12858 if $test -s ccsym1.raw; then
12859 $sort ccsym1.raw | $uniq >ccsym.raw
12861 mv ccsym1.raw ccsym.raw
12864 $awk '/\=/ { print $0; next }
12865 { print $0"=1" }' ccsym.raw >ccsym.list
12866 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12867 $comm -13 ccsym.true ccsym.list >ccsym.own
12868 $comm -12 ccsym.true ccsym.list >ccsym.com
12869 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12871 if $test -z ccsym.raw; then
12872 echo "Your C compiler doesn't seem to define any symbols!" >&4
12874 echo "However, your C preprocessor defines the following symbols:"
12877 cppsymbols=`$cat Cppsym.true`
12878 cppsymbols=`echo $cppsymbols`
12879 cppccsymbols="$cppsymbols"
12881 if $test -s ccsym.com; then
12882 echo "Your C compiler and pre-processor define these symbols:"
12883 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12886 cppccsymbols=`$cat ccsym.com`
12887 cppccsymbols=`echo $cppccsymbols`
12888 $test "$silent" || sleep 1
12890 if $test -s ccsym.cpp; then
12891 $test "$also" && echo " "
12892 echo "Your C pre-processor ${also}defines the following symbols:"
12893 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12895 cppsymbols=`$cat ccsym.cpp`
12896 cppsymbols=`echo $cppsymbols`
12897 $test "$silent" || sleep 1
12899 if $test -s ccsym.own; then
12900 $test "$also" && echo " "
12901 echo "Your C compiler ${also}defines the following cpp symbols:"
12902 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12903 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12904 ccsymbols=`$cat ccsym.own`
12905 ccsymbols=`echo $ccsymbols`
12906 $test "$silent" || sleep 1
12911 : see if this is a termio system
12915 if $test `./findhdr termios.h`; then
12916 set tcsetattr i_termios
12922 "$define") echo "You have POSIX termios.h... good!" >&4;;
12923 *) if ./Cppsym pyr; then
12924 case "`/bin/universe`" in
12925 ucb) if $test `./findhdr sgtty.h`; then
12927 echo "<sgtty.h> found." >&4
12929 echo "System is pyramid with BSD universe."
12930 echo "<sgtty.h> not found--you could have problems." >&4
12932 *) if $test `./findhdr termio.h`; then
12934 echo "<termio.h> found." >&4
12936 echo "System is pyramid with USG universe."
12937 echo "<termio.h> not found--you could have problems." >&4
12941 if $test `./findhdr termio.h`; then
12942 echo "<termio.h> found." >&4
12944 elif $test `./findhdr sgtty.h`; then
12945 echo "<sgtty.h> found." >&4
12948 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12951 if $test `./findhdr sgtty.h`; then
12952 echo "<sgtty.h> found." >&4
12954 elif $test `./findhdr termio.h`; then
12955 echo "<termio.h> found." >&4
12958 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12962 set i_termio; eval $setvar
12963 val=$val2; set i_sgtty; eval $setvar
12964 val=$val3; set i_termios; eval $setvar
12966 : see if this is a shadow.h system
12967 set shadow.h i_shadow
12970 : see if this is a socks.h system
12971 set socks.h i_socks
12974 : see if stdarg is available
12976 if $test `./findhdr stdarg.h`; then
12977 echo "<stdarg.h> found." >&4
12980 echo "<stdarg.h> NOT found." >&4
12984 : see if varags is available
12986 if $test `./findhdr varargs.h`; then
12987 echo "<varargs.h> found." >&4
12989 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12992 : set up the varargs testing programs
12993 $cat > varargs.c <<EOP
12995 #include <stdarg.h>
12998 #include <varargs.h>
13002 int f(char *p, ...)
13016 p = va_arg(ap, char *);
13021 $cat > varargs <<EOP
13023 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13032 : now check which varargs header should be included
13037 if `./varargs I_STDARG`; then
13039 elif `./varargs I_VARARGS`; then
13044 if `./varargs I_VARARGS`; then
13051 echo "I could not find the definition for va_dcl... You have problems..." >&4
13052 val="$undef"; set i_stdarg; eval $setvar
13053 val="$undef"; set i_varargs; eval $setvar
13058 case "$i_varhdr" in
13060 val="$define"; set i_stdarg; eval $setvar
13061 val="$undef"; set i_varargs; eval $setvar
13064 val="$undef"; set i_stdarg; eval $setvar
13065 val="$define"; set i_varargs; eval $setvar
13068 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13072 : see if stddef is available
13073 set stddef.h i_stddef
13076 : see if sys/access.h is available
13077 set sys/access.h i_sysaccess
13080 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13081 set sys/filio.h i_sysfilio
13084 if $test `./findhdr sys/ioctl.h`; then
13086 echo '<sys/ioctl.h> found.' >&4
13089 if $test $i_sysfilio = "$define"; then
13090 echo '<sys/ioctl.h> NOT found.' >&4
13092 $test $i_sgtty = "$define" && xxx="sgtty.h"
13093 $test $i_termio = "$define" && xxx="termio.h"
13094 $test $i_termios = "$define" && xxx="termios.h"
13095 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13101 : see if sys/resource.h has to be included
13102 set sys/resource.h i_sysresrc
13105 : see if sys/security.h is available
13106 set sys/security.h i_syssecrt
13109 : see if this is a sys/statvfs.h system
13110 set sys/statvfs.h i_sysstatvfs
13113 : see if this is a sys/un.h system
13114 set sys/un.h i_sysun
13117 : see if this is a syswait system
13118 set sys/wait.h i_syswait
13121 : see if this is an utime system
13122 set utime.h i_utime
13125 : see if this is a values.h system
13126 set values.h i_values
13129 : see if this is a vfork system
13132 set vfork.h i_vfork
13140 : see if gdbm.h is available
13145 : see if gdbm_open exists
13146 set gdbm_open d_gdbm_open
13148 case "$d_gdbm_open" in
13151 echo "We won't be including <gdbm.h>"
13161 echo "Looking for extensions..." >&4
13162 : If we are using the old config.sh, known_extensions may contain
13163 : old or inaccurate or duplicate values.
13164 known_extensions=''
13165 nonxs_extensions=''
13166 : We do not use find because it might not be available.
13167 : We do not just use MANIFEST because the user may have dropped
13168 : some additional extensions into the source tree and expect them
13171 : Function to recursively find available extensions, ignoring DynaLoader
13172 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13176 DynaLoader|dynaload) ;;
13178 if $test -f $xxx/$xxx.xs; then
13179 known_extensions="$known_extensions $1$xxx";
13180 elif $test -f $xxx/Makefile.PL; then
13181 nonxs_extensions="$nonxs_extensions $1$xxx";
13183 if $test -d $xxx -a $# -lt 10; then
13186 eval $find_extensions;
13198 eval $find_extensions
13199 set X $nonxs_extensions
13201 nonxs_extensions="$*"
13202 set X $known_extensions
13204 known_extensions="$*"
13207 : Now see which are supported on this system.
13209 for xxx in $known_extensions ; do
13213 $define) avail_ext="$avail_ext $xxx" ;;
13216 GDBM_File|gdbm_fil)
13218 $define) avail_ext="$avail_ext $xxx" ;;
13221 NDBM_File|ndbm_fil)
13223 $define) avail_ext="$avail_ext $xxx" ;;
13226 ODBM_File|odbm_fil)
13227 case "${i_dbm}${i_rpcsvcdbm}" in
13228 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13232 case "$useposix" in
13233 true|define|y) avail_ext="$avail_ext $xxx" ;;
13237 case "$useopcode" in
13238 true|define|y) avail_ext="$avail_ext $xxx" ;;
13242 case "$d_socket" in
13243 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13247 case "$usethreads" in
13248 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13252 : XXX Do we need a useipcsysv variable here
13253 case "${d_msg}${d_sem}${d_shm}" in
13254 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13257 *) avail_ext="$avail_ext $xxx"
13266 : Now see which nonxs extensions are supported on this system.
13267 : For now assume all are.
13269 for xxx in $nonxs_extensions ; do
13271 *) nonxs_ext="$nonxs_ext $xxx"
13283 A number of extensions are supplied with $package. You may choose to
13284 compile these extensions for dynamic loading (the default), compile
13285 them into the $package executable (static loading), or not include
13286 them at all. Answer "none" to include no extensions.
13287 Note that DynaLoader is always built and need not be mentioned here.
13290 case "$dynamic_ext" in
13291 '') dflt="$avail_ext" ;;
13292 *) dflt="$dynamic_ext"
13293 # Perhaps we are reusing an old out-of-date config.sh.
13296 if test X"$dynamic_ext" != X"$avail_ext"; then
13298 NOTICE: Your previous config.sh list may be incorrect.
13299 The extensions now available to you are
13301 but the default list from your previous config.sh is
13313 rp="What extensions do you wish to load dynamically?"
13316 none) dynamic_ext=' ' ;;
13317 *) dynamic_ext="$ans" ;;
13320 case "$static_ext" in
13322 : Exclude those already listed in dynamic linking
13324 for xxx in $avail_ext; do
13325 case " $dynamic_ext " in
13327 *) dflt="$dflt $xxx" ;;
13334 *) dflt="$static_ext"
13341 rp="What extensions do you wish to load statically?"
13344 none) static_ext=' ' ;;
13345 *) static_ext="$ans" ;;
13350 A number of extensions are supplied with $package. Answer "none"
13351 to include no extensions.
13352 Note that DynaLoader is always built and need not be mentioned here.
13355 case "$static_ext" in
13356 '') dflt="$avail_ext" ;;
13357 *) dflt="$static_ext"
13358 # Perhaps we are reusing an old out-of-date config.sh.
13361 if test X"$static_ext" != X"$avail_ext"; then
13363 NOTICE: Your previous config.sh list may be incorrect.
13364 The extensions now available to you are
13366 but the default list from your previous config.sh is
13375 : Exclude those that are not xs extensions
13379 rp="What extensions do you wish to include?"
13382 none) static_ext=' ' ;;
13383 *) static_ext="$ans" ;;
13388 set X $dynamic_ext $static_ext $nonxs_ext
13392 : Remove build directory name from cppstdin so it can be used from
13393 : either the present location or the final installed location.
13395 : Get out of the UU directory to get correct path name.
13397 case "$cppstdin" in
13399 echo "Stripping down cppstdin path name"
13405 : end of configuration questions
13407 echo "End of configuration questions."
13410 : back to where it started
13411 if test -d ../UU; then
13415 : configuration may be patched via a 'config.over' file
13416 if $test -f config.over; then
13419 rp='I see a config.over file. Do you wish to load it?'
13422 n*) echo "OK, I'll ignore it.";;
13424 echo "Configuration override changes have been loaded."
13429 : in case they want portability, strip down executable paths
13430 case "$d_portable" in
13433 echo "Stripping down executable paths..." >&4
13434 for file in $loclist $trylist; do
13436 eval $file=`basename $temp`
13441 : create config.sh file
13443 echo "Creating config.sh..." >&4
13444 $spitshell <<EOT >config.sh
13447 # This file was produced by running the Configure script. It holds all the
13448 # definitions figured out by Configure. Should you modify one of these values,
13449 # do not forget to propagate your changes by running "Configure -der". You may
13450 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13453 # Package name : $package
13454 # Source directory : $src
13455 # Configuration time: $cf_time
13456 # Configured by : $cf_by
13457 # Target system : $myuname
13467 Revision='$Revision'
13474 alignbytes='$alignbytes'
13475 ansi2knr='$ansi2knr'
13476 aphostname='$aphostname'
13477 apiversion='$apiversion'
13480 archlibexp='$archlibexp'
13481 archname64='$archname64'
13482 archname='$archname'
13483 archobjs='$archobjs'
13488 bincompat5005='$bincompat5005'
13492 byteorder='$byteorder'
13494 castflags='$castflags'
13497 cccdlflags='$cccdlflags'
13498 ccdlflags='$ccdlflags'
13500 ccsymbols='$ccsymbols'
13502 cf_email='$cf_email'
13507 clocktype='$clocktype'
13509 compress='$compress'
13510 contains='$contains'
13514 cpp_stuff='$cpp_stuff'
13515 cppccsymbols='$cppccsymbols'
13516 cppflags='$cppflags'
13518 cppminus='$cppminus'
13520 cppstdin='$cppstdin'
13521 cppsymbols='$cppsymbols'
13522 crosscompile='$crosscompile'
13523 cryptlib='$cryptlib'
13525 d_Gconvert='$d_Gconvert'
13526 d_PRIEldbl='$d_PRIEldbl'
13527 d_PRIFldbl='$d_PRIFldbl'
13528 d_PRIGldbl='$d_PRIGldbl'
13529 d_PRIX64='$d_PRIX64'
13530 d_PRId64='$d_PRId64'
13531 d_PRIeldbl='$d_PRIeldbl'
13532 d_PRIfldbl='$d_PRIfldbl'
13533 d_PRIgldbl='$d_PRIgldbl'
13534 d_PRIi64='$d_PRIi64'
13535 d_PRIo64='$d_PRIo64'
13536 d_PRIu64='$d_PRIu64'
13537 d_PRIx64='$d_PRIx64'
13538 d_access='$d_access'
13539 d_accessx='$d_accessx'
13541 d_archlib='$d_archlib'
13544 d_attribut='$d_attribut'
13547 d_bincompat5005='$d_bincompat5005'
13549 d_bsdgetpgrp='$d_bsdgetpgrp'
13550 d_bsdsetpgrp='$d_bsdsetpgrp'
13552 d_casti32='$d_casti32'
13553 d_castneg='$d_castneg'
13554 d_charvspr='$d_charvspr'
13556 d_chroot='$d_chroot'
13557 d_chsize='$d_chsize'
13558 d_closedir='$d_closedir'
13559 d_cmsghdr_s='$d_cmsghdr_s'
13563 d_cuserid='$d_cuserid'
13564 d_dbl_dig='$d_dbl_dig'
13565 d_difftime='$d_difftime'
13566 d_dirnamlen='$d_dirnamlen'
13567 d_dlerror='$d_dlerror'
13568 d_dlopen='$d_dlopen'
13569 d_dlsymun='$d_dlsymun'
13570 d_dosuid='$d_dosuid'
13571 d_drand48proto='$d_drand48proto'
13573 d_eaccess='$d_eaccess'
13574 d_endgrent='$d_endgrent'
13575 d_endhent='$d_endhent'
13576 d_endnent='$d_endnent'
13577 d_endpent='$d_endpent'
13578 d_endpwent='$d_endpwent'
13579 d_endsent='$d_endsent'
13580 d_endspent='$d_endspent'
13581 d_eofnblk='$d_eofnblk'
13582 d_eunice='$d_eunice'
13583 d_fchmod='$d_fchmod'
13584 d_fchown='$d_fchown'
13586 d_fd_macros='$d_fd_macros'
13587 d_fd_set='$d_fd_set'
13588 d_fds_bits='$d_fds_bits'
13589 d_fgetpos='$d_fgetpos'
13590 d_flexfnam='$d_flexfnam'
13593 d_fpathconf='$d_fpathconf'
13594 d_fpos64_t='$d_fpos64_t'
13595 d_fseeko='$d_fseeko'
13596 d_fsetpos='$d_fsetpos'
13597 d_fstatfs='$d_fstatfs'
13598 d_fstatvfs='$d_fstatvfs'
13599 d_ftello='$d_ftello'
13601 d_getgrent='$d_getgrent'
13602 d_getgrps='$d_getgrps'
13603 d_gethbyaddr='$d_gethbyaddr'
13604 d_gethbyname='$d_gethbyname'
13605 d_gethent='$d_gethent'
13606 d_gethname='$d_gethname'
13607 d_gethostprotos='$d_gethostprotos'
13608 d_getlogin='$d_getlogin'
13609 d_getmnt='$d_getmnt'
13610 d_getmntent='$d_getmntent'
13611 d_getnbyaddr='$d_getnbyaddr'
13612 d_getnbyname='$d_getnbyname'
13613 d_getnent='$d_getnent'
13614 d_getnetprotos='$d_getnetprotos'
13615 d_getpbyname='$d_getpbyname'
13616 d_getpbynumber='$d_getpbynumber'
13617 d_getpent='$d_getpent'
13618 d_getpgid='$d_getpgid'
13619 d_getpgrp2='$d_getpgrp2'
13620 d_getpgrp='$d_getpgrp'
13621 d_getppid='$d_getppid'
13622 d_getprior='$d_getprior'
13623 d_getprotoprotos='$d_getprotoprotos'
13624 d_getpwent='$d_getpwent'
13625 d_getsbyname='$d_getsbyname'
13626 d_getsbyport='$d_getsbyport'
13627 d_getsent='$d_getsent'
13628 d_getservprotos='$d_getservprotos'
13629 d_getspent='$d_getspent'
13630 d_getspnam='$d_getspnam'
13631 d_gettimeod='$d_gettimeod'
13632 d_gnulibc='$d_gnulibc'
13633 d_grpasswd='$d_grpasswd'
13634 d_hasmntopt='$d_hasmntopt'
13637 d_inetaton='$d_inetaton'
13638 d_int64t='$d_int64t'
13639 d_iovec_s='$d_iovec_s'
13640 d_isascii='$d_isascii'
13641 d_killpg='$d_killpg'
13642 d_lchown='$d_lchown'
13643 d_ldbl_dig='$d_ldbl_dig'
13645 d_llseek='$d_llseek'
13646 d_locconv='$d_locconv'
13648 d_longdbl='$d_longdbl'
13649 d_longlong='$d_longlong'
13651 d_madvise='$d_madvise'
13653 d_mbstowcs='$d_mbstowcs'
13654 d_mbtowc='$d_mbtowc'
13655 d_memchr='$d_memchr'
13656 d_memcmp='$d_memcmp'
13657 d_memcpy='$d_memcpy'
13658 d_memmove='$d_memmove'
13659 d_memset='$d_memset'
13661 d_mkfifo='$d_mkfifo'
13662 d_mktime='$d_mktime'
13664 d_mprotect='$d_mprotect'
13666 d_msg_ctrunc='$d_msg_ctrunc'
13667 d_msg_dontroute='$d_msg_dontroute'
13668 d_msg_oob='$d_msg_oob'
13669 d_msg_peek='$d_msg_peek'
13670 d_msg_proxy='$d_msg_proxy'
13671 d_msgctl='$d_msgctl'
13672 d_msgget='$d_msgget'
13673 d_msghdr_s='$d_msghdr_s'
13674 d_msgrcv='$d_msgrcv'
13675 d_msgsnd='$d_msgsnd'
13677 d_munmap='$d_munmap'
13678 d_mymalloc='$d_mymalloc'
13680 d_off64_t='$d_off64_t'
13681 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13682 d_oldpthreads='$d_oldpthreads'
13683 d_oldsock='$d_oldsock'
13685 d_pathconf='$d_pathconf'
13687 d_phostname='$d_phostname'
13690 d_portable='$d_portable'
13691 d_pthread_yield='$d_pthread_yield'
13693 d_pwchange='$d_pwchange'
13694 d_pwclass='$d_pwclass'
13695 d_pwcomment='$d_pwcomment'
13696 d_pwexpire='$d_pwexpire'
13697 d_pwgecos='$d_pwgecos'
13698 d_pwpasswd='$d_pwpasswd'
13699 d_pwquota='$d_pwquota'
13700 d_readdir='$d_readdir'
13701 d_readlink='$d_readlink'
13703 d_recvmsg='$d_recvmsg'
13704 d_rename='$d_rename'
13705 d_rewinddir='$d_rewinddir'
13707 d_safebcpy='$d_safebcpy'
13708 d_safemcpy='$d_safemcpy'
13709 d_sanemcmp='$d_sanemcmp'
13710 d_sched_yield='$d_sched_yield'
13711 d_scm_rights='$d_scm_rights'
13712 d_seekdir='$d_seekdir'
13713 d_select='$d_select'
13715 d_semctl='$d_semctl'
13716 d_semctl_semid_ds='$d_semctl_semid_ds'
13717 d_semctl_semun='$d_semctl_semun'
13718 d_semget='$d_semget'
13720 d_sendmsg='$d_sendmsg'
13721 d_setegid='$d_setegid'
13722 d_seteuid='$d_seteuid'
13723 d_setgrent='$d_setgrent'
13724 d_setgrps='$d_setgrps'
13725 d_sethent='$d_sethent'
13726 d_setlinebuf='$d_setlinebuf'
13727 d_setlocale='$d_setlocale'
13728 d_setnent='$d_setnent'
13729 d_setpent='$d_setpent'
13730 d_setpgid='$d_setpgid'
13731 d_setpgrp2='$d_setpgrp2'
13732 d_setpgrp='$d_setpgrp'
13733 d_setprior='$d_setprior'
13734 d_setpwent='$d_setpwent'
13735 d_setregid='$d_setregid'
13736 d_setresgid='$d_setresgid'
13737 d_setresuid='$d_setresuid'
13738 d_setreuid='$d_setreuid'
13739 d_setrgid='$d_setrgid'
13740 d_setruid='$d_setruid'
13741 d_setsent='$d_setsent'
13742 d_setsid='$d_setsid'
13743 d_setspent='$d_setspent'
13744 d_setvbuf='$d_setvbuf'
13748 d_shmatprototype='$d_shmatprototype'
13749 d_shmctl='$d_shmctl'
13751 d_shmget='$d_shmget'
13752 d_sigaction='$d_sigaction'
13753 d_sigsetjmp='$d_sigsetjmp'
13754 d_socket='$d_socket'
13755 d_sockpair='$d_sockpair'
13757 d_statblks='$d_statblks'
13758 d_statfs='$d_statfs'
13759 d_statfsflags='$d_statfsflags'
13760 d_statvfs='$d_statvfs'
13761 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13762 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13763 d_stdio_stream_array='$d_stdio_stream_array'
13764 d_stdiobase='$d_stdiobase'
13765 d_stdstdio='$d_stdstdio'
13766 d_strchr='$d_strchr'
13767 d_strcoll='$d_strcoll'
13768 d_strctcpy='$d_strctcpy'
13769 d_strerrm='$d_strerrm'
13770 d_strerror='$d_strerror'
13771 d_strtod='$d_strtod'
13772 d_strtol='$d_strtol'
13773 d_strtoul='$d_strtoul'
13774 d_strtoull='$d_strtoull'
13775 d_strxfrm='$d_strxfrm'
13776 d_suidsafe='$d_suidsafe'
13777 d_symlink='$d_symlink'
13778 d_syscall='$d_syscall'
13779 d_sysconf='$d_sysconf'
13780 d_sysernlst='$d_sysernlst'
13781 d_syserrlst='$d_syserrlst'
13782 d_system='$d_system'
13783 d_tcgetpgrp='$d_tcgetpgrp'
13784 d_tcsetpgrp='$d_tcsetpgrp'
13785 d_telldir='$d_telldir'
13786 d_telldirproto='$d_telldirproto'
13789 d_truncate='$d_truncate'
13790 d_tzname='$d_tzname'
13793 d_union_semun='$d_union_semun'
13794 d_vendorbin='$d_vendorbin'
13795 d_vendorlib='$d_vendorlib'
13797 d_void_closedir='$d_void_closedir'
13798 d_voidsig='$d_voidsig'
13799 d_voidtty='$d_voidtty'
13800 d_volatile='$d_volatile'
13801 d_vprintf='$d_vprintf'
13803 d_waitpid='$d_waitpid'
13804 d_wcstombs='$d_wcstombs'
13805 d_wctomb='$d_wctomb'
13806 d_writev='$d_writev'
13809 db_hashtype='$db_hashtype'
13810 db_prefixtype='$db_prefixtype'
13811 defvoidused='$defvoidused'
13812 direntrytype='$direntrytype'
13815 doublesize='$doublesize'
13817 dynamic_ext='$dynamic_ext'
13823 eunicefix='$eunicefix'
13826 extensions='$extensions'
13827 fflushNULL='$fflushNULL'
13828 fflushall='$fflushall'
13830 firstmakefile='$firstmakefile'
13832 fpostype='$fpostype'
13833 freetype='$freetype'
13835 full_csh='$full_csh'
13836 full_sed='$full_sed'
13837 gccversion='$gccversion'
13841 groupcat='$groupcat'
13842 groupstype='$groupstype'
13845 h_sysfile='$h_sysfile'
13849 i_arpainet='$i_arpainet'
13850 i_bsdioctl='$i_bsdioctl'
13853 i_dirent='$i_dirent'
13860 i_inttypes='$i_inttypes'
13861 i_limits='$i_limits'
13862 i_locale='$i_locale'
13863 i_machcthr='$i_machcthr'
13864 i_malloc='$i_malloc'
13866 i_memory='$i_memory'
13867 i_mntent='$i_mntent'
13870 i_neterrno='$i_neterrno'
13871 i_netinettcp='$i_netinettcp'
13874 i_pthread='$i_pthread'
13876 i_rpcsvcdbm='$i_rpcsvcdbm'
13879 i_shadow='$i_shadow'
13881 i_stdarg='$i_stdarg'
13882 i_stddef='$i_stddef'
13883 i_stdlib='$i_stdlib'
13884 i_string='$i_string'
13885 i_sysaccess='$i_sysaccess'
13886 i_sysdir='$i_sysdir'
13887 i_sysfile='$i_sysfile'
13888 i_sysfilio='$i_sysfilio'
13890 i_sysioctl='$i_sysioctl'
13891 i_sysmman='$i_sysmman'
13892 i_sysmount='$i_sysmount'
13893 i_sysndir='$i_sysndir'
13894 i_sysparam='$i_sysparam'
13895 i_sysresrc='$i_sysresrc'
13896 i_syssecrt='$i_syssecrt'
13897 i_sysselct='$i_sysselct'
13898 i_syssockio='$i_syssockio'
13899 i_sysstat='$i_sysstat'
13900 i_sysstatvfs='$i_sysstatvfs'
13901 i_systime='$i_systime'
13902 i_systimek='$i_systimek'
13903 i_systimes='$i_systimes'
13904 i_systypes='$i_systypes'
13905 i_sysuio='$i_sysuio'
13907 i_syswait='$i_syswait'
13908 i_termio='$i_termio'
13909 i_termios='$i_termios'
13911 i_unistd='$i_unistd'
13913 i_values='$i_values'
13914 i_varargs='$i_varargs'
13915 i_varhdr='$i_varhdr'
13917 ignore_versioned_solibs='$ignore_versioned_solibs'
13920 installarchlib='$installarchlib'
13921 installbin='$installbin'
13922 installman1dir='$installman1dir'
13923 installman3dir='$installman3dir'
13924 installprefix='$installprefix'
13925 installprefixexp='$installprefixexp'
13926 installprivlib='$installprivlib'
13927 installscript='$installscript'
13928 installsitearch='$installsitearch'
13929 installsitebin='$installsitebin'
13930 installsitelib='$installsitelib'
13931 installstyle='$installstyle'
13932 installusrbinperl='$installusrbinperl'
13933 installvendorbin='$installvendorbin'
13934 installvendorlib='$installvendorlib'
13936 known_extensions='$known_extensions'
13940 lddlflags='$lddlflags'
13942 ldlibpthname='$ldlibpthname'
13949 libswanted='$libswanted'
13955 locincpth='$locincpth'
13956 loclibpth='$loclibpth'
13957 longdblsize='$longdblsize'
13958 longlongsize='$longlongsize'
13959 longsize='$longsize'
13963 lseeksize='$lseeksize'
13964 lseektype='$lseektype'
13968 make_set_make='$make_set_make'
13969 mallocobj='$mallocobj'
13970 mallocsrc='$mallocsrc'
13971 malloctype='$malloctype'
13973 man1direxp='$man1direxp'
13976 man3direxp='$man3direxp'
13980 mips_type='$mips_type'
13982 mmaptype='$mmaptype'
13984 modetype='$modetype'
13986 multiarch='$multiarch'
13988 myarchname='$myarchname'
13989 mydomain='$mydomain'
13990 myhostname='$myhostname'
13993 netdb_hlen_type='$netdb_hlen_type'
13994 netdb_host_type='$netdb_host_type'
13995 netdb_name_type='$netdb_name_type'
13996 netdb_net_type='$netdb_net_type'
13999 nm_so_opt='$nm_so_opt'
14000 nonxs_ext='$nonxs_ext'
14002 o_nonblock='$o_nonblock'
14004 old_pthread_create_joinable='$old_pthread_create_joinable'
14005 optimize='$optimize'
14006 orderlib='$orderlib'
14012 patchlevel='$patchlevel'
14013 path_sep='$path_sep'
14015 perladmin='$perladmin'
14016 perlpath='$perlpath'
14018 phostname='$phostname'
14021 pm_apiversion='$pm_apiversion'
14025 prefixexp='$prefixexp'
14027 privlibexp='$privlibexp'
14028 prototype='$prototype'
14030 randbits='$randbits'
14031 randfunc='$randfunc'
14032 randseedtype='$randseedtype'
14034 rd_nodata='$rd_nodata'
14038 sPRIEldbl='$sPRIEldbl'
14039 sPRIFldbl='$sPRIFldbl'
14040 sPRIGldbl='$sPRIGldbl'
14043 sPRIeldbl='$sPRIeldbl'
14044 sPRIfldbl='$sPRIfldbl'
14045 sPRIgldbl='$sPRIgldbl'
14050 sched_yield='$sched_yield'
14051 scriptdir='$scriptdir'
14052 scriptdirexp='$scriptdirexp'
14054 seedfunc='$seedfunc'
14055 selectminbits='$selectminbits'
14056 selecttype='$selecttype'
14057 sendmail='$sendmail'
14060 sharpbang='$sharpbang'
14061 shmattype='$shmattype'
14062 shortsize='$shortsize'
14065 sig_count='$sig_count'
14066 sig_name='$sig_name'
14067 sig_name_init='$sig_name_init'
14069 sig_num_init='$sig_num_init'
14070 signal_t='$signal_t'
14071 sitearch='$sitearch'
14072 sitearchexp='$sitearchexp'
14074 sitebinexp='$sitebinexp'
14076 sitelibexp='$sitelibexp'
14077 siteprefix='$siteprefix'
14078 siteprefixexp='$siteprefixexp'
14079 sizetype='$sizetype'
14084 sockethdr='$sockethdr'
14085 socketlib='$socketlib'
14087 spackage='$spackage'
14088 spitshell='$spitshell'
14091 ssizetype='$ssizetype'
14092 startperl='$startperl'
14094 static_ext='$static_ext'
14096 stdio_base='$stdio_base'
14097 stdio_bufsiz='$stdio_bufsiz'
14098 stdio_cnt='$stdio_cnt'
14099 stdio_filbuf='$stdio_filbuf'
14100 stdio_ptr='$stdio_ptr'
14101 stdio_stream_array='$stdio_stream_array'
14104 subversion='$subversion'
14111 timeincl='$timeincl'
14112 timetype='$timetype'
14121 use64bits='$use64bits'
14123 uselargefiles='$uselargefiles'
14124 uselongdouble='$uselongdouble'
14125 usemorebits='$usemorebits'
14126 usemultiplicity='$usemultiplicity'
14127 usemymalloc='$usemymalloc'
14129 useopcode='$useopcode'
14130 useperlio='$useperlio'
14131 useposix='$useposix'
14133 useshrplib='$useshrplib'
14134 usesocks='$usesocks'
14135 usethreads='$usethreads'
14136 usevendorprefix='$usevendorprefix'
14137 usevfork='$usevfork'
14140 vendorbin='$vendorbin'
14141 vendorbinexp='$vendorbinexp'
14142 vendorlib='$vendorlib'
14143 vendorlibexp='$vendorlibexp'
14144 vendorprefix='$vendorprefix'
14145 vendorprefixexp='$vendorprefixexp'
14148 voidflags='$voidflags'
14150 xs_apiversion='$xs_apiversion'
14155 : Add in command line options if available
14156 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14158 : add special variables
14159 $test -f $src/patchlevel.h && \
14160 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14161 echo "CONFIGDOTSH=true" >>config.sh
14163 : propagate old symbols
14164 if $test -f UU/config.sh; then
14165 <UU/config.sh sort | uniq >UU/oldconfig.sh
14166 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14167 sort | uniq -u >UU/oldsyms
14168 set X `cat UU/oldsyms`
14174 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14176 echo "# Variables propagated from previous config.sh file." >>config.sh
14177 for sym in `cat UU/oldsyms`; do
14178 echo " Propagating $hint variable "'$'"$sym..."
14179 eval 'tmp="$'"${sym}"'"'
14181 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14187 : Finish up by extracting the .SH files
14201 If you'd like to make any changes to the config.sh file before I begin
14202 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14205 rp="Press return or use a shell escape to edit config.sh:"
14210 *) : in case they cannot read
14211 sh 1>&4 -c "$ans";;
14216 : if this fails, just run all the .SH files by hand
14223 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14230 Now you need to generate make dependencies by running "$make depend".
14231 You might prefer to run it in background: "$make depend > makedepend.out &"
14232 It can take a while, so you might not want to run it right now.
14237 rp="Run $make depend now?"
14241 $make depend && echo "Now you must run a $make."
14244 echo "You must run '$make depend' then '$make'."
14247 elif test -f [Mm]akefile; then
14249 echo "Now you must run a $make."
14254 if $test -f Policy.sh; then
14257 If you compile $package on a different machine or from a different object
14258 directory, copy the Policy.sh file from this object directory to the
14259 new one before you run Configure -- this will help you with most of
14260 the policy defaults.
14264 if $test -f config.msg; then
14265 echo "Hmm. I also noted the following information while running:"
14267 $cat config.msg >&4
14270 $rm -f kit*isdone ark*isdone