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 Thu Oct 28 15:06:20 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
438 d_old_pthread_create_joinable=''
439 old_pthread_create_joinable=''
687 ignore_versioned_solibs=''
811 d_stdio_stream_array=''
812 stdio_stream_array=''
855 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
858 : We must find out about Eunice early
860 if test -f /etc/unixtovms; then
861 eunicefix=/etc/unixtovms
863 if test -f /etc/unixtovms.exe; then
864 eunicefix=/etc/unixtovms.exe
868 : Possible local include directories to search.
869 : Set locincpth to "" in a hint file to defeat local include searches.
870 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
871 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
873 : no include file wanted by default
876 : list of known cpp symbols, sorted alphabetically
877 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
878 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
879 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
880 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
881 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
882 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
883 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
884 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
885 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
886 al="$al VMS Xenix286"
887 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
888 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
889 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
890 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
891 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
892 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
893 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
894 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
895 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
896 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
897 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
898 al="$al __SVR4_2__ __UMAXV__"
899 al="$al ____386BSD____ __alpha __alpha__ __amiga"
900 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
901 al="$al __host_mips__"
902 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
903 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
904 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
905 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
906 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
907 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
908 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
909 al="$al __mc88100 __mc88100__ __mips __mips__"
910 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
911 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
912 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
913 al="$al _host_mips _mips _unix"
914 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
915 al="$al apollo ardent att386 att3b"
916 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
917 al="$al cadmus clipper concurrent convex cray ctix"
918 al="$al dmert encore gcos gcx gimpel gould"
919 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
920 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
921 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
922 al="$al i186 i286 i386 i486 i8086"
923 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
924 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
925 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
926 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
927 al="$al mc88000 mc88100 merlin mert mips mvs n16"
928 al="$al ncl_el ncl_mr"
929 al="$al news1500 news1700 news1800 news1900 news3700"
930 al="$al news700 news800 news900 ns16000 ns32000"
931 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
932 al="$al parisc pc532 pdp11 plexus posix pyr"
933 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
934 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
935 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
936 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
937 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
938 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
941 : Trailing extension. Override this in a hint file, if needed.
943 : Extra object files, if any, needed on this platform.
946 : change the next line if compiling for Xenix/286 on Xenix/386
947 xlibpth='/usr/lib/386 /lib/386'
949 : Possible local library directories to search.
950 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
951 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
953 : general looking path for locating libraries
954 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
955 glibpth="$glibpth /lib /usr/lib $xlibpth"
956 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
957 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
959 : Private path used by Configure to find libraries. Its value
960 : is prepended to libpth. This variable takes care of special
961 : machines, like the mips. Usually, it should be empty.
964 : default library list
966 : some systems want to use only the non-versioned libso:s
967 ignore_versioned_solibs=''
968 : full support for void wanted by default
971 : set useposix=false in your hint file to disable the POSIX extension.
973 : set useopcode=false in your hint file to disable the Opcode extension.
975 : set usemultiplicity on the Configure command line to enable multiplicity.
976 : set usesocks on the Configure command line to enable socks.
977 : set usethreads on the Configure command line to enable threads.
978 : List of libraries we want.
979 : If anyone needs -lnet, put it in a hint file.
980 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
981 libswanted="$libswanted dld ld sun m c cposix posix"
982 libswanted="$libswanted ndir dir crypt sec"
983 libswanted="$libswanted ucb bsd BSD PW x"
984 : We probably want to search /usr/shlib before most other libraries.
985 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
986 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
987 glibpth="/usr/shlib $glibpth"
988 : Do not use vfork unless overridden by a hint file.
991 : Find the basic shell for Bourne shell scripts
995 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
998 if test -f "$xxx"; then
1001 : Build up a list and do a single loop so we can 'break' out.
1002 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1003 for xxx in sh bash ksh pdksh ash; do
1005 try="$try ${p}/${xxx}"
1009 if test -f "$xxx"; then
1012 elif test -f "$xxx.exe"; then
1023 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1025 Usually it's in /bin/sh. How did you even get this far?
1026 Please contact me (Perl Maintainers) at perlbug@perl.com and
1027 we'll try to straighten this all out.
1033 : see if sh knows # comments
1034 if `$sh -c '#' >/dev/null 2>&1`; then
1038 test -f $xcat || xcat=/usr/bin/cat
1043 if test -s today; then
1046 echo "#! $xcat" > try
1050 if test -s today; then
1058 echo "Your $sh doesn't grok # comments--I will strip them later on."
1061 echo "exec grep -v '^[ ]*#'" >spitshell
1063 $eunicefix spitshell
1064 spitshell=`pwd`/spitshell
1066 echo "I presume that if # doesn't work, #! won't work either!"
1071 : figure out how to guarantee sh startup
1073 '') startsh=${sharpbang}${sh} ;;
1085 : echo "Yup, it does."
1087 echo "Hmm... '$startsh' does not guarantee sh startup..."
1088 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1093 : Save command line options in file UU/cmdline.opt for later use in
1094 : generating config.sh.
1095 cat > cmdline.opt <<EOSH
1096 # Configure command line arguments.
1103 cat >>cmdline.opt <<EOSH
1104 config_arg$argn='$arg'
1106 argn=`expr $argn + 1`
1109 : produce awk script to parse command line options
1110 cat >options.awk <<'EOF'
1112 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1114 len = length(optstr);
1115 for (i = 1; i <= len; i++) {
1116 c = substr(optstr, i, 1);
1117 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1128 if (substr(str, 1, 1) != "-") {
1129 printf("'%s'\n", str);
1133 for (i = 2; i <= len; i++) {
1134 c = substr(str, i, 1);
1136 printf("-%s\n", substr(str, i));
1142 printf("'%s'\n", substr(str, i + 1));
1155 : process the command line options
1156 set X `for arg in "$@"; do echo "X$arg"; done |
1157 sed -e s/X// | awk -f options.awk`
1162 : set up default values
1172 rm -f optdef.sh posthint.sh
1173 cat >optdef.sh <<EOS
1179 while test $# -gt 0; do
1181 -d) shift; fastread=yes;;
1182 -e) shift; alldone=cont;;
1186 if test -r "$1"; then
1189 echo "$me: cannot read config file $1." >&2
1194 -h) shift; error=true;;
1195 -r) shift; reuseval=true;;
1196 -s) shift; silent=true; realsilent=true;;
1197 -E) shift; alldone=exit;;
1198 -K) shift; knowitall=true;;
1199 -O) shift; override=true;;
1200 -S) shift; silent=true; extractsh=true;;
1205 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1206 echo "$me: ignoring -D $1" >&2
1209 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1210 *) echo "$1='define'" >> optdef.sh;;
1217 *=) echo "$1" >> optdef.sh;;
1219 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1220 echo "$me: ignoring -U $1" >&2
1222 *) echo "$1='undef'" >> optdef.sh;;
1233 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1237 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1238 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1244 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1245 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1246 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1247 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1248 *) xxx=`echo $yyy|sed 's!:.*!!'`
1249 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1255 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1257 echo "$yyy=''" >> posthint.sh ;;
1262 echo "$yyy='$zzz'" >> posthint.sh ;;
1264 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1266 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1271 echo "$yyy=$zzz" >> posthint.sh ;;
1272 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1275 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1278 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1286 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1287 [-U symbol] [-U symbol=] [-A command:symbol...]
1288 -d : use defaults for all answers.
1289 -e : go on without questioning past the production of config.sh.
1290 -f : specify an alternate default configuration file.
1291 -h : print this help message and exit (with an error status).
1292 -r : reuse C symbols value if possible (skips costly nm extraction).
1293 -s : silent mode, only echoes questions and essential information.
1294 -D : define symbol to have some value:
1295 -D symbol symbol gets the value 'define'
1296 -D symbol=value symbol gets the value 'value'
1297 -E : stop at the end of questions, after having produced config.sh.
1298 -K : do not use unless you know what you are doing.
1299 -O : let -D and -U override definitions from loaded configuration file.
1300 -S : perform variable substitutions on all .SH files (can mix with -f)
1301 -U : undefine symbol:
1302 -U symbol symbol gets the value 'undef'
1303 -U symbol= symbol gets completely empty
1304 -A : manipulate symbol after the platform specific hints have been applied:
1305 -A symbol=value append " "value to symbol
1306 -A append:symbol=value append value to symbol
1307 -A define:symbol=value define symbol to have value
1308 -A clear:symbol define symbol to be ''
1309 -A define:symbol define symbol to be 'define'
1310 -A eval:symbol=value define symbol to be eval of value
1311 -A prepend:symbol=value prepend value to symbol
1312 -A undef:symbol define symbol to be 'undef'
1313 -A undef:symbol= define symbol to be ''
1314 -V : print version number and exit (with a zero status).
1321 case "$fastread$alldone" in
1324 if test ! -t 0; then
1325 echo "Say 'sh Configure', not 'sh <Configure'"
1333 true) exec 1>/dev/null;;
1336 : run the defines and the undefines, if any, but leave the file out there...
1339 : create the posthint manipulation script and leave the file out there...
1344 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1345 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1346 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1347 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1348 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1351 : Some greps do not return status, grrr.
1352 echo "grimblepritz" >grimble
1353 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1355 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1361 : the following should work in any shell
1365 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1366 cat >contains <<'EOSS'
1367 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1372 : Find the path to the source tree
1375 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1378 *) src=`cd ../$src && pwd` ;;
1391 if test -f $rsrc/Configure && \
1392 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1394 : found it, so we are ok.
1397 for src in . .. ../.. ../../.. ../../../..; do
1398 if test -f ../$src/Configure && \
1399 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1410 Sorry, I can't seem to locate the source dir for $package. Please start
1411 Configure with an explicit path -- i.e. /some/path/Configure.
1419 echo "Sources for $package found in \"$src\"." >&4
1423 : script used to extract .SH files with variable substitutions
1424 cat >extract <<'EOS'
1426 echo "Doing variable substitutions on .SH files..."
1427 if test -f $src/MANIFEST; then
1428 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1430 echo "(Looking for .SH files under the source directory.)"
1431 set x `(cd $src; find . -name "*.SH" -print)`
1435 0) set x `(cd $src; echo *.SH)`; shift;;
1437 if test ! -f $src/$1; then
1443 while test $name; do
1444 if test ! -d "$name"; then
1445 create="$name $create";
1446 name=`echo $name | sed -e "s|^[^/]*$||"`;
1447 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1452 for file in $create; do
1461 dir=`expr X$file : 'X\(.*\)/'`
1462 file=`expr X$file : 'X.*/\(.*\)'`
1463 (cd $dir && . ./$file)
1473 dir=`expr X$file : 'X\(.*\)/'`
1474 file=`expr X$file : 'X.*/\(.*\)'`
1475 (set x $dir; shift; eval $mkdir_p)
1485 if test -f $src/config_h.SH; then
1486 if test ! -f config.h; then
1487 : oops, they left it out of MANIFEST, probably, so do it anyway.
1493 : extract files and exit if asked to do so
1494 case "$extractsh" in
1496 case "$realsilent" in
1500 case "$config_sh" in
1501 '') config_sh='config.sh';;
1504 echo "Fetching answers from $config_sh..."
1507 test "$override" && . ./optdef.sh
1516 : Eunice requires " " instead of "", can you believe it
1519 echo "Beginning of configuration questions for $package."
1521 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1523 : first determine how to suppress newline on echo command
1525 echo "Checking echo to see how to suppress newlines..."
1526 (echo "hi there\c" ; echo " ") >.echotmp
1527 if $contains c .echotmp >/dev/null 2>&1 ; then
1538 echo $n "The star should be here-->$c"
1542 : Now test for existence of everything in MANIFEST
1544 if test -f $rsrc/MANIFEST; then
1545 echo "First let's make sure your kit is complete. Checking..." >&4
1546 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1549 for filelist in x??; do
1550 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1552 if test -s missing; then
1556 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1558 You have the option of continuing the configuration process, despite the
1559 distinct possibility that your kit is damaged, by typing 'y'es. If you
1560 do, don't blame me if something goes wrong. I advise you to type 'n'o
1561 and contact the author (perlbug@perl.com).
1564 echo $n "Continue? [n] $c" >&4
1568 echo "Continuing..." >&4
1572 echo "ABORTING..." >&4
1577 echo "Looks good..."
1580 echo "There is no MANIFEST file. I hope your kit is complete !"
1585 : Find the appropriate value for a newline for tr
1586 if test -n "$DJGPP"; then
1589 if test X"$trnl" = X; then
1590 case "`echo foo|tr '\n' x 2>/dev/null`" in
1594 if test X"$trnl" = X; then
1595 case "`echo foo|tr '\012' x 2>/dev/null`" in
1596 foox) trnl='\012' ;;
1599 if test X"$trnl" = X; then
1602 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1608 : compute the number of columns on the terminal for proper question formatting
1613 : set up the echo used in my read
1614 myecho="case \"\$xxxm\" in
1615 '') echo $n \"\$rp $c\" >&4;;
1617 '') echo $n \"[\$xxxm] $c\";;
1619 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1621 echo $n \"[\$xxxm] $c\" >&4
1623 echo $n \"\$rp [\$xxxm] $c\" >&4
1629 : now set up to do reads with possible shell escape and default assignment
1635 case "\$fastread" in
1636 yes) case "\$dflt" in
1639 case "\$silent-\$rp" in
1644 *) case "\$silent" in
1645 true) case "\$rp" in
1650 while expr "X\$ans" : "X!" >/dev/null; do
1654 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1662 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1671 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1676 echo "(OK, I'll run with -d after this question.)" >&4
1679 echo "*** Sorry, \$1 not supported yet." >&4
1689 echo "*** Substitution done -- please confirm."
1691 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1696 echo "*** Error -- try again."
1703 case "\$ans\$xxxm\$nostick" in
1715 : create .config dir to save info across Configure sessions
1716 test -d ../.config || mkdir ../.config
1717 cat >../.config/README <<EOF
1718 This directory created by Configure to save information that should
1719 persist across sessions for $package.
1721 You may safely delete it if you wish.
1724 : general instructions
1727 user=`(logname) 2>/dev/null`
1729 '') user=`whoami 2>&1`;;
1731 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1734 rp='Would you like to see the instructions?'
1745 This installation shell script will examine your system and ask you questions
1746 to determine how the perl5 package should be installed. If you get
1747 stuck on a question, you may use a ! shell escape to start a subshell or
1748 execute a command. Many of the questions will have default answers in square
1749 brackets; typing carriage return will give you the default.
1751 On some of the questions which ask for file or directory names you are allowed
1752 to use the ~name construct to specify the login directory belonging to "name",
1753 even if you don't have a shell which knows about that. Questions where this is
1754 allowed will be marked "(~name ok)".
1758 dflt='Type carriage return to continue'
1762 The prompter used in this script allows you to use shell variables and
1763 backticks in your answers. You may use $1, $2, etc... to refer to the words
1764 in the default answer, as if the default line was a set of arguments given to a
1765 script shell. This means you may also use $* to repeat the whole default line,
1766 so you do not have to re-type everything to add something to the default.
1768 Everytime there is a substitution, you will have to confirm. If there is an
1769 error (e.g. an unmatched backtick), the default answer will remain unchanged
1770 and you will be prompted again.
1772 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1773 the questions and use the computed defaults (or the previous answers if there
1774 was already a config.sh file). Type 'Configure -h' for a list of options.
1775 You may also start interactively and then answer '& -d' at any prompt to turn
1776 on the non-interactive behaviour for the remainder of the execution.
1782 Much effort has been expended to ensure that this shell script will run on any
1783 Unix system. If despite that it blows up on yours, your best bet is to edit
1784 Configure and run it again. If you can't run Configure for some reason,
1785 you'll have to generate a config.sh file by hand. Whatever problems you
1786 have, let me (perlbug@perl.com) know how I blew it.
1788 This installation script affects things in two ways:
1790 1) it may do direct variable substitutions on some of the files included
1792 2) it builds a config.h file for inclusion in C programs. You may edit
1793 any of these files as the need arises after running this script.
1795 If you make a mistake on a question, there is no easy way to back up to it
1796 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1797 files. Configure will offer to let you do this before it runs the SH files.
1800 dflt='Type carriage return to continue'
1802 case "$firsttime" in
1803 true) echo $user >>../.config/instruct;;
1807 : find out where common programs are
1809 echo "Locating common programs..." >&4
1822 if test -d \$dir/\$thing; then
1828 for thisthing in \$dir/\$thing; do
1829 : just loop through to pick last item
1831 if test -f \$thisthing; then
1834 elif test -f \$dir/\$thing.exe; then
1835 if test -n "$DJGPP"; then
1836 echo \$dir/\$thing.exe
1838 : on Eunice apparently
1888 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1889 pth="$pth /lib /usr/lib"
1890 for file in $loclist; do
1894 if test -f "$xxx"; then
1897 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1898 xxx=`./loc $file $file $pth`
1901 '') xxx=`./loc $file $file $pth`;;
1902 *) xxx=`./loc $xxx $xxx $pth`;;
1908 echo $file is in $xxx.
1911 echo $file is in $xxx.
1914 echo "I don't know where '$file' is, and my life depends on it." >&4
1915 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1921 echo "Don't worry if any of the following aren't found..."
1923 for file in $trylist; do
1927 if test -f "$xxx"; then
1930 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1931 xxx=`./loc $file $file $pth`
1934 '') xxx=`./loc $file $file $pth`;;
1935 *) xxx=`./loc $xxx $xxx $pth`;;
1941 echo $file is in $xxx.
1944 echo $file is in $xxx.
1947 echo "I don't see $file out there, $say."
1954 echo "Substituting grep for egrep."
1960 echo "Substituting cp for ln."
1966 echo "Hopefully test is built into your sh."
1969 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1970 echo "Using the test built into your sh."
1978 echo "Hopefully echo is built into your sh."
1983 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1984 $echo $n "hi there$c" >foo1
1985 echo $n "hi there$c" >foo2
1986 if cmp foo1 foo2 >/dev/null 2>&1; then
1987 echo "They are compatible. In fact, they may be identical."
1994 They are not compatible! You are probably running ksh on a non-USG system.
1995 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1996 have echo built in and we may have to run some Bourne shell scripts. That
1997 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2000 $echo $n "The star should be here-->$c"
2007 : determine whether symbolic links are supported
2010 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2011 echo "Symbolic links are supported." >&4
2014 echo "Symbolic links are NOT supported." >&4
2019 : see whether [:lower:] and [:upper:] are supported character classes
2021 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2023 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2027 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2028 # (0xc9 and 0xd1), therefore that is a nice testing point.
2029 if test "X$up" = X -o "X$low" = X; then
2030 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2036 if test "X$up" = X -o "X$low" = X; then
2037 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2043 if test "X$up" = X -o "X$low" = X; then
2044 case "`echo IJ | od -x 2>/dev/null`" in
2046 echo "Hey, this might be EBCDIC." >&4
2047 if test "X$up" = X -o "X$low" = X; then
2048 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2049 ij) up='[A-IJ-RS-Z]'
2054 if test "X$up" = X -o "X$low" = X; then
2055 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2065 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2067 echo "Using $up and $low to convert case." >&4
2070 echo "I don't know how to translate letters from upper to lower case." >&4
2071 echo "Your tr is not acting any way I know of." >&4
2075 : set up the translation script tr, must be called with ./tr of course
2079 '[A-Z][a-z]') exec $tr '$up' '$low';;
2080 '[a-z][A-Z]') exec $tr '$low' '$up';;
2087 : Try to determine whether config.sh was made on this system
2088 case "$config_sh" in
2090 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2091 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2092 # because the A-Z/a-z are not consecutive.
2093 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2094 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2095 newmyuname="$myuname"
2097 case "$knowitall" in
2099 if test -f ../config.sh; then
2100 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2101 eval "`grep myuname= ../config.sh`"
2103 if test "X$myuname" = "X$newmyuname"; then
2111 : Get old answers from old config file if Configure was run on the
2112 : same system, otherwise use the hints.
2115 if test -f config.sh; then
2117 rp="I see a config.sh file. Shall I use it to set the defaults?"
2120 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2121 *) echo "Fetching default answers from your old config.sh file..." >&4
2129 : Older versions did not always set $sh. Catch re-use of such
2138 if test ! -f config.sh; then
2141 First time through, eh? I have some defaults handy for some systems
2142 that need some extra help getting the Configure answers right:
2145 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2147 : Half the following guesses are probably wrong... If you have better
2148 : tests or hints, please send them to perlbug@perl.com
2149 : The metaconfig authors would also appreciate a copy...
2150 $test -f /irix && osname=irix
2151 $test -f /xenix && osname=sco_xenix
2152 $test -f /dynix && osname=dynix
2153 $test -f /dnix && osname=dnix
2154 $test -f /lynx.os && osname=lynxos
2155 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2156 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2157 $test -f /bin/mips && /bin/mips && osname=mips
2158 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2159 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2160 $test -d /usr/apollo/bin && osname=apollo
2161 $test -f /etc/saf/_sactab && osname=svr4
2162 $test -d /usr/include/minix && osname=minix
2163 if $test -d /MachTen -o -d /MachTen_Folder; then
2165 if $test -x /sbin/version; then
2166 osvers=`/sbin/version | $awk '{print $2}' |
2167 $sed -e 's/[A-Za-z]$//'`
2168 elif $test -x /usr/etc/version; then
2169 osvers=`/usr/etc/version | $awk '{print $2}' |
2170 $sed -e 's/[A-Za-z]$//'`
2175 $test -f /sys/posix.dll &&
2176 $test -f /usr/bin/what &&
2177 set X `/usr/bin/what /sys/posix.dll` &&
2178 $test "$3" = UWIN &&
2181 if $test -f $uname; then
2189 umips) osname=umips ;;
2192 [23]100) osname=mips ;;
2193 next*) osname=next ;;
2195 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2196 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2199 elif $test -f /etc/kconfig; then
2201 if test "$lns" = "$ln -s"; then
2203 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2205 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2212 if test -n "$DJGPP"; then
2221 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2223 'not found') osvers="$4"."$3" ;;
2224 '<3240'|'<>3240') osvers=3.2.0 ;;
2225 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2226 '=3250'|'>3250') osvers=3.2.5 ;;
2230 *dc.osx) osname=dcosx
2236 domainos) osname=apollo
2242 dynixptx*) osname=dynixptx
2243 osvers=`echo "$4"|sed 's/^v//'`
2245 freebsd) osname=freebsd
2247 genix) osname=genix ;;
2249 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2265 netbsd*) osname=netbsd
2268 news-os) osvers="$3"
2270 4*) osname=newsos4 ;;
2274 bsd386) osname=bsd386
2277 POSIX-BC | posix-bc ) osname=posix-bc
2280 powerux | power_ux | powermax_os | powermaxos | \
2281 powerunix | power_unix) osname=powerux
2284 next*) osname=next ;;
2285 solaris) osname=solaris
2287 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2294 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2298 titanos) osname=titanos
2307 ultrix) osname=ultrix
2310 osf1|mls+) case "$5" in
2313 osvers=`echo "$3" | sed 's/^[xvt]//'`
2315 hp*) osname=hp_osf1 ;;
2316 mips) osname=mips_osf1 ;;
2319 unixware) osname=svr5
2328 $2) case "$osname" in
2332 : svr4.x or possibly later
2342 if test -f /stand/boot ; then
2343 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2344 if test -n "$INITPROG" -a -f "$INITPROG"; then
2345 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2346 if test -n "$isesix"; then
2354 *) if test -f /etc/systemid; then
2356 set `echo $3 | $sed 's/\./ /g'` $4
2357 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2359 elif $test -f $src/hints/sco_$1_$2.sh; then
2361 elif $test -f $src/hints/sco_$1.sh; then
2366 '') : Still unknown. Probably a generic Sys V.
2375 *) case "$osname" in
2376 '') : Still unknown. Probably a generic BSD.
2384 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2385 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2386 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2389 $rm -f UU/kernel.what
2390 elif test -d c:/.; then
2397 : Now look for a hint file osname_osvers, unless one has been
2398 : specified already.
2401 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2402 : Also try without trailing minor version numbers.
2403 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2404 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2405 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2406 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2409 *) case "$osvers" in
2412 *) if $test -f $src/hints/$file.sh ; then
2414 elif $test -f $src/hints/$xfile.sh ; then
2416 elif $test -f $src/hints/$xxfile.sh ; then
2418 elif $test -f $src/hints/$xxxfile.sh ; then
2420 elif $test -f $src/hints/$xxxxfile.sh ; then
2422 elif $test -f "$src/hints/${osname}.sh" ; then
2431 if $test -f Policy.sh ; then
2434 none) dflt="Policy" ;;
2435 *) dflt="Policy $dflt" ;;
2440 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2444 if $test -f Policy.sh ; then
2447 There's also a Policy hint file available, which should make the
2448 site-specific (policy) questions easier to answer.
2455 You may give one or more space-separated answers, or "none" if appropriate.
2456 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2457 is a good thing. DO NOT give a wrong version or a wrong OS.
2461 rp="Which of these apply, if any?"
2464 for file in $tans; do
2465 if $test X$file = XPolicy -a -f Policy.sh; then
2467 $cat Policy.sh >> UU/config.sh
2468 elif $test -f $src/hints/$file.sh; then
2469 . $src/hints/$file.sh
2470 $cat $src/hints/$file.sh >> UU/config.sh
2471 elif $test X$tans = X -o X$tans = Xnone ; then
2474 : Give one chance to correct a possible typo.
2475 echo "$file.sh does not exist"
2477 rp="hint to use instead?"
2479 for file in $ans; do
2480 if $test -f "$src/hints/$file.sh"; then
2481 . $src/hints/$file.sh
2482 $cat $src/hints/$file.sh >> UU/config.sh
2483 elif $test X$ans = X -o X$ans = Xnone ; then
2486 echo "$file.sh does not exist -- ignored."
2493 : Remember our hint file for later.
2494 if $test -f "$src/hints/$file.sh" ; then
2504 echo "Fetching default answers from $config_sh..." >&4
2508 cp $config_sh config.sh 2>/dev/null
2518 test "$override" && . ./optdef.sh
2519 myuname="$newmyuname"
2521 : Restore computed paths
2522 for file in $loclist $trylist; do
2523 eval $file="\$_$file"
2528 Configure uses the operating system name and version to set some defaults.
2529 The default value is probably right if the name rings a bell. Otherwise,
2530 since spelling matters for me, either accept the default or answer "none"
2537 ''|' '|none) dflt=none ;;
2538 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2541 *) dflt="$osname" ;;
2543 rp="Operating system name?"
2547 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2553 ''|' '|none) dflt=none ;;
2554 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2555 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2557 ''|' ') dflt=none ;;
2562 *) dflt="$osvers" ;;
2564 rp="Operating system version?"
2574 : who configured the system
2575 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2576 cf_by=`(logname) 2>/dev/null`
2579 cf_by=`(whoami) 2>/dev/null`
2581 "") cf_by=unknown ;;
2585 : set up the script used to warn in case of inconsistency
2592 echo "*** WHOA THERE!!! ***" >&4
2593 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2594 rp=" Keep the $hint value?"
2597 y) td=$was; tu=$was;;
2601 : function used to set $1 to $val
2602 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2604 $define$undef) . ./whoa; eval "$var=\$td";;
2605 $undef$define) . ./whoa; eval "$var=\$tu";;
2606 *) eval "$var=$val";;
2611 Perl can be built to take advantage of threads, on some systems.
2612 To do so, Configure must be run with -Dusethreads.
2614 Note that threading is a highly experimental feature, and
2615 some known race conditions still remain. If you choose to try
2616 it, be very sure to not actually deploy it for production
2617 purposes. README.threads has more details, and is required
2618 reading if you enable threads.
2620 case "$usethreads" in
2621 $define|true|[yY]*) dflt='y';;
2624 rp='Build a threading Perl?'
2627 y|Y) val="$define" ;;
2633 case "$d_oldpthreads" in
2634 '') : Configure tests would be welcome here. For now, assume undef.
2636 *) val="$d_oldpthreads" ;;
2642 case "$usethreads" in
2643 "$define"|true|[yY]*)
2644 : Look for a hint-file generated 'call-back-unit'. If the
2645 : user has specified that a threading perl is to be built,
2646 : we may need to set or change some other defaults.
2647 if $test -f usethreads.cbu; then
2648 echo "Your platform has some specific hints for threaded builds, using them..."
2652 (Your platform doesn't have any specific hints for threaded builds.
2653 Assuming POSIX threads, then.)
2661 Perl can be built so that multiple Perl interpreters can coexist
2662 within the same Perl executable. To do so, Configure must be run with
2665 Normally you do not need this and you should answer no.
2668 case "$usemultiplicity" in
2669 $define|true|[yY]*) dflt='y';;
2672 rp='Build Perl for multiplicity?'
2675 y|Y) val="$define" ;;
2681 : determine where manual pages are on this system
2685 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2686 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2687 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2688 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2689 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2690 sysman=`./loc . /usr/man/man1 $syspath`
2693 if $test -d "$sysman"; then
2694 echo "System manual is in $sysman." >&4
2696 echo "Could not find manual pages in source form." >&4
2699 : see what memory models we can support
2702 $cat >pdp11.c <<'EOP'
2711 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2712 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2713 dflt='unsplit split'
2715 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2718 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2723 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2726 if $test -d /lib/large || $test -d /usr/lib/large; then
2729 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2738 Some systems have different model sizes. On most systems they are called
2739 small, medium, large, and huge. On the PDP11 they are called unsplit and
2740 split. If your system doesn't support different memory models, say "none".
2741 If you wish to force everything to one memory model, say "none" here and
2742 put the appropriate flags later when it asks you for other cc and ld flags.
2743 Venix systems may wish to put "none" and let the compiler figure things out.
2744 (In the following question multiple model names should be space separated.)
2746 The default for most systems is "none".
2749 rp="Which memory models are supported?"
2764 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2765 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2772 rp="What flag indicates separate I and D space?"
2780 *large*|*small*|*medium*|*huge*)
2787 rp="What flag indicates large model?"
2797 *huge*) case "$huge" in
2801 rp="What flag indicates huge model?"
2811 *medium*) case "$medium" in
2815 rp="What flag indicates medium model?"
2822 *) medium="$large";;
2825 *small*) case "$small" in
2829 rp="What flag indicates small model?"
2840 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2843 $rm -f pdp11.* pdp11
2845 : make some quick guesses about what we are up against
2847 $echo $n "Hmm... $c"
2857 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2858 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2860 echo "Looks kind of like an OSF/1 system, but we'll see..."
2862 elif test `echo abc | tr a-z A-Z` = Abc ; then
2863 xxx=`./loc addbib blurfl $pth`
2864 if $test -f $xxx; then
2865 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2869 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2870 echo "Looks kind of like an extended USG system, but we'll see..."
2872 echo "Looks kind of like a USG system, but we'll see..."
2876 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2877 echo "Looks kind of like a BSD system, but we'll see..."
2881 echo "Looks kind of like a Version 7 system, but we'll see..."
2884 case "$eunicefix" in
2887 There is, however, a strange, musty smell in the air that reminds me of
2888 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2892 : it so happens the Eunice I know will not run shell scripts in Unix format
2896 echo "Congratulations. You aren't running Eunice."
2900 : Detect OS2. The p_ variable is set above in the Head.U unit.
2905 I have the feeling something is not exactly right, however...don't tell me...
2906 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2911 if test -f /xenix; then
2912 echo "Actually, this looks more like a XENIX system..."
2917 echo "It's not Xenix..."
2922 if test -f /venix; then
2923 echo "Actually, this looks more like a VENIX system..."
2930 echo "Nor is it Venix..."
2933 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2934 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2937 : see if we need a special compiler
2945 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2946 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2960 On some older systems the default C compiler will not resolve multiple global
2961 references that happen to have the same name. On some such systems the "Mcc"
2962 command may be used to force these to be resolved. On other systems a "cc -M"
2963 command is required. (Note that the -M flag on other systems indicates a
2964 memory model to use!) If you have the Gnu C compiler, you might wish to use
2970 rp="Use which C compiler?"
2978 rp="Use which C compiler?"
2982 : Look for a hint-file generated 'call-back-unit'. Now that the
2983 : user has specified the compiler, we may need to set or change some
2985 if $test -f cc.cbu; then
2989 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2990 $cat >gccvers.c <<EOM
2995 printf("%s\n", __VERSION__);
2997 printf("%s\n", "1");
3003 if $cc -o gccvers gccvers.c; then
3004 gccversion=`./gccvers`
3005 case "$gccversion" in
3006 '') echo "You are not using GNU cc." ;;
3007 *) echo "You are using GNU cc $gccversion." ;;
3011 echo "*** WHOA THERE!!! ***" >&4
3012 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3013 case "$knowitall" in
3015 echo " You'd better start hunting for one and let me know about it." >&4
3021 case "$gccversion" in
3022 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3026 case "$usemorebits" in
3027 "$define"|true|[yY]*)
3029 uselongdouble="$define"
3030 usemorebits="$define"
3032 *) usemorebits="$undef"
3039 Perl can be built to understand large files (files larger than 2 gigabytes)
3040 on some systems. To do so, Configure must be run with -Duselargefiles.
3042 If this doesn't make any sense to you, just accept the default.
3044 case "$uselargefiles" in
3045 "$define"|true|[yY]*) dflt='y' ;;
3048 rp='Try to understand large files?'
3051 y|Y) val="$define" ;;
3056 case "$uselargefiles" in
3057 "$define") use64bits="$define" ;;
3062 Perl can be built to take advantage of explicit 64-bit interfaces,
3063 on some systems. To do so, Configure must be run with -Duse64bits.
3065 If this doesn't make any sense to you, just accept the default.
3067 case "$use64bits" in
3068 $define|true|[yY]*) dflt='y';;
3071 rp='Try to use explicit 64-bit interfaces, if available?'
3084 case "$archname64" in
3085 '') archname64='' ;; # not a typo
3088 case "$use64bits" in
3089 "$define"|true|[yY]*)
3090 : Look for a hint-file generated 'call-back-unit'. If the
3091 : user has specified that a 64 bit perl is to be built,
3092 : we may need to set or change some other defaults.
3093 if $test -f use64bits.cbu; then
3094 echo "Your platform has some specific hints for 64-bit builds, using them..."
3098 (Your platform doesn't have any specific hints for 64-bit builds.
3099 This is probably okay, especially if your system is a true 64-bit system.)
3101 case "$gccversion" in
3104 But since you seem to be using gcc,
3105 I will now add -DUSE_LONG_LONG to the compilation flags.
3107 ccflags="$ccflags -DUSE_LONG_LONG"
3114 : determine the architecture name
3116 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3117 tarch=`arch`"-$osname"
3118 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3119 if uname -m > tmparch 2>&1 ; then
3120 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3121 -e 's/$/'"-$osname/" tmparch`
3129 case "$myarchname" in
3132 echo "(Your architecture name used to be $myarchname.)"
3139 *) dflt="$archname";;
3141 rp='What is your architecture name'
3144 case "$usethreads" in
3146 echo "Threads selected." >&4
3148 *-thread*) echo "...and architecture name already has -thread." >&4
3150 *) archname="$archname-thread"
3151 echo "...setting architecture name to $archname." >&4
3156 case "$usemultiplicity" in
3158 echo "Multiplicity selected." >&4
3160 *-multi*) echo "...and architecture name already has -multi." >&4
3162 *) archname="$archname-multi"
3163 echo "...setting architecture name to $archname." >&4
3168 case "$use64bits" in
3170 echo "Explicit 64-bitness selected." >&4
3171 case "$archname64" in
3176 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3178 *) archname="$archname-$archname64"
3179 echo "...setting architecture name to $archname." >&4
3186 : decide how portable to be. Allow command line overrides.
3187 case "$d_portable" in
3189 *) d_portable="$define" ;;
3192 : set up shell script to do ~ expansion
3198 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3201 if $test -f /bin/csh; then
3202 /bin/csh -f -c "glob \$1"
3207 name=\`$expr x\$1 : '..\([^/]*\)'\`
3208 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3209 if $test ! -d "\$dir"; then
3211 echo "\$me: can't locate home directory for: \$name" >&2
3216 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3232 : now set up to get a file name
3236 cat <<'EOSC' >>getfile
3252 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3253 fn=`echo $fn | sed 's/(.*)//'`
3259 loc_file=`expr $fn : '.*:\(.*\)'`
3260 fn=`expr $fn : '\(.*\):.*'`
3268 */*) fullpath=true;;
3277 *e*) exp_file=true;;
3280 *p*) nopath_ok=true;;
3285 *d*) type='Directory';;
3286 *l*) type='Locate';;
3291 Locate) what='File';;
3296 case "$d_portable" in
3304 while test "$type"; do
3309 true) rp="$rp (~name ok)";;
3312 if test -f UU/getfile.ok && \
3313 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3332 value=`UU/filexp $ans`
3335 if test "$ans" != "$value"; then
3336 echo "(That expands to $value on this system.)"
3350 /*) value="$ansexp" ;;
3355 echo "I shall only accept a full path name, as in /bin/ls." >&4
3356 echo "Use a ! shell escape if you wish to check pathnames." >&4
3359 echo "Please give a full path name, starting with slash." >&4
3362 echo "Note that using ~name is ok provided it expands well." >&4
3375 for fp in $gfpth; do
3376 if test "X$fp" = X.; then
3381 if test -f "$pf"; then
3383 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3385 echo "($value is not a plain file, but that's ok.)"
3388 if test X"$type" = X; then
3395 for fp in $gfpth; do
3396 if test "X$fp" = X.; then
3401 if test -d "$pf"; then
3409 if test -d "$ansexp"; then
3410 echo "(Looking for $loc_file in directory $value.)"
3411 value="$value/$loc_file"
3412 ansexp="$ansexp/$loc_file"
3414 if test -f "$ansexp"; then
3417 case "$nopath_ok" in
3418 true) case "$value" in
3420 *) echo "Assuming $value will be in people's path."
3436 if test "$fastread" = yes; then
3441 rp="$what $value doesn't exist. Use that name anyway?"
3460 test "X$gfpthkeep" != Xy && gfpth=""
3463 : determine root of directory hierarchy where package will be installed.
3466 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3474 By default, $package will be installed in $dflt/bin, manual pages
3475 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3476 installation directories. Typically this is something like /usr/local.
3477 If you wish to have binaries under /usr/bin but other parts of the
3478 installation under /usr/local, that's ok: you will be prompted
3479 separately for each of the installation directories, the prefix being
3480 only used to set the defaults.
3484 rp='Installation prefix to use?'
3492 *) oldprefix="$prefix";;
3502 $define|true) afs=true ;;
3503 $undef|false) afs=false ;;
3504 *) if test -d /afs; then
3512 echo "AFS may be running... I'll be extra cautious then..." >&4
3514 echo "AFS does not seem to be running..." >&4
3517 : determine installation prefix for where package is to be installed.
3521 Since you are running AFS, I need to distinguish the directory in which
3522 files will reside from the directory in which they are installed (and from
3523 which they are presumably copied to the former directory by occult means).
3526 case "$installprefix" in
3527 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3528 *) dflt="$installprefix";;
3533 In some special cases, particularly when building $package for distribution,
3534 it is convenient to distinguish between the directory in which files should
3535 be installed from the directory ($prefix) in which they
3536 will eventually reside. For most users, these two directories are the same.
3539 case "$installprefix" in
3541 *) dflt=$installprefix;;
3545 rp='What installation prefix should I use for installing files?'
3547 installprefix="$ans"
3548 installprefixexp="$ansexp"
3550 : set the prefixit variable, to compute a suitable default value
3551 prefixit='case "$3" in
3553 case "$oldprefix" in
3554 "") eval "$1=\"\$$2\"";;
3561 ""|" ") eval "$1=\"\$$2\"";;
3567 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3569 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3570 /*-$oldprefix/*|\~*-$oldprefix/*)
3571 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3572 *) eval "$1=\"\$$2\"";;
3576 : set the base revision
3579 : get the patchlevel
3581 echo "Getting the current patchlevel..." >&4
3582 if $test -r $rsrc/patchlevel.h;then
3583 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3584 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3585 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
3591 $echo $n "(You have $package" $c
3594 *) $echo $n " $baserev" $c ;;
3596 $echo $n " patchlevel $patchlevel" $c
3597 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3600 if test 0 -eq "$subversion"; then
3601 version=`LC_ALL=C; export LC_ALL; \
3602 echo $baserev $patchlevel | \
3603 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3605 version=`LC_ALL=C; export LC_ALL; \
3606 echo $baserev $patchlevel $subversion | \
3607 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3610 : determine installation style
3611 : For now, try to deduce it from prefix unless it is already set.
3612 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3613 case "$installstyle" in
3614 '') case "$prefix" in
3615 *perl*) dflt='lib';;
3616 *) dflt='lib/perl5' ;;
3619 *) dflt='lib/perl5' ;;
3621 : Probably not worth prompting for this since we prompt for all
3622 : the directories individually, and the prompt would be too long and
3626 : determine where private library files go
3627 : Usual default is /usr/local/lib/perl5/$version.
3628 : Also allow things like /opt/perl/lib/$version, since
3629 : /opt/perl/lib/perl5... would be redundant.
3630 : The default "style" setting is made in installstyle.U
3631 case "$installstyle" in
3632 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3633 *) set dflt privlib lib/$version ;;
3638 There are some auxiliary files for $package that need to be put into a
3639 private library directory that is accessible by everyone.
3643 rp='Pathname where the private library files will reside?'
3646 privlibexp="$ansexp"
3647 : Change installation prefix, if necessary.
3648 if $test X"$prefix" != X"$installprefix"; then
3649 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3651 installprivlib="$privlibexp"
3654 : set the prefixup variable, to restore leading tilda escape
3655 prefixup='case "$prefixexp" in
3657 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3660 : determine where public architecture dependent libraries go
3663 : privlib default is /usr/local/lib/$package/$version
3664 : archlib default is /usr/local/lib/$package/$version/$archname
3665 : privlib may have an optional trailing /share.
3666 tdflt=`echo $privlib | $sed 's,/share$,,'`
3667 tdflt=$tdflt/$archname
3676 $spackage contains architecture-dependent library files. If you are
3677 sharing libraries in a heterogeneous environment, you might store
3678 these files in a separate location. Otherwise, you can just include
3679 them with the rest of the public library files.
3683 rp='Where do you want to put the public architecture-dependent libraries?'
3686 archlibexp="$ansexp"
3687 if $test X"$archlib" = X"$privlib"; then
3692 : Change installation prefix, if necessary.
3693 if $test X"$prefix" != X"$installprefix"; then
3694 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3696 installarchlib="$archlibexp"
3700 : Binary compatibility with 5.005 is not possible for builds
3701 : with advanced features
3702 case "$usethreads$usemultiplicity" in
3704 bincompat5005="$undef"
3705 d_bincompat5005="$undef"
3709 Perl 5.006 can be compiled for binary compatibility with 5.005.
3710 If you decide to do so, you will be able to continue using most
3711 of the extensions that were compiled for Perl 5.005.
3714 case "$bincompat5005$d_bincompat5005" in
3715 *"$undef"*) dflt=n ;;
3718 rp='Binary compatibility with Perl 5.005?'
3721 y*) val="$define" ;;
3726 case "$d_bincompat5005" in
3728 bincompat5005="$define"
3730 *) bincompat5005="$undef"
3731 d_bincompat5005="$undef"
3738 : see if setuid scripts can be secure
3741 Some kernels have a bug that prevents setuid #! scripts from being
3742 secure. Some sites have disabled setuid #! scripts because of this.
3744 First let's decide if your kernel supports secure setuid #! scripts.
3745 (If setuid #! scripts would be secure but have been disabled anyway,
3746 don't say that they are secure if asked.)
3751 if $test -d /dev/fd; then
3752 echo "#!$ls" >reflect
3753 chmod +x,u+s reflect
3754 ./reflect >flect 2>&1
3755 if $contains "/dev/fd" flect >/dev/null; then
3756 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3760 If you are not sure if they are secure, I can check but I'll need a
3761 username and password different from the one you are using right now.
3762 If you don't have such a username or don't want me to test, simply
3766 rp='Other username to test security of setuid scripts with?'
3771 case "$d_suidsafe" in
3772 '') echo "I'll assume setuid scripts are *not* secure." >&4
3775 echo "Well, the $hint value is *not* secure." >&4
3777 *) echo "Well, the $hint value *is* secure." >&4
3782 $rm -f reflect flect
3783 echo "#!$ls" >reflect
3784 chmod +x,u+s reflect
3787 echo '"su" will (probably) prompt you for '"$ans's password."
3788 su $ans -c './reflect >flect'
3789 if $contains "/dev/fd" flect >/dev/null; then
3790 echo "Okay, it looks like setuid scripts are secure." >&4
3793 echo "I don't think setuid scripts are secure." >&4
3798 rp='Does your kernel have *secure* setuid scripts?'
3801 [yY]*) val="$define";;
3806 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3807 echo "(That's for file descriptors, not floppy disks.)"
3813 $rm -f reflect flect
3815 : now see if they want to do setuid emulation
3818 case "$d_suidsafe" in
3821 echo "No need to emulate SUID scripts since they are secure here." >& 4
3825 Some systems have disabled setuid scripts, especially systems where
3826 setuid scripts cannot be secure. On systems where setuid scripts have
3827 been disabled, the setuid/setgid bits on scripts are currently
3828 useless. It is possible for $package to detect those bits and emulate
3829 setuid/setgid in a secure fashion. This emulation will only work if
3830 setuid scripts have been disabled in your kernel.
3834 "$define") dflt=y ;;
3837 rp="Do you want to do setuid/setgid emulation?"
3840 [yY]*) val="$define";;
3848 : What should the include directory be ?
3850 $echo $n "Hmm... $c"
3854 if $test -f /bin/mips && /bin/mips; then
3855 echo "Looks like a MIPS system..."
3856 $cat >usr.c <<'EOCP'
3857 #ifdef SYSTYPE_BSD43
3861 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3862 dflt='/bsd43/usr/include'
3866 mips_type='System V'
3868 $rm -f usr.c usr.out
3869 echo "and you're compiling with the $mips_type compiler and libraries."
3873 echo "Doesn't look like a MIPS system."
3883 case "$xxx_prompt" in
3886 rp='Where are the include files you want to use?'
3894 : see how we invoke the C preprocessor
3896 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3897 cat <<'EOT' >testcpp.c
3903 if test ! -f cppstdin; then
3904 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3905 # AIX cc -E doesn't show the absolute headerfile
3906 # locations but we'll cheat by using the -M flag.
3907 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
3909 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3912 echo "Keeping your $hint cppstdin wrapper."
3915 wrapper=`pwd`/cppstdin
3919 if $test "X$cppstdin" != "X" && \
3920 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3921 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3923 echo "You used to use $cppstdin $cppminus so we'll use that again."
3925 '') echo "But let's see if we can live without a wrapper..." ;;
3927 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3928 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3930 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3933 echo "(However, $cpprun $cpplast does not work, let's see...)"
3941 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3948 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3949 $cc -E <testcpp.c >testcpp.out 2>&1; \
3950 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3951 echo "Yup, it does."
3954 elif echo 'Nope...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"' -P" will work...'; \
3961 $cc -P <testcpp.c >testcpp.out 2>&1; \
3962 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3963 echo "Yipee, that works!"
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 "At long last!"
3972 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3973 $cpp <testcpp.c >testcpp.out 2>&1; \
3974 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3978 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3979 $cpp - <testcpp.c >testcpp.out 2>&1; \
3980 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3981 echo "Hooray, it works! I was beginning to wonder."
3984 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3985 $wrapper <testcpp.c >testcpp.out 2>&1; \
3986 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3992 rp="No dice. I can't find a C preprocessor. Name one:"
3996 $x_cpp <testcpp.c >testcpp.out 2>&1
3997 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3998 echo "OK, that will do." >&4
4000 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4015 echo "Perhaps can we force $cc -E using a wrapper..."
4016 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4017 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4023 echo "Nope, we'll have to live without it..."
4037 "$wrapper"|'cppstdin') ;;
4038 *) $rm -f $wrapper;;
4040 $rm -f testcpp.c testcpp.out
4042 : Set private lib path
4045 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4050 '') dlist="$loclibpth $plibpth $glibpth";;
4051 *) dlist="$libpth";;
4054 : Now check and see which directories actually exist, avoiding duplicates
4058 if $test -d $xxx; then
4061 *) libpth="$libpth $xxx";;
4067 Some systems have incompatible or broken versions of libraries. Among
4068 the directories listed in the question below, please remove any you
4069 know not to be holding relevant libraries, and add any that are needed.
4070 Say "none" for none.
4081 rp="Directories to use for library searches?"
4088 : compute shared library extension
4091 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4101 On some systems, shared libraries may be available. Answer 'none' if
4102 you want to suppress searching of shared libraries for the remaining
4103 of this configuration.
4106 rp='What is the file extension used for shared libraries?'
4110 : Define several unixisms.
4111 : Hints files or command line option can be used to override them.
4112 : The convoluted testing is in case hints files set either the old
4115 '') case "$exe_ext" in
4117 *) _exe="$exe_ext" ;;
4122 '') case "$lib_ext" in
4129 '') case "$obj_ext" in
4136 '') case "$path_sep" in
4147 : Which makefile gets called first. This is used by make depend.
4148 case "$firstmakefile" in
4149 '') firstmakefile='makefile';;
4154 Perl can be built to use the SOCKS proxy protocol library. To do so,
4155 Configure must be run with -Dusesocks.
4157 Normally you do not need this and you should answer no.
4161 $define|true|[yY]*) dflt='y';;
4164 rp='Build Perl for SOCKS?'
4167 y|Y) val="$define" ;;
4173 : Looking for optional libraries
4175 echo "Checking for optional libraries..." >&4
4180 case "$libswanted" in
4181 '') libswanted='c_s';;
4185 libswanted="$libswanted socks5 socks5_sh"
4188 for thislib in $libswanted; do
4190 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4191 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4192 echo "Found -l$thislib (shared)."
4195 *) dflt="$dflt -l$thislib";;
4197 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4198 echo "Found -l$thislib (shared)."
4201 *) dflt="$dflt -l$thislib";;
4203 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4204 echo "Found -l$thislib."
4207 *) dflt="$dflt -l$thislib";;
4209 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4210 echo "Found -l$thislib."
4213 *) dflt="$dflt -l$thislib";;
4215 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4216 echo "Found -l${thislib}_s."
4219 *) dflt="$dflt -l${thislib}_s";;
4221 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4222 echo "Found -l$thislib."
4225 *) dflt="$dflt -l$thislib";;
4228 echo "No -l$thislib."
4239 ' '|'') dflt='none';;
4244 In order to compile $package on your machine, a number of libraries
4245 are usually needed. Include any other special libraries here as well.
4246 Say "none" for none. The default list is almost always right.
4250 rp="What libraries to use?"
4257 : determine optimization, if desired, or use for debug flag also
4259 ' '|$undef) dflt='none';;
4261 *) dflt="$optimize";;
4265 By default, $package compiles with the -O flag to use the optimizer.
4266 Alternately, you might want to use the symbolic debugger, which uses
4267 the -g flag (on traditional Unix systems). Either flag can be
4268 specified here. To use neither flag, specify the word "none".
4271 rp="What optimizer/debugger flag should be used?"
4275 'none') optimize=" ";;
4279 : We will not override a previous value, but we might want to
4280 : augment a hint file
4282 default|recommended)
4283 case "$gccversion" in
4284 1*) dflt='-fpcc-struct-return' ;;
4287 *-g*) dflt="$dflt -DDEBUGGING";;
4289 case "$gccversion" in
4290 2*) if test -d /etc/conf/kconfig.d &&
4291 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4297 case "$gccversion" in
4301 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4302 echo 'int main(void) { return 0; }' > gcctest.c
4303 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4304 echo "Yes, it does." 2>&1
4307 echo "Leaving current flags $ccflags alone." 2>&1
4309 *) dflt="$dflt -fno-strict-aliasing" ;;
4312 echo "Nope, it doesn't, but that's ok." 2>&1
4319 case "$mips_type" in
4320 *BSD*|'') inclwanted="$locincpth $usrinc";;
4321 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4323 for thisincl in $inclwanted; do
4324 if $test -d $thisincl; then
4325 if $test x$thisincl != x$usrinc; then
4328 *) dflt="$dflt -I$thisincl";;
4334 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4336 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4344 *) dflt="$dflt -D$2";;
4348 set signal.h LANGUAGE_C; eval $inctest
4352 ccflags="$ccflags -DSOCKS"
4357 default|recommended) dflt="$ccflags $dflt" ;;
4358 *) dflt="$ccflags";;
4366 Your C compiler may want other flags. For this question you should include
4367 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4368 but you should NOT include libraries or ld flags like -lwhatever. If you
4369 want $package to honor its debug switch, you should include -DDEBUGGING here.
4370 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4372 To use no flags, specify the word "none".
4378 rp="Any additional cc flags?"
4385 : the following weeds options from ccflags that are of no interest to cpp
4387 case "$gccversion" in
4388 1*) cppflags="$cppflags -D__GNUC__"
4390 case "$mips_type" in
4392 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4398 echo "Let me guess what the preprocessor flags are..." >&4
4412 *) ftry="$previous $flag";;
4414 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4415 >cpp1.out 2>/dev/null && \
4416 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4417 >cpp2.out 2>/dev/null && \
4418 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4419 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4421 cppflags="$cppflags $ftry"
4431 *-*) echo "They appear to be: $cppflags";;
4433 $rm -f cpp.c cpp?.out
4437 : flags used in final linking phase
4439 '') if ./venix; then
4445 *-posix*) dflt="$dflt -posix" ;;
4448 *) dflt="$ldflags";;
4451 : Try to guess additional flags to pick up local libraries.
4452 for thislibdir in $libpth; do
4453 case " $loclibpth " in
4456 *"-L$thislibdir "*) ;;
4457 *) dflt="$dflt -L$thislibdir" ;;
4469 Your C linker may need flags. For this question you should
4470 include -L/whatever and any other flags used by the C linker, but you
4471 should NOT include libraries like -lwhatever.
4473 Make sure you include the appropriate -L/path flags if your C linker
4474 does not normally search all of the directories you specified above,
4477 To use no flags, specify the word "none".
4481 rp="Any additional ld flags (NOT including libraries)?"
4487 rmlist="$rmlist pdp11"
4491 echo "Checking your choice of C compiler and flags for coherency..." >&4
4492 $cat > try.c <<'EOF'
4494 int main() { printf("Ok\n"); exit(0); }
4496 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4498 $cat >try.msg <<'EOM'
4499 I've tried to compile and run the following simple program:
4502 $cat try.c >> try.msg
4504 $cat >> try.msg <<EOM
4511 and I got the following output:
4515 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4516 if sh -c './try' >>try.msg 2>&1; then
4520 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4523 cat >> try.msg <<'EOQS'
4524 If $libs contains -lsfio, and sfio is mis-configured, then it
4525 sometimes (apparently) runs and exits with a 0 status, but with no
4526 output! It may have to do with sfio's use of _exit vs. exit.
4529 rp="You have a big problem. Shall I abort Configure"
4536 echo "The program compiled OK, but exited with status $?." >>try.msg
4537 rp="You have a problem. Shall I abort Configure"
4541 echo "I can't compile the test program." >>try.msg
4542 rp="You have a BIG problem. Shall I abort Configure"
4548 case "$knowitall" in
4550 echo "(The supplied flags or libraries might be incorrect.)"
4558 *) echo "Ok. Stopping Configure." >&4
4563 n) echo "OK, that should do.";;
4565 $rm -f try try.* core
4567 : determine filename position in cpp output
4569 echo "Computing filename position in cpp output for #include directives..." >&4
4570 echo '#include <stdio.h>' > foo.c
4573 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4574 $grep '^[ ]*#.*stdio\.h' | \
4575 while read cline; do
4578 while $test \$# -gt 0; do
4579 if $test -r \`echo \$1 | $tr -d '"'\`; then
4584 pos=\`expr \$pos + 1\`
4596 *) pos="${fieldn}th";;
4598 echo "Your cpp writes the filename in the $pos field of the line."
4600 : locate header file
4605 for usrincdir in $usrinc
4607 if test -f \$usrincdir/\$wanted; then
4608 echo "\$usrincdir/\$wanted"
4612 awkprg='{ print \$$fieldn }'
4613 echo "#include <\$wanted>" > foo\$\$.c
4614 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4615 $grep "^[ ]*#.*\$wanted" | \
4616 while read cline; do
4617 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4619 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4620 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4625 # status = 0: grep returned 0 lines, case statement not executed
4626 # status = 1: headerfile found
4627 # status = 2: while loop executed, no headerfile found
4631 if test \$status -eq 1; then
4638 : define an alternate in-header-list? function
4639 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4640 cont=true; xxf="echo \"<\$1> found.\" >&4";
4641 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4642 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4644 case $# in 4) instead=instead;; *) instead="at last";; esac;
4645 while $test "$cont"; do
4647 var=$2; eval "was=\$$2";
4648 if $test "$xxx" && $test -r "$xxx";
4650 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4653 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4654 set $yyy; shift; shift; yyy=$@;
4655 case $# in 0) cont="";;
4656 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4657 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4658 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4659 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4663 do set $yyy; var=$2; eval "was=\$$2";
4664 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4665 set $yyy; shift; shift; yyy=$@;
4668 : see if this is a malloc.h system
4669 set malloc.h i_malloc
4672 : see if stdlib is available
4673 set stdlib.h i_stdlib
4676 : determine which malloc to compile in
4678 case "$usemymalloc" in
4679 ''|[yY]*|true|$define) dflt='y' ;;
4682 rp="Do you wish to attempt to use the malloc that comes with $package?"
4688 mallocsrc='malloc.c'
4689 mallocobj="malloc$_o"
4690 d_mymalloc="$define"
4693 : Remove malloc from list of libraries to use
4694 echo "Removing unneeded -lmalloc from library list" >&4
4695 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4698 echo "libs = $libs" >&4
4710 : compute the return types of malloc and free
4712 $cat >malloc.c <<END
4716 #include <sys/types.h>
4730 case "$malloctype" in
4732 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4739 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4743 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4750 echo "Your system uses $freetype free(), it would seem." >&4
4754 The installation process will also create a directory for
4755 vendor-supplied add-ons. Vendors who supply perl with their system
4756 may find it convenient to place all vendor-supplied files in this
4757 directory rather than in the main distribution directory. This will
4758 ease upgrades between binary-compatible maintenance versions of perl.
4760 Of course you may also use these directories in whatever way you see
4761 fit. For example, you might use them to access modules shared over a
4762 company-wide network.
4764 The default answer should be fine for most people.
4765 This causes further questions about vendor add-ons to be skipped
4766 and no vendor-specific directories will be configured for perl.
4769 rp='Do you want to configure vendor-specific add-on directories?'
4770 case "$usevendorprefix" in
4771 define|true|[yY]*) dflt=y ;;
4777 rp='Installation prefix to use for vendor-supplied add-ons?'
4778 case "$vendorprefix" in
4780 *) dflt=$vendorprefix ;;
4784 case "$vendorprefix" in
4788 *) oldvendorprefix="$prefix";;
4792 usevendorprefix="$define"
4794 vendorprefixexp="$ansexp"
4796 *) usevendorprefix="$undef"
4802 case "$vendorprefix" in
4803 '') d_vendorlib="$undef"
4807 *) d_vendorlib="$define"
4808 : determine where vendor-supplied modules go.
4809 : Usual default is /usr/local/lib/perl5/vendor_perl
4810 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4811 case "$installstyle" in
4812 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4813 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4816 rp='Pathname for the vendor-supplied library files?'
4819 vendorlibexp="$ansexp"
4820 : Change installation prefix, if necessary.
4821 if $test X"$prefix" != X"$installprefix"; then
4822 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4824 installvendorlib="$vendorlibexp"
4829 : Cruising for prototypes
4831 echo "Checking out function prototypes..." >&4
4832 $cat >prototype.c <<'EOCP'
4833 int main(int argc, char *argv[]) {
4836 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4837 echo "Your C compiler appears to support function prototypes."
4840 echo "Your C compiler doesn't seem to understand function prototypes."
4847 case "$prototype" in
4849 *) ansi2knr='ansi2knr'
4854 This version of $package can only be compiled by a compiler that
4855 understands function prototypes. Unfortunately, your C compiler
4857 doesn't seem to understand them. Sorry about that.
4859 If GNU cc is available for your system, perhaps you could try that instead.
4861 Eventually, we hope to support building Perl with pre-ANSI compilers.
4862 If you would like to help in that effort, please contact <perlbug@perl.org>.
4864 Aborting Configure now.
4870 : determine where public executables go
4875 rp='Pathname where the public executables will reside?'
4877 if $test "X$ansexp" != "X$binexp"; then
4882 : Change installation prefix, if necessary.
4883 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4884 if $test X"$prefix" != X"$installprefix"; then
4885 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4887 installbin="$binexp"
4890 : determine whether to install perl also as /usr/bin/perl
4893 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4895 Many scripts expect to perl to be installed as /usr/bin/perl.
4896 I can install the perl you are about to compile also as /usr/bin/perl
4897 (in addition to $installbin/perl).
4899 case "$installusrbinperl" in
4900 "$undef"|[nN]*) dflt='n';;
4903 rp="Do you want to install perl as /usr/bin/perl?"
4906 [yY]*) val="$define";;
4912 set installusrbinperl
4915 : define a shorthand compile call
4919 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4920 : define a shorthand compile call for compilations that should be ok.
4924 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4927 echo "Checking for GNU C Library..." >&4
4928 cat >gnulibc.c <<EOM
4940 if eval $compile_ok && ./gnulibc; then
4942 echo "You are using the GNU C Library"
4945 echo "You are not using the GNU C Library"
4951 : see if nm is to be used to determine whether a symbol is defined or not
4955 case "$d_gnulibc" in
4958 echo "nm probably won't work on the GNU C Library." >&4
4964 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4966 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4967 echo "'nm' won't be sufficient on this sytem." >&4
4973 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4974 if $test $dflt -gt 20; then
4984 true|$define) dflt=y;;
4991 I can use $nm to extract the symbols from your C libraries. This
4992 is a time consuming task which may generate huge output on the disk (up
4993 to 3 megabytes) but that should make the symbols extraction faster. The
4994 alternative is to skip the 'nm' extraction part and to compile a small
4995 test program instead to determine whether each symbol is present. If
4996 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4997 this may be the best solution.
4999 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5002 rp="Shall I use $nm to extract C symbols from the libraries?"
5005 [Nn]*) usenm=false;;
5014 : nm options which may be necessary
5016 '') if $test -f /mach_boot; then
5018 elif $test -d /usr/ccs/lib; then
5019 nm_opt='-p' # Solaris (and SunOS?)
5020 elif $test -f /dgux; then
5022 elif $test -f /lib64/rld; then
5023 nm_opt='-p' # 64-bit Irix
5029 : nm options which may be necessary for shared libraries but illegal
5030 : for archive libraries. Thank you, Linux.
5031 case "$nm_so_opt" in
5032 '') case "$myuname" in
5034 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5035 nm_so_opt='--dynamic'
5044 : get list of predefined functions in a handy place
5049 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5056 *) for thislib in $libs; do
5059 : Handle C library specially below.
5062 thislib=`echo $thislib | $sed -e 's/^-l//'`
5063 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5065 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5067 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5069 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5071 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5073 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5075 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5080 libnames="$libnames $try"
5082 *) libnames="$libnames $thislib" ;;
5091 for xxx in $libpth; do
5092 $test -r $1 || set $xxx/libc.$so
5093 : The messy sed command sorts on library version numbers.
5095 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5096 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5098 s/[0-9][0-9]*/0000&/g
5099 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5102 sort | $sed -e 's/^.* //'`
5105 $test -r $1 || set /usr/ccs/lib/libc.$so
5106 $test -r $1 || set /lib/libsys_s$_a
5112 if $test -r "$1"; then
5113 echo "Your (shared) C library seems to be in $1."
5115 elif $test -r /lib/libc && $test -r /lib/clib; then
5116 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5118 libc='/lib/clib /lib/libc'
5119 if $test -r /lib/syslib; then
5120 echo "(Your math library is in /lib/syslib.)"
5121 libc="$libc /lib/syslib"
5123 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5124 echo "Your C library seems to be in $libc, as you said before."
5125 elif $test -r $incpath/usr/lib/libc$_a; then
5126 libc=$incpath/usr/lib/libc$_a;
5127 echo "Your C library seems to be in $libc. That's fine."
5128 elif $test -r /lib/libc$_a; then
5130 echo "Your C library seems to be in $libc. You're normal."
5132 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5134 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5135 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5136 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5138 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5140 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5143 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5145 if $test -r "$tans"; then
5146 echo "Your C library seems to be in $tans, of all places."
5152 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5156 If the guess above is wrong (which it might be if you're using a strange
5157 compiler, or your machine supports multiple models), you can override it here.
5162 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5164 I can't seem to find your C library. I've looked in the following places:
5167 $sed 's/^/ /' libpath
5170 None of these seems to contain your C library. I need to get its name...
5175 rp='Where is your C library?'
5180 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5181 set X `cat libnames`
5184 case $# in 1) xxx=file; esac
5185 echo "Extracting names from the following $xxx for later perusal:" >&4
5187 $sed 's/^/ /' libnames >&4
5189 $echo $n "This may take a while...$c" >&4
5193 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5194 *) $nm $nm_opt $file 2>/dev/null;;
5199 $grep fprintf libc.tmp > libc.ptf
5200 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5201 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5203 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5205 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5207 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5209 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5211 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5213 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5215 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5217 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5219 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5221 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5223 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5225 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5227 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5228 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5230 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5232 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5234 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5236 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5238 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5240 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5242 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5244 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5246 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5248 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5250 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5252 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5254 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5256 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5258 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5261 $nm -p $* 2>/dev/null >libc.tmp
5262 $grep fprintf libc.tmp > libc.ptf
5263 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5264 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5270 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5272 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5273 for thisname in $libnames $libc; do
5274 $ar t $thisname >>libc.tmp
5276 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5278 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5279 # Repeat libc to extract forwarders to DLL entries too
5280 for thisname in $libnames $libc; do
5281 $ar tv $thisname >>libc.tmp
5282 # Revision 50 of EMX has bug in $ar.
5283 # it will not extract forwarders to DLL entries
5284 # Use emximp which will extract exactly them.
5285 emximp -o tmp.imp $thisname \
5287 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5288 < tmp.imp >>libc.tmp
5291 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5294 echo "$ar didn't seem to work right." >&4
5295 echo "Maybe this is a Cray...trying bld instead..." >&4
5296 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5298 for thisname in $libnames; do
5300 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5301 $ar t $thisname >>libc.tmp
5305 echo "That didn't work either. Giving up." >&4
5312 if $test -f /lib/syscalls.exp; then
5314 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5315 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5319 $rm -f libnames libpath
5321 : see if dld is available
5325 : is a C symbol defined?
5328 -v) tf=libc.tmp; tc=""; tdc="";;
5329 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5330 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5333 case "$reuseval-$4" in
5335 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5341 if $contains $tlook $tf >/dev/null 2>&1;
5346 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5347 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5355 $define) tval=true;;
5361 : define an is-in-libc? function
5362 inlibc='echo " "; td=$define; tu=$undef;
5363 sym=$1; var=$2; eval "was=\$$2";
5365 case "$reuseval$was" in
5375 echo "$sym() found." >&4;
5376 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5378 echo "$sym() NOT found." >&4;
5379 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5383 $define) echo "$sym() found." >&4;;
5384 *) echo "$sym() NOT found." >&4;;
5388 : see if dlopen exists
5395 : determine which dynamic loading, if any, to compile in
5397 dldir="ext/DynaLoader"
5410 $define) dflt='y' ;;
5413 $define) dflt='y' ;;
5415 : Does a dl_xxx.xs file exist for this operating system
5416 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5419 rp="Do you wish to use dynamic loading?"
5426 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5427 dflt="$dldir/dl_${osname}.xs"
5428 elif $test "$d_dlopen" = "$define" ; then
5429 dflt="$dldir/dl_dlopen.xs"
5430 elif $test "$i_dld" = "$define" ; then
5431 dflt="$dldir/dl_dld.xs"
5436 *) dflt="$dldir/$dlsrc"
5439 echo "The following dynamic loading files are available:"
5440 : Can not go over to $dldir because getfile has path hard-coded in.
5441 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5442 rp="Source file to use for dynamic loading"
5448 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5452 Some systems may require passing special flags to $cc -c to
5453 compile modules that will be used to create a shared library.
5454 To use no flags, say "none".
5457 case "$cccdlflags" in
5458 '') case "$gccversion" in
5459 '') case "$osname" in
5461 next) dflt='none' ;;
5462 irix*) dflt='-KPIC' ;;
5463 svr4*|esix*|solaris) dflt='-KPIC' ;;
5464 sunos) dflt='-pic' ;;
5468 *) case "$osname" in
5469 svr4*|esix*|solaris) dflt='-fPIC' ;;
5474 *) dflt="$cccdlflags" ;;
5476 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5479 none) cccdlflags=' ' ;;
5480 *) cccdlflags="$ans" ;;
5485 Some systems use ld to create libraries that can be dynamically loaded,
5486 while other systems (such as those using ELF) use $cc.
5490 '') $cat >try.c <<'EOM'
5491 /* Test for whether ELF binaries are produced */
5496 int i = open("a.out",O_RDONLY);
5499 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5500 exit(0); /* succeed (yes, it's ELF) */
5505 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5507 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5511 echo "I'll use ld to build dynamic libraries."
5520 rp="What command should be used to create dynamic libraries?"
5526 Some systems may require passing special flags to $ld to create a
5527 library that can be dynamically loaded. If your ld flags include
5528 -L/other/path options to locate libraries outside your loader's normal
5529 search path, you may need to specify those -L options here as well. To
5530 use no flags, say "none".
5533 case "$lddlflags" in
5534 '') case "$osname" in
5535 beos) dflt='-nostart' ;;
5537 linux|irix*) dflt='-shared' ;;
5538 next) dflt='none' ;;
5539 solaris) dflt='-G' ;;
5540 sunos) dflt='-assert nodefinitions' ;;
5541 svr4*|esix*) dflt="-G $ldflags" ;;
5545 *) dflt="$lddlflags" ;;
5548 : Try to guess additional flags to pick up local libraries.
5549 : Be careful not to append to a plain 'none'
5553 for thisflag in $ldflags; do
5558 *) dflt="$dflt $thisflag" ;;
5565 ''|' ') dflt='none' ;;
5568 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5571 none) lddlflags=' ' ;;
5572 *) lddlflags="$ans" ;;
5577 Some systems may require passing special flags to $cc to indicate that
5578 the resulting executable will use dynamic linking. To use no flags,
5582 case "$ccdlflags" in
5583 '') case "$osname" in
5584 hpux) dflt='-Wl,-E' ;;
5585 linux) dflt='-rdynamic' ;;
5586 next) dflt='none' ;;
5587 sunos) dflt='none' ;;
5591 *) dflt="$ccdlflags" ;;
5593 rp="Any special flags to pass to $cc to use dynamic loading?"
5596 none) ccdlflags=' ' ;;
5597 *) ccdlflags="$ans" ;;
5611 # No dynamic loading being used, so don't bother even to prompt.
5614 *) case "$useshrplib" in
5615 '') case "$osname" in
5616 svr4*|dgux|dynixptx|esix|powerux|beos)
5618 also='Building a shared libperl is required for dynamic loading to work on your system.'
5623 also='Building a shared libperl is needed for MAB support.'
5641 The perl executable is normally obtained by linking perlmain.c with
5642 libperl${_a}, any static extensions (usually just DynaLoader), and
5643 any other libraries needed on this system (such as -lm, etc.). Since
5644 your system supports dynamic loading, it is probably possible to build
5645 a shared libperl.$so. If you will have more than one executable linked
5646 to libperl.$so, this will significantly reduce the size of each
5647 executable, but it may have a noticeable affect on performance. The
5648 default is probably sensible for your system.
5652 rp="Build a shared libperl.$so (y/n)"
5656 useshrplib='true' ;;
5657 *) useshrplib='false' ;;
5662 case "$useshrplib" in
5666 # Figure out a good name for libperl.so. Since it gets stored in
5667 # a version-specific architecture-dependent library, the version
5668 # number isn't really that important, except for making cc/ld happy.
5670 # A name such as libperl.so.3.1
5671 majmin="libperl.$so.$patchlevel.$subversion"
5672 # A name such as libperl.so.301
5673 majonly=`echo $patchlevel $subversion |
5674 $awk '{printf "%d%02d", $1, $2}'`
5675 majonly=libperl.$so.$majonly
5676 # I'd prefer to keep the os-specific stuff here to a minimum, and
5677 # rely on figuring it out from the naming of libc.
5678 case "${osname}${osvers}" in
5681 # XXX How handle the --version stuff for MAB?
5683 linux*) # ld won't link with a bare -lperl otherwise.
5686 *) # Try to guess based on whether libc has major.minor.
5688 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5689 *libc.$so.[0-9]*) dflt=$majonly ;;
5690 *) dflt=libperl.$so ;;
5700 I need to select a good name for the shared libperl. If your system uses
5701 library names with major and minor numbers, then you might want something
5702 like $majmin. Alternatively, if your system uses a single version
5703 number for shared libraries, then you might want to use $majonly.
5704 Or, your system might be quite happy with a simple libperl.$so.
5706 Since the shared libperl will get installed into a version-specific
5707 architecture-dependent directory, the version number of the shared perl
5708 library probably isn't important, so the default should be o.k.
5711 rp='What name do you want to give to the shared libperl?'
5714 echo "Ok, I'll use $libperl"
5717 libperl="libperl${_a}"
5721 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5725 WARNING: Use of the shrpdir variable for the installation location of
5726 the shared $libperl is not supported. It was never documented and
5727 will not work in this version. Let me (perlbug@perl.com)
5728 know of any problems this may cause.
5734 But your current setting of $shrpdir is
5735 the default anyway, so it's harmless.
5740 Further, your current attempted setting of $shrpdir
5741 conflicts with the value of $archlibexp/CORE
5742 that installperl will use.
5749 # How will the perl executable find the installed shared $libperl?
5750 # Add $xxx to ccdlflags.
5751 # If we can't figure out a command-line option, use $shrpenv to
5752 # set env LD_RUN_PATH. The main perl makefile uses this.
5753 shrpdir=$archlibexp/CORE
5756 if "$useshrplib"; then
5759 # We'll set it in Makefile.SH...
5765 xxx="-Wl,-R$shrpdir"
5767 linux|irix*|dec_osf)
5768 xxx="-Wl,-rpath,$shrpdir"
5771 # next doesn't like the default...
5774 # beos doesn't like the default, either.
5777 # hpux doesn't like the default, either.
5778 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5781 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5787 # Only add $xxx if it isn't already in ccdlflags.
5788 case " $ccdlflags " in
5790 *) ccdlflags="$ccdlflags $xxx"
5793 Adding $xxx to the flags
5794 passed to $ld so that the perl executable will find the
5795 installed shared $libperl.
5803 # Fix ccdlflags in AIX for building external extensions.
5804 # (For building Perl itself bare -bE:perl.exp is needed,
5805 # Makefile.SH takes care of this.)
5807 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5809 # Respect a hint or command-line value.
5811 '') shrpenv="$tmp_shrpenv" ;;
5813 case "$ldlibpthname" in
5814 '') ldlibpthname=LD_LIBRARY_PATH ;;
5815 none) ldlibpthname='' ;;
5818 : determine where manual pages go
5819 set man1dir man1dir none
5823 $spackage has manual pages available in source form.
5827 echo "However, you don't have nroff, so they're probably useless to you."
5829 '') man1dir="none";;
5832 echo "If you don't want the manual sources installed, answer 'none'."
5837 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5838 lookpath="$lookpath $prefixexp/man/p_man/man1"
5839 lookpath="$lookpath $prefixexp/man/u_man/man1"
5840 lookpath="$lookpath $prefixexp/man/man.1"
5842 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5843 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5853 rp="Where do the main $spackage manual pages (source) go?"
5855 if $test "X$man1direxp" != "X$ansexp"; then
5859 man1direxp="$ansexp"
5865 : Change installation prefix, if necessary.
5866 if $test X"$prefix" != X"$installprefix"; then
5867 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5869 installman1dir="$man1direxp"
5872 : What suffix to use on installed man pages
5879 rp="What suffix should be used for the main $spackage man pages?"
5881 '') case "$man1dir" in
5895 *) dflt="$man1ext";;
5902 : see if we can have long filenames
5904 rmlist="$rmlist /tmp/cf$$"
5905 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5906 first=123456789abcdef
5907 second=/tmp/cf$$/$first
5908 $rm -f $first $second
5909 if (echo hi >$first) 2>/dev/null; then
5910 if $test -f 123456789abcde; then
5911 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5914 if (echo hi >$second) 2>/dev/null; then
5915 if $test -f /tmp/cf$$/123456789abcde; then
5917 That's peculiar... You can have filenames longer than 14 characters, but only
5918 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5919 I shall consider your system cannot support long filenames at all.
5923 echo 'You can have filenames longer than 14 characters.' >&4
5928 How confusing! Some of your filesystems are sane enough to allow filenames
5929 longer than 14 characters but some others like /tmp can't even think about them.
5930 So, for now on, I shall assume your kernel does not allow them at all.
5937 You can't have filenames longer than 14 chars. You can't even think about them!
5943 $rm -rf /tmp/cf$$ 123456789abcde*
5945 : determine where library module manual pages go
5946 set man3dir man3dir none
5950 $spackage has manual pages for many of the library modules.
5956 However, you don't have nroff, so they're probably useless to you.
5959 '') man3dir="none";;
5963 case "$d_flexfnam" in
5966 However, your system can't handle the long file names like File::Basename.3.
5969 '') man3dir="none";;
5973 echo "If you don't want the manual sources installed, answer 'none'."
5974 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5976 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5977 if $test -d "$privlib/man/man3"; then
5980 WARNING: Previous versions of perl installed man3 pages into
5981 $privlib/man/man3. This version will suggest a
5982 new default of $dflt.
5986 rp='Do you wish to preserve the old behavior?(y/n)'
5989 y*) dflt="$privlib/man/man3" ;;
5995 *) dflt="$man3dir" ;;
5999 rp="Where do the $package library man pages (source) go?"
6002 man3direxp="$ansexp"
6008 : Change installation prefix, if necessary.
6009 if $test X"$prefix" != X"$installprefix"; then
6010 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6012 installman3dir="$man3direxp"
6015 : What suffix to use on installed man pages
6021 rp="What suffix should be used for the $package library man pages?"
6023 '') case "$man3dir" in
6037 *) dflt="$man3ext";;
6044 : see if we have to deal with yellow pages, now NIS.
6045 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6046 if $test -f /usr/etc/nibindd; then
6048 echo "I'm fairly confident you're on a NeXT."
6050 rp='Do you get the hosts file via NetInfo?'
6059 y*) hostcat='nidump hosts .';;
6060 *) case "$hostcat" in
6061 nidump*) hostcat='';;
6071 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6079 rp='Are you getting the hosts file via yellow pages?'
6082 y*) hostcat='ypcat hosts';;
6083 *) hostcat='cat /etc/hosts';;
6089 '') hostcat='cat /etc/hosts';;
6092 '') groupcat='cat /etc/group';;
6095 '') passcat='cat /etc/passwd';;
6098 : now get the host name
6100 echo "Figuring out host name..." >&4
6101 case "$myhostname" in
6103 echo 'Maybe "hostname" will work...'
6104 if tans=`sh -c hostname 2>&1` ; then
6112 if $test "$cont"; then
6114 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6115 if tans=`cat /etc/systemid 2>&1` ; then
6117 phostname='cat /etc/systemid'
6118 echo "Whadyaknow. Xenix always was a bit strange..."
6121 elif $test -r /etc/systemid; then
6122 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6125 if $test "$cont"; then
6126 echo 'No, maybe "uuname -l" will work...'
6127 if tans=`sh -c 'uuname -l' 2>&1` ; then
6129 phostname='uuname -l'
6131 echo 'Strange. Maybe "uname -n" will work...'
6132 if tans=`sh -c 'uname -n' 2>&1` ; then
6134 phostname='uname -n'
6136 echo 'Oh well, maybe I can mine it out of whoami.h...'
6137 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6138 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6139 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6141 case "$myhostname" in
6142 '') echo "Does this machine have an identity crisis or something?"
6145 echo "Well, you said $myhostname before..."
6146 phostname='echo $myhostname';;
6152 : you do not want to know about this
6157 if $test "$myhostname" ; then
6159 rp='Your host name appears to be "'$myhostname'".'" Right?"
6167 : bad guess or no guess
6168 while $test "X$myhostname" = X ; do
6170 rp="Please type the (one word) name of your host:"
6175 : translate upper to lower if necessary
6176 case "$myhostname" in
6178 echo "(Normalizing case in your host name)"
6179 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6183 case "$myhostname" in
6185 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6186 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6187 echo "(Trimming domain name from host name--host name is now $myhostname)"
6189 *) case "$mydomain" in
6192 test "X$hostcat" = "Xypcat hosts" &&
6193 ypmatch "$myhostname" hosts 2>/dev/null |\
6194 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6197 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6198 /[ ]$myhostname[ . ]/p" > hosts
6201 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6202 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6203 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6204 hosts | $sort | $uniq | \
6205 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6206 case `$echo X$dflt` in
6207 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6210 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6215 tans=`./loc resolv.conf X /etc /usr/etc`
6216 if $test -f "$tans"; then
6217 echo "(Attempting domain name extraction from $tans)"
6218 dflt=.`$sed -n -e 's/ / /g' \
6219 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6220 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6222 .) dflt=.`$sed -n -e 's/ / /g' \
6223 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6224 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6231 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6232 dflt=.`sh -c domainname 2>/dev/null`
6235 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6240 .) echo "(Lost all hope -- silly guess then)"
6246 *) dflt="$mydomain";;
6250 rp="What is your domain name?"
6260 : translate upper to lower if necessary
6263 echo "(Normalizing case in your domain name)"
6264 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6268 : a little sanity check here
6269 case "$phostname" in
6272 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6273 $myhostname$mydomain|$myhostname) ;;
6275 case "$phostname" in
6277 echo "(That doesn't agree with your whoami.h file, by the way.)"
6280 echo "(That doesn't agree with your $phostname command, by the way.)"
6290 I need to get your e-mail address in Internet format if possible, i.e.
6291 something like user@host.domain. Please answer accurately since I have
6292 no easy means to double check it. The default value provided below
6293 is most probably close to the reality but may not be valid from outside
6294 your organization...
6298 while test "$cont"; do
6300 '') dflt="$cf_by@$myhostname$mydomain";;
6301 *) dflt="$cf_email";;
6303 rp='What is your e-mail address?'
6309 rp='Address does not look like an Internet one. Use it anyway?'
6325 If you or somebody else will be maintaining perl at your site, please
6326 fill in the correct e-mail address here so that they may be contacted
6327 if necessary. Currently, the "perlbug" program included with perl
6328 will send mail to this address in addition to perlbug@perl.com. You may
6329 enter "none" for no administrator.
6332 case "$perladmin" in
6333 '') dflt="$cf_email";;
6334 *) dflt="$perladmin";;
6336 rp='Perl administrator e-mail address'
6340 : figure out how to guarantee perl startup
6341 case "$startperl" in
6343 case "$sharpbang" in
6347 I can use the #! construct to start perl on your system. This will
6348 make startup of perl scripts faster, but may cause problems if you
6349 want to share those scripts and perl is not in a standard place
6350 ($binexp/perl) on all your platforms. The alternative is to force
6351 a shell by starting the script with a single ':' character.
6355 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6358 none) startperl=": # use perl";;
6359 *) startperl="#!$ans"
6360 if $test 30 -lt `echo "$ans" | wc -c`; then
6363 WARNING: Some systems limit the #! command to 32 characters.
6364 If you experience difficulty running Perl scripts with #!, try
6365 installing Perl in a directory with a shorter pathname.
6371 *) startperl=": # use perl"
6376 echo "I'll use $startperl to start perl scripts."
6378 : figure best path for perl in scripts
6381 perlpath="$binexp/perl"
6382 case "$startperl" in
6387 I will use the "eval 'exec'" idiom to start Perl on your system.
6388 I can use the full path of your Perl binary for this purpose, but
6389 doing so may cause problems if you want to share those scripts and
6390 Perl is not always in a standard place ($binexp/perl).
6394 rp="What path shall I use in \"eval 'exec'\"?"
6401 case "$startperl" in
6403 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6406 : determine where public executable scripts go
6407 set scriptdir scriptdir
6409 case "$scriptdir" in
6412 : guess some guesses
6413 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6414 $test -d /usr/share/bin && dflt=/usr/share/bin
6415 $test -d /usr/local/script && dflt=/usr/local/script
6416 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6417 $test -d $prefixexp/script && dflt=$prefixexp/script
6421 *) dflt="$scriptdir"
6426 Some installations have a separate directory just for executable scripts so
6427 that they can mount it across multiple architectures but keep the scripts in
6428 one spot. You might, for example, have a subdirectory of /usr/share for this.
6429 Or you might just lump your scripts in with all your other executables.
6433 rp='Where do you keep publicly executable scripts?'
6435 if $test "X$ansexp" != "X$scriptdirexp"; then
6439 scriptdirexp="$ansexp"
6440 : Change installation prefix, if necessary.
6441 if $test X"$prefix" != X"$installprefix"; then
6442 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6444 installscript="$scriptdirexp"
6449 After $package is installed, you may wish to install various
6450 add-on modules and utilities. Typically, these add-ons will
6451 be installed under $prefix with the rest
6452 of this package. However, you may wish to install such add-ons
6453 elsewhere under a different prefix.
6455 If you do not wish to put everything under a single prefix, that's
6456 ok. You will be prompted for the individual locations; this siteprefix
6457 is only used to suggest the defaults.
6459 The default should be fine for most people.
6463 rp='Installation prefix to use for add-on modules and utilities?'
6464 : XXX Here might be another good place for an installstyle setting.
6465 case "$siteprefix" in
6467 *) dflt=$siteprefix ;;
6471 case "$siteprefix" in
6476 *) oldsiteprefix="$prefix";;
6481 siteprefixexp="$ansexp"
6483 : determine where site specific libraries go.
6484 : Usual default is /usr/local/lib/perl5/site_perl
6485 : The default "style" setting is made in installstyle.U
6486 : XXX No longer works with Prefixit stuff.
6487 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6488 case "$installstyle" in
6489 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6490 *) dflt=$siteprefix/lib/site_$prog ;;
6494 The installation process will create a directory for
6495 site-specific extensions and modules. Most users find it convenient
6496 to place all site-specific files in this directory rather than in the
6497 main distribution directory.
6501 rp='Pathname for the site-specific library files?'
6504 sitelibexp="$ansexp"
6505 : Change installation prefix, if necessary.
6506 if $test X"$prefix" != X"$installprefix"; then
6507 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6509 installsitelib="$sitelibexp"
6512 : determine where site specific architecture-dependent libraries go.
6513 : sitelib default is /usr/local/lib/perl5/site_perl/
6514 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6515 : sitelib may have an optional trailing /share.
6516 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6517 tdflt="$tdflt/$apiversion/$archname"
6518 set sitearch sitearch none
6521 '') dflt="$tdflt" ;;
6522 *) dflt="$sitearch" ;;
6526 The installation process will also create a directory for
6527 architecture-dependent site-specific extensions and modules.
6531 rp='Pathname for the site-specific architecture-dependent library files?'
6534 sitearchexp="$ansexp"
6535 : Change installation prefix, if necessary.
6536 if $test X"$prefix" != X"$installprefix"; then
6537 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6539 installsitearch="$sitearchexp"
6542 : determine where add-on public executables go
6544 '') dflt=$siteprefix/bin ;;
6548 rp='Pathname where the add-on public executables should be installed?'
6551 sitebinexp="$ansexp"
6552 : Change installation prefix, if necessary.
6553 if $test X"$prefix" != X"$installprefix"; then
6554 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6556 installsitebin="$sitebinexp"
6561 Perl can be built to take advantage of long doubles which
6562 (if available) may give more accuracy and range for floating point
6563 numbers. To do so, Configure must be run with -Duselongdouble.
6565 If this doesn't make any sense to you, just accept the default 'n'.
6567 case "$uselongdouble" in
6568 $define|true|[yY]*) dflt='y';;
6571 rp='Try to use long doubles if available?'
6574 y|Y) val="$define" ;;
6580 case "$uselongdouble" in
6581 "$define"|true|[yY]*)
6582 : Look for a hint-file generated 'call-back-unit'. If the
6583 : user has specified that long doubles should be used,
6584 : we may need to set or change some other defaults.
6585 if $test -f uselongdouble.cbu; then
6586 echo "Your platform has some specific hints for long doubles, using them..."
6587 . ./uselongdouble.cbu
6590 (Your platform doesn't have any specific hints for long doubles.)
6598 Previous version of $package used the standard IO mechanisms as defined
6599 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6600 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6601 the default. This abstraction layer can use AT&T's sfio (if you already
6602 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6603 problems with some extension modules. Using PerlIO with stdio is safe,
6604 but it is slower than plain stdio and therefore is not the default.
6606 If this doesn't make any sense to you, just accept the default 'n'.
6608 case "$useperlio" in
6609 $define|true|[yY]*) dflt='y';;
6612 rp='Use the experimental PerlIO abstraction layer?'
6619 echo "Ok, doing things the stdio way"
6626 case "$vendorprefix" in
6627 '') d_vendorbin="$undef"
6631 *) d_vendorbin="$define"
6632 : determine where vendor-supplied executables go.
6633 dflt=$vendorprefix/bin
6635 rp='Pathname for the vendor-supplied executables directory?'
6638 vendorbinexp="$ansexp"
6639 : Change installation prefix, if necessary.
6640 if $test X"$prefix" != X"$installprefix"; then
6641 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
6643 installvendorbin="$vendorbinexp"
6648 : Check how to convert floats to strings.
6649 if test "X$d_Gconvert" = X; then
6651 echo "Checking for an efficient way to convert floats to strings."
6654 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6655 char *myname = "gconvert";
6658 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6659 char *myname = "gcvt";
6662 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6663 char *myname = "sprintf";
6669 checkit(expect, got)
6673 if (strcmp(expect, got)) {
6674 printf("%s oddity: Expected %s, got %s\n",
6675 myname, expect, got);
6685 /* This must be 1st test on (which?) platform */
6686 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6687 Gconvert(0.1, 8, 0, buf);
6688 checkit("0.1", buf);
6690 Gconvert(1.0, 8, 0, buf);
6693 Gconvert(0.0, 8, 0, buf);
6696 Gconvert(-1.0, 8, 0, buf);
6699 /* Some Linux gcvt's give 1.e+5 here. */
6700 Gconvert(100000.0, 8, 0, buf);
6701 checkit("100000", buf);
6703 /* Some Linux gcvt's give -1.e+5 here. */
6704 Gconvert(-100000.0, 8, 0, buf);
6705 checkit("-100000", buf);
6710 case "$d_Gconvert" in
6711 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6712 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6713 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6714 *) xxx_list='gconvert gcvt sprintf' ;;
6717 for xxx_convert in $xxx_list; do
6718 echo "Trying $xxx_convert"
6720 set try -DTRY_$xxx_convert
6721 if eval $compile; then
6722 echo "$xxx_convert" found. >&4
6724 echo "I'll use $xxx_convert to convert floats into a string." >&4
6727 echo "...But $xxx_convert didn't work as I expected."
6730 echo "$xxx_convert NOT found." >&4
6734 case "$xxx_convert" in
6735 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6736 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6737 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6741 : see if inttypes.h is available
6742 : we want a real compile instead of Inhdr because some systems
6743 : have an inttypes.h which includes non-existent headers
6746 #include <inttypes.h>
6748 static int32_t foo32 = 0x12345678;
6752 if eval $compile; then
6753 echo "<inttypes.h> found." >&4
6756 echo "<inttypes.h> NOT found." >&4
6764 case "$use64bits" in
6767 $echo $n "Checking to see if your system supports int64_t...$c" >&4
6769 #include <sys/types.h>
6770 #$i_inttypes I_INTTYPES
6772 #include <inttypes.h>
6774 int64_t foo() { int64_t x; x = 7; return x; }
6776 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6778 echo " Yup, it does." >&4
6781 echo " Nope, it doesn't." >&4
6792 : check for lengths of integral types
6796 echo "Checking to see how big your integers are..." >&4
6797 $cat >intsize.c <<'EOCP'
6801 printf("intsize=%d;\n", sizeof(int));
6802 printf("longsize=%d;\n", sizeof(long));
6803 printf("shortsize=%d;\n", sizeof(short));
6808 if eval $compile_ok && ./intsize > /dev/null; then
6810 echo "Your integers are $intsize bytes long."
6811 echo "Your long integers are $longsize bytes long."
6812 echo "Your short integers are $shortsize bytes long."
6816 Help! I can't compile and run the intsize test program: please enlighten me!
6817 (This is probably a misconfiguration in your system or libraries, and
6818 you really ought to fix it. Still, I'll try anyway.)
6822 rp="What is the size of an integer (in bytes)?"
6826 rp="What is the size of a long integer (in bytes)?"
6830 rp="What is the size of a short integer (in bytes)?"
6836 $rm -f intsize intsize.*
6838 : check for long long
6840 $echo $n "Checking to see if your system supports long long...$c" >&4
6841 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6842 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6844 echo " Yup, it does." >&4
6847 echo " Nope, it doesn't." >&4
6853 : check for length of long long
6854 case "${d_longlong}${longlongsize}" in
6857 $echo $n "Checking to see how big your long longs are...$c" >&4
6858 $cat >try.c <<'EOCP'
6862 printf("%d\n", sizeof(long long));
6866 if eval $compile_ok; then
6867 longlongsize=`./try`
6868 $echo " $longlongsize bytes." >&4
6872 echo "(I can't seem to compile the test program. Guessing...)"
6873 rp="What is the size of a long long (in bytes)?"
6877 if $test "X$longsize" = "X$longlongsize"; then
6878 echo "(That isn't any different from an ordinary long.)"
6886 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6888 echo "Checking how to print 64-bit integers..." >&4
6890 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6892 $cat >try.c <<'EOCP'
6893 #include <sys/types.h>
6896 int q = 12345678901;
6901 if eval $compile; then
6905 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6906 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6907 echo "We will use %d."
6913 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6915 $cat >try.c <<'EOCP'
6916 #include <sys/types.h>
6919 long q = 12345678901;
6924 if eval $compile; then
6928 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6929 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6930 echo "We will use %ld."
6936 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6938 $cat >try.c <<'EOCP'
6939 #include <sys/types.h>
6940 #include <inttypes.h>
6943 int64_t q = 12345678901;
6944 printf("%" PRId64 "\n", q);
6948 if eval $compile; then
6952 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6953 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6954 echo "We will use the C9X style."
6960 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6962 $cat >try.c <<'EOCP'
6963 #include <sys/types.h>
6966 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6967 printf("%lld\n", q);
6971 if eval $compile; then
6975 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6976 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6977 echo "We will use the %lld style."
6983 if $test X"$sPRId64" = X -a X"$quad" != X; then
6985 #include <sys/types.h>
6988 $quad q = 12345678901;
6993 if eval $compile; then
6997 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
6998 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
6999 echo "We will use %lld."
7005 if $test X"$sPRId64" = X -a X"$quad" != X; then
7007 #include <sys/types.h>
7010 $quad q = 12345678901;
7015 if eval $compile; then
7019 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
7020 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
7021 echo "We will use %qd."
7027 if $test X"$sPRId64" = X; then
7028 echo "Cannot figure out how to print 64-bit integers." >&4
7033 fi # intsize -o longsize -o d_int64t -o d_longlong
7036 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
7037 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
7039 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
7040 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
7044 : check for length of double
7046 case "$doublesize" in
7048 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7049 $cat >try.c <<'EOCP'
7053 printf("%d\n", sizeof(double));
7057 if eval $compile_ok; then
7059 $echo " $doublesize bytes." >&4
7062 echo "(I can't seem to compile the test program. Guessing...)"
7063 rp="What is the size of a double precision number (in bytes)?"
7071 : check for long doubles
7073 $echo $n "Checking to see if your system supports long double...$c" >&4
7074 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7075 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7077 echo " Yup, it does." >&4
7080 echo " Nope, it doesn't." >&4
7086 : check for length of long double
7087 case "${d_longdbl}${longdblsize}" in
7090 $echo $n "Checking to see how big your long doubles are...$c" >&4
7091 $cat >try.c <<'EOCP'
7095 printf("%d\n", sizeof(long double));
7099 if eval $compile; then
7101 $echo " $longdblsize bytes." >&4
7105 echo "(I can't seem to compile the test program. Guessing...)" >&4
7106 rp="What is the size of a long double (in bytes)?"
7110 if $test "X$doublesize" = "X$longdblsize"; then
7111 echo "(That isn't any different from an ordinary double.)"
7119 if $test X"$d_longdbl" = X"$define"; then
7121 echo "Checking how to print long doubles..." >&4
7123 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7124 $cat >try.c <<'EOCP'
7125 #include <sys/types.h>
7129 printf("%.3f\n", d);
7133 if eval $compile; then
7137 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7138 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7139 echo "We will use %f."
7145 if $test X"$sPRIfldbl" = X; then
7146 $cat >try.c <<'EOCP'
7147 #include <sys/types.h>
7150 long double d = 123.456;
7151 printf("%.3llf\n", d);
7155 if eval $compile; then
7159 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7160 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7161 echo "We will use %llf."
7167 if $test X"$sPRIfldbl" = X; then
7168 $cat >try.c <<'EOCP'
7169 #include <sys/types.h>
7172 long double d = 123.456;
7173 printf("%.3Lf\n", d);
7177 if eval $compile; then
7181 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7182 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7183 echo "We will use %Lf."
7189 if $test X"$sPRIfldbl" = X; then
7190 $cat >try.c <<'EOCP'
7191 #include <sys/types.h>
7194 long double d = 123.456;
7195 printf("%.3lf\n", d);
7199 if eval $compile; then
7203 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7204 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7205 echo "We will use %lf."
7211 if $test X"$sPRIfldbl" = X; then
7212 echo "Cannot figure out how to print long doubles." >&4
7219 case "$sPRIfldbl" in
7220 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7221 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7223 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7224 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7228 : Initialize h_fcntl
7231 : Initialize h_sysfile
7234 : access call always available on UNIX
7238 : locate the flags for 'access()'
7242 $cat >access.c <<'EOCP'
7243 #include <sys/types.h>
7248 #include <sys/file.h>
7257 : check sys/file.h first, no particular reason here
7258 if $test `./findhdr sys/file.h` && \
7259 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7261 echo "<sys/file.h> defines the *_OK access constants." >&4
7262 elif $test `./findhdr fcntl.h` && \
7263 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7265 echo "<fcntl.h> defines the *_OK access constants." >&4
7266 elif $test `./findhdr unistd.h` && \
7267 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7268 echo "<unistd.h> defines the *_OK access constants." >&4
7270 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7276 : see if accessx exists
7277 set accessx d_accessx
7280 : see if alarm exists
7284 : see if atolf exists
7288 : see if atoll exists
7292 : Look for GNU-cc style attribute checking
7294 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7295 $cat >attrib.c <<'EOCP'
7297 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7299 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7300 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7301 echo "Your C compiler doesn't fully support __attribute__."
7304 echo "Your C compiler supports __attribute__."
7308 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7315 : see if bcmp exists
7319 : see if bcopy exists
7323 : see if this is a unistd.h system
7324 set unistd.h i_unistd
7327 : see if getpgrp exists
7328 set getpgrp d_getpgrp
7331 case "$d_getpgrp" in
7334 echo "Checking to see which flavor of getpgrp is in use..."
7337 #include <sys/types.h>
7339 # include <unistd.h>
7343 if (getuid() == 0) {
7344 printf("(I see you are running Configure as super-user...)\n");
7348 if (getpgrp(1) == 0)
7357 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7358 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7360 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7361 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7364 echo "I can't seem to compile and run the test program."
7366 xxx="a USG one, i.e. you use getpgrp()."
7368 # SVR4 systems can appear rather BSD-ish.
7371 xxx="a BSD one, i.e. you use getpgrp(pid)."
7375 xxx="probably a USG one, i.e. you use getpgrp()."
7380 echo "Assuming your getpgrp is $xxx" >&4
7389 : see if setpgrp exists
7390 set setpgrp d_setpgrp
7393 case "$d_setpgrp" in
7396 echo "Checking to see which flavor of setpgrp is in use..."
7399 #include <sys/types.h>
7401 # include <unistd.h>
7405 if (getuid() == 0) {
7406 printf("(I see you are running Configure as super-user...)\n");
7410 if (-1 == setpgrp(1, 1))
7413 if (setpgrp() != -1)
7419 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7420 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7422 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7423 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7426 echo "(I can't seem to compile and run the test program.)"
7428 xxx="a USG one, i.e. you use setpgrp()."
7430 # SVR4 systems can appear rather BSD-ish.
7433 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7437 xxx="probably a USG one, i.e. you use setpgrp()."
7442 echo "Assuming your setpgrp is $xxx" >&4
7450 : see if bzero exists
7454 : see if signal is declared as pointer to function returning int or void
7456 xxx=`./findhdr signal.h`
7457 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7458 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7459 echo "You have int (*signal())() instead of void." >&4
7461 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7462 echo "You have void (*signal())()." >&4
7464 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7465 echo "You have int (*signal())() instead of void." >&4
7467 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7468 echo "You have void (*signal())()." >&4
7471 case "$d_voidsig" in
7473 echo "I can't determine whether signal handler returns void or int..." >&4
7475 rp="What type does your signal handler return?"
7482 echo "As you already told me, signal handler returns void." >&4
7485 *) echo "As you already told me, signal handler returns int." >&4
7492 case "$d_voidsig" in
7493 "$define") signal_t="void";;
7498 : check for ability to cast large floats to 32-bit ints.
7500 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7501 if $test "$intsize" -ge 4; then
7508 #include <sys/types.h>
7510 $signal_t blech(s) int s; { exit(3); }
7517 signal(SIGFPE, blech);
7519 /* Don't let compiler optimize the test away. Store the number
7520 in a writable string for gcc to pass to sscanf under HP/UX.
7522 sprintf(str, "2147483647");
7523 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7527 /* x86 processors will probably give 0x8000 0000, which is a
7528 sign change. We don't want that. We want to mimic SPARC
7529 behavior here, which is to preserve the sign and give
7532 if (i32 != ($xxx) f)
7538 if eval $compile_ok; then
7542 echo "(I can't seem to compile the test program--assuming it can't)"
7550 echo "Nope, it can't."
7557 : check for ability to cast negative floats to unsigned
7559 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7562 #include <sys/types.h>
7564 $signal_t blech(s) int s; { exit(7); }
7565 $signal_t blech_in_list(s) int s; { exit(4); }
7566 unsigned long dummy_long(p) unsigned long p; { return p; }
7567 unsigned int dummy_int(p) unsigned int p; { return p; }
7568 unsigned short dummy_short(p) unsigned short p; { return p; }
7572 unsigned long along;
7574 unsigned short ashort;
7578 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7579 a direct f = -123. assignment. gcc-2.8.0 reportedly
7580 optimized the whole file away
7582 /* Store the number in a writable string for gcc to pass to
7585 sprintf(str, "-123");
7586 sscanf(str, "%lf", &f); /* f = -123.; */
7588 signal(SIGFPE, blech);
7589 along = (unsigned long)f;
7590 aint = (unsigned int)f;
7591 ashort = (unsigned short)f;
7592 if (along != (unsigned long)-123)
7594 if (aint != (unsigned int)-123)
7596 if (ashort != (unsigned short)-123)
7598 sprintf(str, "1073741824.");
7599 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7602 along = (unsigned long)f;
7603 if (along != 0x80000000)
7607 along = (unsigned long)f;
7608 if (along != 0x7fffffff)
7612 along = (unsigned long)f;
7613 if (along != 0x80000001)
7617 signal(SIGFPE, blech_in_list);
7618 sprintf(str, "123.");
7619 sscanf(str, "%lf", &f); /* f = 123.; */
7620 along = dummy_long((unsigned long)f);
7621 aint = dummy_int((unsigned int)f);
7622 ashort = dummy_short((unsigned short)f);
7623 if (along != (unsigned long)123)
7625 if (aint != (unsigned int)123)
7627 if (ashort != (unsigned short)123)
7634 if eval $compile_ok; then
7638 echo "(I can't seem to compile the test program--assuming it can't)"
7641 case "$castflags" in
7646 echo "Nope, it can't."
7653 : see if vprintf exists
7655 if set vprintf val -f d_vprintf; eval $csym; $val; then
7656 echo 'vprintf() found.' >&4
7658 $cat >vprintf.c <<'EOF'
7659 #include <varargs.h>
7661 int main() { xxx("foo"); }
7670 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7674 if eval $compile && ./vprintf; then
7675 echo "Your vsprintf() returns (int)." >&4
7678 echo "Your vsprintf() returns (char*)." >&4
7682 echo 'vprintf() NOT found.' >&4
7692 : see if chown exists
7696 : see if chroot exists
7700 : see if chsize exists
7704 : check for const keyword
7706 echo 'Checking to see if your C compiler knows about "const"...' >&4
7707 $cat >const.c <<'EOCP'
7708 typedef struct spug { int drokk; } spug;
7715 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7717 echo "Yup, it does."
7720 echo "Nope, it doesn't."
7725 : see if crypt exists
7727 if set crypt val -f d_crypt; eval $csym; $val; then
7728 echo 'crypt() found.' >&4
7732 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7733 if $test -z "$cryptlib"; then
7734 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7738 if $test -z "$cryptlib"; then
7739 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7743 if $test -z "$cryptlib"; then
7744 cryptlib=`./loc libcrypt$_a "" $libpth`
7748 if $test -z "$cryptlib"; then
7749 echo 'crypt() NOT found.' >&4
7758 : get csh whereabouts
7760 'csh') val="$undef" ;;
7765 : Respect a hint or command line value for full_csh.
7767 '') full_csh=$csh ;;
7770 : see if cuserid exists
7771 set cuserid d_cuserid
7774 : see if this is a limits.h system
7775 set limits.h i_limits
7778 : see if this is a float.h system
7782 : See if number of significant digits in a double precision number is known
7784 $cat >dbl_dig.c <<EOM
7794 printf("Contains DBL_DIG");
7797 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7798 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7799 echo "DBL_DIG found." >&4
7802 echo "DBL_DIG NOT found." >&4
7809 : see if difftime exists
7810 set difftime d_difftime
7813 : see if this is a dirent system
7815 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7817 echo "<dirent.h> found." >&4
7820 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7821 echo "<sys/dir.h> found." >&4
7824 xinc=`./findhdr sys/ndir.h`
7826 echo "<dirent.h> NOT found." >&4
7831 : Look for type of directory structure.
7833 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7835 case "$direntrytype" in
7838 $define) guess1='struct dirent' ;;
7839 *) guess1='struct direct' ;;
7842 *) guess1="$direntrytype"
7847 'struct dirent') guess2='struct direct' ;;
7848 *) guess2='struct dirent' ;;
7851 if $contains "$guess1" try.c >/dev/null 2>&1; then
7852 direntrytype="$guess1"
7853 echo "Your directory entries are $direntrytype." >&4
7854 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7855 direntrytype="$guess2"
7856 echo "Your directory entries seem to be $direntrytype." >&4
7858 echo "I don't recognize your system's directory entries." >&4
7859 rp="What type is used for directory entries on this system?"
7867 : see if the directory entry stores field length
7869 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7870 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7871 echo "Good, your directory entry keeps length information in d_namlen." >&4
7874 echo "Your directory entry does not know about the d_namlen field." >&4
7881 : see if dlerror exists
7884 set dlerror d_dlerror
7888 : see if dlfcn is available
7896 On a few systems, the dynamically loaded modules that perl generates and uses
7897 will need a different extension than shared libs. The default will probably
7905 rp='What is the extension of dynamically loaded modules'
7914 : Check if dlsym need a leading underscore
7920 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7921 $cat >dyna.c <<'EOM'
7930 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7932 #include <sys/types.h>
7946 int mode = RTLD_LAZY ;
7948 handle = dlopen("./dyna.$dlext", mode) ;
7949 if (handle == NULL) {
7954 symbol = dlsym(handle, "fred") ;
7955 if (symbol == NULL) {
7956 /* try putting a leading underscore */
7957 symbol = dlsym(handle, "_fred") ;
7958 if (symbol == NULL) {
7971 : Call the object file tmp-dyna.o in case dlext=o.
7972 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7973 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7974 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7975 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7978 1) echo "Test program failed using dlopen." >&4
7979 echo "Perhaps you should not use dynamic loading." >&4;;
7980 2) echo "Test program failed using dlsym." >&4
7981 echo "Perhaps you should not use dynamic loading." >&4;;
7982 3) echo "dlsym needs a leading underscore" >&4
7984 4) echo "dlsym doesn't need a leading underscore." >&4;;
7987 echo "I can't compile and run the test program." >&4
7988 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
7993 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7998 hasproto='varname=$1; func=$2; shift; shift;
7999 while $test $# -ge 2; do
8001 $define) echo "#include <$2>";;
8005 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8006 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8007 echo "$func() prototype found.";
8010 echo "$func() prototype NOT found.";
8015 $rm -f try.c tryout.c'
8017 : see if prototype for drand48 is available
8019 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8022 : see if dup2 exists
8026 : see if eaccess exists
8027 set eaccess d_eaccess
8030 : see if endgrent exists
8031 set endgrent d_endgrent
8034 : see if endhostent exists
8035 set endhostent d_endhent
8038 : see if endnetent exists
8039 set endnetent d_endnent
8042 : see if endprotoent exists
8043 set endprotoent d_endpent
8046 : see if endpwent exists
8047 set endpwent d_endpwent
8050 : see if endservent exists
8051 set endservent d_endsent
8054 : see if endspent exists
8055 set endspent d_endspent
8058 : Locate the flags for 'open()'
8060 $cat >open3.c <<'EOCP'
8061 #include <sys/types.h>
8066 #include <sys/file.h>
8077 : check sys/file.h first to get FREAD on Sun
8078 if $test `./findhdr sys/file.h` && \
8079 set open3 -DI_SYS_FILE && eval $compile; then
8081 echo "<sys/file.h> defines the O_* constants..." >&4
8083 echo "and you have the 3 argument form of open()." >&4
8086 echo "but not the 3 argument form of open(). Oh, well." >&4
8089 elif $test `./findhdr fcntl.h` && \
8090 set open3 -DI_FCNTL && eval $compile; then
8092 echo "<fcntl.h> defines the O_* constants..." >&4
8094 echo "and you have the 3 argument form of open()." >&4
8097 echo "but not the 3 argument form of open(). Oh, well." >&4
8102 echo "I can't find the O_* constant definitions! You got problems." >&4
8108 : check for non-blocking I/O stuff
8109 case "$h_sysfile" in
8110 true) echo "#include <sys/file.h>" > head.c;;
8113 true) echo "#include <fcntl.h>" > head.c;;
8114 *) echo "#include <sys/fcntl.h>" > head.c;;
8119 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8120 case "$o_nonblock" in
8123 $cat >>try.c <<'EOCP'
8126 printf("O_NONBLOCK\n");
8130 printf("O_NDELAY\n");
8134 printf("FNDELAY\n");
8141 if eval $compile_ok; then
8143 case "$o_nonblock" in
8144 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8145 *) echo "Seems like we can use $o_nonblock.";;
8148 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8151 *) echo "Using $hint value $o_nonblock.";;
8153 $rm -f try try.* .out core
8156 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8162 #include <sys/types.h>
8164 #define MY_O_NONBLOCK $o_nonblock
8165 #ifndef errno /* XXX need better Configure test */
8168 $signal_t blech(x) int x; { exit(3); }
8170 $cat >> try.c <<'EOCP'
8178 pipe(pd); /* Down: child -> parent */
8179 pipe(pu); /* Up: parent -> child */
8182 close(pd[1]); /* Parent reads from pd[0] */
8183 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8184 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8186 signal(SIGALRM, blech);
8188 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8190 sprintf(string, "%d\n", ret);
8191 write(2, string, strlen(string));
8194 if (errno == EAGAIN) {
8200 if (errno == EWOULDBLOCK)
8201 printf("EWOULDBLOCK\n");
8204 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8205 sleep(2); /* Give it time to close our pipe */
8207 ret = read(pd[0], buf, 1); /* Should read EOF */
8209 sprintf(string, "%d\n", ret);
8210 write(3, string, strlen(string));
8214 close(pd[0]); /* We write to pd[1] */
8215 close(pu[1]); /* We read from pu[0] */
8216 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8217 close(pd[1]); /* Pipe pd is now fully closed! */
8218 exit(0); /* Bye bye, thank you for playing! */
8222 if eval $compile_ok; then
8223 echo "$startsh" >mtry
8224 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8226 ./mtry >/dev/null 2>&1
8228 0) eagain=`$cat try.out`;;
8229 1) echo "Could not perform non-blocking setting!";;
8230 2) echo "I did a successful read() for something that was not there!";;
8231 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8232 *) echo "Something terribly wrong happened during testing.";;
8234 rd_nodata=`$cat try.ret`
8235 echo "A read() system call with no data present returns $rd_nodata."
8236 case "$rd_nodata" in
8239 echo "(That's peculiar, fixing that to be -1.)"
8245 echo "Forcing errno EAGAIN on read() with no data available."
8249 echo "Your read() sets errno to $eagain when no data is available."
8252 status=`$cat try.err`
8254 0) echo "And it correctly returns 0 to signal EOF.";;
8255 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8256 *) echo "However, your read() returns '$status' on EOF??";;
8259 if test "$status" = "$rd_nodata"; then
8260 echo "WARNING: you can't distinguish between EOF and no data!"
8264 echo "I can't compile the test program--assuming errno EAGAIN will do."
8271 echo "Using $hint value $eagain."
8272 echo "Your read() returns $rd_nodata when no data is present."
8273 case "$d_eofnblk" in
8274 "$define") echo "And you can see EOF because read() returns 0.";;
8275 "$undef") echo "But you can't see EOF status from read() returned value.";;
8277 echo "(Assuming you can't see EOF status from read anyway.)"
8283 $rm -f try try.* .out core head.c mtry
8285 : see if fchmod exists
8289 : see if fchown exists
8293 : see if this is an fcntl system
8297 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8298 while $test $# -ge 2; do
8300 $define) echo "#include <$2>";;
8304 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8306 if eval $compile; then
8317 : see whether socket exists
8319 $echo $n "Hmm... $c" >&4
8320 if set socket val -f d_socket; eval $csym; $val; then
8321 echo "Looks like you have Berkeley networking support." >&4
8323 if set setsockopt val -f; eval $csym; $val; then
8326 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8330 if $contains socklib libc.list >/dev/null 2>&1; then
8331 echo "Looks like you have Berkeley networking support." >&4
8333 : we will have to assume that it supports the 4.2 BSD interface
8336 echo "You don't have Berkeley networking in libc$_a..." >&4
8337 if test "X$d_socket" = "X$define"; then
8338 echo "...but you seem to believe that you have sockets." >&4
8340 for net in net socket
8342 if test -f /usr/lib/lib$net$_a; then
8343 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8344 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8345 if $contains socket libc.list >/dev/null 2>&1; then
8350 echo "...but the Wollongong group seems to have hacked it in." >&4
8351 sockethdr="-I/usr/netinclude"
8354 echo "Found Berkeley sockets interface in lib$net." >& 4
8355 if $contains setsockopt libc.list >/dev/null 2>&1; then
8358 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8365 if test "X$d_socket" != "X$define"; then
8366 echo "or anywhere else I see." >&4
8374 : see if socketpair exists
8375 set socketpair d_sockpair
8380 echo "Checking the availability of certain socket constants..." >& 4
8381 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8382 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8384 #include <sys/types.h>
8385 #include <sys/socket.h>
8391 set try; if eval $compile; then
8394 set d_${enum}; eval $setvar
8398 : see if sys/select.h has to be included
8399 set sys/select.h i_sysselct
8402 : see if we should include time.h, sys/time.h, or both
8404 if test "X$timeincl" = X; then
8405 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8406 $echo $n "I'm now running the test program...$c"
8407 $cat >try.c <<'EOCP'
8408 #include <sys/types.h>
8413 #ifdef SYSTIMEKERNEL
8416 #include <sys/time.h>
8419 #include <sys/select.h>
8428 struct timezone tzp;
8430 if (foo.tm_sec == foo.tm_sec)
8433 if (bar.tv_sec == bar.tv_sec)
8440 for s_timezone in '-DS_TIMEZONE' ''; do
8442 for s_timeval in '-DS_TIMEVAL' ''; do
8443 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8444 for i_time in '' '-DI_TIME'; do
8445 for i_systime in '-DI_SYSTIME' ''; do
8448 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8449 if eval $compile; then
8450 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8454 $echo $n "Succeeded with $flags$c"
8466 *SYSTIMEKERNEL*) i_systimek="$define"
8467 timeincl=`./findhdr sys/time.h`
8468 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8469 *) i_systimek="$undef";;
8472 *I_TIME*) i_time="$define"
8473 timeincl=`./findhdr time.h`" $timeincl"
8474 echo "We'll include <time.h>." >&4;;
8475 *) i_time="$undef";;
8478 *I_SYSTIME*) i_systime="$define"
8479 timeincl=`./findhdr sys/time.h`" $timeincl"
8480 echo "We'll include <sys/time.h>." >&4;;
8481 *) i_systime="$undef";;
8486 : check for fd_set items
8489 Checking to see how well your C compiler handles fd_set and friends ...
8491 $cat >fd_set.c <<EOCP
8492 #$i_systime I_SYS_TIME
8493 #$i_sysselct I_SYS_SELECT
8494 #$d_socket HAS_SOCKET
8495 #include <sys/types.h>
8497 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8500 #include <sys/time.h>
8503 #include <sys/select.h>
8512 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8519 set fd_set -DTRYBITS
8520 if eval $compile; then
8521 d_fds_bits="$define"
8523 echo "Well, your system knows about the normal fd_set typedef..." >&4
8525 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8526 d_fd_macros="$define"
8529 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8531 d_fd_macros="$undef"
8535 Hmm, your compiler has some difficulty with fd_set. Checking further...
8538 if eval $compile; then
8541 echo "Well, your system has some sort of fd_set available..." >&4
8543 echo "and you have the normal fd_set macros." >&4
8544 d_fd_macros="$define"
8547 but not the normal fd_set macros! Gross! More work for me...
8549 d_fd_macros="$undef"
8552 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8555 d_fd_macros="$undef"
8560 : see if fgetpos exists
8561 set fgetpos d_fgetpos
8564 : see if flock exists
8568 : see if fork exists
8572 : see if pathconf exists
8573 set pathconf d_pathconf
8576 : see if fpathconf exists
8577 set fpathconf d_fpathconf
8581 : see if llseek exists
8587 $echo $n "Checking to see if your system supports off64_t...$c" >&4
8589 #include <sys/types.h>
8591 off64_t foo() { off64_t x; x = 7; return x; }'
8593 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8595 echo " Yup, it does." >&4
8598 echo " Nope, it doesn't." >&4
8604 : check for fpos64_t
8606 $echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8608 #include <sys/stdio.h>
8609 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8611 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8613 echo " Yup, it does." >&4
8616 echo " Nope, it doesn't." >&4
8622 hasstruct='varname=$1; struct=$2; shift; shift;
8623 while $test $# -ge 2; do
8625 $define) echo "#include <$2>";;
8629 echo "int main () { struct $struct foo; }" >> try.c;
8631 if eval $compile; then
8640 : see if this is a sys/param system
8641 set sys/param.h i_sysparam
8644 : see if this is a sys/mount.h system
8645 set sys/mount.h i_sysmount
8648 : see if sys/types.h has to be included
8649 set sys/types.h i_systypes
8654 echo "Checking to see if your system supports struct fs_data..." >&4
8655 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8657 case "$d_fs_data_s" in
8658 "$define") echo "Yup, it does." >&4 ;;
8659 *) echo "Nope, it doesn't." >&4 ;;
8662 : see if fseeko exists
8666 : see if fsetpos exists
8667 set fsetpos d_fsetpos
8671 : see if fstatfs exists
8672 set fstatfs d_fstatfs
8676 : see if statvfs exists
8677 set statvfs d_statvfs
8680 : see if fstatvfs exists
8681 set fstatvfs d_fstatvfs
8685 : see if ftello exists
8689 : see if getgrent exists
8690 set getgrent d_getgrent
8693 : see if gethostbyaddr exists
8694 set gethostbyaddr d_gethbyaddr
8697 : see if gethostbyname exists
8698 set gethostbyname d_gethbyname
8701 : see if gethostent exists
8702 set gethostent d_gethent
8705 : see how we will look up host name
8708 if set gethostname val -f d_gethname; eval $csym; $val; then
8709 echo 'gethostname() found.' >&4
8710 d_gethname="$define"
8713 if set uname val -f d_uname; eval $csym; $val; then
8716 uname() was found, but you're running xenix, and older versions of xenix
8717 have a broken uname(). If you don't really know whether your xenix is old
8718 enough to have a broken system call, use the default answer.
8725 rp='Is your uname() broken?'
8728 n*) d_uname="$define"; call=uname;;
8731 echo 'uname() found.' >&4
8738 case "$d_gethname" in
8739 '') d_gethname="$undef";;
8742 '') d_uname="$undef";;
8744 case "$d_uname$d_gethname" in
8749 Every now and then someone has a $call() that lies about the hostname
8750 but can't be fixed for political or economic reasons. If you wish, I can
8751 pretend $call() isn't there and maybe compute hostname at run-time
8752 thanks to the '$phostname' command.
8755 rp="Shall I ignore $call() from now on?"
8758 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8761 case "$phostname" in
8763 *) case "$aphostname" in
8769 file=`./loc $file $file $pth`
8770 aphostname=`echo $file $*`
8775 case "$d_uname$d_gethname" in
8778 case "$phostname" in
8780 echo "There will be no way for $package to get your hostname." >&4;;
8782 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8786 case "$d_phostname" in
8787 '') d_phostname="$undef";;
8790 : see if this is a netdb.h system
8794 : see if prototypes for various gethostxxx netdb.h functions are available
8796 set d_gethostprotos gethostent $i_netdb netdb.h
8799 : see if getlogin exists
8800 set getlogin d_getlogin
8803 : see if getmnt exists
8807 : see if getmntent exists
8808 set getmntent d_getmntent
8811 : see if getnetbyaddr exists
8812 set getnetbyaddr d_getnbyaddr
8815 : see if getnetbyname exists
8816 set getnetbyname d_getnbyname
8819 : see if getnetent exists
8820 set getnetent d_getnent
8823 : see if prototypes for various getnetxxx netdb.h functions are available
8825 set d_getnetprotos getnetent $i_netdb netdb.h
8829 : see if getprotobyname exists
8830 set getprotobyname d_getpbyname
8833 : see if getprotobynumber exists
8834 set getprotobynumber d_getpbynumber
8837 : see if getprotoent exists
8838 set getprotoent d_getpent
8841 : see if getpgid exists
8842 set getpgid d_getpgid
8845 : see if getpgrp2 exists
8846 set getpgrp2 d_getpgrp2
8849 : see if getppid exists
8850 set getppid d_getppid
8853 : see if getpriority exists
8854 set getpriority d_getprior
8857 : see if prototypes for various getprotoxxx netdb.h functions are available
8859 set d_getprotoprotos getprotoent $i_netdb netdb.h
8862 : see if getpwent exists
8863 set getpwent d_getpwent
8867 : see if getservbyname exists
8868 set getservbyname d_getsbyname
8871 : see if getservbyport exists
8872 set getservbyport d_getsbyport
8875 : see if getservent exists
8876 set getservent d_getsent
8879 : see if prototypes for various getservxxx netdb.h functions are available
8881 set d_getservprotos getservent $i_netdb netdb.h
8884 : see if getspent exists
8885 set getspent d_getspent
8888 : see if getspnam exists
8889 set getspnam d_getspnam
8892 : see if gettimeofday or ftime exists
8893 set gettimeofday d_gettimeod
8895 case "$d_gettimeod" in
8901 val="$undef"; set d_ftime; eval $setvar
8904 case "$d_gettimeod$d_ftime" in
8907 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8911 : see if this is an grp system
8917 xxx=`./findhdr grp.h`
8918 $cppstdin $cppflags $cppminus < $xxx >$$.h
8920 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8932 set d_grpasswd; eval $setvar
8936 : see if hasmntopt exists
8937 set hasmntopt d_hasmntopt
8940 : see if this is a netinet/in.h or sys/in.h system
8941 set netinet/in.h i_niin sys/in.h i_sysin
8944 : see if arpa/inet.h has to be included
8945 set arpa/inet.h i_arpainet
8948 : see if htonl --and friends-- exists
8953 : Maybe they are macros.
8958 #include <sys/types.h>
8959 #$i_niin I_NETINET_IN
8961 #$i_arpainet I_ARPA_INET
8963 #include <netinet/in.h>
8969 #include <arpa/inet.h>
8972 printf("Defined as a macro.");
8975 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8976 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8978 echo "But it seems to be defined as a macro." >&4
8986 : see which of string.h or strings.h is needed
8988 strings=`./findhdr string.h`
8989 if $test "$strings" && $test -r "$strings"; then
8990 echo "Using <string.h> instead of <strings.h>." >&4
8994 strings=`./findhdr strings.h`
8995 if $test "$strings" && $test -r "$strings"; then
8996 echo "Using <strings.h> instead of <string.h>." >&4
8998 echo "No string header found -- You'll surely have problems." >&4
9004 "$undef") strings=`./findhdr strings.h`;;
9005 *) strings=`./findhdr string.h`;;
9010 if set index val -f; eval $csym; $val; then
9011 if set strchr val -f d_strchr; eval $csym; $val; then
9012 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9015 echo "strchr() found." >&4
9019 echo "index() found." >&4
9024 echo "index() found." >&4
9027 if set strchr val -f d_strchr; eval $csym; $val; then
9030 echo "strchr() found." >&4
9032 echo "No index() or strchr() found!" >&4
9037 set d_strchr; eval $setvar
9039 set d_index; eval $setvar
9041 : check whether inet_aton exists
9042 set inet_aton d_inetaton
9047 $cat >isascii.c <<'EOCP'
9059 if eval $compile; then
9060 echo "isascii() found." >&4
9063 echo "isascii() NOT found." >&4
9070 : see if killpg exists
9074 : see if lchown exists
9076 $cat > try.c <<'EOCP'
9077 /* System header to define __stub macros and hopefully few prototypes,
9078 which can conflict with char lchown(); below. */
9080 /* Override any gcc2 internal prototype to avoid an error. */
9081 /* We use char because int might match the return type of a gcc2
9082 builtin and then its argument prototype would still apply. */
9085 /* The GNU C library defines this for functions which it implements
9086 to always fail with ENOSYS. Some functions are actually named
9087 something starting with __ and the normal name is an alias. */
9088 #if defined (__stub_lchown) || defined (__stub___lchown)
9096 if eval $compile; then
9097 $echo "lchown() found." >&4
9100 $echo "lchown() NOT found." >&4
9106 : See if number of significant digits in a double precision number is known
9108 $cat >ldbl_dig.c <<EOM
9118 printf("Contains LDBL_DIG");
9121 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9122 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9123 echo "LDBL_DIG found." >&4
9126 echo "LDBL_DIG NOT found." >&4
9133 : see if link exists
9137 : see if localeconv exists
9138 set localeconv d_locconv
9141 : see if lockf exists
9145 : see if lstat exists
9149 : see if mblen exists
9153 : see if mbstowcs exists
9154 set mbstowcs d_mbstowcs
9157 : see if mbtowc exists
9161 : see if memchr exists
9165 : see if memcmp exists
9169 : see if memcpy exists
9173 : see if memmove exists
9174 set memmove d_memmove
9177 : see if memset exists
9181 : see if mkdir exists
9185 : see if mkfifo exists
9189 : see if mktime exists
9193 : see if msgctl exists
9197 : see if msgget exists
9201 : see if msgsnd exists
9205 : see if msgrcv exists
9209 : see how much of the 'msg*(2)' library is present.
9212 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9213 *"$undef"*) h_msg=false;;
9217 case "`ipcs 2>&1`" in
9218 "SVID messages"*"not configured"*)
9219 echo "Your $osname does not have the msg*(2) configured." >&4
9234 : we could also check for sys/ipc.h ...
9235 if $h_msg && $test `./findhdr sys/msg.h`; then
9236 echo "You have the full msg*(2) library." >&4
9239 echo "You don't have the full msg*(2) library." >&4
9245 : see if nice exists
9249 : see if POSIX threads are available
9250 set pthread.h i_pthread
9256 : how to create joinable pthreads
9257 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9259 echo "Checking what constant to use for creating joinable pthreads..." >&4
9260 $cat >try.c <<'EOCP'
9261 #include <pthread.h>
9263 int detachstate = JOINABLE;
9266 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9267 if eval $compile; then
9268 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9269 val="$undef" # Yes, undef.
9270 set d_old_pthread_create_joinable
9273 set old_pthread_create_joinable
9276 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9277 if eval $compile; then
9278 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9280 set d_old_pthread_create_joinable
9282 val=PTHREAD_CREATE_UNDETACHED
9283 set old_pthread_create_joinable
9286 set try -DJOINABLE=__UNDETACHED
9287 if eval $compile; then
9288 echo "You seem to use __UNDETACHED." >&4
9290 set d_old_pthread_create_joinable
9293 set old_pthread_create_joinable
9296 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9298 set d_old_pthread_create_joinable
9301 set old_pthread_create_joinable
9308 d_old_pthread_create_joinable="$undef"
9309 old_pthread_create_joinable=""
9312 : see if pause exists
9316 : see if pipe exists
9320 : see if poll exists
9325 : see whether the various POSIXish _yields exist
9327 #include <pthread.h>
9333 #ifdef PTHREAD_YIELD
9336 #ifdef PTHREAD_YIELD_NULL
9337 pthread_yield(NULL);
9343 : see if sched_yield exists
9344 set try -DSCHED_YIELD
9345 if eval $compile; then
9347 sched_yield='sched_yield()'
9351 case "$usethreads" in
9354 $define) echo 'sched_yield() found.' >&4 ;;
9355 *) echo 'sched_yield() NOT found.' >&4 ;;
9361 : see if pthread_yield exists
9362 set try -DPTHREAD_YIELD
9363 if eval $compile; then
9365 case "$sched_yield" in
9366 '') sched_yield='pthread_yield()' ;;
9369 set try -DPTHREAD_YIELD_NULL
9370 if eval $compile; then
9372 case "$sched_yield" in
9373 '') sched_yield='pthread_yield(NULL)' ;;
9379 case "$usethreads" in
9382 $define) echo 'pthread_yield() found.' >&4 ;;
9383 *) echo 'pthread_yield() NOT found.' >&4 ;;
9390 case "$sched_yield" in
9391 '') sched_yield=undef ;;
9396 : see if this is a pwd.h system
9402 xxx=`./findhdr pwd.h`
9403 $cppstdin $cppflags $cppminus < $xxx >$$.h
9405 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9413 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9421 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9429 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9437 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9445 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9453 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9461 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9473 set d_pwquota; eval $setvar
9474 set d_pwage; eval $setvar
9475 set d_pwchange; eval $setvar
9476 set d_pwclass; eval $setvar
9477 set d_pwexpire; eval $setvar
9478 set d_pwcomment; eval $setvar
9479 set d_pwgecos; eval $setvar
9480 set d_pwpasswd; eval $setvar
9484 : see if readdir and friends exist
9485 set readdir d_readdir
9487 set seekdir d_seekdir
9489 set telldir d_telldir
9491 set rewinddir d_rewinddir
9494 : see if readlink exists
9495 set readlink d_readlink
9498 : see if rename exists
9502 : see if rmdir exists
9506 : see if memory.h is available.
9511 : See if it conflicts with string.h
9517 $cppstdin $cppflags $cppminus < $strings > mem.h
9518 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9520 echo "We won't be including <memory.h>."
9530 : can bcopy handle overlapping blocks?
9535 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9542 $cat >>try.c <<'EOCP'
9545 # include <memory.h>
9548 # include <stdlib.h>
9551 # include <string.h>
9553 # include <strings.h>
9556 # include <unistd.h> /* Needed for NetBSD */
9560 char buf[128], abc[128];
9566 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9568 for (align = 7; align >= 0; align--) {
9569 for (len = 36; len; len--) {
9572 for (off = 1; off <= len; off++) {
9573 bcopy(b, b+off, len);
9574 bcopy(b+off, b, len);
9575 if (bcmp(b, abc, len))
9584 if eval $compile_ok; then
9585 if ./try 2>/dev/null; then
9589 echo "It can't, sorry."
9590 case "$d_memmove" in
9591 "$define") echo "But that's Ok since you have memmove()." ;;
9595 echo "(I can't compile the test program, so we'll assume not...)"
9596 case "$d_memmove" in
9597 "$define") echo "But that's Ok since you have memmove()." ;;
9602 $rm -f try.* try core
9606 : can memcpy handle overlapping blocks?
9611 echo "Checking to see if your memcpy() 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 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9643 try to store the string in read-only memory. */
9644 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9646 for (align = 7; align >= 0; align--) {
9647 for (len = 36; len; len--) {
9649 memcpy(b, abc, len);
9650 for (off = 1; off <= len; off++) {
9651 memcpy(b+off, b, len);
9652 memcpy(b, b+off, len);
9653 if (memcmp(b, abc, len))
9662 if eval $compile_ok; then
9663 if ./try 2>/dev/null; then
9667 echo "It can't, sorry."
9668 case "$d_memmove" in
9669 "$define") echo "But that's Ok since you have memmove()." ;;
9673 echo "(I can't compile the test program, so we'll assume not...)"
9674 case "$d_memmove" in
9675 "$define") echo "But that's Ok since you have memmove()." ;;
9680 $rm -f try.* try core
9684 : can memcmp be trusted to compare relative magnitude?
9689 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9696 $cat >>try.c <<'EOCP'
9699 # include <memory.h>
9702 # include <stdlib.h>
9705 # include <string.h>
9707 # include <strings.h>
9710 # include <unistd.h> /* Needed for NetBSD */
9716 if ((a < b) && memcmp(&a, &b, 1) < 0)
9722 if eval $compile_ok; then
9723 if ./try 2>/dev/null; then
9727 echo "No, it can't (it uses signed chars)."
9730 echo "(I can't compile the test program, so we'll assume not...)"
9734 $rm -f try.* try core
9738 : see if select exists
9742 : see if semctl exists
9746 : see if semget exists
9750 : see if semop exists
9754 : see how much of the 'sem*(2)' library is present.
9757 case "$d_semctl$d_semget$d_semop" in
9758 *"$undef"*) h_sem=false;;
9762 case "`ipcs 2>&1`" in
9763 "SVID messages"*"not configured"*)
9764 echo "Your $osname does not have the sem*(2) configured." >&4
9777 : we could also check for sys/ipc.h ...
9778 if $h_sem && $test `./findhdr sys/sem.h`; then
9779 echo "You have the full sem*(2) library." >&4
9782 echo "You don't have the full sem*(2) library." >&4
9788 : see whether sys/sem.h defines union semun
9790 $cat > try.c <<'END'
9791 #include <sys/types.h>
9792 #include <sys/ipc.h>
9793 #include <sys/sem.h>
9794 int main () { union semun semun; semun.buf = 0; }
9797 if eval $compile; then
9798 echo "You have union semun in <sys/sem.h>." >&4
9801 echo "You do not have union semun in <sys/sem.h>." >&4
9804 $rm -f try try.c try.h
9808 : see how to do semctl IPC_STAT
9811 : see whether semctl IPC_STAT can use union semun
9816 # define S_IRUSR S_IREAD
9817 # define S_IWUSR S_IWRITE
9818 # define S_IXUSR S_IEXEC
9820 # define S_IRUSR 0400
9821 # define S_IWUSR 0200
9822 # define S_IXUSR 0100
9824 # define S_IRGRP (S_IRUSR>>3)
9825 # define S_IWGRP (S_IWUSR>>3)
9826 # define S_IXGRP (S_IXUSR>>3)
9827 # define S_IROTH (S_IRUSR>>6)
9828 # define S_IWOTH (S_IWUSR>>6)
9829 # define S_IXOTH (S_IXUSR>>6)
9832 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9833 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9834 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9839 #include <sys/types.h>
9840 #include <sys/ipc.h>
9841 #include <sys/sem.h>
9842 #include <sys/stat.h>
9849 #$d_union_semun HAS_UNION_SEMUN
9852 #ifndef HAS_UNION_SEMUN
9855 struct semid_ds *buf;
9856 unsigned short *array;
9862 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9863 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9865 struct semid_ds argbuf;
9868 st = semctl(sem, 0, IPC_STAT, arg);
9872 # endif /* IPC_STAT */
9873 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9875 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9876 # endif /* IPC_RMID */
9877 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9879 #endif /* IPC_PRIVATE && ... */
9880 printf("semget failed: errno = %d\n", errno);
9886 if eval $compile; then
9889 semun) val="$define" ;;
9895 case "$d_semctl_semun" in
9897 echo "You can use union semun for semctl IPC_STAT." >&4
9900 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9905 : see whether semctl IPC_STAT can use struct semid_ds pointer
9906 $cat > try.c <<'END'
9907 #include <sys/types.h>
9908 #include <sys/ipc.h>
9909 #include <sys/sem.h>
9910 #include <sys/stat.h>
9918 struct semid_ds arg;
9921 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9922 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9925 st = semctl(sem, 0, IPC_STAT, &arg);
9927 printf("semid_ds\n");
9929 # endif /* IPC_STAT */
9930 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9932 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9933 # endif /* IPC_RMID */
9934 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9936 #endif /* IPC_PRIVATE && ... */
9937 printf("semget failed: errno = %d\n", errno);
9944 if eval $compile; then
9947 semid_ds) val="$define" ;;
9951 set d_semctl_semid_ds
9953 case "$d_semctl_semid_ds" in
9955 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9957 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9964 # We do not have the full sem*(2) library, so assume we can not
9970 set d_semctl_semid_ds
9975 : see if setegid exists
9976 set setegid d_setegid
9979 : see if seteuid exists
9980 set seteuid d_seteuid
9983 : see if setgrent exists
9984 set setgrent d_setgrent
9987 : see if sethostent exists
9988 set sethostent d_sethent
9991 : see if setlinebuf exists
9992 set setlinebuf d_setlinebuf
9995 : see if setlocale exists
9996 set setlocale d_setlocale
9999 : see if setnetent exists
10000 set setnetent d_setnent
10003 : see if setprotoent exists
10004 set setprotoent d_setpent
10007 : see if setpgid exists
10008 set setpgid d_setpgid
10011 : see if setpgrp2 exists
10012 set setpgrp2 d_setpgrp2
10015 : see if setpriority exists
10016 set setpriority d_setprior
10019 : see if setpwent exists
10020 set setpwent d_setpwent
10023 : see if setregid exists
10024 set setregid d_setregid
10026 set setresgid d_setresgid
10029 : see if setreuid exists
10030 set setreuid d_setreuid
10032 set setresuid d_setresuid
10035 : see if setrgid exists
10036 set setrgid d_setrgid
10039 : see if setruid exists
10040 set setruid d_setruid
10043 : see if setservent exists
10044 set setservent d_setsent
10047 : see if setsid exists
10048 set setsid d_setsid
10051 : see if setspent exists
10052 set setspent d_setspent
10055 : see if setvbuf exists
10056 set setvbuf d_setvbuf
10059 : see if sfio.h is available
10064 : see if sfio library is available
10075 : Ok, but do we want to use it.
10079 true|$define|[yY]*) dflt='y';;
10082 echo "$package can use the sfio library, but it is experimental."
10083 rp="You seem to have sfio available, do you want to try using it?"
10087 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10089 : Remove sfio from list of libraries to use
10090 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10093 echo "libs = $libs" >&4
10097 *) case "$usesfio" in
10098 true|$define|[yY]*)
10099 echo "Sorry, cannot find sfio on this machine" >&4
10100 echo "Ignoring your setting of usesfio=$usesfio" >&4
10108 $define) usesfio='true';;
10109 *) usesfio='false';;
10112 : see if shmctl exists
10113 set shmctl d_shmctl
10116 : see if shmget exists
10117 set shmget d_shmget
10120 : see if shmat exists
10123 : see what shmat returns
10126 $cat >shmat.c <<'END'
10127 #include <sys/shm.h>
10130 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10135 echo "and it returns ($shmattype)." >&4
10136 : see if a prototype for shmat is available
10137 xxx=`./findhdr sys/shm.h`
10138 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10139 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10150 set d_shmatprototype
10153 : see if shmdt exists
10157 : see how much of the 'shm*(2)' library is present.
10160 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10161 *"$undef"*) h_shm=false;;
10165 case "`ipcs 2>&1`" in
10166 "SVID shared memory"*"not configured"*)
10167 echo "Your $osname does not have the shm*(2) configured." >&4
10170 set shmctl d_shmctl
10172 set shmget d_shmget
10182 : we could also check for sys/ipc.h ...
10183 if $h_shm && $test `./findhdr sys/shm.h`; then
10184 echo "You have the full shm*(2) library." >&4
10187 echo "You don't have the full shm*(2) library." >&4
10194 : see if we have sigaction
10195 if set sigaction val -f d_sigaction; eval $csym; $val; then
10196 echo 'sigaction() found.' >&4
10197 $cat > try.c <<'EOP'
10199 #include <sys/types.h>
10200 #include <signal.h>
10203 struct sigaction act, oact;
10205 oact.sa_handler = 0;
10209 if eval $compile_ok; then
10212 echo "But you don't seem to have a useable struct sigaction." >&4
10216 echo 'sigaction NOT found.' >&4
10219 set d_sigaction; eval $setvar
10220 $rm -f try try$_o try.c
10222 : see if sigsetjmp exists
10224 case "$d_sigsetjmp" in
10226 $cat >try.c <<'EOP'
10227 #include <setjmp.h>
10232 if (sigsetjmp(env,1))
10235 siglongjmp(env, 1);
10240 if eval $compile; then
10241 if ./try >/dev/null 2>&1; then
10242 echo "POSIX sigsetjmp found." >&4
10246 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10252 echo "sigsetjmp not found." >&4
10256 *) val="$d_sigsetjmp"
10257 case "$d_sigsetjmp" in
10258 $define) echo "POSIX sigsetjmp found." >&4;;
10259 $undef) echo "sigsetjmp not found." >&4;;
10267 : see if sqrtl exists
10271 : see if sys/stat.h is available
10272 set sys/stat.h i_sysstat
10276 : see if stat knows about block sizes
10278 echo "Checking to see if your struct stat has st_blocks field..." >&4
10279 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10283 : see if this is a sys/vfs.h system
10284 set sys/vfs.h i_sysvfs
10288 : see if this is a sys/statfs.h system
10289 set sys/statfs.h i_sysstatfs
10294 echo "Checking to see if your system supports struct statfs..." >&4
10295 set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
10297 case "$d_statfs_s" in
10298 "$define") echo "Yup, it does." >&4 ;;
10299 *) echo "Nope, it doesn't." >&4 ;;
10304 : see if struct statfs knows about f_flags
10305 case "$d_statfs_s" in
10308 echo "Checking to see if your struct statfs has f_flags field..." >&4
10309 set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
10313 set d_statfs_f_flags
10317 case "$d_statfs_f_flags" in
10318 "$define") echo "Yup, it does." >&4 ;;
10319 *) echo "Nope, it doesn't." >&4 ;;
10322 : see if _ptr and _cnt from stdio act std
10324 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10325 echo "(Looks like you have stdio.h from Linux.)"
10326 case "$stdio_ptr" in
10327 '') stdio_ptr='((fp)->_IO_read_ptr)'
10330 *) ptr_lval=$d_stdio_ptr_lval;;
10332 case "$stdio_cnt" in
10333 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10336 *) cnt_lval=$d_stdio_cnt_lval;;
10338 case "$stdio_base" in
10339 '') stdio_base='((fp)->_IO_read_base)';;
10341 case "$stdio_bufsiz" in
10342 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10345 case "$stdio_ptr" in
10346 '') stdio_ptr='((fp)->_ptr)'
10349 *) ptr_lval=$d_stdio_ptr_lval;;
10351 case "$stdio_cnt" in
10352 '') stdio_cnt='((fp)->_cnt)'
10355 *) cnt_lval=$d_stdio_cnt_lval;;
10357 case "$stdio_base" in
10358 '') stdio_base='((fp)->_base)';;
10360 case "$stdio_bufsiz" in
10361 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10364 : test whether _ptr and _cnt really work
10365 echo "Checking how std your stdio is..." >&4
10368 #define FILE_ptr(fp) $stdio_ptr
10369 #define FILE_cnt(fp) $stdio_cnt
10371 FILE *fp = fopen("try.c", "r");
10374 18 <= FILE_cnt(fp) &&
10375 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10383 if eval $compile; then
10385 echo "Your stdio acts pretty std."
10388 echo "Your stdio isn't very std."
10391 echo "Your stdio doesn't appear very std."
10397 : Can _ptr be used as an lvalue?
10398 case "$d_stdstdio$ptr_lval" in
10399 $define$define) val=$define ;;
10402 set d_stdio_ptr_lval
10405 : Can _cnt be used as an lvalue?
10406 case "$d_stdstdio$cnt_lval" in
10407 $define$define) val=$define ;;
10410 set d_stdio_cnt_lval
10413 : see if _base is also standard
10415 case "$d_stdstdio" in
10419 #define FILE_base(fp) $stdio_base
10420 #define FILE_bufsiz(fp) $stdio_bufsiz
10422 FILE *fp = fopen("try.c", "r");
10425 19 <= FILE_bufsiz(fp) &&
10426 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10433 if eval $compile; then
10435 echo "And its _base field acts std."
10438 echo "But its _base field isn't std."
10441 echo "However, it seems to be lacking the _base field."
10450 Checking how to access stdio streams by file descriptor number...
10452 case "$stdio_stream_array" in
10453 '') $cat >try.c <<EOCP
10456 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10460 for s in _iob __iob __sF
10462 set try -DSTDIO_STREAM_ARRAY=$s
10463 if eval $compile; then
10464 case "`./try$exe_ext`" in
10465 yes) stdio_stream_array=$s; break ;;
10469 $rm -f try.* try$exe_ext
10471 case "$stdio_stream_array" in
10473 I can't figure out how to access stdio streams by file descriptor number.
10475 d_stdio_stream_array="$undef"
10478 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10480 d_stdio_stream_array="$define"
10484 : see if strcoll exists
10485 set strcoll d_strcoll
10488 : check for structure copying
10490 echo "Checking to see if your C compiler can copy structs..." >&4
10491 $cat >try.c <<'EOCP'
10501 if $cc -c try.c >/dev/null 2>&1 ; then
10503 echo "Yup, it can."
10506 echo "Nope, it can't."
10512 : see if strerror and/or sys_errlist[] exist
10514 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10515 if set strerror val -f d_strerror; eval $csym; $val; then
10516 echo 'strerror() found.' >&4
10517 d_strerror="$define"
10518 d_strerrm='strerror(e)'
10519 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10520 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10521 d_syserrlst="$define"
10523 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10524 d_syserrlst="$undef"
10526 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10527 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10528 echo 'strerror() found in string header.' >&4
10529 d_strerror="$define"
10530 d_strerrm='strerror(e)'
10531 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10532 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10533 d_syserrlst="$define"
10535 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10536 d_syserrlst="$undef"
10538 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10539 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10540 d_strerror="$undef"
10541 d_syserrlst="$define"
10542 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10544 echo 'strerror() and sys_errlist[] NOT found.' >&4
10545 d_strerror="$undef"
10546 d_syserrlst="$undef"
10547 d_strerrm='"unknown"'
10551 : see if strtod exists
10552 set strtod d_strtod
10555 : see if strtol exists
10556 set strtol d_strtol
10559 : see if strtoul exists
10560 set strtoul d_strtoul
10563 : see if strtoull exists
10564 set strtoull d_strtoull
10567 : see if strxfrm exists
10568 set strxfrm d_strxfrm
10571 : see if symlink exists
10572 set symlink d_symlink
10575 : see if syscall exists
10576 set syscall d_syscall
10579 : see if sysconf exists
10580 set sysconf d_sysconf
10583 : see if system exists
10584 set system d_system
10587 : see if tcgetpgrp exists
10588 set tcgetpgrp d_tcgetpgrp
10591 : see if tcsetpgrp exists
10592 set tcsetpgrp d_tcsetpgrp
10595 : see if prototype for telldir is available
10597 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10600 : define an is-a-typedef? function
10601 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10603 "") inclist="sys/types.h";;
10605 eval "varval=\$$var";
10609 for inc in $inclist; do
10610 echo "#include <$inc>" >>temp.c;
10612 echo "#ifdef $type" >> temp.c;
10613 echo "printf(\"We have $type\");" >> temp.c;
10614 echo "#endif" >> temp.c;
10615 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10616 if $contains $type temp.E >/dev/null 2>&1; then
10617 eval "$var=\$type";
10622 *) eval "$var=\$varval";;
10625 : define an is-a-typedef? function that prompts if the type is not available.
10626 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10628 "") inclist="sys/types.h";;
10630 eval "varval=\$$var";
10634 for inc in $inclist; do
10635 echo "#include <$inc>" >>temp.c;
10637 echo "#ifdef $type" >> temp.c;
10638 echo "printf(\"We have $type\");" >> temp.c;
10639 echo "#endif" >> temp.c;
10640 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10642 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10643 if $contains $type temp.E >/dev/null 2>&1; then
10644 echo "$type found." >&4;
10645 eval "$var=\$type";
10647 echo "$type NOT found." >&4;
10653 *) eval "$var=\$varval";;
10656 : see if this is a sys/times.h system
10657 set sys/times.h i_systimes
10660 : see if times exists
10662 if set times val -f d_times; eval $csym; $val; then
10663 echo 'times() found.' >&4
10666 case "$i_systimes" in
10667 "$define") inc='sys/times.h';;
10669 rp="What is the type returned by times() on this system?"
10670 set clock_t clocktype long stdio.h sys/types.h $inc
10673 echo 'times() NOT found, hope that will do.' >&4
10678 : see if truncate exists
10679 set truncate d_truncate
10682 : see if tzname[] exists
10684 if set tzname val -a d_tzname; eval $csym; $val; then
10686 echo 'tzname[] found.' >&4
10689 echo 'tzname[] NOT found.' >&4
10694 : see if umask exists
10698 : see if ustat exists
10702 : backward compatibility for d_hvfork
10703 if test X$d_hvfork != X; then
10704 d_vfork="$d_hvfork"
10707 : see if there is a vfork
10712 : Ok, but do we want to use it. vfork is reportedly unreliable in
10713 : perl on Solaris 2.x, and probably elsewhere.
10717 case "$usevfork" in
10723 Perl can only use a vfork() that doesn't suffer from strict
10724 restrictions on calling functions or modifying global data in
10725 the child. For example, glibc-2.1 contains such a vfork()
10726 that is unsuitable. If your system provides a proper fork()
10727 call, chances are that you do NOT want perl to use vfork().
10730 rp="Do you still want to use vfork()?"
10735 echo "Ok, we won't use vfork()."
10744 $define) usevfork='true';;
10745 *) usevfork='false';;
10748 : see if this is an sysdir system
10749 set sys/dir.h i_sysdir
10752 : see if this is an sysndir system
10753 set sys/ndir.h i_sysndir
10756 : see if closedir exists
10757 set closedir d_closedir
10760 case "$d_closedir" in
10763 echo "Checking whether closedir() returns a status..." >&4
10764 cat > closedir.c <<EOM
10765 #$i_dirent I_DIRENT /**/
10766 #$i_sysdir I_SYS_DIR /**/
10767 #$i_sysndir I_SYS_NDIR /**/
10768 #$i_systypes I_SYS_TYPES /**/
10770 #if defined(I_SYS_TYPES)
10771 #include <sys/types.h>
10773 #if defined(I_DIRENT)
10774 #include <dirent.h>
10775 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10776 #include <sys/dir.h>
10780 #include <sys/ndir.h>
10784 #include <ndir.h> /* may be wrong in the future */
10786 #include <sys/dir.h>
10791 int main() { return closedir(opendir(".")); }
10794 if eval $compile_ok; then
10795 if ./closedir > /dev/null 2>&1 ; then
10796 echo "Yes, it does."
10799 echo "No, it doesn't."
10803 echo "(I can't seem to compile the test program--assuming it doesn't)"
10811 set d_void_closedir
10814 : check for volatile keyword
10816 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10817 $cat >try.c <<'EOCP'
10820 typedef struct _goo_struct goo_struct;
10821 goo_struct * volatile goo = ((goo_struct *)0);
10822 struct _goo_struct {
10827 typedef unsigned short foo_t;
10828 char *volatile foo;
10830 volatile foo_t blech;
10834 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10836 echo "Yup, it does."
10839 echo "Nope, it doesn't."
10845 : see if there is a wait4
10849 : see if waitpid exists
10850 set waitpid d_waitpid
10853 : see if wcstombs exists
10854 set wcstombs d_wcstombs
10857 : see if wctomb exists
10858 set wctomb d_wctomb
10861 : preserve RCS keywords in files with variable substitution, grrr
10866 Revision='$Revision'
10868 case "$crosscompile" in
10869 ''|[nN]*) crosscompile="$undef" ;;
10873 next|rhapsody) multiarch="$define" ;;
10875 case "$multiarch" in
10876 ''|[nN]*) multiarch="$undef" ;;
10879 : check for alignment requirements
10881 case "$crosscompile$multiarch" in
10884 You seem to be either cross-compiling or doing a multiarchitecture build,
10885 skipping the memory alignment check.
10888 case "$alignbytes" in
10889 '') alignbytes=8 ;;
10893 case "$alignbytes" in
10894 '') echo "Checking alignment constraints..." >&4
10895 $cat >try.c <<'EOCP'
10902 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10906 if eval $compile_ok; then
10910 echo "(I can't seem to compile the test program...)"
10913 *) dflt="$alignbytes"
10916 rp="Doubles must be aligned on a how-many-byte boundary?"
10924 : check for ordering of bytes in a long
10926 case "$crosscompile$multiarch" in
10929 You seem to be either cross-compiling or doing a multiarchitecture build,
10930 skipping the byteorder check.
10936 case "$byteorder" in
10939 In the following, larger digits indicate more significance. A big-endian
10940 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10941 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10942 machines may have weird orders like 3412. A Cray will report 87654321,
10943 an Alpha will report 12345678. If the test program works the default is
10945 I'm now running the test program...
10947 $cat >try.c <<'EOCP'
10954 char c[sizeof(long)];
10957 if (sizeof(long) > 4)
10958 u.l = (0x08070605L << 32) | 0x04030201L;
10961 for (i = 0; i < sizeof(long); i++)
10962 printf("%c", u.c[i]+'0');
10969 if eval $compile && ./try > /dev/null; then
10972 [1-4][1-4][1-4][1-4]|12345678|87654321)
10973 echo "(The test program ran ok.)"
10974 echo "byteorder=$dflt"
10977 ????|????????) echo "(The test program ran ok.)" ;;
10978 *) echo "(The test program didn't run right for some reason.)" ;;
10983 (I can't seem to compile the test program. Guessing big-endian...)
10986 case "$xxx_prompt" in
10988 rp="What is the order of bytes in a long?"
11002 : how do we catenate cpp tokens here?
11004 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11005 $cat >cpp_stuff.c <<'EOCP'
11006 #define RCAT(a,b)a/**/b
11007 #define ACAT(a,b)a ## b
11011 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11012 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11013 echo "Oh! Smells like ANSI's been here." >&4
11014 echo "We can catify or stringify, separately or together!"
11016 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11017 echo "Ah, yes! The good old days!" >&4
11018 echo "However, in the good old days we don't know how to stringify and"
11019 echo "catify at the same time."
11023 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11024 to have to edit the values of CAT[2-5] in config.h...
11026 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11030 : see if this is a db.h system
11036 : Check db version.
11038 echo "Checking Berkeley DB version ..." >&4
11044 #include <sys/types.h>
11049 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11050 int Major, Minor, Patch ;
11051 unsigned long Version ;
11052 (void)db_version(&Major, &Minor, &Patch) ;
11053 printf("You have Berkeley DB Version 2 or greater\n");
11055 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11056 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11057 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11058 Major, Minor, Patch) ;
11060 /* check that db.h & libdb are compatible */
11061 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11062 printf("db.h and libdb are incompatible\n") ;
11066 printf("db.h and libdb are compatible\n") ;
11068 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11069 + DB_VERSION_PATCH ;
11071 /* needs to be >= 2.3.4 */
11072 if (Version < 2003004) {
11073 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11074 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11080 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11081 printf("You have Berkeley DB Version 1\n");
11082 exit(0); /* DB version < 2: the coast is clear. */
11084 exit(1); /* <db.h> not Berkeley DB? */
11090 if eval $compile && ./try; then
11091 echo 'Looks OK.' >&4
11093 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11097 : Remove db from list of libraries to use
11098 echo "Removing unusable -ldb from library list" >&4
11099 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11102 echo "libs = $libs" >&4
11112 : Check the return type needed for hash
11114 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11120 #include <sys/types.h>
11123 #ifndef DB_VERSION_MAJOR
11124 u_int32_t hash_cb (ptr, size)
11132 info.hash = hash_cb;
11136 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11137 if $contains warning try.out >>/dev/null 2>&1 ; then
11140 db_hashtype='u_int32_t'
11143 : XXX Maybe we should just give up here.
11144 db_hashtype=u_int32_t
11146 echo "Help: I can't seem to compile the db test program." >&4
11147 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11150 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11152 *) db_hashtype=u_int32_t
11157 : Check the return type needed for prefix
11159 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11165 #include <sys/types.h>
11168 #ifndef DB_VERSION_MAJOR
11169 size_t prefix_cb (key1, key2)
11177 info.prefix = prefix_cb;
11181 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11182 if $contains warning try.out >>/dev/null 2>&1 ; then
11183 db_prefixtype='int'
11185 db_prefixtype='size_t'
11188 db_prefixtype='size_t'
11189 : XXX Maybe we should just give up here.
11191 echo "Help: I can't seem to compile the db test program." >&4
11192 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11195 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11197 *) db_prefixtype='size_t'
11201 : check for void type
11203 echo "Checking to see how well your C compiler groks the void type..." >&4
11204 case "$voidflags" in
11206 $cat >try.c <<'EOCP'
11212 extern void moo(); /* function returning void */
11213 void (*goo)(); /* ptr to func returning void */
11215 void *hue; /* generic ptr */
11228 int main() { sub(); }
11230 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11231 voidflags=$defvoidused
11232 echo "Good. It appears to support void to the level $package wants.">&4
11233 if $contains warning .out >/dev/null 2>&1; then
11234 echo "However, you might get some warnings that look like this:"
11238 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11239 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11240 echo "It supports 1..."
11241 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11242 echo "It also supports 2..."
11243 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11245 echo "And it supports 4 but not 8 definitely."
11247 echo "It doesn't support 4..."
11248 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11250 echo "But it supports 8."
11253 echo "Neither does it support 8."
11257 echo "It does not support 2..."
11258 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11260 echo "But it supports 4 and 8."
11262 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11264 echo "And it supports 4 but has not heard about 8."
11266 echo "However it supports 8 but not 4."
11271 echo "There is no support at all for void."
11276 case "$voidflags" in
11278 *) $cat >&4 <<'EOM'
11279 Support flag bits are:
11280 1: basic void declarations.
11281 2: arrays of pointers to functions returning void.
11282 4: operations between pointers to and addresses of void functions.
11283 8: generic void pointers.
11286 rp="Your void support flags add up to what?"
11294 : How can we generate normalized random numbers ?
11296 echo "Looking for a random number function..." >&4
11297 case "$randfunc" in
11299 if set drand48 val -f; eval $csym; $val; then
11301 echo "Good, found drand48()." >&4
11302 elif set random val -f; eval $csym; $val; then
11304 echo "OK, found random()." >&4
11307 echo "Yick, looks like I have to use rand()." >&4
11318 *-Dmy_rand=*|*-Dmy_srand=*)
11319 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11320 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11321 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11322 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11326 while $test "$cont"; do
11327 rp="Use which function to generate random numbers?"
11329 if $test "$ans" = "$dflt"; then
11335 if set $ans val -f; eval $csym; $val; then
11339 rp="I cannot find function $ans. Use that name anyway?"
11348 case "$randfunc" in
11350 drand01="drand48()"
11356 case "$randbits" in
11358 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11360 #$i_unistd I_UNISTD
11361 #$i_stdlib I_STDLIB
11364 # include <unistd.h>
11367 # include <stdlib.h>
11372 register unsigned long tmp;
11373 register unsigned long max = 0L;
11375 for (i = 1000; i; i--) {
11376 tmp = (unsigned long) $randfunc();
11377 if (tmp > max) max = tmp;
11379 for (i = 0; max; i++)
11385 if eval $compile_ok; then
11389 echo "(I can't seem to compile the test program...)"
11396 rp="How many bits does your $randfunc() function produce?"
11400 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11401 seedfunc="s$randfunc"
11402 randseedtype=unsigned
11406 rp="How many bits does your $randfunc() function produce?"
11409 seedfunc="s$randfunc"
11410 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11411 if set $seedfunc val -f; eval $csym; $val; then
11412 echo "(Using $seedfunc() to seed random generator)"
11414 echo "(Warning: no $seedfunc() to seed random generator)"
11417 randseedtype=unsigned
11425 echo "Determining whether or not we are on an EBCDIC system..." >&4
11426 $cat >tebcdic.c <<'EOM'
11429 if ('M'==0xd4) return 0;
11436 if eval $compile_ok; then
11438 echo "You have EBCDIC." >&4
11441 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11444 echo "I'm unable to compile the test program." >&4
11445 echo "I'll assume ASCII or some ISO Latin." >&4
11447 $rm -f tebcdic.c tebcdic
11453 Checking how to flush all pending stdio output...
11455 # I only know how to find the first 32 possibly open files on SunOS.
11456 # See also hints/sunos_4_1.sh and util.c --AD
11458 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11460 $cat >>try.c <<EOCP
11462 #$i_unistd I_UNISTD
11464 # include <unistd.h>
11466 #$d_sysconf HAS_SYSCONF
11467 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11468 #ifdef HAS_STDIO_STREAM_ARRAY
11469 # define STDIO_STREAM_ARRAY $stdio_stream_array
11472 FILE* p = fopen("try.out", "w");
11476 # ifdef TRY_FPRINTF
11480 #ifdef TRY_FFLUSH_NULL
11483 #ifdef TRY_FFLUSH_ALL
11485 long open_max = -1;
11486 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11487 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11489 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11490 open_max = sysconf(_SC_OPEN_MAX);
11493 open_max = FOPEN_MAX;
11496 open_max = OPEN_MAX;
11505 # ifdef HAS_STDIO_STREAM_ARRAY
11506 if (open_max > 0) {
11508 for (i = 0; i < open_max; i++)
11509 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11510 STDIO_STREAM_ARRAY[i]._file < open_max &&
11511 STDIO_STREAM_ARRAY[i]._flag)
11512 fflush(&STDIO_STREAM_ARRAY[i]);
11520 : first we have to find out how _not_ to flush
11521 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11523 set try -DTRY_FPUTC
11524 if eval $compile; then
11526 ./try$exe_ext 2>/dev/null
11527 if $test ! -s try.out -a "X$?" = X42; then
11533 set try -DTRY_FPRINTF
11535 if eval $compile; then
11537 ./try$exe_ext 2>/dev/null
11538 if $test ! -s try.out -a "X$?" = X42; then
11539 output=-DTRY_FPRINTF
11545 : check for fflush NULL behaviour
11546 case "$fflushNULL" in
11547 '') set try -DTRY_FFLUSH_NULL $output
11548 if eval $compile; then
11550 ./try$exe_ext 2>/dev/null
11552 if $test -s try.out -a "X$code" = X42; then
11553 fflushNULL="`$cat try.out`"
11555 if $test "X$code" != X42; then
11557 (If this test failed, don't worry, we'll try another method shortly.)
11562 $rm -f core try.core core.try.*
11563 case "$fflushNULL" in
11565 Your fflush(NULL) works okay.
11567 fflushNULL="$define"
11570 Your fflush(NULL) isn't working (contrary to ANSI C).
11572 fflushNULL="$undef"
11575 Cannot figure out whether your fflush(NULL) works or not.
11576 I'm assuming it doesn't (contrary to ANSI C).
11578 fflushNULL="$undef"
11582 $define|true|[yY]*)
11583 fflushNULL="$define"
11586 fflushNULL="$undef"
11589 : check explicit looping only if NULL did not work
11590 case "$fflushNULL" in
11592 : check for fflush all behaviour
11593 case "$fflushall" in
11594 '') set try -DTRY_FFLUSH_ALL $output
11595 if eval $compile; then
11597 (Now testing the other method--but note that also this may fail.)
11600 ./try$exe_ext 2>/dev/null
11601 if $test -s try.out -a "X$?" = X42; then
11602 fflushall="`$cat try.out`"
11605 $rm -f core try.core core.try.*
11606 case "$fflushall" in
11608 Whew. Flushing explicitly all the stdio streams works.
11610 fflushall="$define"
11613 Sigh. Flushing explicitly all the stdio streams doesn't work.
11618 Cannot figure out whether flushing stdio streams explicitly works or not.
11619 I'm assuming it doesn't.
11625 "$define"|true|[yY]*)
11626 fflushall="$define"
11633 *) fflushall="$undef"
11636 case "$fflushNULL$fflushall" in
11639 I cannot figure out how to flush pending stdio output.
11643 $rm -f try.* try$exe_ext
11645 : see what type file positions are declared as in the library
11646 rp="What is the type for file position used by fsetpos()?"
11647 set fpos_t fpostype long stdio.h sys/types.h
11650 : Store the full pathname to the ar program for use in the C program
11651 : Respect a hint or command line value for full_ar.
11656 : Store the full pathname to the sed program for use in the C program
11659 : see what type gids are declared as in the kernel
11661 echo "Looking for the type for group ids returned by getgid()."
11662 set gid_t gidtype xxx stdio.h sys/types.h
11666 xxx=`./findhdr sys/user.h`
11667 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11669 unsigned) dflt="$1 $2" ;;
11673 *) dflt="$gidtype";;
11676 gid_t) echo "gid_t found." ;;
11677 *) rp="What is the type for group ids returned by getgid()?"
11685 *_t) zzz="$gidtype" ;;
11688 echo "Checking the sign of $zzz..." >&4
11690 #include <sys/types.h>
11701 if eval $compile; then
11705 echo "(I can't execute the test program--guessing unsigned.)" >&4
11709 1) echo "Your $zzz is unsigned." ;;
11710 -1) echo "Your $zzz is signed." ;;
11716 echo "(I can't compile the test program--guessing unsigned.)" >&4
11722 *_t) zzz="$gidtype" ;;
11725 echo "Checking the size of $zzz..." >&4
11727 #include <sys/types.h>
11730 printf("%d\n", sizeof($gidtype));
11734 if eval $compile_ok; then
11738 echo "(I can't execute the test program--guessing $gidsize.)" >&4
11741 echo "Your $zzz size is $gidsize bytes."
11746 echo "(I can't compile the test program--guessing $gidsize.)" >&4
11750 : see if getgroups exists
11751 set getgroups d_getgrps
11754 : see if setgroups exists
11755 set setgroups d_setgrps
11759 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11761 case "$d_getgrps$d_setgrps" in
11763 case "$groupstype" in
11764 '') dflt="$gidtype" ;;
11765 *) dflt="$groupstype" ;;
11768 What type of pointer is the second argument to getgroups() and setgroups()?
11769 Usually this is the same as group ids, $gidtype, but not always.
11772 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11776 *) groupstype="$gidtype";;
11779 : see what type lseek is declared as in the kernel
11780 rp="What is the type used for lseek's offset on this system?"
11781 set off_t lseektype long stdio.h sys/types.h
11785 $echo $n "Checking to see how big your file offsets are...$c" >&4
11787 #include <sys/types.h>
11791 printf("%d\n", sizeof($lseektype));
11795 if eval $compile_ok; then
11797 $echo " $lseeksize bytes." >&4
11801 echo "(I can't seem to compile the test program. Guessing...)"
11802 rp="What is the size of your file offsets (in bytes)?"
11809 echo "Checking if your $make program sets \$(MAKE)..." >&4
11810 case "$make_set_make" in
11812 $sed 's/^X //' > testmake.mak << 'EOF'
11814 X @echo 'maketemp="$(MAKE)"'
11816 case "`$make -f testmake.mak 2>/dev/null`" in
11817 *maketemp=*) make_set_make='#' ;;
11818 *) make_set_make="MAKE=$make" ;;
11820 $rm -f testmake.mak
11823 case "$make_set_make" in
11824 '#') echo "Yup, it does.";;
11825 *) echo "Nope, it doesn't.";;
11828 : see what type is used for mode_t
11829 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11830 set mode_t modetype int stdio.h sys/types.h
11833 : define a fucntion to check prototypes
11834 $cat > protochk <<EOSH
11837 optimize="$optimize"
11839 prototype="$prototype"
11844 $cat >> protochk <<'EOSH'
11849 while test $# -ge 2; do
11851 $define) echo "#include <$2>" >> try.c ;;
11852 literal) echo "$2" >> try.c ;;
11856 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11857 cat >> try.c <<'EOCP'
11858 #ifdef CAN_PROTOTYPE
11859 #define _(args) args
11864 echo "$foo" >> try.c
11865 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11866 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11872 $eunicefix protochk
11874 : see what type is used for size_t
11875 rp="What is the type used for the length parameter for string functions?"
11876 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11879 : check for type of arguments to gethostbyaddr.
11880 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11881 case "$d_gethbyaddr" in
11885 Checking to see what type of arguments are accepted by gethostbyaddr().
11887 hdrs="$define sys/types.h
11888 $d_socket sys/socket.h
11889 $i_niin netinet/in.h
11891 $i_unistd unistd.h"
11892 : The first arg can 'char *' or 'void *'
11893 : The second arg is some of integral type
11894 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11895 for yyy in size_t long int; do
11896 case "$netdb_host_type" in
11897 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11898 if ./protochk "$try" $hdrs; then
11899 echo "Your system accepts $xxx for the first arg."
11900 echo "...and $yyy for the second arg."
11901 netdb_host_type="$xxx"
11902 netdb_hlen_type="$yyy"
11908 : In case none of those worked, prompt the user.
11909 case "$netdb_host_type" in
11910 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11913 netdb_host_type=$ans
11914 rp='What is the type for the 2nd argument to gethostbyaddr?'
11917 netdb_hlen_type=$ans
11921 *) : no gethostbyaddr, so pick harmless defaults
11922 netdb_host_type='char *'
11923 netdb_hlen_type="$sizetype"
11926 # Remove the "const" if needed. -- but then we'll have a
11928 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11931 : check for type of argument to gethostbyname.
11932 if test "X$netdb_name_type" = X ; then
11933 case "$d_gethbyname" in
11937 Checking to see what type of argument is accepted by gethostbyname().
11939 hdrs="$define sys/types.h
11940 $d_socket sys/socket.h
11941 $i_niin netinet/in.h
11943 $i_unistd unistd.h"
11944 for xxx in "const char *" "char *"; do
11945 case "$netdb_name_type" in
11946 '') try="extern struct hostent *gethostbyname($xxx);"
11947 if ./protochk "$try" $hdrs; then
11948 echo "Your system accepts $xxx."
11949 netdb_name_type="$xxx"
11954 : In case none of those worked, prompt the user.
11955 case "$netdb_name_type" in
11956 '') rp='What is the type for the 1st argument to gethostbyname?'
11959 netdb_name_type=$ans
11963 *) : no gethostbyname, so pick harmless default
11964 netdb_name_type='char *'
11969 : check for type of 1st argument to getnetbyaddr.
11970 if test "X$netdb_net_type" = X ; then
11971 case "$d_getnbyaddr" in
11975 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11977 hdrs="$define sys/types.h
11978 $d_socket sys/socket.h
11979 $i_niin netinet/in.h
11981 $i_unistd unistd.h"
11982 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11983 case "$netdb_net_type" in
11984 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11985 if ./protochk "$try" $hdrs; then
11986 echo "Your system accepts $xxx."
11987 netdb_net_type="$xxx"
11992 : In case none of those worked, prompt the user.
11993 case "$netdb_net_type" in
11994 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11997 netdb_net_type=$ans
12001 *) : no getnetbyaddr, so pick harmless default
12002 netdb_net_type='long'
12006 : locate the preferred pager for this system
12020 '') dflt=/usr/ucb/more;;
12027 rp='What pager is used on your system?'
12031 : see what type pids are declared as in the kernel
12032 rp="What is the type of process ids on this system?"
12033 set pid_t pidtype int stdio.h sys/types.h
12036 : Find earliest binary compatible site_perl subdirectory perl can use.
12037 case "$bincompat5005" in
12038 "$define") xs_apiversion='5.005' ;;
12039 *) xs_apiversion=$apiversion ;; # The current site_perl version.
12041 : Find earliest pure perl site_perl subdirectory perl can use.
12042 : The versioned directories started at 5.005.
12043 pm_apiversion='5.005'
12045 : check for length of pointer
12049 $echo $n "Checking to see how big your pointers are...$c" >&4
12050 if test "$voidflags" -gt 7; then
12051 echo '#define VOID_PTR char *' > try.c
12053 echo '#define VOID_PTR void *' > try.c
12055 $cat >>try.c <<'EOCP'
12059 printf("%d\n", sizeof(VOID_PTR));
12064 if eval $compile_ok; then
12066 $echo " $ptrsize bytes." >&4
12069 echo "(I can't seem to compile the test program. Guessing...)" >&4
12070 rp="What is the size of a pointer (in bytes)?"
12078 : see if ar generates random libraries by itself
12080 echo "Checking how to generate random libraries on your machine..." >&4
12081 echo 'int bar1() { return bar2(); }' > bar1.c
12082 echo 'int bar2() { return 2; }' > bar2.c
12083 $cat > foo.c <<'EOP'
12084 int main() { printf("%d\n", bar1()); exit(0); }
12086 $cc $ccflags -c bar1.c >/dev/null 2>&1
12087 $cc $ccflags -c bar2.c >/dev/null 2>&1
12088 $cc $ccflags -c foo.c >/dev/null 2>&1
12089 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12090 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12091 ./foobar >/dev/null 2>&1; then
12092 echo "$ar appears to generate random libraries itself."
12095 elif $ar ts bar$_a >/dev/null 2>&1 &&
12096 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12097 ./foobar >/dev/null 2>&1; then
12098 echo "a table of contents needs to be added with '$ar ts'."
12105 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12106 $test -f $ranlib || ranlib=''
12109 if $test -n "$ranlib"; then
12110 echo "your system has '$ranlib'; we'll use that."
12113 echo "your system doesn't seem to support random libraries"
12114 echo "so we'll use lorder and tsort to order the libraries."
12121 : check for type of arguments to select.
12122 case "$selecttype" in
12123 '') case "$d_select" in
12126 Checking to see what type of arguments are accepted by select().
12128 hdrs="$define sys/types.h
12129 $i_systime sys/time.h
12130 $i_sysselct sys/select.h
12131 $d_socket sys/socket.h"
12132 : The first arg can be int, unsigned, or size_t
12133 : The last arg may or may not be 'const'
12135 : void pointer has been seen but using that
12136 : breaks the selectminbits test
12137 for xxx in 'fd_set *' 'int *'; do
12138 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12139 for tmo in 'struct timeval *' 'const struct timeval *'; do
12141 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12142 if ./protochk "$try" $hdrs; then
12143 echo "Your system accepts $xxx."
12152 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12153 case "$d_fd_set" in
12154 $define) dflt="fd_set *" ;;
12163 *) : no select, so pick a harmless default
12170 : check for the select 'width'
12171 case "$selectminbits" in
12172 '') case "$d_select" in
12176 Checking to see on how many bits at a time your select() operates...
12179 #include <sys/types.h>
12181 #$i_systime I_SYS_TIME
12182 #$i_systimek I_SYS_TIME_KERNEL
12187 # ifdef I_SYS_TIME_KERNEL
12190 # include <sys/time.h>
12191 # ifdef I_SYS_TIME_KERNEL
12195 #$i_sysselct I_SYS_SELECT
12196 #ifdef I_SYS_SELECT
12197 #include <sys/select.h>
12199 #$d_socket HAS_SOCKET
12201 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12205 #define S sizeof(*(b))
12207 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12208 #define NBITS (NBYTES * 8)
12217 fp = fopen("try.c", "r");
12223 b = ($selecttype)s;
12224 for (i = 0; i < NBITS; i++)
12228 select(fd + 1, b, 0, 0, &t);
12229 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12230 printf("%d\n", i + 1);
12235 if eval $compile_ok; then
12236 selectminbits=`./try`
12237 case "$selectminbits" in
12239 Cannot figure out on how many bits at a time your select() operates.
12240 I'll play safe and guess it is 32 bits.
12246 *) bits="$selectminbits bits" ;;
12248 echo "Your select() operates on $bits at a time." >&4
12250 rp='What is the minimum number of bits your select() operates on?'
12251 case "$byteorder" in
12252 1234|12345678) dflt=32 ;;
12257 selectminbits="$val"
12261 *) : no select, so pick a harmless default
12268 : Trace out the files included by signal.h, then look for SIGxxx names.
12269 : Remove SIGARRAYSIZE used by HPUX.
12270 : Remove SIGSTKSIZE used by Linux.
12271 : Remove SIGSTKSZ used by Posix.
12272 : Remove SIGTYP void lines used by OS2.
12273 xxx=`echo '#include <signal.h>' |
12274 $cppstdin $cppminus $cppflags 2>/dev/null |
12275 $grep '^[ ]*#.*include' |
12276 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12277 : Check this list of files to be sure we have parsed the cpp output ok.
12278 : This will also avoid potentially non-existent files, such
12281 for xx in $xxx /dev/null ; do
12282 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12284 : If we have found no files, at least try signal.h
12285 case "$xxxfiles" in
12286 '') xxxfiles=`./findhdr signal.h` ;;
12289 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12290 print substr($2, 4, 20)
12292 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12293 print substr($3, 4, 20)
12295 : Append some common names just in case the awk scan failed.
12296 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12297 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12298 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12299 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12300 : generate a few handy files for later
12301 $cat > signal.c <<'EOCP'
12302 #include <sys/types.h>
12303 #include <signal.h>
12307 /* Strange style to avoid deeply-nested #if/#else/#endif */
12310 # define NSIG (_NSIG)
12316 # define NSIG (SIGMAX+1)
12322 # define NSIG (SIG_MAX+1)
12328 # define NSIG (MAXSIG+1)
12334 # define NSIG (MAX_SIG+1)
12339 # ifdef SIGARRAYSIZE
12340 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12346 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12350 /* Default to some arbitrary number that's big enough to get most
12351 of the common signals.
12357 printf("NSIG %d\n", NSIG);
12363 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12365 printf "#ifdef SIG"; printf $1; printf "\n"
12366 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12367 printf $1; printf ");\n"
12371 printf "#endif /* JUST_NSIG */\n";
12375 $cat >signal.awk <<'EOP'
12376 BEGIN { ndups = 0 }
12377 $1 ~ /^NSIG$/ { nsig = $2 }
12378 ($1 !~ /^NSIG$/) && (NF == 2) {
12379 if ($2 > maxsig) { maxsig = $2 }
12380 if (sig_name[$2]) {
12381 dup_name[ndups] = $1
12382 dup_num[ndups] = $2
12394 printf("NSIG %d\n", nsig);
12395 for (n = 1; n < nsig; n++) {
12397 printf("%s %d\n", sig_name[n], sig_num[n])
12400 printf("NUM%d %d\n", n, n)
12403 for (n = 0; n < ndups; n++) {
12404 printf("%s %d\n", dup_name[n], dup_num[n])
12408 $cat >signal_cmd <<EOS
12410 if $test -s signal.lst; then
12411 echo "Using your existing signal.lst file"
12416 $cat >>signal_cmd <<'EOS'
12419 if eval $compile_ok; then
12420 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12422 echo "(I can't seem be able to compile the whole test program)" >&4
12423 echo "(I'll try it in little pieces.)" >&4
12424 set signal -DJUST_NSIG
12425 if eval $compile_ok; then
12426 ./signal$_exe > signal.nsg
12429 echo "I can't seem to figure out how many signals you have." >&4
12430 echo "Guessing 50." >&4
12431 echo 'NSIG 50' > signal.nsg
12433 : Now look at all the signal names, one at a time.
12434 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12435 $cat > signal.c <<EOCP
12436 #include <sys/types.h>
12437 #include <signal.h>
12440 printf("$xx %d\n", SIG${xx});
12445 if eval $compile; then
12446 echo "SIG${xx} found."
12447 ./signal$_exe >> signal.ls1
12449 echo "SIG${xx} NOT found."
12452 if $test -s signal.ls1; then
12453 $cat signal.nsg signal.ls1 |
12454 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12458 if $test -s signal.lst; then
12461 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12462 echo 'kill -l' >signal
12463 set X `csh -f <signal`
12467 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12469 echo $@ | $tr ' ' $trnl | \
12470 $awk '{ printf "%s %d\n", $1, ++s; }
12471 END { printf "NSIG %d\n", ++s }' >signal.lst
12473 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12475 chmod a+x signal_cmd
12476 $eunicefix signal_cmd
12478 : generate list of signal names
12480 case "$sig_name_init" in
12482 *) case "$sig_num_init" in
12483 ''|*,*) doinit=yes ;;
12488 echo "Generating a list of signal names and numbers..." >&4
12490 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12491 sig_name=`$awk 'BEGIN { printf "ZERO " }
12492 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12493 sig_num=`$awk 'BEGIN { printf "0 " }
12494 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12495 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12496 !/^NSIG/ { printf "\"%s\", ", $1 }
12497 END { printf "0\n" }' signal.lst`
12498 sig_num_init=`$awk 'BEGIN { printf "0, " }
12499 !/^NSIG/ { printf "%d, ", $2}
12500 END { printf "0\n"}' signal.lst`
12503 echo "The following $sig_count signals are available:"
12505 echo $sig_name | $awk \
12506 'BEGIN { linelen = 0 }
12508 for (i = 1; i <= NF; i++) {
12509 name = "SIG" $i " "
12510 linelen = linelen + length(name)
12511 if (linelen > 70) {
12513 linelen = length(name)
12519 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12521 : see what type is used for signed size_t
12522 set ssize_t ssizetype int stdio.h sys/types.h
12525 $cat > ssize.c <<EOM
12527 #include <sys/types.h>
12528 #define Size_t $sizetype
12529 #define SSize_t $dflt
12532 if (sizeof(Size_t) == sizeof(SSize_t))
12534 else if (sizeof(Size_t) == sizeof(int))
12543 if eval $compile_ok && ./ssize > /dev/null; then
12544 ssizetype=`./ssize`
12545 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12548 Help! I can't compile and run the ssize_t test program: please enlighten me!
12549 (This is probably a misconfiguration in your system or libraries, and
12550 you really ought to fix it. Still, I'll try anyway.)
12552 I need a type that is the same size as $sizetype, but is guaranteed to
12553 be signed. Common values are ssize_t, int and long.
12556 rp="What signed type is the same size as $sizetype?"
12560 $rm -f ssize ssize.*
12562 : see what type of char stdio uses.
12564 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12565 echo "Your stdio uses unsigned chars." >&4
12566 stdchar="unsigned char"
12568 echo "Your stdio uses signed chars." >&4
12572 : see if time exists
12574 if test "X$d_time" = X -o X"$timetype" = X; then
12575 if set time val -f d_time; eval $csym; $val; then
12576 echo 'time() found.' >&4
12578 rp="What is the type returned by time() on this system?"
12579 set time_t timetype long stdio.h sys/types.h
12582 echo 'time() not found, hope that will do.' >&4
12590 : see what type uids are declared as in the kernel
12592 echo "Looking for the type for user ids returned by getuid()."
12593 set uid_t uidtype xxx stdio.h sys/types.h
12597 xxx=`./findhdr sys/user.h`
12598 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12600 unsigned) dflt="$1 $2" ;;
12604 *) dflt="$uidtype";;
12607 uid_t) echo "uid_t found." ;;
12608 *) rp="What is the type for user ids returned by getuid()?"
12616 *_t) zzz="$uidtype" ;;
12619 echo "Checking the sign of $zzz..." >&4
12621 #include <sys/types.h>
12632 if eval $compile; then
12636 echo "(I can't execute the test program--guessing unsigned.)" >&4
12640 1) echo "Your $zzz is unsigned." ;;
12641 -1) echo "Your $zzz is signed." ;;
12647 echo "(I can't compile the test program--guessing unsigned.)" >&4
12653 *_t) zzz="$uidtype" ;;
12656 echo "Checking the size of $zzz..." >&4
12658 #include <sys/types.h>
12661 printf("%d\n", sizeof($uidtype));
12665 if eval $compile_ok; then
12669 echo "(I can't execute the test program--guessing $uidsize.)" >&4
12672 echo "Your $zzz size is $uidsize bytes."
12677 echo "(I can't compile the test program--guessing $uidsize.)" >&4
12680 : see if dbm.h is available
12681 : see if dbmclose exists
12682 set dbmclose d_dbmclose
12685 case "$d_dbmclose" in
12695 *) set rpcsvc/dbm.h i_rpcsvcdbm
12700 *) echo "We won't be including <dbm.h>"
12710 : see if this is a sys/file.h system
12715 : do we need to include sys/file.h ?
12719 if $h_sysfile; then
12721 echo "We'll be including <sys/file.h>." >&4
12724 echo "We won't be including <sys/file.h>." >&4
12734 : see if fcntl.h is there
12739 : see if we can include fcntl.h
12745 echo "We'll be including <fcntl.h>." >&4
12748 if $h_sysfile; then
12749 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12751 echo "We won't be including <fcntl.h>." >&4
12763 : see if locale.h is available
12764 set locale.h i_locale
12767 : see if mach cthreads are available
12768 if test "X$usethreads" = "X$define"; then
12769 set mach/cthreads.h i_machcthr
12772 i_machcthr="$undef"
12777 : see if this is a math.h system
12781 : see if this is a mntent.h system
12782 set mntent.h i_mntent
12785 : see if ndbm.h is available
12790 : see if dbm_open exists
12791 set dbm_open d_dbm_open
12793 case "$d_dbm_open" in
12796 echo "We won't be including <ndbm.h>"
12805 : see if net/errno.h is available
12807 set net/errno.h val
12810 : Unfortunately, it causes problems on some systems. Arrgh.
12813 cat > try.c <<'EOM'
12816 #include <net/errno.h>
12822 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12823 echo "We'll be including <net/errno.h>." >&4
12825 echo "We won't be including <net/errno.h>." >&4
12834 : see if netinet/tcp.h is available
12835 set netinet/tcp.h i_netinettcp
12838 : see if this is a poll.h system
12842 : get C preprocessor symbols handy
12844 $echo $n "Hmm... $c"
12845 echo $al | $tr ' ' $trnl >Cppsym.know
12846 $cat <<EOSS >Cppsym
12854 case "\$list\$#" in
12857 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12859 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12862 unknown="\$unknown \$sym"
12872 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12874 exit 0; _ _ _ _\1\\ \1\\
12877 echo "exit 1; _ _ _" >>Cppsym\$\$
12878 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12880 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12886 $rm -f Cppsym\$\$ Cppsym2\$\$
12891 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12893 : now check the C compiler for additional symbols
12894 postprocess_cc_v=''
12896 aix) postprocess_cc_v="|$tr , ' '" ;;
12903 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12906 -D*) echo "\$i" | $sed 's/^-D//';;
12907 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12912 postprocess_cc_v=''
12915 ./ccsym > ccsym1.raw
12916 if $test -s ccsym1.raw; then
12917 $sort ccsym1.raw | $uniq >ccsym.raw
12919 mv ccsym1.raw ccsym.raw
12922 $awk '/\=/ { print $0; next }
12923 { print $0"=1" }' ccsym.raw >ccsym.list
12924 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12925 $comm -13 ccsym.true ccsym.list >ccsym.own
12926 $comm -12 ccsym.true ccsym.list >ccsym.com
12927 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12929 if $test -z ccsym.raw; then
12930 echo "Your C compiler doesn't seem to define any symbols!" >&4
12932 echo "However, your C preprocessor defines the following symbols:"
12935 cppsymbols=`$cat Cppsym.true`
12936 cppsymbols=`echo $cppsymbols`
12937 cppccsymbols="$cppsymbols"
12939 if $test -s ccsym.com; then
12940 echo "Your C compiler and pre-processor define these symbols:"
12941 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12944 cppccsymbols=`$cat ccsym.com`
12945 cppccsymbols=`echo $cppccsymbols`
12946 $test "$silent" || sleep 1
12948 if $test -s ccsym.cpp; then
12949 $test "$also" && echo " "
12950 echo "Your C pre-processor ${also}defines the following symbols:"
12951 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12953 cppsymbols=`$cat ccsym.cpp`
12954 cppsymbols=`echo $cppsymbols`
12955 $test "$silent" || sleep 1
12957 if $test -s ccsym.own; then
12958 $test "$also" && echo " "
12959 echo "Your C compiler ${also}defines the following cpp symbols:"
12960 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12961 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12962 ccsymbols=`$cat ccsym.own`
12963 ccsymbols=`echo $ccsymbols`
12964 $test "$silent" || sleep 1
12969 : see if this is a termio system
12973 if $test `./findhdr termios.h`; then
12974 set tcsetattr i_termios
12980 "$define") echo "You have POSIX termios.h... good!" >&4;;
12981 *) if ./Cppsym pyr; then
12982 case "`/bin/universe`" in
12983 ucb) if $test `./findhdr sgtty.h`; then
12985 echo "<sgtty.h> found." >&4
12987 echo "System is pyramid with BSD universe."
12988 echo "<sgtty.h> not found--you could have problems." >&4
12990 *) if $test `./findhdr termio.h`; then
12992 echo "<termio.h> found." >&4
12994 echo "System is pyramid with USG universe."
12995 echo "<termio.h> not found--you could have problems." >&4
12999 if $test `./findhdr termio.h`; then
13000 echo "<termio.h> found." >&4
13002 elif $test `./findhdr sgtty.h`; then
13003 echo "<sgtty.h> found." >&4
13006 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13009 if $test `./findhdr sgtty.h`; then
13010 echo "<sgtty.h> found." >&4
13012 elif $test `./findhdr termio.h`; then
13013 echo "<termio.h> found." >&4
13016 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13020 set i_termio; eval $setvar
13021 val=$val2; set i_sgtty; eval $setvar
13022 val=$val3; set i_termios; eval $setvar
13024 : see if this is a shadow.h system
13025 set shadow.h i_shadow
13028 : see if this is a socks.h system
13029 set socks.h i_socks
13032 : see if stdarg is available
13034 if $test `./findhdr stdarg.h`; then
13035 echo "<stdarg.h> found." >&4
13038 echo "<stdarg.h> NOT found." >&4
13042 : see if varags is available
13044 if $test `./findhdr varargs.h`; then
13045 echo "<varargs.h> found." >&4
13047 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13050 : set up the varargs testing programs
13051 $cat > varargs.c <<EOP
13053 #include <stdarg.h>
13056 #include <varargs.h>
13060 int f(char *p, ...)
13074 p = va_arg(ap, char *);
13079 $cat > varargs <<EOP
13081 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13090 : now check which varargs header should be included
13095 if `./varargs I_STDARG`; then
13097 elif `./varargs I_VARARGS`; then
13102 if `./varargs I_VARARGS`; then
13109 echo "I could not find the definition for va_dcl... You have problems..." >&4
13110 val="$undef"; set i_stdarg; eval $setvar
13111 val="$undef"; set i_varargs; eval $setvar
13116 case "$i_varhdr" in
13118 val="$define"; set i_stdarg; eval $setvar
13119 val="$undef"; set i_varargs; eval $setvar
13122 val="$undef"; set i_stdarg; eval $setvar
13123 val="$define"; set i_varargs; eval $setvar
13126 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13130 : see if stddef is available
13131 set stddef.h i_stddef
13134 : see if sys/access.h is available
13135 set sys/access.h i_sysaccess
13138 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13139 set sys/filio.h i_sysfilio
13142 if $test `./findhdr sys/ioctl.h`; then
13144 echo '<sys/ioctl.h> found.' >&4
13147 if $test $i_sysfilio = "$define"; then
13148 echo '<sys/ioctl.h> NOT found.' >&4
13150 $test $i_sgtty = "$define" && xxx="sgtty.h"
13151 $test $i_termio = "$define" && xxx="termio.h"
13152 $test $i_termios = "$define" && xxx="termios.h"
13153 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13159 : see if sys/resource.h has to be included
13160 set sys/resource.h i_sysresrc
13163 : see if sys/security.h is available
13164 set sys/security.h i_syssecrt
13167 : see if this is a sys/statvfs.h system
13168 set sys/statvfs.h i_sysstatvfs
13171 : see if this is a sys/uio.h system
13172 set sys/uio.h i_sysuio
13175 echo "Checking to see if your system supports struct iovec..." >&4
13176 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
13178 case "$d_iovec_s" in
13179 "$define") echo "Yup, it does." >&4
13181 *) echo "Nope, it doesn't." >&4
13185 : see if this is a sys/un.h system
13186 set sys/un.h i_sysun
13189 : see if this is a syswait system
13190 set sys/wait.h i_syswait
13193 : see if this is a ustat.h system
13194 set ustat.h i_ustat
13197 : see if this is an utime system
13198 set utime.h i_utime
13201 : see if this is a values.h system
13202 set values.h i_values
13205 : see if this is a vfork system
13208 set vfork.h i_vfork
13216 : see if gdbm.h is available
13221 : see if gdbm_open exists
13222 set gdbm_open d_gdbm_open
13224 case "$d_gdbm_open" in
13227 echo "We won't be including <gdbm.h>"
13237 echo "Looking for extensions..." >&4
13238 : If we are using the old config.sh, known_extensions may contain
13239 : old or inaccurate or duplicate values.
13240 known_extensions=''
13241 nonxs_extensions=''
13242 : We do not use find because it might not be available.
13243 : We do not just use MANIFEST because the user may have dropped
13244 : some additional extensions into the source tree and expect them
13247 : Function to recursively find available extensions, ignoring DynaLoader
13248 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13252 DynaLoader|dynaload) ;;
13254 if $test -f $xxx/$xxx.xs; then
13255 known_extensions="$known_extensions $1$xxx";
13256 elif $test -f $xxx/Makefile.PL; then
13257 nonxs_extensions="$nonxs_extensions $1$xxx";
13259 if $test -d $xxx -a $# -lt 10; then
13262 eval $find_extensions;
13274 eval $find_extensions
13275 set X $nonxs_extensions
13277 nonxs_extensions="$*"
13278 set X $known_extensions
13280 known_extensions="$*"
13283 : Now see which are supported on this system.
13285 for xxx in $known_extensions ; do
13289 $define) avail_ext="$avail_ext $xxx" ;;
13292 GDBM_File|gdbm_fil)
13294 $define) avail_ext="$avail_ext $xxx" ;;
13297 NDBM_File|ndbm_fil)
13299 $define) avail_ext="$avail_ext $xxx" ;;
13302 ODBM_File|odbm_fil)
13303 case "${i_dbm}${i_rpcsvcdbm}" in
13304 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13308 case "$useposix" in
13309 true|define|y) avail_ext="$avail_ext $xxx" ;;
13313 case "$useopcode" in
13314 true|define|y) avail_ext="$avail_ext $xxx" ;;
13318 case "$d_socket" in
13319 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13323 case "$usethreads" in
13324 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13328 : XXX Do we need a useipcsysv variable here
13329 case "${d_msg}${d_sem}${d_shm}" in
13330 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13333 *) avail_ext="$avail_ext $xxx"
13342 : Now see which nonxs extensions are supported on this system.
13343 : For now assume all are.
13345 for xxx in $nonxs_extensions ; do
13347 *) nonxs_ext="$nonxs_ext $xxx"
13359 A number of extensions are supplied with $package. You may choose to
13360 compile these extensions for dynamic loading (the default), compile
13361 them into the $package executable (static loading), or not include
13362 them at all. Answer "none" to include no extensions.
13363 Note that DynaLoader is always built and need not be mentioned here.
13366 case "$dynamic_ext" in
13367 '') dflt="$avail_ext" ;;
13368 *) dflt="$dynamic_ext"
13369 # Perhaps we are reusing an old out-of-date config.sh.
13372 if test X"$dynamic_ext" != X"$avail_ext"; then
13374 NOTICE: Your previous config.sh list may be incorrect.
13375 The extensions now available to you are
13377 but the default list from your previous config.sh is
13389 rp="What extensions do you wish to load dynamically?"
13392 none) dynamic_ext=' ' ;;
13393 *) dynamic_ext="$ans" ;;
13396 case "$static_ext" in
13398 : Exclude those already listed in dynamic linking
13400 for xxx in $avail_ext; do
13401 case " $dynamic_ext " in
13403 *) dflt="$dflt $xxx" ;;
13410 *) dflt="$static_ext"
13417 rp="What extensions do you wish to load statically?"
13420 none) static_ext=' ' ;;
13421 *) static_ext="$ans" ;;
13426 A number of extensions are supplied with $package. Answer "none"
13427 to include no extensions.
13428 Note that DynaLoader is always built and need not be mentioned here.
13431 case "$static_ext" in
13432 '') dflt="$avail_ext" ;;
13433 *) dflt="$static_ext"
13434 # Perhaps we are reusing an old out-of-date config.sh.
13437 if test X"$static_ext" != X"$avail_ext"; then
13439 NOTICE: Your previous config.sh list may be incorrect.
13440 The extensions now available to you are
13442 but the default list from your previous config.sh is
13451 : Exclude those that are not xs extensions
13455 rp="What extensions do you wish to include?"
13458 none) static_ext=' ' ;;
13459 *) static_ext="$ans" ;;
13464 set X $dynamic_ext $static_ext $nonxs_ext
13468 : Remove build directory name from cppstdin so it can be used from
13469 : either the present location or the final installed location.
13471 : Get out of the UU directory to get correct path name.
13473 case "$cppstdin" in
13475 echo "Stripping down cppstdin path name"
13481 : end of configuration questions
13483 echo "End of configuration questions."
13486 : back to where it started
13487 if test -d ../UU; then
13491 : configuration may be patched via a 'config.over' file
13492 if $test -f config.over; then
13495 rp='I see a config.over file. Do you wish to load it?'
13498 n*) echo "OK, I'll ignore it.";;
13500 echo "Configuration override changes have been loaded."
13505 : in case they want portability, strip down executable paths
13506 case "$d_portable" in
13509 echo "Stripping down executable paths..." >&4
13510 for file in $loclist $trylist; do
13512 eval $file=`basename $temp`
13517 : create config.sh file
13519 echo "Creating config.sh..." >&4
13520 $spitshell <<EOT >config.sh
13523 # This file was produced by running the Configure script. It holds all the
13524 # definitions figured out by Configure. Should you modify one of these values,
13525 # do not forget to propagate your changes by running "Configure -der". You may
13526 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13529 # Package name : $package
13530 # Source directory : $src
13531 # Configuration time: $cf_time
13532 # Configured by : $cf_by
13533 # Target system : $myuname
13543 Revision='$Revision'
13550 alignbytes='$alignbytes'
13551 ansi2knr='$ansi2knr'
13552 aphostname='$aphostname'
13553 apiversion='$apiversion'
13556 archlibexp='$archlibexp'
13557 archname64='$archname64'
13558 archname='$archname'
13559 archobjs='$archobjs'
13564 bincompat5005='$bincompat5005'
13568 byteorder='$byteorder'
13570 castflags='$castflags'
13573 cccdlflags='$cccdlflags'
13574 ccdlflags='$ccdlflags'
13576 ccsymbols='$ccsymbols'
13578 cf_email='$cf_email'
13583 clocktype='$clocktype'
13585 compress='$compress'
13586 contains='$contains'
13590 cpp_stuff='$cpp_stuff'
13591 cppccsymbols='$cppccsymbols'
13592 cppflags='$cppflags'
13594 cppminus='$cppminus'
13596 cppstdin='$cppstdin'
13597 cppsymbols='$cppsymbols'
13598 crosscompile='$crosscompile'
13599 cryptlib='$cryptlib'
13601 d_Gconvert='$d_Gconvert'
13602 d_PRIEldbl='$d_PRIEldbl'
13603 d_PRIFldbl='$d_PRIFldbl'
13604 d_PRIGldbl='$d_PRIGldbl'
13605 d_PRIX64='$d_PRIX64'
13606 d_PRId64='$d_PRId64'
13607 d_PRIeldbl='$d_PRIeldbl'
13608 d_PRIfldbl='$d_PRIfldbl'
13609 d_PRIgldbl='$d_PRIgldbl'
13610 d_PRIi64='$d_PRIi64'
13611 d_PRIo64='$d_PRIo64'
13612 d_PRIu64='$d_PRIu64'
13613 d_PRIx64='$d_PRIx64'
13614 d_access='$d_access'
13615 d_accessx='$d_accessx'
13617 d_archlib='$d_archlib'
13620 d_attribut='$d_attribut'
13623 d_bincompat5005='$d_bincompat5005'
13625 d_bsdgetpgrp='$d_bsdgetpgrp'
13626 d_bsdsetpgrp='$d_bsdsetpgrp'
13628 d_casti32='$d_casti32'
13629 d_castneg='$d_castneg'
13630 d_charvspr='$d_charvspr'
13632 d_chroot='$d_chroot'
13633 d_chsize='$d_chsize'
13634 d_closedir='$d_closedir'
13638 d_cuserid='$d_cuserid'
13639 d_dbl_dig='$d_dbl_dig'
13640 d_difftime='$d_difftime'
13641 d_dirnamlen='$d_dirnamlen'
13642 d_dlerror='$d_dlerror'
13643 d_dlopen='$d_dlopen'
13644 d_dlsymun='$d_dlsymun'
13645 d_dosuid='$d_dosuid'
13646 d_drand48proto='$d_drand48proto'
13648 d_eaccess='$d_eaccess'
13649 d_endgrent='$d_endgrent'
13650 d_endhent='$d_endhent'
13651 d_endnent='$d_endnent'
13652 d_endpent='$d_endpent'
13653 d_endpwent='$d_endpwent'
13654 d_endsent='$d_endsent'
13655 d_endspent='$d_endspent'
13656 d_eofnblk='$d_eofnblk'
13657 d_eunice='$d_eunice'
13658 d_fchmod='$d_fchmod'
13659 d_fchown='$d_fchown'
13661 d_fd_macros='$d_fd_macros'
13662 d_fd_set='$d_fd_set'
13663 d_fds_bits='$d_fds_bits'
13664 d_fgetpos='$d_fgetpos'
13665 d_flexfnam='$d_flexfnam'
13668 d_fpathconf='$d_fpathconf'
13669 d_fpos64_t='$d_fpos64_t'
13670 d_fs_data_s='$d_fs_data_s'
13671 d_fseeko='$d_fseeko'
13672 d_fsetpos='$d_fsetpos'
13673 d_fstatfs='$d_fstatfs'
13674 d_fstatvfs='$d_fstatvfs'
13675 d_ftello='$d_ftello'
13677 d_getgrent='$d_getgrent'
13678 d_getgrps='$d_getgrps'
13679 d_gethbyaddr='$d_gethbyaddr'
13680 d_gethbyname='$d_gethbyname'
13681 d_gethent='$d_gethent'
13682 d_gethname='$d_gethname'
13683 d_gethostprotos='$d_gethostprotos'
13684 d_getlogin='$d_getlogin'
13685 d_getmnt='$d_getmnt'
13686 d_getmntent='$d_getmntent'
13687 d_getnbyaddr='$d_getnbyaddr'
13688 d_getnbyname='$d_getnbyname'
13689 d_getnent='$d_getnent'
13690 d_getnetprotos='$d_getnetprotos'
13691 d_getpbyname='$d_getpbyname'
13692 d_getpbynumber='$d_getpbynumber'
13693 d_getpent='$d_getpent'
13694 d_getpgid='$d_getpgid'
13695 d_getpgrp2='$d_getpgrp2'
13696 d_getpgrp='$d_getpgrp'
13697 d_getppid='$d_getppid'
13698 d_getprior='$d_getprior'
13699 d_getprotoprotos='$d_getprotoprotos'
13700 d_getpwent='$d_getpwent'
13701 d_getsbyname='$d_getsbyname'
13702 d_getsbyport='$d_getsbyport'
13703 d_getsent='$d_getsent'
13704 d_getservprotos='$d_getservprotos'
13705 d_getspent='$d_getspent'
13706 d_getspnam='$d_getspnam'
13707 d_gettimeod='$d_gettimeod'
13708 d_gnulibc='$d_gnulibc'
13709 d_grpasswd='$d_grpasswd'
13710 d_hasmntopt='$d_hasmntopt'
13713 d_inetaton='$d_inetaton'
13714 d_int64t='$d_int64t'
13715 d_iovec_s='$d_iovec_s'
13716 d_isascii='$d_isascii'
13717 d_killpg='$d_killpg'
13718 d_lchown='$d_lchown'
13719 d_ldbl_dig='$d_ldbl_dig'
13721 d_llseek='$d_llseek'
13722 d_locconv='$d_locconv'
13724 d_longdbl='$d_longdbl'
13725 d_longlong='$d_longlong'
13728 d_mbstowcs='$d_mbstowcs'
13729 d_mbtowc='$d_mbtowc'
13730 d_memchr='$d_memchr'
13731 d_memcmp='$d_memcmp'
13732 d_memcpy='$d_memcpy'
13733 d_memmove='$d_memmove'
13734 d_memset='$d_memset'
13736 d_mkfifo='$d_mkfifo'
13737 d_mktime='$d_mktime'
13739 d_msg_ctrunc='$d_msg_ctrunc'
13740 d_msg_dontroute='$d_msg_dontroute'
13741 d_msg_oob='$d_msg_oob'
13742 d_msg_peek='$d_msg_peek'
13743 d_msg_proxy='$d_msg_proxy'
13744 d_msgctl='$d_msgctl'
13745 d_msgget='$d_msgget'
13746 d_msgrcv='$d_msgrcv'
13747 d_msgsnd='$d_msgsnd'
13748 d_mymalloc='$d_mymalloc'
13750 d_off64_t='$d_off64_t'
13751 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13752 d_oldpthreads='$d_oldpthreads'
13753 d_oldsock='$d_oldsock'
13755 d_pathconf='$d_pathconf'
13757 d_phostname='$d_phostname'
13760 d_portable='$d_portable'
13761 d_pthread_yield='$d_pthread_yield'
13763 d_pwchange='$d_pwchange'
13764 d_pwclass='$d_pwclass'
13765 d_pwcomment='$d_pwcomment'
13766 d_pwexpire='$d_pwexpire'
13767 d_pwgecos='$d_pwgecos'
13768 d_pwpasswd='$d_pwpasswd'
13769 d_pwquota='$d_pwquota'
13770 d_readdir='$d_readdir'
13771 d_readlink='$d_readlink'
13772 d_rename='$d_rename'
13773 d_rewinddir='$d_rewinddir'
13775 d_safebcpy='$d_safebcpy'
13776 d_safemcpy='$d_safemcpy'
13777 d_sanemcmp='$d_sanemcmp'
13778 d_sched_yield='$d_sched_yield'
13779 d_scm_rights='$d_scm_rights'
13780 d_seekdir='$d_seekdir'
13781 d_select='$d_select'
13783 d_semctl='$d_semctl'
13784 d_semctl_semid_ds='$d_semctl_semid_ds'
13785 d_semctl_semun='$d_semctl_semun'
13786 d_semget='$d_semget'
13788 d_setegid='$d_setegid'
13789 d_seteuid='$d_seteuid'
13790 d_setgrent='$d_setgrent'
13791 d_setgrps='$d_setgrps'
13792 d_sethent='$d_sethent'
13793 d_setlinebuf='$d_setlinebuf'
13794 d_setlocale='$d_setlocale'
13795 d_setnent='$d_setnent'
13796 d_setpent='$d_setpent'
13797 d_setpgid='$d_setpgid'
13798 d_setpgrp2='$d_setpgrp2'
13799 d_setpgrp='$d_setpgrp'
13800 d_setprior='$d_setprior'
13801 d_setpwent='$d_setpwent'
13802 d_setregid='$d_setregid'
13803 d_setresgid='$d_setresgid'
13804 d_setresuid='$d_setresuid'
13805 d_setreuid='$d_setreuid'
13806 d_setrgid='$d_setrgid'
13807 d_setruid='$d_setruid'
13808 d_setsent='$d_setsent'
13809 d_setsid='$d_setsid'
13810 d_setspent='$d_setspent'
13811 d_setvbuf='$d_setvbuf'
13815 d_shmatprototype='$d_shmatprototype'
13816 d_shmctl='$d_shmctl'
13818 d_shmget='$d_shmget'
13819 d_sigaction='$d_sigaction'
13820 d_sigsetjmp='$d_sigsetjmp'
13821 d_socket='$d_socket'
13822 d_sockpair='$d_sockpair'
13824 d_statblks='$d_statblks'
13825 d_statfs_f_flags='$d_statfs_f_flags'
13826 d_statfs_s='$d_statfs_s'
13827 d_statvfs='$d_statvfs'
13828 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13829 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13830 d_stdio_stream_array='$d_stdio_stream_array'
13831 d_stdiobase='$d_stdiobase'
13832 d_stdstdio='$d_stdstdio'
13833 d_strchr='$d_strchr'
13834 d_strcoll='$d_strcoll'
13835 d_strctcpy='$d_strctcpy'
13836 d_strerrm='$d_strerrm'
13837 d_strerror='$d_strerror'
13838 d_strtod='$d_strtod'
13839 d_strtol='$d_strtol'
13840 d_strtoul='$d_strtoul'
13841 d_strtoull='$d_strtoull'
13842 d_strxfrm='$d_strxfrm'
13843 d_suidsafe='$d_suidsafe'
13844 d_symlink='$d_symlink'
13845 d_syscall='$d_syscall'
13846 d_sysconf='$d_sysconf'
13847 d_sysernlst='$d_sysernlst'
13848 d_syserrlst='$d_syserrlst'
13849 d_system='$d_system'
13850 d_tcgetpgrp='$d_tcgetpgrp'
13851 d_tcsetpgrp='$d_tcsetpgrp'
13852 d_telldir='$d_telldir'
13853 d_telldirproto='$d_telldirproto'
13856 d_truncate='$d_truncate'
13857 d_tzname='$d_tzname'
13860 d_union_semun='$d_union_semun'
13862 d_vendorbin='$d_vendorbin'
13863 d_vendorlib='$d_vendorlib'
13865 d_void_closedir='$d_void_closedir'
13866 d_voidsig='$d_voidsig'
13867 d_voidtty='$d_voidtty'
13868 d_volatile='$d_volatile'
13869 d_vprintf='$d_vprintf'
13871 d_waitpid='$d_waitpid'
13872 d_wcstombs='$d_wcstombs'
13873 d_wctomb='$d_wctomb'
13876 db_hashtype='$db_hashtype'
13877 db_prefixtype='$db_prefixtype'
13878 defvoidused='$defvoidused'
13879 direntrytype='$direntrytype'
13882 doublesize='$doublesize'
13884 dynamic_ext='$dynamic_ext'
13890 eunicefix='$eunicefix'
13893 extensions='$extensions'
13894 fflushNULL='$fflushNULL'
13895 fflushall='$fflushall'
13897 firstmakefile='$firstmakefile'
13899 fpostype='$fpostype'
13900 freetype='$freetype'
13902 full_csh='$full_csh'
13903 full_sed='$full_sed'
13904 gccversion='$gccversion'
13910 groupcat='$groupcat'
13911 groupstype='$groupstype'
13914 h_sysfile='$h_sysfile'
13918 i_arpainet='$i_arpainet'
13919 i_bsdioctl='$i_bsdioctl'
13922 i_dirent='$i_dirent'
13929 i_inttypes='$i_inttypes'
13930 i_limits='$i_limits'
13931 i_locale='$i_locale'
13932 i_machcthr='$i_machcthr'
13933 i_malloc='$i_malloc'
13935 i_memory='$i_memory'
13936 i_mntent='$i_mntent'
13939 i_neterrno='$i_neterrno'
13940 i_netinettcp='$i_netinettcp'
13943 i_pthread='$i_pthread'
13945 i_rpcsvcdbm='$i_rpcsvcdbm'
13948 i_shadow='$i_shadow'
13950 i_stdarg='$i_stdarg'
13951 i_stddef='$i_stddef'
13952 i_stdlib='$i_stdlib'
13953 i_string='$i_string'
13954 i_sysaccess='$i_sysaccess'
13955 i_sysdir='$i_sysdir'
13956 i_sysfile='$i_sysfile'
13957 i_sysfilio='$i_sysfilio'
13959 i_sysioctl='$i_sysioctl'
13960 i_sysmount='$i_sysmount'
13961 i_sysndir='$i_sysndir'
13962 i_sysparam='$i_sysparam'
13963 i_sysresrc='$i_sysresrc'
13964 i_syssecrt='$i_syssecrt'
13965 i_sysselct='$i_sysselct'
13966 i_syssockio='$i_syssockio'
13967 i_sysstat='$i_sysstat'
13968 i_sysstatfs='$i_sysstatfs'
13969 i_sysstatvfs='$i_sysstatvfs'
13970 i_systime='$i_systime'
13971 i_systimek='$i_systimek'
13972 i_systimes='$i_systimes'
13973 i_systypes='$i_systypes'
13974 i_sysuio='$i_sysuio'
13976 i_sysvfs='$i_sysvfs'
13977 i_syswait='$i_syswait'
13978 i_termio='$i_termio'
13979 i_termios='$i_termios'
13981 i_unistd='$i_unistd'
13984 i_values='$i_values'
13985 i_varargs='$i_varargs'
13986 i_varhdr='$i_varhdr'
13988 ignore_versioned_solibs='$ignore_versioned_solibs'
13991 installarchlib='$installarchlib'
13992 installbin='$installbin'
13993 installman1dir='$installman1dir'
13994 installman3dir='$installman3dir'
13995 installprefix='$installprefix'
13996 installprefixexp='$installprefixexp'
13997 installprivlib='$installprivlib'
13998 installscript='$installscript'
13999 installsitearch='$installsitearch'
14000 installsitebin='$installsitebin'
14001 installsitelib='$installsitelib'
14002 installstyle='$installstyle'
14003 installusrbinperl='$installusrbinperl'
14004 installvendorbin='$installvendorbin'
14005 installvendorlib='$installvendorlib'
14007 known_extensions='$known_extensions'
14011 lddlflags='$lddlflags'
14013 ldlibpthname='$ldlibpthname'
14020 libswanted='$libswanted'
14026 locincpth='$locincpth'
14027 loclibpth='$loclibpth'
14028 longdblsize='$longdblsize'
14029 longlongsize='$longlongsize'
14030 longsize='$longsize'
14034 lseeksize='$lseeksize'
14035 lseektype='$lseektype'
14039 make_set_make='$make_set_make'
14040 mallocobj='$mallocobj'
14041 mallocsrc='$mallocsrc'
14042 malloctype='$malloctype'
14044 man1direxp='$man1direxp'
14047 man3direxp='$man3direxp'
14050 mips_type='$mips_type'
14053 modetype='$modetype'
14055 multiarch='$multiarch'
14057 myarchname='$myarchname'
14058 mydomain='$mydomain'
14059 myhostname='$myhostname'
14062 netdb_hlen_type='$netdb_hlen_type'
14063 netdb_host_type='$netdb_host_type'
14064 netdb_name_type='$netdb_name_type'
14065 netdb_net_type='$netdb_net_type'
14068 nm_so_opt='$nm_so_opt'
14069 nonxs_ext='$nonxs_ext'
14071 o_nonblock='$o_nonblock'
14073 old_pthread_create_joinable='$old_pthread_create_joinable'
14074 optimize='$optimize'
14075 orderlib='$orderlib'
14081 patchlevel='$patchlevel'
14082 path_sep='$path_sep'
14084 perladmin='$perladmin'
14085 perlpath='$perlpath'
14087 phostname='$phostname'
14090 pm_apiversion='$pm_apiversion'
14094 prefixexp='$prefixexp'
14096 privlibexp='$privlibexp'
14097 prototype='$prototype'
14099 randbits='$randbits'
14100 randfunc='$randfunc'
14101 randseedtype='$randseedtype'
14103 rd_nodata='$rd_nodata'
14107 sPRIEldbl='$sPRIEldbl'
14108 sPRIFldbl='$sPRIFldbl'
14109 sPRIGldbl='$sPRIGldbl'
14112 sPRIeldbl='$sPRIeldbl'
14113 sPRIfldbl='$sPRIfldbl'
14114 sPRIgldbl='$sPRIgldbl'
14119 sched_yield='$sched_yield'
14120 scriptdir='$scriptdir'
14121 scriptdirexp='$scriptdirexp'
14123 seedfunc='$seedfunc'
14124 selectminbits='$selectminbits'
14125 selecttype='$selecttype'
14126 sendmail='$sendmail'
14129 sharpbang='$sharpbang'
14130 shmattype='$shmattype'
14131 shortsize='$shortsize'
14134 sig_count='$sig_count'
14135 sig_name='$sig_name'
14136 sig_name_init='$sig_name_init'
14138 sig_num_init='$sig_num_init'
14139 signal_t='$signal_t'
14140 sitearch='$sitearch'
14141 sitearchexp='$sitearchexp'
14143 sitebinexp='$sitebinexp'
14145 sitelibexp='$sitelibexp'
14146 siteprefix='$siteprefix'
14147 siteprefixexp='$siteprefixexp'
14148 sizetype='$sizetype'
14153 sockethdr='$sockethdr'
14154 socketlib='$socketlib'
14156 spackage='$spackage'
14157 spitshell='$spitshell'
14160 ssizetype='$ssizetype'
14161 startperl='$startperl'
14163 static_ext='$static_ext'
14165 stdio_base='$stdio_base'
14166 stdio_bufsiz='$stdio_bufsiz'
14167 stdio_cnt='$stdio_cnt'
14168 stdio_filbuf='$stdio_filbuf'
14169 stdio_ptr='$stdio_ptr'
14170 stdio_stream_array='$stdio_stream_array'
14173 subversion='$subversion'
14180 timeincl='$timeincl'
14181 timetype='$timetype'
14191 use64bits='$use64bits'
14193 uselargefiles='$uselargefiles'
14194 uselongdouble='$uselongdouble'
14195 usemorebits='$usemorebits'
14196 usemultiplicity='$usemultiplicity'
14197 usemymalloc='$usemymalloc'
14199 useopcode='$useopcode'
14200 useperlio='$useperlio'
14201 useposix='$useposix'
14203 useshrplib='$useshrplib'
14204 usesocks='$usesocks'
14205 usethreads='$usethreads'
14206 usevendorprefix='$usevendorprefix'
14207 usevfork='$usevfork'
14210 vendorbin='$vendorbin'
14211 vendorbinexp='$vendorbinexp'
14212 vendorlib='$vendorlib'
14213 vendorlibexp='$vendorlibexp'
14214 vendorprefix='$vendorprefix'
14215 vendorprefixexp='$vendorprefixexp'
14218 voidflags='$voidflags'
14220 xs_apiversion='$xs_apiversion'
14225 : Add in command line options if available
14226 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14228 : add special variables
14229 $test -f $src/patchlevel.h && \
14230 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14231 echo "CONFIGDOTSH=true" >>config.sh
14233 : propagate old symbols
14234 if $test -f UU/config.sh; then
14235 <UU/config.sh sort | uniq >UU/oldconfig.sh
14236 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14237 sort | uniq -u >UU/oldsyms
14238 set X `cat UU/oldsyms`
14244 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14246 echo "# Variables propagated from previous config.sh file." >>config.sh
14247 for sym in `cat UU/oldsyms`; do
14248 echo " Propagating $hint variable "'$'"$sym..."
14249 eval 'tmp="$'"${sym}"'"'
14251 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14257 : Finish up by extracting the .SH files
14271 If you'd like to make any changes to the config.sh file before I begin
14272 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14275 rp="Press return or use a shell escape to edit config.sh:"
14280 *) : in case they cannot read
14281 sh 1>&4 -c "$ans";;
14286 : if this fails, just run all the .SH files by hand
14293 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14300 Now you need to generate make dependencies by running "$make depend".
14301 You might prefer to run it in background: "$make depend > makedepend.out &"
14302 It can take a while, so you might not want to run it right now.
14307 rp="Run $make depend now?"
14311 $make depend && echo "Now you must run a $make."
14314 echo "You must run '$make depend' then '$make'."
14317 elif test -f [Mm]akefile; then
14319 echo "Now you must run a $make."
14324 if $test -f Policy.sh; then
14327 If you compile $package on a different machine or from a different object
14328 directory, copy the Policy.sh file from this object directory to the
14329 new one before you run Configure -- this will help you with most of
14330 the policy defaults.
14334 if $test -f config.msg; then
14335 echo "Hmm. I also noted the following information while running:"
14337 $cat config.msg >&4
14340 $rm -f kit*isdone ark*isdone