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 Wed Oct 27 21:32:42 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=''
685 ignore_versioned_solibs=''
809 d_stdio_stream_array=''
810 stdio_stream_array=''
852 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
855 : We must find out about Eunice early
857 if test -f /etc/unixtovms; then
858 eunicefix=/etc/unixtovms
860 if test -f /etc/unixtovms.exe; then
861 eunicefix=/etc/unixtovms.exe
865 : Possible local include directories to search.
866 : Set locincpth to "" in a hint file to defeat local include searches.
867 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
868 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
870 : no include file wanted by default
873 : list of known cpp symbols, sorted alphabetically
874 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
875 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
876 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
877 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
878 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
879 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
880 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
881 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
882 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
883 al="$al VMS Xenix286"
884 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
885 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
886 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
887 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
888 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
889 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
890 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
891 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
892 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
893 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
894 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
895 al="$al __SVR4_2__ __UMAXV__"
896 al="$al ____386BSD____ __alpha __alpha__ __amiga"
897 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
898 al="$al __host_mips__"
899 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
900 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
901 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
902 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
903 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
904 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
905 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
906 al="$al __mc88100 __mc88100__ __mips __mips__"
907 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
908 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
909 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
910 al="$al _host_mips _mips _unix"
911 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
912 al="$al apollo ardent att386 att3b"
913 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
914 al="$al cadmus clipper concurrent convex cray ctix"
915 al="$al dmert encore gcos gcx gimpel gould"
916 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
917 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
918 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
919 al="$al i186 i286 i386 i486 i8086"
920 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
921 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
922 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
923 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
924 al="$al mc88000 mc88100 merlin mert mips mvs n16"
925 al="$al ncl_el ncl_mr"
926 al="$al news1500 news1700 news1800 news1900 news3700"
927 al="$al news700 news800 news900 ns16000 ns32000"
928 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
929 al="$al parisc pc532 pdp11 plexus posix pyr"
930 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
931 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
932 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
933 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
934 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
935 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
938 : Trailing extension. Override this in a hint file, if needed.
940 : Extra object files, if any, needed on this platform.
943 : change the next line if compiling for Xenix/286 on Xenix/386
944 xlibpth='/usr/lib/386 /lib/386'
946 : Possible local library directories to search.
947 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
948 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
950 : general looking path for locating libraries
951 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
952 glibpth="$glibpth /lib /usr/lib $xlibpth"
953 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
954 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
956 : Private path used by Configure to find libraries. Its value
957 : is prepended to libpth. This variable takes care of special
958 : machines, like the mips. Usually, it should be empty.
961 : default library list
963 : some systems want to use only the non-versioned libso:s
964 ignore_versioned_solibs=''
965 : full support for void wanted by default
968 : set useposix=false in your hint file to disable the POSIX extension.
970 : set useopcode=false in your hint file to disable the Opcode extension.
972 : set usemultiplicity on the Configure command line to enable multiplicity.
973 : set usesocks on the Configure command line to enable socks.
974 : set usethreads on the Configure command line to enable threads.
975 : List of libraries we want.
976 : If anyone needs -lnet, put it in a hint file.
977 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
978 libswanted="$libswanted dld ld sun m c cposix posix"
979 libswanted="$libswanted ndir dir crypt sec"
980 libswanted="$libswanted ucb bsd BSD PW x"
981 : We probably want to search /usr/shlib before most other libraries.
982 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
983 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
984 glibpth="/usr/shlib $glibpth"
985 : Do not use vfork unless overridden by a hint file.
988 : Find the basic shell for Bourne shell scripts
992 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
995 if test -f "$xxx"; then
998 : Build up a list and do a single loop so we can 'break' out.
999 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1000 for xxx in sh bash ksh pdksh ash; do
1002 try="$try ${p}/${xxx}"
1006 if test -f "$xxx"; then
1009 elif test -f "$xxx.exe"; then
1020 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1022 Usually it's in /bin/sh. How did you even get this far?
1023 Please contact me (Perl Maintainers) at perlbug@perl.com and
1024 we'll try to straighten this all out.
1030 : see if sh knows # comments
1031 if `$sh -c '#' >/dev/null 2>&1`; then
1035 test -f $xcat || xcat=/usr/bin/cat
1040 if test -s today; then
1043 echo "#! $xcat" > try
1047 if test -s today; then
1055 echo "Your $sh doesn't grok # comments--I will strip them later on."
1058 echo "exec grep -v '^[ ]*#'" >spitshell
1060 $eunicefix spitshell
1061 spitshell=`pwd`/spitshell
1063 echo "I presume that if # doesn't work, #! won't work either!"
1068 : figure out how to guarantee sh startup
1070 '') startsh=${sharpbang}${sh} ;;
1082 : echo "Yup, it does."
1084 echo "Hmm... '$startsh' does not guarantee sh startup..."
1085 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1090 : Save command line options in file UU/cmdline.opt for later use in
1091 : generating config.sh.
1092 cat > cmdline.opt <<EOSH
1093 # Configure command line arguments.
1100 cat >>cmdline.opt <<EOSH
1101 config_arg$argn='$arg'
1103 argn=`expr $argn + 1`
1106 : produce awk script to parse command line options
1107 cat >options.awk <<'EOF'
1109 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1111 len = length(optstr);
1112 for (i = 1; i <= len; i++) {
1113 c = substr(optstr, i, 1);
1114 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1125 if (substr(str, 1, 1) != "-") {
1126 printf("'%s'\n", str);
1130 for (i = 2; i <= len; i++) {
1131 c = substr(str, i, 1);
1133 printf("-%s\n", substr(str, i));
1139 printf("'%s'\n", substr(str, i + 1));
1152 : process the command line options
1153 set X `for arg in "$@"; do echo "X$arg"; done |
1154 sed -e s/X// | awk -f options.awk`
1159 : set up default values
1169 rm -f optdef.sh posthint.sh
1170 cat >optdef.sh <<EOS
1176 while test $# -gt 0; do
1178 -d) shift; fastread=yes;;
1179 -e) shift; alldone=cont;;
1183 if test -r "$1"; then
1186 echo "$me: cannot read config file $1." >&2
1191 -h) shift; error=true;;
1192 -r) shift; reuseval=true;;
1193 -s) shift; silent=true; realsilent=true;;
1194 -E) shift; alldone=exit;;
1195 -K) shift; knowitall=true;;
1196 -O) shift; override=true;;
1197 -S) shift; silent=true; extractsh=true;;
1202 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1203 echo "$me: ignoring -D $1" >&2
1206 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1207 *) echo "$1='define'" >> optdef.sh;;
1214 *=) echo "$1" >> optdef.sh;;
1216 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1217 echo "$me: ignoring -U $1" >&2
1219 *) echo "$1='undef'" >> optdef.sh;;
1230 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1234 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1235 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1241 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1242 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1243 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1244 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1245 *) xxx=`echo $yyy|sed 's!:.*!!'`
1246 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1252 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1254 echo "$yyy=''" >> posthint.sh ;;
1259 echo "$yyy='$zzz'" >> posthint.sh ;;
1261 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1263 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1268 echo "$yyy=$zzz" >> posthint.sh ;;
1269 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1272 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1275 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1283 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1284 [-U symbol] [-U symbol=] [-A command:symbol...]
1285 -d : use defaults for all answers.
1286 -e : go on without questioning past the production of config.sh.
1287 -f : specify an alternate default configuration file.
1288 -h : print this help message and exit (with an error status).
1289 -r : reuse C symbols value if possible (skips costly nm extraction).
1290 -s : silent mode, only echoes questions and essential information.
1291 -D : define symbol to have some value:
1292 -D symbol symbol gets the value 'define'
1293 -D symbol=value symbol gets the value 'value'
1294 -E : stop at the end of questions, after having produced config.sh.
1295 -K : do not use unless you know what you are doing.
1296 -O : let -D and -U override definitions from loaded configuration file.
1297 -S : perform variable substitutions on all .SH files (can mix with -f)
1298 -U : undefine symbol:
1299 -U symbol symbol gets the value 'undef'
1300 -U symbol= symbol gets completely empty
1301 -A : manipulate symbol after the platform specific hints have been applied:
1302 -A symbol=value append " "value to symbol
1303 -A append:symbol=value append value to symbol
1304 -A define:symbol=value define symbol to have value
1305 -A clear:symbol define symbol to be ''
1306 -A define:symbol define symbol to be 'define'
1307 -A eval:symbol=value define symbol to be eval of value
1308 -A prepend:symbol=value prepend value to symbol
1309 -A undef:symbol define symbol to be 'undef'
1310 -A undef:symbol= define symbol to be ''
1311 -V : print version number and exit (with a zero status).
1318 case "$fastread$alldone" in
1321 if test ! -t 0; then
1322 echo "Say 'sh Configure', not 'sh <Configure'"
1330 true) exec 1>/dev/null;;
1333 : run the defines and the undefines, if any, but leave the file out there...
1336 : create the posthint manipulation script and leave the file out there...
1341 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1342 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1343 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1344 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1345 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1348 : Some greps do not return status, grrr.
1349 echo "grimblepritz" >grimble
1350 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1352 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1358 : the following should work in any shell
1362 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1363 cat >contains <<'EOSS'
1364 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1369 : Find the path to the source tree
1372 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1375 *) src=`cd ../$src && pwd` ;;
1388 if test -f $rsrc/Configure && \
1389 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1391 : found it, so we are ok.
1394 for src in . .. ../.. ../../.. ../../../..; do
1395 if test -f ../$src/Configure && \
1396 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1407 Sorry, I can't seem to locate the source dir for $package. Please start
1408 Configure with an explicit path -- i.e. /some/path/Configure.
1416 echo "Sources for $package found in \"$src\"." >&4
1420 : script used to extract .SH files with variable substitutions
1421 cat >extract <<'EOS'
1423 echo "Doing variable substitutions on .SH files..."
1424 if test -f $src/MANIFEST; then
1425 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1427 echo "(Looking for .SH files under the source directory.)"
1428 set x `(cd $src; find . -name "*.SH" -print)`
1432 0) set x `(cd $src; echo *.SH)`; shift;;
1434 if test ! -f $src/$1; then
1440 while test $name; do
1441 if test ! -d "$name"; then
1442 create="$name $create";
1443 name=`echo $name | sed -e "s|^[^/]*$||"`;
1444 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1449 for file in $create; do
1458 dir=`expr X$file : 'X\(.*\)/'`
1459 file=`expr X$file : 'X.*/\(.*\)'`
1460 (cd $dir && . ./$file)
1470 dir=`expr X$file : 'X\(.*\)/'`
1471 file=`expr X$file : 'X.*/\(.*\)'`
1472 (set x $dir; shift; eval $mkdir_p)
1482 if test -f $src/config_h.SH; then
1483 if test ! -f config.h; then
1484 : oops, they left it out of MANIFEST, probably, so do it anyway.
1490 : extract files and exit if asked to do so
1491 case "$extractsh" in
1493 case "$realsilent" in
1497 case "$config_sh" in
1498 '') config_sh='config.sh';;
1501 echo "Fetching answers from $config_sh..."
1504 test "$override" && . ./optdef.sh
1513 : Eunice requires " " instead of "", can you believe it
1516 echo "Beginning of configuration questions for $package."
1518 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1520 : first determine how to suppress newline on echo command
1522 echo "Checking echo to see how to suppress newlines..."
1523 (echo "hi there\c" ; echo " ") >.echotmp
1524 if $contains c .echotmp >/dev/null 2>&1 ; then
1535 echo $n "The star should be here-->$c"
1539 : Now test for existence of everything in MANIFEST
1541 if test -f $rsrc/MANIFEST; then
1542 echo "First let's make sure your kit is complete. Checking..." >&4
1543 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1546 for filelist in x??; do
1547 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1549 if test -s missing; then
1553 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1555 You have the option of continuing the configuration process, despite the
1556 distinct possibility that your kit is damaged, by typing 'y'es. If you
1557 do, don't blame me if something goes wrong. I advise you to type 'n'o
1558 and contact the author (perlbug@perl.com).
1561 echo $n "Continue? [n] $c" >&4
1565 echo "Continuing..." >&4
1569 echo "ABORTING..." >&4
1574 echo "Looks good..."
1577 echo "There is no MANIFEST file. I hope your kit is complete !"
1582 : Find the appropriate value for a newline for tr
1583 if test -n "$DJGPP"; then
1586 if test X"$trnl" = X; then
1587 case "`echo foo|tr '\n' x 2>/dev/null`" in
1591 if test X"$trnl" = X; then
1592 case "`echo foo|tr '\012' x 2>/dev/null`" in
1593 foox) trnl='\012' ;;
1596 if test X"$trnl" = X; then
1599 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1605 : compute the number of columns on the terminal for proper question formatting
1610 : set up the echo used in my read
1611 myecho="case \"\$xxxm\" in
1612 '') echo $n \"\$rp $c\" >&4;;
1614 '') echo $n \"[\$xxxm] $c\";;
1616 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1618 echo $n \"[\$xxxm] $c\" >&4
1620 echo $n \"\$rp [\$xxxm] $c\" >&4
1626 : now set up to do reads with possible shell escape and default assignment
1632 case "\$fastread" in
1633 yes) case "\$dflt" in
1636 case "\$silent-\$rp" in
1641 *) case "\$silent" in
1642 true) case "\$rp" in
1647 while expr "X\$ans" : "X!" >/dev/null; do
1651 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1659 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1668 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1673 echo "(OK, I'll run with -d after this question.)" >&4
1676 echo "*** Sorry, \$1 not supported yet." >&4
1686 echo "*** Substitution done -- please confirm."
1688 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1693 echo "*** Error -- try again."
1700 case "\$ans\$xxxm\$nostick" in
1712 : create .config dir to save info across Configure sessions
1713 test -d ../.config || mkdir ../.config
1714 cat >../.config/README <<EOF
1715 This directory created by Configure to save information that should
1716 persist across sessions for $package.
1718 You may safely delete it if you wish.
1721 : general instructions
1724 user=`(logname) 2>/dev/null`
1726 '') user=`whoami 2>&1`;;
1728 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1731 rp='Would you like to see the instructions?'
1742 This installation shell script will examine your system and ask you questions
1743 to determine how the perl5 package should be installed. If you get
1744 stuck on a question, you may use a ! shell escape to start a subshell or
1745 execute a command. Many of the questions will have default answers in square
1746 brackets; typing carriage return will give you the default.
1748 On some of the questions which ask for file or directory names you are allowed
1749 to use the ~name construct to specify the login directory belonging to "name",
1750 even if you don't have a shell which knows about that. Questions where this is
1751 allowed will be marked "(~name ok)".
1755 dflt='Type carriage return to continue'
1759 The prompter used in this script allows you to use shell variables and
1760 backticks in your answers. You may use $1, $2, etc... to refer to the words
1761 in the default answer, as if the default line was a set of arguments given to a
1762 script shell. This means you may also use $* to repeat the whole default line,
1763 so you do not have to re-type everything to add something to the default.
1765 Everytime there is a substitution, you will have to confirm. If there is an
1766 error (e.g. an unmatched backtick), the default answer will remain unchanged
1767 and you will be prompted again.
1769 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1770 the questions and use the computed defaults (or the previous answers if there
1771 was already a config.sh file). Type 'Configure -h' for a list of options.
1772 You may also start interactively and then answer '& -d' at any prompt to turn
1773 on the non-interactive behaviour for the remainder of the execution.
1779 Much effort has been expended to ensure that this shell script will run on any
1780 Unix system. If despite that it blows up on yours, your best bet is to edit
1781 Configure and run it again. If you can't run Configure for some reason,
1782 you'll have to generate a config.sh file by hand. Whatever problems you
1783 have, let me (perlbug@perl.com) know how I blew it.
1785 This installation script affects things in two ways:
1787 1) it may do direct variable substitutions on some of the files included
1789 2) it builds a config.h file for inclusion in C programs. You may edit
1790 any of these files as the need arises after running this script.
1792 If you make a mistake on a question, there is no easy way to back up to it
1793 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1794 files. Configure will offer to let you do this before it runs the SH files.
1797 dflt='Type carriage return to continue'
1799 case "$firsttime" in
1800 true) echo $user >>../.config/instruct;;
1804 : find out where common programs are
1806 echo "Locating common programs..." >&4
1819 if test -d \$dir/\$thing; then
1825 for thisthing in \$dir/\$thing; do
1826 : just loop through to pick last item
1828 if test -f \$thisthing; then
1831 elif test -f \$dir/\$thing.exe; then
1832 if test -n "$DJGPP"; then
1833 echo \$dir/\$thing.exe
1835 : on Eunice apparently
1885 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1886 pth="$pth /lib /usr/lib"
1887 for file in $loclist; do
1891 if test -f "$xxx"; then
1894 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1895 xxx=`./loc $file $file $pth`
1898 '') xxx=`./loc $file $file $pth`;;
1899 *) xxx=`./loc $xxx $xxx $pth`;;
1905 echo $file is in $xxx.
1908 echo $file is in $xxx.
1911 echo "I don't know where '$file' is, and my life depends on it." >&4
1912 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1918 echo "Don't worry if any of the following aren't found..."
1920 for file in $trylist; do
1924 if test -f "$xxx"; then
1927 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1928 xxx=`./loc $file $file $pth`
1931 '') xxx=`./loc $file $file $pth`;;
1932 *) xxx=`./loc $xxx $xxx $pth`;;
1938 echo $file is in $xxx.
1941 echo $file is in $xxx.
1944 echo "I don't see $file out there, $say."
1951 echo "Substituting grep for egrep."
1957 echo "Substituting cp for ln."
1963 echo "Hopefully test is built into your sh."
1966 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1967 echo "Using the test built into your sh."
1975 echo "Hopefully echo is built into your sh."
1980 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1981 $echo $n "hi there$c" >foo1
1982 echo $n "hi there$c" >foo2
1983 if cmp foo1 foo2 >/dev/null 2>&1; then
1984 echo "They are compatible. In fact, they may be identical."
1991 They are not compatible! You are probably running ksh on a non-USG system.
1992 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1993 have echo built in and we may have to run some Bourne shell scripts. That
1994 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1997 $echo $n "The star should be here-->$c"
2004 : determine whether symbolic links are supported
2007 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2008 echo "Symbolic links are supported." >&4
2011 echo "Symbolic links are NOT supported." >&4
2016 : see whether [:lower:] and [:upper:] are supported character classes
2018 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2020 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2024 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2025 # (0xc9 and 0xd1), therefore that is a nice testing point.
2026 if test "X$up" = X -o "X$low" = X; then
2027 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2033 if test "X$up" = X -o "X$low" = X; then
2034 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2040 if test "X$up" = X -o "X$low" = X; then
2041 case "`echo IJ | od -x 2>/dev/null`" in
2043 echo "Hey, this might be EBCDIC." >&4
2044 if test "X$up" = X -o "X$low" = X; then
2045 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2046 ij) up='[A-IJ-RS-Z]'
2051 if test "X$up" = X -o "X$low" = X; then
2052 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2062 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2064 echo "Using $up and $low to convert case." >&4
2067 echo "I don't know how to translate letters from upper to lower case." >&4
2068 echo "Your tr is not acting any way I know of." >&4
2072 : set up the translation script tr, must be called with ./tr of course
2076 '[A-Z][a-z]') exec $tr '$up' '$low';;
2077 '[a-z][A-Z]') exec $tr '$low' '$up';;
2084 : Try to determine whether config.sh was made on this system
2085 case "$config_sh" in
2087 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2088 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2089 # because the A-Z/a-z are not consecutive.
2090 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2091 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2092 newmyuname="$myuname"
2094 case "$knowitall" in
2096 if test -f ../config.sh; then
2097 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2098 eval "`grep myuname= ../config.sh`"
2100 if test "X$myuname" = "X$newmyuname"; then
2108 : Get old answers from old config file if Configure was run on the
2109 : same system, otherwise use the hints.
2112 if test -f config.sh; then
2114 rp="I see a config.sh file. Shall I use it to set the defaults?"
2117 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2118 *) echo "Fetching default answers from your old config.sh file..." >&4
2126 : Older versions did not always set $sh. Catch re-use of such
2135 if test ! -f config.sh; then
2138 First time through, eh? I have some defaults handy for some systems
2139 that need some extra help getting the Configure answers right:
2142 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2144 : Half the following guesses are probably wrong... If you have better
2145 : tests or hints, please send them to perlbug@perl.com
2146 : The metaconfig authors would also appreciate a copy...
2147 $test -f /irix && osname=irix
2148 $test -f /xenix && osname=sco_xenix
2149 $test -f /dynix && osname=dynix
2150 $test -f /dnix && osname=dnix
2151 $test -f /lynx.os && osname=lynxos
2152 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2153 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2154 $test -f /bin/mips && /bin/mips && osname=mips
2155 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2156 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2157 $test -d /usr/apollo/bin && osname=apollo
2158 $test -f /etc/saf/_sactab && osname=svr4
2159 $test -d /usr/include/minix && osname=minix
2160 if $test -d /MachTen -o -d /MachTen_Folder; then
2162 if $test -x /sbin/version; then
2163 osvers=`/sbin/version | $awk '{print $2}' |
2164 $sed -e 's/[A-Za-z]$//'`
2165 elif $test -x /usr/etc/version; then
2166 osvers=`/usr/etc/version | $awk '{print $2}' |
2167 $sed -e 's/[A-Za-z]$//'`
2172 $test -f /sys/posix.dll &&
2173 $test -f /usr/bin/what &&
2174 set X `/usr/bin/what /sys/posix.dll` &&
2175 $test "$3" = UWIN &&
2178 if $test -f $uname; then
2186 umips) osname=umips ;;
2189 [23]100) osname=mips ;;
2190 next*) osname=next ;;
2192 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2193 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2196 elif $test -f /etc/kconfig; then
2198 if test "$lns" = "$ln -s"; then
2200 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2202 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2209 if test -n "$DJGPP"; then
2218 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2220 'not found') osvers="$4"."$3" ;;
2221 '<3240'|'<>3240') osvers=3.2.0 ;;
2222 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2223 '=3250'|'>3250') osvers=3.2.5 ;;
2227 *dc.osx) osname=dcosx
2233 domainos) osname=apollo
2239 dynixptx*) osname=dynixptx
2240 osvers=`echo "$4"|sed 's/^v//'`
2242 freebsd) osname=freebsd
2244 genix) osname=genix ;;
2246 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2262 netbsd*) osname=netbsd
2265 news-os) osvers="$3"
2267 4*) osname=newsos4 ;;
2271 bsd386) osname=bsd386
2274 POSIX-BC | posix-bc ) osname=posix-bc
2277 powerux | power_ux | powermax_os | powermaxos | \
2278 powerunix | power_unix) osname=powerux
2281 next*) osname=next ;;
2282 solaris) osname=solaris
2284 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2291 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2295 titanos) osname=titanos
2304 ultrix) osname=ultrix
2307 osf1|mls+) case "$5" in
2310 osvers=`echo "$3" | sed 's/^[xvt]//'`
2312 hp*) osname=hp_osf1 ;;
2313 mips) osname=mips_osf1 ;;
2316 unixware) osname=svr5
2325 $2) case "$osname" in
2329 : svr4.x or possibly later
2339 if test -f /stand/boot ; then
2340 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2341 if test -n "$INITPROG" -a -f "$INITPROG"; then
2342 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2343 if test -n "$isesix"; then
2351 *) if test -f /etc/systemid; then
2353 set `echo $3 | $sed 's/\./ /g'` $4
2354 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2356 elif $test -f $src/hints/sco_$1_$2.sh; then
2358 elif $test -f $src/hints/sco_$1.sh; then
2363 '') : Still unknown. Probably a generic Sys V.
2372 *) case "$osname" in
2373 '') : Still unknown. Probably a generic BSD.
2381 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2382 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2383 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2386 $rm -f UU/kernel.what
2387 elif test -d c:/.; then
2394 : Now look for a hint file osname_osvers, unless one has been
2395 : specified already.
2398 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2399 : Also try without trailing minor version numbers.
2400 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2401 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2402 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2403 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2406 *) case "$osvers" in
2409 *) if $test -f $src/hints/$file.sh ; then
2411 elif $test -f $src/hints/$xfile.sh ; then
2413 elif $test -f $src/hints/$xxfile.sh ; then
2415 elif $test -f $src/hints/$xxxfile.sh ; then
2417 elif $test -f $src/hints/$xxxxfile.sh ; then
2419 elif $test -f "$src/hints/${osname}.sh" ; then
2428 if $test -f Policy.sh ; then
2431 none) dflt="Policy" ;;
2432 *) dflt="Policy $dflt" ;;
2437 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2441 if $test -f Policy.sh ; then
2444 There's also a Policy hint file available, which should make the
2445 site-specific (policy) questions easier to answer.
2452 You may give one or more space-separated answers, or "none" if appropriate.
2453 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2454 is a good thing. DO NOT give a wrong version or a wrong OS.
2458 rp="Which of these apply, if any?"
2461 for file in $tans; do
2462 if $test X$file = XPolicy -a -f Policy.sh; then
2464 $cat Policy.sh >> UU/config.sh
2465 elif $test -f $src/hints/$file.sh; then
2466 . $src/hints/$file.sh
2467 $cat $src/hints/$file.sh >> UU/config.sh
2468 elif $test X$tans = X -o X$tans = Xnone ; then
2471 : Give one chance to correct a possible typo.
2472 echo "$file.sh does not exist"
2474 rp="hint to use instead?"
2476 for file in $ans; do
2477 if $test -f "$src/hints/$file.sh"; then
2478 . $src/hints/$file.sh
2479 $cat $src/hints/$file.sh >> UU/config.sh
2480 elif $test X$ans = X -o X$ans = Xnone ; then
2483 echo "$file.sh does not exist -- ignored."
2490 : Remember our hint file for later.
2491 if $test -f "$src/hints/$file.sh" ; then
2501 echo "Fetching default answers from $config_sh..." >&4
2505 cp $config_sh config.sh 2>/dev/null
2515 test "$override" && . ./optdef.sh
2516 myuname="$newmyuname"
2518 : Restore computed paths
2519 for file in $loclist $trylist; do
2520 eval $file="\$_$file"
2525 Configure uses the operating system name and version to set some defaults.
2526 The default value is probably right if the name rings a bell. Otherwise,
2527 since spelling matters for me, either accept the default or answer "none"
2534 ''|' '|none) dflt=none ;;
2535 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2538 *) dflt="$osname" ;;
2540 rp="Operating system name?"
2544 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2550 ''|' '|none) dflt=none ;;
2551 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2552 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2554 ''|' ') dflt=none ;;
2559 *) dflt="$osvers" ;;
2561 rp="Operating system version?"
2571 : who configured the system
2572 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2573 cf_by=`(logname) 2>/dev/null`
2576 cf_by=`(whoami) 2>/dev/null`
2578 "") cf_by=unknown ;;
2582 : set up the script used to warn in case of inconsistency
2589 echo "*** WHOA THERE!!! ***" >&4
2590 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2591 rp=" Keep the $hint value?"
2594 y) td=$was; tu=$was;;
2598 : function used to set $1 to $val
2599 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2601 $define$undef) . ./whoa; eval "$var=\$td";;
2602 $undef$define) . ./whoa; eval "$var=\$tu";;
2603 *) eval "$var=$val";;
2608 Perl can be built to take advantage of threads, on some systems.
2609 To do so, Configure must be run with -Dusethreads.
2611 Note that threading is a highly experimental feature, and
2612 some known race conditions still remain. If you choose to try
2613 it, be very sure to not actually deploy it for production
2614 purposes. README.threads has more details, and is required
2615 reading if you enable threads.
2617 case "$usethreads" in
2618 $define|true|[yY]*) dflt='y';;
2621 rp='Build a threading Perl?'
2624 y|Y) val="$define" ;;
2630 case "$d_oldpthreads" in
2631 '') : Configure tests would be welcome here. For now, assume undef.
2633 *) val="$d_oldpthreads" ;;
2639 case "$usethreads" in
2640 "$define"|true|[yY]*)
2641 : Look for a hint-file generated 'call-back-unit'. If the
2642 : user has specified that a threading perl is to be built,
2643 : we may need to set or change some other defaults.
2644 if $test -f usethreads.cbu; then
2645 echo "Your platform has some specific hints for threaded builds, using them..."
2649 (Your platform doesn't have any specific hints for threaded builds.
2650 Assuming POSIX threads, then.)
2658 Perl can be built so that multiple Perl interpreters can coexist
2659 within the same Perl executable. To do so, Configure must be run with
2662 Normally you do not need this and you should answer no.
2665 case "$usemultiplicity" in
2666 $define|true|[yY]*) dflt='y';;
2669 rp='Build Perl for multiplicity?'
2672 y|Y) val="$define" ;;
2678 : determine where manual pages are on this system
2682 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2683 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2684 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2685 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2686 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2687 sysman=`./loc . /usr/man/man1 $syspath`
2690 if $test -d "$sysman"; then
2691 echo "System manual is in $sysman." >&4
2693 echo "Could not find manual pages in source form." >&4
2696 : see what memory models we can support
2699 $cat >pdp11.c <<'EOP'
2708 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2709 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2710 dflt='unsplit split'
2712 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2715 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2720 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2723 if $test -d /lib/large || $test -d /usr/lib/large; then
2726 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2735 Some systems have different model sizes. On most systems they are called
2736 small, medium, large, and huge. On the PDP11 they are called unsplit and
2737 split. If your system doesn't support different memory models, say "none".
2738 If you wish to force everything to one memory model, say "none" here and
2739 put the appropriate flags later when it asks you for other cc and ld flags.
2740 Venix systems may wish to put "none" and let the compiler figure things out.
2741 (In the following question multiple model names should be space separated.)
2743 The default for most systems is "none".
2746 rp="Which memory models are supported?"
2761 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2762 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2769 rp="What flag indicates separate I and D space?"
2777 *large*|*small*|*medium*|*huge*)
2784 rp="What flag indicates large model?"
2794 *huge*) case "$huge" in
2798 rp="What flag indicates huge model?"
2808 *medium*) case "$medium" in
2812 rp="What flag indicates medium model?"
2819 *) medium="$large";;
2822 *small*) case "$small" in
2826 rp="What flag indicates small model?"
2837 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2840 $rm -f pdp11.* pdp11
2842 : make some quick guesses about what we are up against
2844 $echo $n "Hmm... $c"
2854 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2855 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2857 echo "Looks kind of like an OSF/1 system, but we'll see..."
2859 elif test `echo abc | tr a-z A-Z` = Abc ; then
2860 xxx=`./loc addbib blurfl $pth`
2861 if $test -f $xxx; then
2862 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2866 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2867 echo "Looks kind of like an extended USG system, but we'll see..."
2869 echo "Looks kind of like a USG system, but we'll see..."
2873 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2874 echo "Looks kind of like a BSD system, but we'll see..."
2878 echo "Looks kind of like a Version 7 system, but we'll see..."
2881 case "$eunicefix" in
2884 There is, however, a strange, musty smell in the air that reminds me of
2885 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2889 : it so happens the Eunice I know will not run shell scripts in Unix format
2893 echo "Congratulations. You aren't running Eunice."
2897 : Detect OS2. The p_ variable is set above in the Head.U unit.
2902 I have the feeling something is not exactly right, however...don't tell me...
2903 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2908 if test -f /xenix; then
2909 echo "Actually, this looks more like a XENIX system..."
2914 echo "It's not Xenix..."
2919 if test -f /venix; then
2920 echo "Actually, this looks more like a VENIX system..."
2927 echo "Nor is it Venix..."
2930 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2931 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2934 : see if we need a special compiler
2942 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2943 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2957 On some older systems the default C compiler will not resolve multiple global
2958 references that happen to have the same name. On some such systems the "Mcc"
2959 command may be used to force these to be resolved. On other systems a "cc -M"
2960 command is required. (Note that the -M flag on other systems indicates a
2961 memory model to use!) If you have the Gnu C compiler, you might wish to use
2967 rp="Use which C compiler?"
2975 rp="Use which C compiler?"
2979 : Look for a hint-file generated 'call-back-unit'. Now that the
2980 : user has specified the compiler, we may need to set or change some
2982 if $test -f cc.cbu; then
2986 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2987 $cat >gccvers.c <<EOM
2992 printf("%s\n", __VERSION__);
2994 printf("%s\n", "1");
3000 if $cc -o gccvers gccvers.c; then
3001 gccversion=`./gccvers`
3002 case "$gccversion" in
3003 '') echo "You are not using GNU cc." ;;
3004 *) echo "You are using GNU cc $gccversion." ;;
3008 echo "*** WHOA THERE!!! ***" >&4
3009 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3010 case "$knowitall" in
3012 echo " You'd better start hunting for one and let me know about it." >&4
3018 case "$gccversion" in
3019 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3023 case "$usemorebits" in
3024 "$define"|true|[yY]*)
3026 uselongdouble="$define"
3027 usemorebits="$define"
3029 *) usemorebits="$undef"
3036 Perl can be built to understand large files (files larger than 2 gigabytes)
3037 on some systems. To do so, Configure must be run with -Duselargefiles.
3039 If this doesn't make any sense to you, just accept the default.
3041 case "$uselargefiles" in
3042 "$define"|true|[yY]*) dflt='y' ;;
3045 rp='Try to understand large files?'
3048 y|Y) val="$define" ;;
3053 case "$uselargefiles" in
3054 "$define") use64bits="$define" ;;
3059 Perl can be built to take advantage of explicit 64-bit interfaces,
3060 on some systems. To do so, Configure must be run with -Duse64bits.
3062 If this doesn't make any sense to you, just accept the default.
3064 case "$use64bits" in
3065 $define|true|[yY]*) dflt='y';;
3068 rp='Try to use explicit 64-bit interfaces, if available?'
3081 case "$archname64" in
3082 '') archname64='' ;; # not a typo
3085 case "$use64bits" in
3086 "$define"|true|[yY]*)
3087 : Look for a hint-file generated 'call-back-unit'. If the
3088 : user has specified that a 64 bit perl is to be built,
3089 : we may need to set or change some other defaults.
3090 if $test -f use64bits.cbu; then
3091 echo "Your platform has some specific hints for 64-bit builds, using them..."
3095 (Your platform doesn't have any specific hints for 64-bit builds.
3096 This is probably okay, especially if your system is a true 64-bit system.)
3098 case "$gccversion" in
3101 But since you seem to be using gcc,
3102 I will now add -DUSE_LONG_LONG to the compilation flags.
3104 ccflags="$ccflags -DUSE_LONG_LONG"
3111 : determine the architecture name
3113 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
3114 tarch=`arch`"-$osname"
3115 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
3116 if uname -m > tmparch 2>&1 ; then
3117 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
3118 -e 's/$/'"-$osname/" tmparch`
3126 case "$myarchname" in
3129 echo "(Your architecture name used to be $myarchname.)"
3136 *) dflt="$archname";;
3138 rp='What is your architecture name'
3141 case "$usethreads" in
3143 echo "Threads selected." >&4
3145 *-thread*) echo "...and architecture name already has -thread." >&4
3147 *) archname="$archname-thread"
3148 echo "...setting architecture name to $archname." >&4
3153 case "$usemultiplicity" in
3155 echo "Multiplicity selected." >&4
3157 *-multi*) echo "...and architecture name already has -multi." >&4
3159 *) archname="$archname-multi"
3160 echo "...setting architecture name to $archname." >&4
3165 case "$use64bits" in
3167 echo "Explicit 64-bitness selected." >&4
3168 case "$archname64" in
3173 *-$archname64*) echo "...and architecture name already has $archname64." >&4
3175 *) archname="$archname-$archname64"
3176 echo "...setting architecture name to $archname." >&4
3183 : decide how portable to be. Allow command line overrides.
3184 case "$d_portable" in
3186 *) d_portable="$define" ;;
3189 : set up shell script to do ~ expansion
3195 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3198 if $test -f /bin/csh; then
3199 /bin/csh -f -c "glob \$1"
3204 name=\`$expr x\$1 : '..\([^/]*\)'\`
3205 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3206 if $test ! -d "\$dir"; then
3208 echo "\$me: can't locate home directory for: \$name" >&2
3213 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3229 : now set up to get a file name
3233 cat <<'EOSC' >>getfile
3249 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3250 fn=`echo $fn | sed 's/(.*)//'`
3256 loc_file=`expr $fn : '.*:\(.*\)'`
3257 fn=`expr $fn : '\(.*\):.*'`
3265 */*) fullpath=true;;
3274 *e*) exp_file=true;;
3277 *p*) nopath_ok=true;;
3282 *d*) type='Directory';;
3283 *l*) type='Locate';;
3288 Locate) what='File';;
3293 case "$d_portable" in
3301 while test "$type"; do
3306 true) rp="$rp (~name ok)";;
3309 if test -f UU/getfile.ok && \
3310 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3329 value=`UU/filexp $ans`
3332 if test "$ans" != "$value"; then
3333 echo "(That expands to $value on this system.)"
3347 /*) value="$ansexp" ;;
3352 echo "I shall only accept a full path name, as in /bin/ls." >&4
3353 echo "Use a ! shell escape if you wish to check pathnames." >&4
3356 echo "Please give a full path name, starting with slash." >&4
3359 echo "Note that using ~name is ok provided it expands well." >&4
3372 for fp in $gfpth; do
3373 if test "X$fp" = X.; then
3378 if test -f "$pf"; then
3380 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3382 echo "($value is not a plain file, but that's ok.)"
3385 if test X"$type" = X; then
3392 for fp in $gfpth; do
3393 if test "X$fp" = X.; then
3398 if test -d "$pf"; then
3406 if test -d "$ansexp"; then
3407 echo "(Looking for $loc_file in directory $value.)"
3408 value="$value/$loc_file"
3409 ansexp="$ansexp/$loc_file"
3411 if test -f "$ansexp"; then
3414 case "$nopath_ok" in
3415 true) case "$value" in
3417 *) echo "Assuming $value will be in people's path."
3433 if test "$fastread" = yes; then
3438 rp="$what $value doesn't exist. Use that name anyway?"
3457 test "X$gfpthkeep" != Xy && gfpth=""
3460 : determine root of directory hierarchy where package will be installed.
3463 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3471 By default, $package will be installed in $dflt/bin, manual pages
3472 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3473 installation directories. Typically this is something like /usr/local.
3474 If you wish to have binaries under /usr/bin but other parts of the
3475 installation under /usr/local, that's ok: you will be prompted
3476 separately for each of the installation directories, the prefix being
3477 only used to set the defaults.
3481 rp='Installation prefix to use?'
3489 *) oldprefix="$prefix";;
3499 $define|true) afs=true ;;
3500 $undef|false) afs=false ;;
3501 *) if test -d /afs; then
3509 echo "AFS may be running... I'll be extra cautious then..." >&4
3511 echo "AFS does not seem to be running..." >&4
3514 : determine installation prefix for where package is to be installed.
3518 Since you are running AFS, I need to distinguish the directory in which
3519 files will reside from the directory in which they are installed (and from
3520 which they are presumably copied to the former directory by occult means).
3523 case "$installprefix" in
3524 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3525 *) dflt="$installprefix";;
3530 In some special cases, particularly when building $package for distribution,
3531 it is convenient to distinguish between the directory in which files should
3532 be installed from the directory ($prefix) in which they
3533 will eventually reside. For most users, these two directories are the same.
3536 case "$installprefix" in
3538 *) dflt=$installprefix;;
3542 rp='What installation prefix should I use for installing files?'
3544 installprefix="$ans"
3545 installprefixexp="$ansexp"
3547 : set the prefixit variable, to compute a suitable default value
3548 prefixit='case "$3" in
3550 case "$oldprefix" in
3551 "") eval "$1=\"\$$2\"";;
3558 ""|" ") eval "$1=\"\$$2\"";;
3564 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
3566 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
3567 /*-$oldprefix/*|\~*-$oldprefix/*)
3568 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
3569 *) eval "$1=\"\$$2\"";;
3573 : set the base revision
3576 : get the patchlevel
3578 echo "Getting the current patchlevel..." >&4
3579 if $test -r $rsrc/patchlevel.h;then
3580 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
3581 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
3582 apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
3588 $echo $n "(You have $package" $c
3591 *) $echo $n " $baserev" $c ;;
3593 $echo $n " patchlevel $patchlevel" $c
3594 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
3597 if test 0 -eq "$subversion"; then
3598 version=`LC_ALL=C; export LC_ALL; \
3599 echo $baserev $patchlevel | \
3600 $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
3602 version=`LC_ALL=C; export LC_ALL; \
3603 echo $baserev $patchlevel $subversion | \
3604 $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
3607 : determine installation style
3608 : For now, try to deduce it from prefix unless it is already set.
3609 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
3610 case "$installstyle" in
3611 '') case "$prefix" in
3612 *perl*) dflt='lib';;
3613 *) dflt='lib/perl5' ;;
3616 *) dflt='lib/perl5' ;;
3618 : Probably not worth prompting for this since we prompt for all
3619 : the directories individually, and the prompt would be too long and
3623 : determine where private library files go
3624 : Usual default is /usr/local/lib/perl5/$version.
3625 : Also allow things like /opt/perl/lib/$version, since
3626 : /opt/perl/lib/perl5... would be redundant.
3627 : The default "style" setting is made in installstyle.U
3628 case "$installstyle" in
3629 *lib/perl5*) set dflt privlib lib/$package/$version ;;
3630 *) set dflt privlib lib/$version ;;
3635 There are some auxiliary files for $package that need to be put into a
3636 private library directory that is accessible by everyone.
3640 rp='Pathname where the private library files will reside?'
3643 privlibexp="$ansexp"
3644 : Change installation prefix, if necessary.
3645 if $test X"$prefix" != X"$installprefix"; then
3646 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
3648 installprivlib="$privlibexp"
3651 : set the prefixup variable, to restore leading tilda escape
3652 prefixup='case "$prefixexp" in
3654 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
3657 : determine where public architecture dependent libraries go
3660 : privlib default is /usr/local/lib/$package/$version
3661 : archlib default is /usr/local/lib/$package/$version/$archname
3662 : privlib may have an optional trailing /share.
3663 tdflt=`echo $privlib | $sed 's,/share$,,'`
3664 tdflt=$tdflt/$archname
3673 $spackage contains architecture-dependent library files. If you are
3674 sharing libraries in a heterogeneous environment, you might store
3675 these files in a separate location. Otherwise, you can just include
3676 them with the rest of the public library files.
3680 rp='Where do you want to put the public architecture-dependent libraries?'
3683 archlibexp="$ansexp"
3684 if $test X"$archlib" = X"$privlib"; then
3689 : Change installation prefix, if necessary.
3690 if $test X"$prefix" != X"$installprefix"; then
3691 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
3693 installarchlib="$archlibexp"
3697 : Binary compatibility with 5.005 is not possible for builds
3698 : with advanced features
3699 case "$usethreads$usemultiplicity" in
3701 bincompat5005="$undef"
3702 d_bincompat5005="$undef"
3706 Perl 5.006 can be compiled for binary compatibility with 5.005.
3707 If you decide to do so, you will be able to continue using most
3708 of the extensions that were compiled for Perl 5.005.
3711 case "$bincompat5005$d_bincompat5005" in
3712 *"$undef"*) dflt=n ;;
3715 rp='Binary compatibility with Perl 5.005?'
3718 y*) val="$define" ;;
3723 case "$d_bincompat5005" in
3725 bincompat5005="$define"
3727 *) bincompat5005="$undef"
3728 d_bincompat5005="$undef"
3735 : see if setuid scripts can be secure
3738 Some kernels have a bug that prevents setuid #! scripts from being
3739 secure. Some sites have disabled setuid #! scripts because of this.
3741 First let's decide if your kernel supports secure setuid #! scripts.
3742 (If setuid #! scripts would be secure but have been disabled anyway,
3743 don't say that they are secure if asked.)
3748 if $test -d /dev/fd; then
3749 echo "#!$ls" >reflect
3750 chmod +x,u+s reflect
3751 ./reflect >flect 2>&1
3752 if $contains "/dev/fd" flect >/dev/null; then
3753 echo "Congratulations, your kernel has secure setuid scripts!" >&4
3757 If you are not sure if they are secure, I can check but I'll need a
3758 username and password different from the one you are using right now.
3759 If you don't have such a username or don't want me to test, simply
3763 rp='Other username to test security of setuid scripts with?'
3768 case "$d_suidsafe" in
3769 '') echo "I'll assume setuid scripts are *not* secure." >&4
3772 echo "Well, the $hint value is *not* secure." >&4
3774 *) echo "Well, the $hint value *is* secure." >&4
3779 $rm -f reflect flect
3780 echo "#!$ls" >reflect
3781 chmod +x,u+s reflect
3784 echo '"su" will (probably) prompt you for '"$ans's password."
3785 su $ans -c './reflect >flect'
3786 if $contains "/dev/fd" flect >/dev/null; then
3787 echo "Okay, it looks like setuid scripts are secure." >&4
3790 echo "I don't think setuid scripts are secure." >&4
3795 rp='Does your kernel have *secure* setuid scripts?'
3798 [yY]*) val="$define";;
3803 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
3804 echo "(That's for file descriptors, not floppy disks.)"
3810 $rm -f reflect flect
3812 : now see if they want to do setuid emulation
3815 case "$d_suidsafe" in
3818 echo "No need to emulate SUID scripts since they are secure here." >& 4
3822 Some systems have disabled setuid scripts, especially systems where
3823 setuid scripts cannot be secure. On systems where setuid scripts have
3824 been disabled, the setuid/setgid bits on scripts are currently
3825 useless. It is possible for $package to detect those bits and emulate
3826 setuid/setgid in a secure fashion. This emulation will only work if
3827 setuid scripts have been disabled in your kernel.
3831 "$define") dflt=y ;;
3834 rp="Do you want to do setuid/setgid emulation?"
3837 [yY]*) val="$define";;
3845 : What should the include directory be ?
3847 $echo $n "Hmm... $c"
3851 if $test -f /bin/mips && /bin/mips; then
3852 echo "Looks like a MIPS system..."
3853 $cat >usr.c <<'EOCP'
3854 #ifdef SYSTYPE_BSD43
3858 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3859 dflt='/bsd43/usr/include'
3863 mips_type='System V'
3865 $rm -f usr.c usr.out
3866 echo "and you're compiling with the $mips_type compiler and libraries."
3870 echo "Doesn't look like a MIPS system."
3880 case "$xxx_prompt" in
3883 rp='Where are the include files you want to use?'
3891 : see how we invoke the C preprocessor
3893 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3894 cat <<'EOT' >testcpp.c
3900 if test ! -f cppstdin; then
3901 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3902 # AIX cc -E doesn't show the absolute headerfile
3903 # locations but we'll cheat by using the -M flag.
3904 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
3906 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3909 echo "Keeping your $hint cppstdin wrapper."
3912 wrapper=`pwd`/cppstdin
3916 if $test "X$cppstdin" != "X" && \
3917 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3918 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3920 echo "You used to use $cppstdin $cppminus so we'll use that again."
3922 '') echo "But let's see if we can live without a wrapper..." ;;
3924 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3925 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3927 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3930 echo "(However, $cpprun $cpplast does not work, let's see...)"
3938 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3945 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3946 $cc -E <testcpp.c >testcpp.out 2>&1; \
3947 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3948 echo "Yup, it does."
3951 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3952 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3953 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3954 echo "Yup, it does."
3957 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3958 $cc -P <testcpp.c >testcpp.out 2>&1; \
3959 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3960 echo "Yipee, that works!"
3963 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3964 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3965 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3966 echo "At long last!"
3969 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3970 $cpp <testcpp.c >testcpp.out 2>&1; \
3971 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3975 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3976 $cpp - <testcpp.c >testcpp.out 2>&1; \
3977 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3978 echo "Hooray, it works! I was beginning to wonder."
3981 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3982 $wrapper <testcpp.c >testcpp.out 2>&1; \
3983 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3989 rp="No dice. I can't find a C preprocessor. Name one:"
3993 $x_cpp <testcpp.c >testcpp.out 2>&1
3994 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3995 echo "OK, that will do." >&4
3997 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4012 echo "Perhaps can we force $cc -E using a wrapper..."
4013 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4014 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4020 echo "Nope, we'll have to live without it..."
4034 "$wrapper"|'cppstdin') ;;
4035 *) $rm -f $wrapper;;
4037 $rm -f testcpp.c testcpp.out
4039 : Set private lib path
4042 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4047 '') dlist="$loclibpth $plibpth $glibpth";;
4048 *) dlist="$libpth";;
4051 : Now check and see which directories actually exist, avoiding duplicates
4055 if $test -d $xxx; then
4058 *) libpth="$libpth $xxx";;
4064 Some systems have incompatible or broken versions of libraries. Among
4065 the directories listed in the question below, please remove any you
4066 know not to be holding relevant libraries, and add any that are needed.
4067 Say "none" for none.
4078 rp="Directories to use for library searches?"
4085 : compute shared library extension
4088 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4098 On some systems, shared libraries may be available. Answer 'none' if
4099 you want to suppress searching of shared libraries for the remaining
4100 of this configuration.
4103 rp='What is the file extension used for shared libraries?'
4107 : Define several unixisms.
4108 : Hints files or command line option can be used to override them.
4109 : The convoluted testing is in case hints files set either the old
4112 '') case "$exe_ext" in
4114 *) _exe="$exe_ext" ;;
4119 '') case "$lib_ext" in
4126 '') case "$obj_ext" in
4133 '') case "$path_sep" in
4144 : Which makefile gets called first. This is used by make depend.
4145 case "$firstmakefile" in
4146 '') firstmakefile='makefile';;
4151 Perl can be built to use the SOCKS proxy protocol library. To do so,
4152 Configure must be run with -Dusesocks.
4154 Normally you do not need this and you should answer no.
4158 $define|true|[yY]*) dflt='y';;
4161 rp='Build Perl for SOCKS?'
4164 y|Y) val="$define" ;;
4170 : Looking for optional libraries
4172 echo "Checking for optional libraries..." >&4
4177 case "$libswanted" in
4178 '') libswanted='c_s';;
4182 libswanted="$libswanted socks5 socks5_sh"
4185 for thislib in $libswanted; do
4187 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
4188 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4189 echo "Found -l$thislib (shared)."
4192 *) dflt="$dflt -l$thislib";;
4194 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4195 echo "Found -l$thislib (shared)."
4198 *) dflt="$dflt -l$thislib";;
4200 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
4201 echo "Found -l$thislib."
4204 *) dflt="$dflt -l$thislib";;
4206 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
4207 echo "Found -l$thislib."
4210 *) dflt="$dflt -l$thislib";;
4212 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
4213 echo "Found -l${thislib}_s."
4216 *) dflt="$dflt -l${thislib}_s";;
4218 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
4219 echo "Found -l$thislib."
4222 *) dflt="$dflt -l$thislib";;
4225 echo "No -l$thislib."
4236 ' '|'') dflt='none';;
4241 In order to compile $package on your machine, a number of libraries
4242 are usually needed. Include any other special libraries here as well.
4243 Say "none" for none. The default list is almost always right.
4247 rp="What libraries to use?"
4254 : determine optimization, if desired, or use for debug flag also
4256 ' '|$undef) dflt='none';;
4258 *) dflt="$optimize";;
4262 By default, $package compiles with the -O flag to use the optimizer.
4263 Alternately, you might want to use the symbolic debugger, which uses
4264 the -g flag (on traditional Unix systems). Either flag can be
4265 specified here. To use neither flag, specify the word "none".
4268 rp="What optimizer/debugger flag should be used?"
4272 'none') optimize=" ";;
4276 : We will not override a previous value, but we might want to
4277 : augment a hint file
4279 default|recommended)
4280 case "$gccversion" in
4281 1*) dflt='-fpcc-struct-return' ;;
4284 *-g*) dflt="$dflt -DDEBUGGING";;
4286 case "$gccversion" in
4287 2*) if test -d /etc/conf/kconfig.d &&
4288 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4294 case "$gccversion" in
4298 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4299 echo 'int main(void) { return 0; }' > gcctest.c
4300 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4301 echo "Yes, it does." 2>&1
4304 echo "Leaving current flags $ccflags alone." 2>&1
4306 *) dflt="$dflt -fno-strict-aliasing" ;;
4309 echo "Nope, it doesn't, but that's ok." 2>&1
4316 case "$mips_type" in
4317 *BSD*|'') inclwanted="$locincpth $usrinc";;
4318 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4320 for thisincl in $inclwanted; do
4321 if $test -d $thisincl; then
4322 if $test x$thisincl != x$usrinc; then
4325 *) dflt="$dflt -I$thisincl";;
4331 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4333 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4341 *) dflt="$dflt -D$2";;
4345 set signal.h LANGUAGE_C; eval $inctest
4349 ccflags="$ccflags -DSOCKS"
4354 default|recommended) dflt="$ccflags $dflt" ;;
4355 *) dflt="$ccflags";;
4363 Your C compiler may want other flags. For this question you should include
4364 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4365 but you should NOT include libraries or ld flags like -lwhatever. If you
4366 want $package to honor its debug switch, you should include -DDEBUGGING here.
4367 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4369 To use no flags, specify the word "none".
4375 rp="Any additional cc flags?"
4382 : the following weeds options from ccflags that are of no interest to cpp
4384 case "$gccversion" in
4385 1*) cppflags="$cppflags -D__GNUC__"
4387 case "$mips_type" in
4389 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4395 echo "Let me guess what the preprocessor flags are..." >&4
4409 *) ftry="$previous $flag";;
4411 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4412 >cpp1.out 2>/dev/null && \
4413 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4414 >cpp2.out 2>/dev/null && \
4415 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4416 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4418 cppflags="$cppflags $ftry"
4428 *-*) echo "They appear to be: $cppflags";;
4430 $rm -f cpp.c cpp?.out
4434 : flags used in final linking phase
4436 '') if ./venix; then
4442 *-posix*) dflt="$dflt -posix" ;;
4445 *) dflt="$ldflags";;
4448 : Try to guess additional flags to pick up local libraries.
4449 for thislibdir in $libpth; do
4450 case " $loclibpth " in
4453 *"-L$thislibdir "*) ;;
4454 *) dflt="$dflt -L$thislibdir" ;;
4466 Your C linker may need flags. For this question you should
4467 include -L/whatever and any other flags used by the C linker, but you
4468 should NOT include libraries like -lwhatever.
4470 Make sure you include the appropriate -L/path flags if your C linker
4471 does not normally search all of the directories you specified above,
4474 To use no flags, specify the word "none".
4478 rp="Any additional ld flags (NOT including libraries)?"
4484 rmlist="$rmlist pdp11"
4488 echo "Checking your choice of C compiler and flags for coherency..." >&4
4489 $cat > try.c <<'EOF'
4491 int main() { printf("Ok\n"); exit(0); }
4493 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4495 $cat >try.msg <<'EOM'
4496 I've tried to compile and run the following simple program:
4499 $cat try.c >> try.msg
4501 $cat >> try.msg <<EOM
4508 and I got the following output:
4512 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4513 if sh -c './try' >>try.msg 2>&1; then
4517 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4520 cat >> try.msg <<'EOQS'
4521 If $libs contains -lsfio, and sfio is mis-configured, then it
4522 sometimes (apparently) runs and exits with a 0 status, but with no
4523 output! It may have to do with sfio's use of _exit vs. exit.
4526 rp="You have a big problem. Shall I abort Configure"
4533 echo "The program compiled OK, but exited with status $?." >>try.msg
4534 rp="You have a problem. Shall I abort Configure"
4538 echo "I can't compile the test program." >>try.msg
4539 rp="You have a BIG problem. Shall I abort Configure"
4545 case "$knowitall" in
4547 echo "(The supplied flags or libraries might be incorrect.)"
4555 *) echo "Ok. Stopping Configure." >&4
4560 n) echo "OK, that should do.";;
4562 $rm -f try try.* core
4564 : determine filename position in cpp output
4566 echo "Computing filename position in cpp output for #include directives..." >&4
4567 echo '#include <stdio.h>' > foo.c
4570 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4571 $grep '^[ ]*#.*stdio\.h' | \
4572 while read cline; do
4575 while $test \$# -gt 0; do
4576 if $test -r \`echo \$1 | $tr -d '"'\`; then
4581 pos=\`expr \$pos + 1\`
4593 *) pos="${fieldn}th";;
4595 echo "Your cpp writes the filename in the $pos field of the line."
4597 : locate header file
4602 for usrincdir in $usrinc
4604 if test -f \$usrincdir/\$wanted; then
4605 echo "\$usrincdir/\$wanted"
4609 awkprg='{ print \$$fieldn }'
4610 echo "#include <\$wanted>" > foo\$\$.c
4611 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4612 $grep "^[ ]*#.*\$wanted" | \
4613 while read cline; do
4614 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4616 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4617 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4622 # status = 0: grep returned 0 lines, case statement not executed
4623 # status = 1: headerfile found
4624 # status = 2: while loop executed, no headerfile found
4628 if test \$status -eq 1; then
4635 : define an alternate in-header-list? function
4636 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4637 cont=true; xxf="echo \"<\$1> found.\" >&4";
4638 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4639 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4641 case $# in 4) instead=instead;; *) instead="at last";; esac;
4642 while $test "$cont"; do
4644 var=$2; eval "was=\$$2";
4645 if $test "$xxx" && $test -r "$xxx";
4647 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4650 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4651 set $yyy; shift; shift; yyy=$@;
4652 case $# in 0) cont="";;
4653 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4654 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4655 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4656 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4660 do set $yyy; var=$2; eval "was=\$$2";
4661 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4662 set $yyy; shift; shift; yyy=$@;
4665 : see if this is a malloc.h system
4666 set malloc.h i_malloc
4669 : see if stdlib is available
4670 set stdlib.h i_stdlib
4673 : determine which malloc to compile in
4675 case "$usemymalloc" in
4676 ''|[yY]*|true|$define) dflt='y' ;;
4679 rp="Do you wish to attempt to use the malloc that comes with $package?"
4685 mallocsrc='malloc.c'
4686 mallocobj="malloc$_o"
4687 d_mymalloc="$define"
4690 : Remove malloc from list of libraries to use
4691 echo "Removing unneeded -lmalloc from library list" >&4
4692 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
4695 echo "libs = $libs" >&4
4707 : compute the return types of malloc and free
4709 $cat >malloc.c <<END
4713 #include <sys/types.h>
4727 case "$malloctype" in
4729 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
4736 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
4740 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
4747 echo "Your system uses $freetype free(), it would seem." >&4
4751 The installation process will also create a directory for
4752 vendor-supplied add-ons. Vendors who supply perl with their system
4753 may find it convenient to place all vendor-supplied files in this
4754 directory rather than in the main distribution directory. This will
4755 ease upgrades between binary-compatible maintenance versions of perl.
4757 Of course you may also use these directories in whatever way you see
4758 fit. For example, you might use them to access modules shared over a
4759 company-wide network.
4761 The default answer should be fine for most people.
4762 This causes further questions about vendor add-ons to be skipped
4763 and no vendor-specific directories will be configured for perl.
4766 rp='Do you want to configure vendor-specific add-on directories?'
4767 case "$usevendorprefix" in
4768 define|true|[yY]*) dflt=y ;;
4774 rp='Installation prefix to use for vendor-supplied add-ons?'
4775 case "$vendorprefix" in
4777 *) dflt=$vendorprefix ;;
4781 case "$vendorprefix" in
4785 *) oldvendorprefix="$prefix";;
4789 usevendorprefix="$define"
4791 vendorprefixexp="$ansexp"
4793 *) usevendorprefix="$undef"
4799 case "$vendorprefix" in
4800 '') d_vendorlib="$undef"
4804 *) d_vendorlib="$define"
4805 : determine where vendor-supplied modules go.
4806 : Usual default is /usr/local/lib/perl5/vendor_perl
4807 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
4808 case "$installstyle" in
4809 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
4810 *) dflt=$vendorprefix/lib/vendor_$prog ;;
4813 rp='Pathname for the vendor-supplied library files?'
4816 vendorlibexp="$ansexp"
4817 : Change installation prefix, if necessary.
4818 if $test X"$prefix" != X"$installprefix"; then
4819 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
4821 installvendorlib="$vendorlibexp"
4826 : Cruising for prototypes
4828 echo "Checking out function prototypes..." >&4
4829 $cat >prototype.c <<'EOCP'
4830 int main(int argc, char *argv[]) {
4833 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
4834 echo "Your C compiler appears to support function prototypes."
4837 echo "Your C compiler doesn't seem to understand function prototypes."
4844 case "$prototype" in
4846 *) ansi2knr='ansi2knr'
4851 This version of $package can only be compiled by a compiler that
4852 understands function prototypes. Unfortunately, your C compiler
4854 doesn't seem to understand them. Sorry about that.
4856 If GNU cc is available for your system, perhaps you could try that instead.
4858 Eventually, we hope to support building Perl with pre-ANSI compilers.
4859 If you would like to help in that effort, please contact <perlbug@perl.org>.
4861 Aborting Configure now.
4867 : determine where public executables go
4872 rp='Pathname where the public executables will reside?'
4874 if $test "X$ansexp" != "X$binexp"; then
4879 : Change installation prefix, if necessary.
4880 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
4881 if $test X"$prefix" != X"$installprefix"; then
4882 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
4884 installbin="$binexp"
4887 : determine whether to install perl also as /usr/bin/perl
4890 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
4892 Many scripts expect to perl to be installed as /usr/bin/perl.
4893 I can install the perl you are about to compile also as /usr/bin/perl
4894 (in addition to $installbin/perl).
4896 case "$installusrbinperl" in
4897 "$undef"|[nN]*) dflt='n';;
4900 rp="Do you want to install perl as /usr/bin/perl?"
4903 [yY]*) val="$define";;
4909 set installusrbinperl
4912 : define a shorthand compile call
4916 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4917 : define a shorthand compile call for compilations that should be ok.
4921 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4924 echo "Checking for GNU C Library..." >&4
4925 cat >gnulibc.c <<EOM
4937 if eval $compile_ok && ./gnulibc; then
4939 echo "You are using the GNU C Library"
4942 echo "You are not using the GNU C Library"
4948 : see if nm is to be used to determine whether a symbol is defined or not
4952 case "$d_gnulibc" in
4955 echo "nm probably won't work on the GNU C Library." >&4
4961 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4963 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4964 echo "'nm' won't be sufficient on this sytem." >&4
4970 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4971 if $test $dflt -gt 20; then
4981 true|$define) dflt=y;;
4988 I can use $nm to extract the symbols from your C libraries. This
4989 is a time consuming task which may generate huge output on the disk (up
4990 to 3 megabytes) but that should make the symbols extraction faster. The
4991 alternative is to skip the 'nm' extraction part and to compile a small
4992 test program instead to determine whether each symbol is present. If
4993 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4994 this may be the best solution.
4996 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4999 rp="Shall I use $nm to extract C symbols from the libraries?"
5002 [Nn]*) usenm=false;;
5011 : nm options which may be necessary
5013 '') if $test -f /mach_boot; then
5015 elif $test -d /usr/ccs/lib; then
5016 nm_opt='-p' # Solaris (and SunOS?)
5017 elif $test -f /dgux; then
5019 elif $test -f /lib64/rld; then
5020 nm_opt='-p' # 64-bit Irix
5026 : nm options which may be necessary for shared libraries but illegal
5027 : for archive libraries. Thank you, Linux.
5028 case "$nm_so_opt" in
5029 '') case "$myuname" in
5031 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5032 nm_so_opt='--dynamic'
5041 : get list of predefined functions in a handy place
5046 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5053 *) for thislib in $libs; do
5056 : Handle C library specially below.
5059 thislib=`echo $thislib | $sed -e 's/^-l//'`
5060 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5062 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5064 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5066 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5068 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5070 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5072 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5077 libnames="$libnames $try"
5079 *) libnames="$libnames $thislib" ;;
5088 for xxx in $libpth; do
5089 $test -r $1 || set $xxx/libc.$so
5090 : The messy sed command sorts on library version numbers.
5092 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5093 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5095 s/[0-9][0-9]*/0000&/g
5096 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5099 sort | $sed -e 's/^.* //'`
5102 $test -r $1 || set /usr/ccs/lib/libc.$so
5103 $test -r $1 || set /lib/libsys_s$_a
5109 if $test -r "$1"; then
5110 echo "Your (shared) C library seems to be in $1."
5112 elif $test -r /lib/libc && $test -r /lib/clib; then
5113 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5115 libc='/lib/clib /lib/libc'
5116 if $test -r /lib/syslib; then
5117 echo "(Your math library is in /lib/syslib.)"
5118 libc="$libc /lib/syslib"
5120 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5121 echo "Your C library seems to be in $libc, as you said before."
5122 elif $test -r $incpath/usr/lib/libc$_a; then
5123 libc=$incpath/usr/lib/libc$_a;
5124 echo "Your C library seems to be in $libc. That's fine."
5125 elif $test -r /lib/libc$_a; then
5127 echo "Your C library seems to be in $libc. You're normal."
5129 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5131 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5132 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5133 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5135 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5137 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5140 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5142 if $test -r "$tans"; then
5143 echo "Your C library seems to be in $tans, of all places."
5149 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5153 If the guess above is wrong (which it might be if you're using a strange
5154 compiler, or your machine supports multiple models), you can override it here.
5159 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5161 I can't seem to find your C library. I've looked in the following places:
5164 $sed 's/^/ /' libpath
5167 None of these seems to contain your C library. I need to get its name...
5172 rp='Where is your C library?'
5177 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5178 set X `cat libnames`
5181 case $# in 1) xxx=file; esac
5182 echo "Extracting names from the following $xxx for later perusal:" >&4
5184 $sed 's/^/ /' libnames >&4
5186 $echo $n "This may take a while...$c" >&4
5190 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5191 *) $nm $nm_opt $file 2>/dev/null;;
5196 $grep fprintf libc.tmp > libc.ptf
5197 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5198 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5200 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5202 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5204 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5206 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5208 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5210 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5212 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5214 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5216 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5218 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5220 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5222 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5224 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5225 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5227 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5229 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5231 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5233 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5235 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5237 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5239 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5241 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5243 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5245 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5247 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5249 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5251 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5253 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5255 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5258 $nm -p $* 2>/dev/null >libc.tmp
5259 $grep fprintf libc.tmp > libc.ptf
5260 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5261 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5267 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5269 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5270 for thisname in $libnames $libc; do
5271 $ar t $thisname >>libc.tmp
5273 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5275 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5276 # Repeat libc to extract forwarders to DLL entries too
5277 for thisname in $libnames $libc; do
5278 $ar tv $thisname >>libc.tmp
5279 # Revision 50 of EMX has bug in $ar.
5280 # it will not extract forwarders to DLL entries
5281 # Use emximp which will extract exactly them.
5282 emximp -o tmp.imp $thisname \
5284 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5285 < tmp.imp >>libc.tmp
5288 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5291 echo "$ar didn't seem to work right." >&4
5292 echo "Maybe this is a Cray...trying bld instead..." >&4
5293 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5295 for thisname in $libnames; do
5297 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5298 $ar t $thisname >>libc.tmp
5302 echo "That didn't work either. Giving up." >&4
5309 if $test -f /lib/syscalls.exp; then
5311 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5312 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5316 $rm -f libnames libpath
5318 : see if dld is available
5322 : is a C symbol defined?
5325 -v) tf=libc.tmp; tc=""; tdc="";;
5326 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5327 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5330 case "$reuseval-$4" in
5332 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5338 if $contains $tlook $tf >/dev/null 2>&1;
5343 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5344 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5352 $define) tval=true;;
5358 : define an is-in-libc? function
5359 inlibc='echo " "; td=$define; tu=$undef;
5360 sym=$1; var=$2; eval "was=\$$2";
5362 case "$reuseval$was" in
5372 echo "$sym() found." >&4;
5373 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5375 echo "$sym() NOT found." >&4;
5376 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5380 $define) echo "$sym() found." >&4;;
5381 *) echo "$sym() NOT found." >&4;;
5385 : see if dlopen exists
5392 : determine which dynamic loading, if any, to compile in
5394 dldir="ext/DynaLoader"
5407 $define) dflt='y' ;;
5410 $define) dflt='y' ;;
5412 : Does a dl_xxx.xs file exist for this operating system
5413 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5416 rp="Do you wish to use dynamic loading?"
5423 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5424 dflt="$dldir/dl_${osname}.xs"
5425 elif $test "$d_dlopen" = "$define" ; then
5426 dflt="$dldir/dl_dlopen.xs"
5427 elif $test "$i_dld" = "$define" ; then
5428 dflt="$dldir/dl_dld.xs"
5433 *) dflt="$dldir/$dlsrc"
5436 echo "The following dynamic loading files are available:"
5437 : Can not go over to $dldir because getfile has path hard-coded in.
5438 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5439 rp="Source file to use for dynamic loading"
5445 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5449 Some systems may require passing special flags to $cc -c to
5450 compile modules that will be used to create a shared library.
5451 To use no flags, say "none".
5454 case "$cccdlflags" in
5455 '') case "$gccversion" in
5456 '') case "$osname" in
5458 next) dflt='none' ;;
5459 irix*) dflt='-KPIC' ;;
5460 svr4*|esix*|solaris) dflt='-KPIC' ;;
5461 sunos) dflt='-pic' ;;
5465 *) case "$osname" in
5466 svr4*|esix*|solaris) dflt='-fPIC' ;;
5471 *) dflt="$cccdlflags" ;;
5473 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5476 none) cccdlflags=' ' ;;
5477 *) cccdlflags="$ans" ;;
5482 Some systems use ld to create libraries that can be dynamically loaded,
5483 while other systems (such as those using ELF) use $cc.
5487 '') $cat >try.c <<'EOM'
5488 /* Test for whether ELF binaries are produced */
5493 int i = open("a.out",O_RDONLY);
5496 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5497 exit(0); /* succeed (yes, it's ELF) */
5502 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5504 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5508 echo "I'll use ld to build dynamic libraries."
5517 rp="What command should be used to create dynamic libraries?"
5523 Some systems may require passing special flags to $ld to create a
5524 library that can be dynamically loaded. If your ld flags include
5525 -L/other/path options to locate libraries outside your loader's normal
5526 search path, you may need to specify those -L options here as well. To
5527 use no flags, say "none".
5530 case "$lddlflags" in
5531 '') case "$osname" in
5532 beos) dflt='-nostart' ;;
5534 linux|irix*) dflt='-shared' ;;
5535 next) dflt='none' ;;
5536 solaris) dflt='-G' ;;
5537 sunos) dflt='-assert nodefinitions' ;;
5538 svr4*|esix*) dflt="-G $ldflags" ;;
5542 *) dflt="$lddlflags" ;;
5545 : Try to guess additional flags to pick up local libraries.
5546 : Be careful not to append to a plain 'none'
5550 for thisflag in $ldflags; do
5555 *) dflt="$dflt $thisflag" ;;
5562 ''|' ') dflt='none' ;;
5565 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
5568 none) lddlflags=' ' ;;
5569 *) lddlflags="$ans" ;;
5574 Some systems may require passing special flags to $cc to indicate that
5575 the resulting executable will use dynamic linking. To use no flags,
5579 case "$ccdlflags" in
5580 '') case "$osname" in
5581 hpux) dflt='-Wl,-E' ;;
5582 linux) dflt='-rdynamic' ;;
5583 next) dflt='none' ;;
5584 sunos) dflt='none' ;;
5588 *) dflt="$ccdlflags" ;;
5590 rp="Any special flags to pass to $cc to use dynamic loading?"
5593 none) ccdlflags=' ' ;;
5594 *) ccdlflags="$ans" ;;
5608 # No dynamic loading being used, so don't bother even to prompt.
5611 *) case "$useshrplib" in
5612 '') case "$osname" in
5613 svr4*|dgux|dynixptx|esix|powerux|beos)
5615 also='Building a shared libperl is required for dynamic loading to work on your system.'
5620 also='Building a shared libperl is needed for MAB support.'
5638 The perl executable is normally obtained by linking perlmain.c with
5639 libperl${_a}, any static extensions (usually just DynaLoader), and
5640 any other libraries needed on this system (such as -lm, etc.). Since
5641 your system supports dynamic loading, it is probably possible to build
5642 a shared libperl.$so. If you will have more than one executable linked
5643 to libperl.$so, this will significantly reduce the size of each
5644 executable, but it may have a noticeable affect on performance. The
5645 default is probably sensible for your system.
5649 rp="Build a shared libperl.$so (y/n)"
5653 useshrplib='true' ;;
5654 *) useshrplib='false' ;;
5659 case "$useshrplib" in
5663 # Figure out a good name for libperl.so. Since it gets stored in
5664 # a version-specific architecture-dependent library, the version
5665 # number isn't really that important, except for making cc/ld happy.
5667 # A name such as libperl.so.3.1
5668 majmin="libperl.$so.$patchlevel.$subversion"
5669 # A name such as libperl.so.301
5670 majonly=`echo $patchlevel $subversion |
5671 $awk '{printf "%d%02d", $1, $2}'`
5672 majonly=libperl.$so.$majonly
5673 # I'd prefer to keep the os-specific stuff here to a minimum, and
5674 # rely on figuring it out from the naming of libc.
5675 case "${osname}${osvers}" in
5678 # XXX How handle the --version stuff for MAB?
5680 linux*) # ld won't link with a bare -lperl otherwise.
5683 *) # Try to guess based on whether libc has major.minor.
5685 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
5686 *libc.$so.[0-9]*) dflt=$majonly ;;
5687 *) dflt=libperl.$so ;;
5697 I need to select a good name for the shared libperl. If your system uses
5698 library names with major and minor numbers, then you might want something
5699 like $majmin. Alternatively, if your system uses a single version
5700 number for shared libraries, then you might want to use $majonly.
5701 Or, your system might be quite happy with a simple libperl.$so.
5703 Since the shared libperl will get installed into a version-specific
5704 architecture-dependent directory, the version number of the shared perl
5705 library probably isn't important, so the default should be o.k.
5708 rp='What name do you want to give to the shared libperl?'
5711 echo "Ok, I'll use $libperl"
5714 libperl="libperl${_a}"
5718 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
5722 WARNING: Use of the shrpdir variable for the installation location of
5723 the shared $libperl is not supported. It was never documented and
5724 will not work in this version. Let me (perlbug@perl.com)
5725 know of any problems this may cause.
5731 But your current setting of $shrpdir is
5732 the default anyway, so it's harmless.
5737 Further, your current attempted setting of $shrpdir
5738 conflicts with the value of $archlibexp/CORE
5739 that installperl will use.
5746 # How will the perl executable find the installed shared $libperl?
5747 # Add $xxx to ccdlflags.
5748 # If we can't figure out a command-line option, use $shrpenv to
5749 # set env LD_RUN_PATH. The main perl makefile uses this.
5750 shrpdir=$archlibexp/CORE
5753 if "$useshrplib"; then
5756 # We'll set it in Makefile.SH...
5762 xxx="-Wl,-R$shrpdir"
5764 linux|irix*|dec_osf)
5765 xxx="-Wl,-rpath,$shrpdir"
5768 # next doesn't like the default...
5771 # beos doesn't like the default, either.
5774 # hpux doesn't like the default, either.
5775 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
5778 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
5784 # Only add $xxx if it isn't already in ccdlflags.
5785 case " $ccdlflags " in
5787 *) ccdlflags="$ccdlflags $xxx"
5790 Adding $xxx to the flags
5791 passed to $ld so that the perl executable will find the
5792 installed shared $libperl.
5800 # Fix ccdlflags in AIX for building external extensions.
5801 # (For building Perl itself bare -bE:perl.exp is needed,
5802 # Makefile.SH takes care of this.)
5804 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
5806 # Respect a hint or command-line value.
5808 '') shrpenv="$tmp_shrpenv" ;;
5810 case "$ldlibpthname" in
5811 '') ldlibpthname=LD_LIBRARY_PATH ;;
5812 none) ldlibpthname='' ;;
5815 : determine where manual pages go
5816 set man1dir man1dir none
5820 $spackage has manual pages available in source form.
5824 echo "However, you don't have nroff, so they're probably useless to you."
5826 '') man1dir="none";;
5829 echo "If you don't want the manual sources installed, answer 'none'."
5834 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
5835 lookpath="$lookpath $prefixexp/man/p_man/man1"
5836 lookpath="$lookpath $prefixexp/man/u_man/man1"
5837 lookpath="$lookpath $prefixexp/man/man.1"
5839 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
5840 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
5850 rp="Where do the main $spackage manual pages (source) go?"
5852 if $test "X$man1direxp" != "X$ansexp"; then
5856 man1direxp="$ansexp"
5862 : Change installation prefix, if necessary.
5863 if $test X"$prefix" != X"$installprefix"; then
5864 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
5866 installman1dir="$man1direxp"
5869 : What suffix to use on installed man pages
5876 rp="What suffix should be used for the main $spackage man pages?"
5878 '') case "$man1dir" in
5892 *) dflt="$man1ext";;
5899 : see if we can have long filenames
5901 rmlist="$rmlist /tmp/cf$$"
5902 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
5903 first=123456789abcdef
5904 second=/tmp/cf$$/$first
5905 $rm -f $first $second
5906 if (echo hi >$first) 2>/dev/null; then
5907 if $test -f 123456789abcde; then
5908 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
5911 if (echo hi >$second) 2>/dev/null; then
5912 if $test -f /tmp/cf$$/123456789abcde; then
5914 That's peculiar... You can have filenames longer than 14 characters, but only
5915 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
5916 I shall consider your system cannot support long filenames at all.
5920 echo 'You can have filenames longer than 14 characters.' >&4
5925 How confusing! Some of your filesystems are sane enough to allow filenames
5926 longer than 14 characters but some others like /tmp can't even think about them.
5927 So, for now on, I shall assume your kernel does not allow them at all.
5934 You can't have filenames longer than 14 chars. You can't even think about them!
5940 $rm -rf /tmp/cf$$ 123456789abcde*
5942 : determine where library module manual pages go
5943 set man3dir man3dir none
5947 $spackage has manual pages for many of the library modules.
5953 However, you don't have nroff, so they're probably useless to you.
5956 '') man3dir="none";;
5960 case "$d_flexfnam" in
5963 However, your system can't handle the long file names like File::Basename.3.
5966 '') man3dir="none";;
5970 echo "If you don't want the manual sources installed, answer 'none'."
5971 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5973 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
5974 if $test -d "$privlib/man/man3"; then
5977 WARNING: Previous versions of perl installed man3 pages into
5978 $privlib/man/man3. This version will suggest a
5979 new default of $dflt.
5983 rp='Do you wish to preserve the old behavior?(y/n)'
5986 y*) dflt="$privlib/man/man3" ;;
5992 *) dflt="$man3dir" ;;
5996 rp="Where do the $package library man pages (source) go?"
5999 man3direxp="$ansexp"
6005 : Change installation prefix, if necessary.
6006 if $test X"$prefix" != X"$installprefix"; then
6007 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6009 installman3dir="$man3direxp"
6012 : What suffix to use on installed man pages
6018 rp="What suffix should be used for the $package library man pages?"
6020 '') case "$man3dir" in
6034 *) dflt="$man3ext";;
6041 : see if we have to deal with yellow pages, now NIS.
6042 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6043 if $test -f /usr/etc/nibindd; then
6045 echo "I'm fairly confident you're on a NeXT."
6047 rp='Do you get the hosts file via NetInfo?'
6056 y*) hostcat='nidump hosts .';;
6057 *) case "$hostcat" in
6058 nidump*) hostcat='';;
6068 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6076 rp='Are you getting the hosts file via yellow pages?'
6079 y*) hostcat='ypcat hosts';;
6080 *) hostcat='cat /etc/hosts';;
6086 '') hostcat='cat /etc/hosts';;
6089 '') groupcat='cat /etc/group';;
6092 '') passcat='cat /etc/passwd';;
6095 : now get the host name
6097 echo "Figuring out host name..." >&4
6098 case "$myhostname" in
6100 echo 'Maybe "hostname" will work...'
6101 if tans=`sh -c hostname 2>&1` ; then
6109 if $test "$cont"; then
6111 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6112 if tans=`cat /etc/systemid 2>&1` ; then
6114 phostname='cat /etc/systemid'
6115 echo "Whadyaknow. Xenix always was a bit strange..."
6118 elif $test -r /etc/systemid; then
6119 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6122 if $test "$cont"; then
6123 echo 'No, maybe "uuname -l" will work...'
6124 if tans=`sh -c 'uuname -l' 2>&1` ; then
6126 phostname='uuname -l'
6128 echo 'Strange. Maybe "uname -n" will work...'
6129 if tans=`sh -c 'uname -n' 2>&1` ; then
6131 phostname='uname -n'
6133 echo 'Oh well, maybe I can mine it out of whoami.h...'
6134 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6135 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6136 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6138 case "$myhostname" in
6139 '') echo "Does this machine have an identity crisis or something?"
6142 echo "Well, you said $myhostname before..."
6143 phostname='echo $myhostname';;
6149 : you do not want to know about this
6154 if $test "$myhostname" ; then
6156 rp='Your host name appears to be "'$myhostname'".'" Right?"
6164 : bad guess or no guess
6165 while $test "X$myhostname" = X ; do
6167 rp="Please type the (one word) name of your host:"
6172 : translate upper to lower if necessary
6173 case "$myhostname" in
6175 echo "(Normalizing case in your host name)"
6176 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6180 case "$myhostname" in
6182 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6183 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6184 echo "(Trimming domain name from host name--host name is now $myhostname)"
6186 *) case "$mydomain" in
6189 test "X$hostcat" = "Xypcat hosts" &&
6190 ypmatch "$myhostname" hosts 2>/dev/null |\
6191 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6194 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6195 /[ ]$myhostname[ . ]/p" > hosts
6198 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6199 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6200 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6201 hosts | $sort | $uniq | \
6202 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6203 case `$echo X$dflt` in
6204 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6207 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6212 tans=`./loc resolv.conf X /etc /usr/etc`
6213 if $test -f "$tans"; then
6214 echo "(Attempting domain name extraction from $tans)"
6215 dflt=.`$sed -n -e 's/ / /g' \
6216 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6217 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6219 .) dflt=.`$sed -n -e 's/ / /g' \
6220 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6221 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6228 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6229 dflt=.`sh -c domainname 2>/dev/null`
6232 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6237 .) echo "(Lost all hope -- silly guess then)"
6243 *) dflt="$mydomain";;
6247 rp="What is your domain name?"
6257 : translate upper to lower if necessary
6260 echo "(Normalizing case in your domain name)"
6261 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6265 : a little sanity check here
6266 case "$phostname" in
6269 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6270 $myhostname$mydomain|$myhostname) ;;
6272 case "$phostname" in
6274 echo "(That doesn't agree with your whoami.h file, by the way.)"
6277 echo "(That doesn't agree with your $phostname command, by the way.)"
6287 I need to get your e-mail address in Internet format if possible, i.e.
6288 something like user@host.domain. Please answer accurately since I have
6289 no easy means to double check it. The default value provided below
6290 is most probably close to the reality but may not be valid from outside
6291 your organization...
6295 while test "$cont"; do
6297 '') dflt="$cf_by@$myhostname$mydomain";;
6298 *) dflt="$cf_email";;
6300 rp='What is your e-mail address?'
6306 rp='Address does not look like an Internet one. Use it anyway?'
6322 If you or somebody else will be maintaining perl at your site, please
6323 fill in the correct e-mail address here so that they may be contacted
6324 if necessary. Currently, the "perlbug" program included with perl
6325 will send mail to this address in addition to perlbug@perl.com. You may
6326 enter "none" for no administrator.
6329 case "$perladmin" in
6330 '') dflt="$cf_email";;
6331 *) dflt="$perladmin";;
6333 rp='Perl administrator e-mail address'
6337 : figure out how to guarantee perl startup
6338 case "$startperl" in
6340 case "$sharpbang" in
6344 I can use the #! construct to start perl on your system. This will
6345 make startup of perl scripts faster, but may cause problems if you
6346 want to share those scripts and perl is not in a standard place
6347 ($binexp/perl) on all your platforms. The alternative is to force
6348 a shell by starting the script with a single ':' character.
6352 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6355 none) startperl=": # use perl";;
6356 *) startperl="#!$ans"
6357 if $test 30 -lt `echo "$ans" | wc -c`; then
6360 WARNING: Some systems limit the #! command to 32 characters.
6361 If you experience difficulty running Perl scripts with #!, try
6362 installing Perl in a directory with a shorter pathname.
6368 *) startperl=": # use perl"
6373 echo "I'll use $startperl to start perl scripts."
6375 : figure best path for perl in scripts
6378 perlpath="$binexp/perl"
6379 case "$startperl" in
6384 I will use the "eval 'exec'" idiom to start Perl on your system.
6385 I can use the full path of your Perl binary for this purpose, but
6386 doing so may cause problems if you want to share those scripts and
6387 Perl is not always in a standard place ($binexp/perl).
6391 rp="What path shall I use in \"eval 'exec'\"?"
6398 case "$startperl" in
6400 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6403 : determine where public executable scripts go
6404 set scriptdir scriptdir
6406 case "$scriptdir" in
6409 : guess some guesses
6410 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6411 $test -d /usr/share/bin && dflt=/usr/share/bin
6412 $test -d /usr/local/script && dflt=/usr/local/script
6413 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6414 $test -d $prefixexp/script && dflt=$prefixexp/script
6418 *) dflt="$scriptdir"
6423 Some installations have a separate directory just for executable scripts so
6424 that they can mount it across multiple architectures but keep the scripts in
6425 one spot. You might, for example, have a subdirectory of /usr/share for this.
6426 Or you might just lump your scripts in with all your other executables.
6430 rp='Where do you keep publicly executable scripts?'
6432 if $test "X$ansexp" != "X$scriptdirexp"; then
6436 scriptdirexp="$ansexp"
6437 : Change installation prefix, if necessary.
6438 if $test X"$prefix" != X"$installprefix"; then
6439 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6441 installscript="$scriptdirexp"
6446 After $package is installed, you may wish to install various
6447 add-on modules and utilities. Typically, these add-ons will
6448 be installed under $prefix with the rest
6449 of this package. However, you may wish to install such add-ons
6450 elsewhere under a different prefix.
6452 If you do not wish to put everything under a single prefix, that's
6453 ok. You will be prompted for the individual locations; this siteprefix
6454 is only used to suggest the defaults.
6456 The default should be fine for most people.
6460 rp='Installation prefix to use for add-on modules and utilities?'
6461 : XXX Here might be another good place for an installstyle setting.
6462 case "$siteprefix" in
6464 *) dflt=$siteprefix ;;
6468 case "$siteprefix" in
6473 *) oldsiteprefix="$prefix";;
6478 siteprefixexp="$ansexp"
6480 : determine where site specific libraries go.
6481 : Usual default is /usr/local/lib/perl5/site_perl
6482 : The default "style" setting is made in installstyle.U
6483 : XXX No longer works with Prefixit stuff.
6484 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6485 case "$installstyle" in
6486 *lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
6487 *) dflt=$siteprefix/lib/site_$prog ;;
6491 The installation process will create a directory for
6492 site-specific extensions and modules. Most users find it convenient
6493 to place all site-specific files in this directory rather than in the
6494 main distribution directory.
6498 rp='Pathname for the site-specific library files?'
6501 sitelibexp="$ansexp"
6502 : Change installation prefix, if necessary.
6503 if $test X"$prefix" != X"$installprefix"; then
6504 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
6506 installsitelib="$sitelibexp"
6509 : determine where site specific architecture-dependent libraries go.
6510 : sitelib default is /usr/local/lib/perl5/site_perl/
6511 : sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
6512 : sitelib may have an optional trailing /share.
6513 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6514 tdflt="$tdflt/$apiversion/$archname"
6515 set sitearch sitearch none
6518 '') dflt="$tdflt" ;;
6519 *) dflt="$sitearch" ;;
6523 The installation process will also create a directory for
6524 architecture-dependent site-specific extensions and modules.
6528 rp='Pathname for the site-specific architecture-dependent library files?'
6531 sitearchexp="$ansexp"
6532 : Change installation prefix, if necessary.
6533 if $test X"$prefix" != X"$installprefix"; then
6534 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6536 installsitearch="$sitearchexp"
6539 : determine where add-on public executables go
6541 '') dflt=$siteprefix/bin ;;
6545 rp='Pathname where the add-on public executables should be installed?'
6548 sitebinexp="$ansexp"
6549 : Change installation prefix, if necessary.
6550 if $test X"$prefix" != X"$installprefix"; then
6551 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6553 installsitebin="$sitebinexp"
6558 Perl can be built to take advantage of long doubles which
6559 (if available) may give more accuracy and range for floating point
6560 numbers. To do so, Configure must be run with -Duselongdouble.
6562 If this doesn't make any sense to you, just accept the default 'n'.
6564 case "$uselongdouble" in
6565 $define|true|[yY]*) dflt='y';;
6568 rp='Try to use long doubles if available?'
6571 y|Y) val="$define" ;;
6577 case "$uselongdouble" in
6578 "$define"|true|[yY]*)
6579 : Look for a hint-file generated 'call-back-unit'. If the
6580 : user has specified that long doubles should be used,
6581 : we may need to set or change some other defaults.
6582 if $test -f uselongdouble.cbu; then
6583 echo "Your platform has some specific hints for long doubles, using them..."
6584 . ./uselongdouble.cbu
6587 (Your platform doesn't have any specific hints for long doubles.)
6595 Previous version of $package used the standard IO mechanisms as defined
6596 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
6597 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
6598 the default. This abstraction layer can use AT&T's sfio (if you already
6599 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
6600 problems with some extension modules. Using PerlIO with stdio is safe,
6601 but it is slower than plain stdio and therefore is not the default.
6603 If this doesn't make any sense to you, just accept the default 'n'.
6605 case "$useperlio" in
6606 $define|true|[yY]*) dflt='y';;
6609 rp='Use the experimental PerlIO abstraction layer?'
6616 echo "Ok, doing things the stdio way"
6623 case "$vendorprefix" in
6624 '') d_vendorbin="$undef"
6628 *) d_vendorbin="$define"
6629 : determine where vendor-supplied executables go.
6630 dflt=$vendorprefix/bin
6632 rp='Pathname for the vendor-supplied executables directory?'
6635 vendorbinexp="$ansexp"
6636 : Change installation prefix, if necessary.
6637 if $test X"$prefix" != X"$installprefix"; then
6638 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
6640 installvendorbin="$vendorbinexp"
6645 : Check how to convert floats to strings.
6646 if test "X$d_Gconvert" = X; then
6648 echo "Checking for an efficient way to convert floats to strings."
6651 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
6652 char *myname = "gconvert";
6655 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
6656 char *myname = "gcvt";
6659 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
6660 char *myname = "sprintf";
6666 checkit(expect, got)
6670 if (strcmp(expect, got)) {
6671 printf("%s oddity: Expected %s, got %s\n",
6672 myname, expect, got);
6682 /* This must be 1st test on (which?) platform */
6683 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
6684 Gconvert(0.1, 8, 0, buf);
6685 checkit("0.1", buf);
6687 Gconvert(1.0, 8, 0, buf);
6690 Gconvert(0.0, 8, 0, buf);
6693 Gconvert(-1.0, 8, 0, buf);
6696 /* Some Linux gcvt's give 1.e+5 here. */
6697 Gconvert(100000.0, 8, 0, buf);
6698 checkit("100000", buf);
6700 /* Some Linux gcvt's give -1.e+5 here. */
6701 Gconvert(-100000.0, 8, 0, buf);
6702 checkit("-100000", buf);
6707 case "$d_Gconvert" in
6708 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
6709 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
6710 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
6711 *) xxx_list='gconvert gcvt sprintf' ;;
6714 for xxx_convert in $xxx_list; do
6715 echo "Trying $xxx_convert"
6717 set try -DTRY_$xxx_convert
6718 if eval $compile; then
6719 echo "$xxx_convert" found. >&4
6721 echo "I'll use $xxx_convert to convert floats into a string." >&4
6724 echo "...But $xxx_convert didn't work as I expected."
6727 echo "$xxx_convert NOT found." >&4
6731 case "$xxx_convert" in
6732 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
6733 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
6734 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
6738 : see if inttypes.h is available
6739 : we want a real compile instead of Inhdr because some systems
6740 : have an inttypes.h which includes non-existent headers
6743 #include <inttypes.h>
6745 static int32_t foo32 = 0x12345678;
6749 if eval $compile; then
6750 echo "<inttypes.h> found." >&4
6753 echo "<inttypes.h> NOT found." >&4
6761 case "$use64bits" in
6764 $echo $n "Checking to see if your system supports int64_t...$c" >&4
6766 #include <sys/types.h>
6767 #$i_inttypes I_INTTYPES
6769 #include <inttypes.h>
6771 int64_t foo() { int64_t x; x = 7; return x; }
6773 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6775 echo " Yup, it does." >&4
6778 echo " Nope, it doesn't." >&4
6789 : check for lengths of integral types
6793 echo "Checking to see how big your integers are..." >&4
6794 $cat >intsize.c <<'EOCP'
6798 printf("intsize=%d;\n", sizeof(int));
6799 printf("longsize=%d;\n", sizeof(long));
6800 printf("shortsize=%d;\n", sizeof(short));
6805 if eval $compile_ok && ./intsize > /dev/null; then
6807 echo "Your integers are $intsize bytes long."
6808 echo "Your long integers are $longsize bytes long."
6809 echo "Your short integers are $shortsize bytes long."
6813 Help! I can't compile and run the intsize test program: please enlighten me!
6814 (This is probably a misconfiguration in your system or libraries, and
6815 you really ought to fix it. Still, I'll try anyway.)
6819 rp="What is the size of an integer (in bytes)?"
6823 rp="What is the size of a long integer (in bytes)?"
6827 rp="What is the size of a short integer (in bytes)?"
6833 $rm -f intsize intsize.*
6835 : check for long long
6837 $echo $n "Checking to see if your system supports long long...$c" >&4
6838 echo 'long long foo() { long long x; x = 7; return x; }' > try.c
6839 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
6841 echo " Yup, it does." >&4
6844 echo " Nope, it doesn't." >&4
6850 : check for length of long long
6851 case "${d_longlong}${longlongsize}" in
6854 $echo $n "Checking to see how big your long longs are...$c" >&4
6855 $cat >try.c <<'EOCP'
6859 printf("%d\n", sizeof(long long));
6863 if eval $compile_ok; then
6864 longlongsize=`./try`
6865 $echo " $longlongsize bytes." >&4
6869 echo "(I can't seem to compile the test program. Guessing...)"
6870 rp="What is the size of a long long (in bytes)?"
6874 if $test "X$longsize" = "X$longlongsize"; then
6875 echo "(That isn't any different from an ordinary long.)"
6883 if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
6885 echo "Checking how to print 64-bit integers..." >&4
6887 if $test X"$sPRId64" = X -a X"$intsize" = X8; then
6889 $cat >try.c <<'EOCP'
6890 #include <sys/types.h>
6893 int q = 12345678901;
6898 if eval $compile; then
6902 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
6903 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
6904 echo "We will use %d."
6910 if $test X"$sPRId64" = X -a X"$longsize" = X8; then
6912 $cat >try.c <<'EOCP'
6913 #include <sys/types.h>
6916 long q = 12345678901;
6921 if eval $compile; then
6925 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
6926 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
6927 echo "We will use %ld."
6933 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
6935 $cat >try.c <<'EOCP'
6936 #include <sys/types.h>
6937 #include <inttypes.h>
6940 int64_t q = 12345678901;
6941 printf("%" PRId64 "\n", q);
6945 if eval $compile; then
6949 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
6950 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
6951 echo "We will use the C9X style."
6957 if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
6959 $cat >try.c <<'EOCP'
6960 #include <sys/types.h>
6963 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
6964 printf("%lld\n", q);
6968 if eval $compile; then
6972 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
6973 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
6974 echo "We will use the %lld style."
6980 if $test X"$sPRId64" = X -a X"$quad" != X; then
6982 #include <sys/types.h>
6985 $quad q = 12345678901;
6990 if eval $compile; then
6994 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
6995 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
6996 echo "We will use %lld."
7002 if $test X"$sPRId64" = X -a X"$quad" != X; then
7004 #include <sys/types.h>
7007 $quad q = 12345678901;
7012 if eval $compile; then
7016 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
7017 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
7018 echo "We will use %qd."
7024 if $test X"$sPRId64" = X; then
7025 echo "Cannot figure out how to print 64-bit integers." >&4
7030 fi # intsize -o longsize -o d_int64t -o d_longlong
7033 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
7034 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
7036 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
7037 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
7041 : check for length of double
7043 case "$doublesize" in
7045 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7046 $cat >try.c <<'EOCP'
7050 printf("%d\n", sizeof(double));
7054 if eval $compile_ok; then
7056 $echo " $doublesize bytes." >&4
7059 echo "(I can't seem to compile the test program. Guessing...)"
7060 rp="What is the size of a double precision number (in bytes)?"
7068 : check for long doubles
7070 $echo $n "Checking to see if your system supports long double...$c" >&4
7071 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
7072 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
7074 echo " Yup, it does." >&4
7077 echo " Nope, it doesn't." >&4
7083 : check for length of long double
7084 case "${d_longdbl}${longdblsize}" in
7087 $echo $n "Checking to see how big your long doubles are...$c" >&4
7088 $cat >try.c <<'EOCP'
7092 printf("%d\n", sizeof(long double));
7096 if eval $compile; then
7098 $echo " $longdblsize bytes." >&4
7102 echo "(I can't seem to compile the test program. Guessing...)" >&4
7103 rp="What is the size of a long double (in bytes)?"
7107 if $test "X$doublesize" = "X$longdblsize"; then
7108 echo "(That isn't any different from an ordinary double.)"
7116 if $test X"$d_longdbl" = X"$define"; then
7118 echo "Checking how to print long doubles..." >&4
7120 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7121 $cat >try.c <<'EOCP'
7122 #include <sys/types.h>
7126 printf("%.3f\n", d);
7130 if eval $compile; then
7134 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7135 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7136 echo "We will use %f."
7142 if $test X"$sPRIfldbl" = X; then
7143 $cat >try.c <<'EOCP'
7144 #include <sys/types.h>
7147 long double d = 123.456;
7148 printf("%.3llf\n", d);
7152 if eval $compile; then
7156 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7157 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7158 echo "We will use %llf."
7164 if $test X"$sPRIfldbl" = X; then
7165 $cat >try.c <<'EOCP'
7166 #include <sys/types.h>
7169 long double d = 123.456;
7170 printf("%.3Lf\n", d);
7174 if eval $compile; then
7178 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7179 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7180 echo "We will use %Lf."
7186 if $test X"$sPRIfldbl" = X; then
7187 $cat >try.c <<'EOCP'
7188 #include <sys/types.h>
7191 long double d = 123.456;
7192 printf("%.3lf\n", d);
7196 if eval $compile; then
7200 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7201 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7202 echo "We will use %lf."
7208 if $test X"$sPRIfldbl" = X; then
7209 echo "Cannot figure out how to print long doubles." >&4
7216 case "$sPRIfldbl" in
7217 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7218 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7220 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7221 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7225 : Initialize h_fcntl
7228 : Initialize h_sysfile
7231 : access call always available on UNIX
7235 : locate the flags for 'access()'
7239 $cat >access.c <<'EOCP'
7240 #include <sys/types.h>
7245 #include <sys/file.h>
7254 : check sys/file.h first, no particular reason here
7255 if $test `./findhdr sys/file.h` && \
7256 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7258 echo "<sys/file.h> defines the *_OK access constants." >&4
7259 elif $test `./findhdr fcntl.h` && \
7260 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7262 echo "<fcntl.h> defines the *_OK access constants." >&4
7263 elif $test `./findhdr unistd.h` && \
7264 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7265 echo "<unistd.h> defines the *_OK access constants." >&4
7267 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7273 : see if accessx exists
7274 set accessx d_accessx
7277 : see if alarm exists
7281 : see if atolf exists
7285 : see if atoll exists
7289 : Look for GNU-cc style attribute checking
7291 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7292 $cat >attrib.c <<'EOCP'
7294 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7296 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7297 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7298 echo "Your C compiler doesn't fully support __attribute__."
7301 echo "Your C compiler supports __attribute__."
7305 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7312 : see if bcmp exists
7316 : see if bcopy exists
7320 : see if this is a unistd.h system
7321 set unistd.h i_unistd
7324 : see if getpgrp exists
7325 set getpgrp d_getpgrp
7328 case "$d_getpgrp" in
7331 echo "Checking to see which flavor of getpgrp is in use..."
7334 #include <sys/types.h>
7336 # include <unistd.h>
7340 if (getuid() == 0) {
7341 printf("(I see you are running Configure as super-user...)\n");
7345 if (getpgrp(1) == 0)
7354 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7355 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7357 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7358 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7361 echo "I can't seem to compile and run the test program."
7363 xxx="a USG one, i.e. you use getpgrp()."
7365 # SVR4 systems can appear rather BSD-ish.
7368 xxx="a BSD one, i.e. you use getpgrp(pid)."
7372 xxx="probably a USG one, i.e. you use getpgrp()."
7377 echo "Assuming your getpgrp is $xxx" >&4
7386 : see if setpgrp exists
7387 set setpgrp d_setpgrp
7390 case "$d_setpgrp" in
7393 echo "Checking to see which flavor of setpgrp is in use..."
7396 #include <sys/types.h>
7398 # include <unistd.h>
7402 if (getuid() == 0) {
7403 printf("(I see you are running Configure as super-user...)\n");
7407 if (-1 == setpgrp(1, 1))
7410 if (setpgrp() != -1)
7416 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7417 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7419 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7420 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7423 echo "(I can't seem to compile and run the test program.)"
7425 xxx="a USG one, i.e. you use setpgrp()."
7427 # SVR4 systems can appear rather BSD-ish.
7430 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7434 xxx="probably a USG one, i.e. you use setpgrp()."
7439 echo "Assuming your setpgrp is $xxx" >&4
7447 : see if bzero exists
7451 : see if signal is declared as pointer to function returning int or void
7453 xxx=`./findhdr signal.h`
7454 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7455 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7456 echo "You have int (*signal())() instead of void." >&4
7458 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7459 echo "You have void (*signal())()." >&4
7461 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7462 echo "You have int (*signal())() instead of void." >&4
7464 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7465 echo "You have void (*signal())()." >&4
7468 case "$d_voidsig" in
7470 echo "I can't determine whether signal handler returns void or int..." >&4
7472 rp="What type does your signal handler return?"
7479 echo "As you already told me, signal handler returns void." >&4
7482 *) echo "As you already told me, signal handler returns int." >&4
7489 case "$d_voidsig" in
7490 "$define") signal_t="void";;
7495 : check for ability to cast large floats to 32-bit ints.
7497 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7498 if $test "$intsize" -ge 4; then
7505 #include <sys/types.h>
7507 $signal_t blech(s) int s; { exit(3); }
7514 signal(SIGFPE, blech);
7516 /* Don't let compiler optimize the test away. Store the number
7517 in a writable string for gcc to pass to sscanf under HP/UX.
7519 sprintf(str, "2147483647");
7520 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7524 /* x86 processors will probably give 0x8000 0000, which is a
7525 sign change. We don't want that. We want to mimic SPARC
7526 behavior here, which is to preserve the sign and give
7529 if (i32 != ($xxx) f)
7535 if eval $compile_ok; then
7539 echo "(I can't seem to compile the test program--assuming it can't)"
7547 echo "Nope, it can't."
7554 : check for ability to cast negative floats to unsigned
7556 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7559 #include <sys/types.h>
7561 $signal_t blech(s) int s; { exit(7); }
7562 $signal_t blech_in_list(s) int s; { exit(4); }
7563 unsigned long dummy_long(p) unsigned long p; { return p; }
7564 unsigned int dummy_int(p) unsigned int p; { return p; }
7565 unsigned short dummy_short(p) unsigned short p; { return p; }
7569 unsigned long along;
7571 unsigned short ashort;
7575 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7576 a direct f = -123. assignment. gcc-2.8.0 reportedly
7577 optimized the whole file away
7579 /* Store the number in a writable string for gcc to pass to
7582 sprintf(str, "-123");
7583 sscanf(str, "%lf", &f); /* f = -123.; */
7585 signal(SIGFPE, blech);
7586 along = (unsigned long)f;
7587 aint = (unsigned int)f;
7588 ashort = (unsigned short)f;
7589 if (along != (unsigned long)-123)
7591 if (aint != (unsigned int)-123)
7593 if (ashort != (unsigned short)-123)
7595 sprintf(str, "1073741824.");
7596 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7599 along = (unsigned long)f;
7600 if (along != 0x80000000)
7604 along = (unsigned long)f;
7605 if (along != 0x7fffffff)
7609 along = (unsigned long)f;
7610 if (along != 0x80000001)
7614 signal(SIGFPE, blech_in_list);
7615 sprintf(str, "123.");
7616 sscanf(str, "%lf", &f); /* f = 123.; */
7617 along = dummy_long((unsigned long)f);
7618 aint = dummy_int((unsigned int)f);
7619 ashort = dummy_short((unsigned short)f);
7620 if (along != (unsigned long)123)
7622 if (aint != (unsigned int)123)
7624 if (ashort != (unsigned short)123)
7631 if eval $compile_ok; then
7635 echo "(I can't seem to compile the test program--assuming it can't)"
7638 case "$castflags" in
7643 echo "Nope, it can't."
7650 : see if vprintf exists
7652 if set vprintf val -f d_vprintf; eval $csym; $val; then
7653 echo 'vprintf() found.' >&4
7655 $cat >vprintf.c <<'EOF'
7656 #include <varargs.h>
7658 int main() { xxx("foo"); }
7667 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7671 if eval $compile && ./vprintf; then
7672 echo "Your vsprintf() returns (int)." >&4
7675 echo "Your vsprintf() returns (char*)." >&4
7679 echo 'vprintf() NOT found.' >&4
7689 : see if chown exists
7693 : see if chroot exists
7697 : see if chsize exists
7701 : check for const keyword
7703 echo 'Checking to see if your C compiler knows about "const"...' >&4
7704 $cat >const.c <<'EOCP'
7705 typedef struct spug { int drokk; } spug;
7712 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7714 echo "Yup, it does."
7717 echo "Nope, it doesn't."
7722 : see if crypt exists
7724 if set crypt val -f d_crypt; eval $csym; $val; then
7725 echo 'crypt() found.' >&4
7729 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7730 if $test -z "$cryptlib"; then
7731 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7735 if $test -z "$cryptlib"; then
7736 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7740 if $test -z "$cryptlib"; then
7741 cryptlib=`./loc libcrypt$_a "" $libpth`
7745 if $test -z "$cryptlib"; then
7746 echo 'crypt() NOT found.' >&4
7755 : get csh whereabouts
7757 'csh') val="$undef" ;;
7762 : Respect a hint or command line value for full_csh.
7764 '') full_csh=$csh ;;
7767 : see if cuserid exists
7768 set cuserid d_cuserid
7771 : see if this is a limits.h system
7772 set limits.h i_limits
7775 : see if this is a float.h system
7779 : See if number of significant digits in a double precision number is known
7781 $cat >dbl_dig.c <<EOM
7791 printf("Contains DBL_DIG");
7794 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7795 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7796 echo "DBL_DIG found." >&4
7799 echo "DBL_DIG NOT found." >&4
7806 : see if difftime exists
7807 set difftime d_difftime
7810 : see if this is a dirent system
7812 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7814 echo "<dirent.h> found." >&4
7817 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7818 echo "<sys/dir.h> found." >&4
7821 xinc=`./findhdr sys/ndir.h`
7823 echo "<dirent.h> NOT found." >&4
7828 : Look for type of directory structure.
7830 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7832 case "$direntrytype" in
7835 $define) guess1='struct dirent' ;;
7836 *) guess1='struct direct' ;;
7839 *) guess1="$direntrytype"
7844 'struct dirent') guess2='struct direct' ;;
7845 *) guess2='struct dirent' ;;
7848 if $contains "$guess1" try.c >/dev/null 2>&1; then
7849 direntrytype="$guess1"
7850 echo "Your directory entries are $direntrytype." >&4
7851 elif $contains "$guess2" try.c >/dev/null 2>&1; then
7852 direntrytype="$guess2"
7853 echo "Your directory entries seem to be $direntrytype." >&4
7855 echo "I don't recognize your system's directory entries." >&4
7856 rp="What type is used for directory entries on this system?"
7864 : see if the directory entry stores field length
7866 $cppstdin $cppflags $cppminus < "$xinc" > try.c
7867 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
7868 echo "Good, your directory entry keeps length information in d_namlen." >&4
7871 echo "Your directory entry does not know about the d_namlen field." >&4
7878 : see if dlerror exists
7881 set dlerror d_dlerror
7885 : see if dlfcn is available
7893 On a few systems, the dynamically loaded modules that perl generates and uses
7894 will need a different extension than shared libs. The default will probably
7902 rp='What is the extension of dynamically loaded modules'
7911 : Check if dlsym need a leading underscore
7917 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
7918 $cat >dyna.c <<'EOM'
7927 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
7929 #include <sys/types.h>
7943 int mode = RTLD_LAZY ;
7945 handle = dlopen("./dyna.$dlext", mode) ;
7946 if (handle == NULL) {
7951 symbol = dlsym(handle, "fred") ;
7952 if (symbol == NULL) {
7953 /* try putting a leading underscore */
7954 symbol = dlsym(handle, "_fred") ;
7955 if (symbol == NULL) {
7968 : Call the object file tmp-dyna.o in case dlext=o.
7969 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
7970 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
7971 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
7972 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
7975 1) echo "Test program failed using dlopen." >&4
7976 echo "Perhaps you should not use dynamic loading." >&4;;
7977 2) echo "Test program failed using dlsym." >&4
7978 echo "Perhaps you should not use dynamic loading." >&4;;
7979 3) echo "dlsym needs a leading underscore" >&4
7981 4) echo "dlsym doesn't need a leading underscore." >&4;;
7984 echo "I can't compile and run the test program." >&4
7985 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
7990 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
7995 hasproto='varname=$1; func=$2; shift; shift;
7996 while $test $# -ge 2; do
7998 $define) echo "#include <$2>";;
8002 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8003 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8004 echo "$func() prototype found.";
8007 echo "$func() prototype NOT found.";
8012 $rm -f try.c tryout.c'
8014 : see if prototype for drand48 is available
8016 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8019 : see if dup2 exists
8023 : see if eaccess exists
8024 set eaccess d_eaccess
8027 : see if endgrent exists
8028 set endgrent d_endgrent
8031 : see if endhostent exists
8032 set endhostent d_endhent
8035 : see if endnetent exists
8036 set endnetent d_endnent
8039 : see if endprotoent exists
8040 set endprotoent d_endpent
8043 : see if endpwent exists
8044 set endpwent d_endpwent
8047 : see if endservent exists
8048 set endservent d_endsent
8051 : see if endspent exists
8052 set endspent d_endspent
8055 : Locate the flags for 'open()'
8057 $cat >open3.c <<'EOCP'
8058 #include <sys/types.h>
8063 #include <sys/file.h>
8074 : check sys/file.h first to get FREAD on Sun
8075 if $test `./findhdr sys/file.h` && \
8076 set open3 -DI_SYS_FILE && eval $compile; then
8078 echo "<sys/file.h> defines the O_* constants..." >&4
8080 echo "and you have the 3 argument form of open()." >&4
8083 echo "but not the 3 argument form of open(). Oh, well." >&4
8086 elif $test `./findhdr fcntl.h` && \
8087 set open3 -DI_FCNTL && eval $compile; then
8089 echo "<fcntl.h> defines the O_* constants..." >&4
8091 echo "and you have the 3 argument form of open()." >&4
8094 echo "but not the 3 argument form of open(). Oh, well." >&4
8099 echo "I can't find the O_* constant definitions! You got problems." >&4
8105 : check for non-blocking I/O stuff
8106 case "$h_sysfile" in
8107 true) echo "#include <sys/file.h>" > head.c;;
8110 true) echo "#include <fcntl.h>" > head.c;;
8111 *) echo "#include <sys/fcntl.h>" > head.c;;
8116 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8117 case "$o_nonblock" in
8120 $cat >>try.c <<'EOCP'
8123 printf("O_NONBLOCK\n");
8127 printf("O_NDELAY\n");
8131 printf("FNDELAY\n");
8138 if eval $compile_ok; then
8140 case "$o_nonblock" in
8141 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8142 *) echo "Seems like we can use $o_nonblock.";;
8145 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8148 *) echo "Using $hint value $o_nonblock.";;
8150 $rm -f try try.* .out core
8153 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8159 #include <sys/types.h>
8161 #define MY_O_NONBLOCK $o_nonblock
8162 #ifndef errno /* XXX need better Configure test */
8165 $signal_t blech(x) int x; { exit(3); }
8167 $cat >> try.c <<'EOCP'
8175 pipe(pd); /* Down: child -> parent */
8176 pipe(pu); /* Up: parent -> child */
8179 close(pd[1]); /* Parent reads from pd[0] */
8180 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8181 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8183 signal(SIGALRM, blech);
8185 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8187 sprintf(string, "%d\n", ret);
8188 write(2, string, strlen(string));
8191 if (errno == EAGAIN) {
8197 if (errno == EWOULDBLOCK)
8198 printf("EWOULDBLOCK\n");
8201 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8202 sleep(2); /* Give it time to close our pipe */
8204 ret = read(pd[0], buf, 1); /* Should read EOF */
8206 sprintf(string, "%d\n", ret);
8207 write(3, string, strlen(string));
8211 close(pd[0]); /* We write to pd[1] */
8212 close(pu[1]); /* We read from pu[0] */
8213 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8214 close(pd[1]); /* Pipe pd is now fully closed! */
8215 exit(0); /* Bye bye, thank you for playing! */
8219 if eval $compile_ok; then
8220 echo "$startsh" >mtry
8221 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8223 ./mtry >/dev/null 2>&1
8225 0) eagain=`$cat try.out`;;
8226 1) echo "Could not perform non-blocking setting!";;
8227 2) echo "I did a successful read() for something that was not there!";;
8228 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8229 *) echo "Something terribly wrong happened during testing.";;
8231 rd_nodata=`$cat try.ret`
8232 echo "A read() system call with no data present returns $rd_nodata."
8233 case "$rd_nodata" in
8236 echo "(That's peculiar, fixing that to be -1.)"
8242 echo "Forcing errno EAGAIN on read() with no data available."
8246 echo "Your read() sets errno to $eagain when no data is available."
8249 status=`$cat try.err`
8251 0) echo "And it correctly returns 0 to signal EOF.";;
8252 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8253 *) echo "However, your read() returns '$status' on EOF??";;
8256 if test "$status" = "$rd_nodata"; then
8257 echo "WARNING: you can't distinguish between EOF and no data!"
8261 echo "I can't compile the test program--assuming errno EAGAIN will do."
8268 echo "Using $hint value $eagain."
8269 echo "Your read() returns $rd_nodata when no data is present."
8270 case "$d_eofnblk" in
8271 "$define") echo "And you can see EOF because read() returns 0.";;
8272 "$undef") echo "But you can't see EOF status from read() returned value.";;
8274 echo "(Assuming you can't see EOF status from read anyway.)"
8280 $rm -f try try.* .out core head.c mtry
8282 : see if fchmod exists
8286 : see if fchown exists
8290 : see if this is an fcntl system
8294 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8295 while $test $# -ge 2; do
8297 $define) echo "#include <$2>";;
8301 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8303 if eval $compile; then
8314 : see whether socket exists
8316 $echo $n "Hmm... $c" >&4
8317 if set socket val -f d_socket; eval $csym; $val; then
8318 echo "Looks like you have Berkeley networking support." >&4
8320 if set setsockopt val -f; eval $csym; $val; then
8323 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8327 if $contains socklib libc.list >/dev/null 2>&1; then
8328 echo "Looks like you have Berkeley networking support." >&4
8330 : we will have to assume that it supports the 4.2 BSD interface
8333 echo "You don't have Berkeley networking in libc$_a..." >&4
8334 if test "X$d_socket" = "X$define"; then
8335 echo "...but you seem to believe that you have sockets." >&4
8337 for net in net socket
8339 if test -f /usr/lib/lib$net$_a; then
8340 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8341 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8342 if $contains socket libc.list >/dev/null 2>&1; then
8347 echo "...but the Wollongong group seems to have hacked it in." >&4
8348 sockethdr="-I/usr/netinclude"
8351 echo "Found Berkeley sockets interface in lib$net." >& 4
8352 if $contains setsockopt libc.list >/dev/null 2>&1; then
8355 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8362 if test "X$d_socket" != "X$define"; then
8363 echo "or anywhere else I see." >&4
8371 : see if socketpair exists
8372 set socketpair d_sockpair
8377 echo "Checking the availability of certain socket constants..." >& 4
8378 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8379 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8381 #include <sys/types.h>
8382 #include <sys/socket.h>
8388 set try; if eval $compile; then
8391 set d_${enum}; eval $setvar
8395 : see if sys/select.h has to be included
8396 set sys/select.h i_sysselct
8399 : see if we should include time.h, sys/time.h, or both
8401 if test "X$timeincl" = X; then
8402 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8403 $echo $n "I'm now running the test program...$c"
8404 $cat >try.c <<'EOCP'
8405 #include <sys/types.h>
8410 #ifdef SYSTIMEKERNEL
8413 #include <sys/time.h>
8416 #include <sys/select.h>
8425 struct timezone tzp;
8427 if (foo.tm_sec == foo.tm_sec)
8430 if (bar.tv_sec == bar.tv_sec)
8437 for s_timezone in '-DS_TIMEZONE' ''; do
8439 for s_timeval in '-DS_TIMEVAL' ''; do
8440 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8441 for i_time in '' '-DI_TIME'; do
8442 for i_systime in '-DI_SYSTIME' ''; do
8445 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8446 if eval $compile; then
8447 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8451 $echo $n "Succeeded with $flags$c"
8463 *SYSTIMEKERNEL*) i_systimek="$define"
8464 timeincl=`./findhdr sys/time.h`
8465 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8466 *) i_systimek="$undef";;
8469 *I_TIME*) i_time="$define"
8470 timeincl=`./findhdr time.h`" $timeincl"
8471 echo "We'll include <time.h>." >&4;;
8472 *) i_time="$undef";;
8475 *I_SYSTIME*) i_systime="$define"
8476 timeincl=`./findhdr sys/time.h`" $timeincl"
8477 echo "We'll include <sys/time.h>." >&4;;
8478 *) i_systime="$undef";;
8483 : check for fd_set items
8486 Checking to see how well your C compiler handles fd_set and friends ...
8488 $cat >fd_set.c <<EOCP
8489 #$i_systime I_SYS_TIME
8490 #$i_sysselct I_SYS_SELECT
8491 #$d_socket HAS_SOCKET
8492 #include <sys/types.h>
8494 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8497 #include <sys/time.h>
8500 #include <sys/select.h>
8509 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8516 set fd_set -DTRYBITS
8517 if eval $compile; then
8518 d_fds_bits="$define"
8520 echo "Well, your system knows about the normal fd_set typedef..." >&4
8522 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8523 d_fd_macros="$define"
8526 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8528 d_fd_macros="$undef"
8532 Hmm, your compiler has some difficulty with fd_set. Checking further...
8535 if eval $compile; then
8538 echo "Well, your system has some sort of fd_set available..." >&4
8540 echo "and you have the normal fd_set macros." >&4
8541 d_fd_macros="$define"
8544 but not the normal fd_set macros! Gross! More work for me...
8546 d_fd_macros="$undef"
8549 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8552 d_fd_macros="$undef"
8557 : see if fgetpos exists
8558 set fgetpos d_fgetpos
8561 : see if flock exists
8565 : see if fork exists
8569 : see if pathconf exists
8570 set pathconf d_pathconf
8573 : see if fpathconf exists
8574 set fpathconf d_fpathconf
8578 : see if llseek exists
8584 $echo $n "Checking to see if your system supports off64_t...$c" >&4
8586 #include <sys/types.h>
8588 off64_t foo() { off64_t x; x = 7; return x; }'
8590 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8592 echo " Yup, it does." >&4
8595 echo " Nope, it doesn't." >&4
8601 : check for fpos64_t
8603 $echo $n "Checking to see if your system supports fpos64_t...$c" >&4
8605 #include <sys/stdio.h>
8606 fpos64_t foo() { fpos64_t x; x = 7; return x; }'
8608 if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
8610 echo " Yup, it does." >&4
8613 echo " Nope, it doesn't." >&4
8619 hasstruct='varname=$1; struct=$2; shift; shift;
8620 while $test $# -ge 2; do
8622 $define) echo "#include <$2>";;
8626 echo "int main () { struct $struct foo; }" >> try.c;
8628 if eval $compile; then
8637 : see if this is a sys/param system
8638 set sys/param.h i_sysparam
8641 : see if this is a sys/mount.h system
8642 set sys/mount.h i_sysmount
8645 : see if sys/types.h has to be included
8646 set sys/types.h i_systypes
8651 echo "Checking to see if your system supports struct fs_data..." >&4
8652 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8654 case "$d_fs_data_s" in
8655 "$define") echo "Yup, it does." >&4 ;;
8656 *) echo "Nope, it doesn't." >&4 ;;
8659 : see if fseeko exists
8663 : see if fsetpos exists
8664 set fsetpos d_fsetpos
8668 : see if fstatfs exists
8669 set fstatfs d_fstatfs
8673 : see if statvfs exists
8674 set statvfs d_statvfs
8677 : see if fstatvfs exists
8678 set fstatvfs d_fstatvfs
8682 : see if ftello exists
8686 : see if getgrent exists
8687 set getgrent d_getgrent
8690 : see if gethostbyaddr exists
8691 set gethostbyaddr d_gethbyaddr
8694 : see if gethostbyname exists
8695 set gethostbyname d_gethbyname
8698 : see if gethostent exists
8699 set gethostent d_gethent
8702 : see how we will look up host name
8705 if set gethostname val -f d_gethname; eval $csym; $val; then
8706 echo 'gethostname() found.' >&4
8707 d_gethname="$define"
8710 if set uname val -f d_uname; eval $csym; $val; then
8713 uname() was found, but you're running xenix, and older versions of xenix
8714 have a broken uname(). If you don't really know whether your xenix is old
8715 enough to have a broken system call, use the default answer.
8722 rp='Is your uname() broken?'
8725 n*) d_uname="$define"; call=uname;;
8728 echo 'uname() found.' >&4
8735 case "$d_gethname" in
8736 '') d_gethname="$undef";;
8739 '') d_uname="$undef";;
8741 case "$d_uname$d_gethname" in
8746 Every now and then someone has a $call() that lies about the hostname
8747 but can't be fixed for political or economic reasons. If you wish, I can
8748 pretend $call() isn't there and maybe compute hostname at run-time
8749 thanks to the '$phostname' command.
8752 rp="Shall I ignore $call() from now on?"
8755 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8758 case "$phostname" in
8760 *) case "$aphostname" in
8766 file=`./loc $file $file $pth`
8767 aphostname=`echo $file $*`
8772 case "$d_uname$d_gethname" in
8775 case "$phostname" in
8777 echo "There will be no way for $package to get your hostname." >&4;;
8779 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
8783 case "$d_phostname" in
8784 '') d_phostname="$undef";;
8787 : see if this is a netdb.h system
8791 : see if prototypes for various gethostxxx netdb.h functions are available
8793 set d_gethostprotos gethostent $i_netdb netdb.h
8796 : see if getlogin exists
8797 set getlogin d_getlogin
8800 : see if getmnt exists
8804 : see if getmntent exists
8805 set getmntent d_getmntent
8808 : see if getnetbyaddr exists
8809 set getnetbyaddr d_getnbyaddr
8812 : see if getnetbyname exists
8813 set getnetbyname d_getnbyname
8816 : see if getnetent exists
8817 set getnetent d_getnent
8820 : see if prototypes for various getnetxxx netdb.h functions are available
8822 set d_getnetprotos getnetent $i_netdb netdb.h
8826 : see if getprotobyname exists
8827 set getprotobyname d_getpbyname
8830 : see if getprotobynumber exists
8831 set getprotobynumber d_getpbynumber
8834 : see if getprotoent exists
8835 set getprotoent d_getpent
8838 : see if getpgid exists
8839 set getpgid d_getpgid
8842 : see if getpgrp2 exists
8843 set getpgrp2 d_getpgrp2
8846 : see if getppid exists
8847 set getppid d_getppid
8850 : see if getpriority exists
8851 set getpriority d_getprior
8854 : see if prototypes for various getprotoxxx netdb.h functions are available
8856 set d_getprotoprotos getprotoent $i_netdb netdb.h
8859 : see if getpwent exists
8860 set getpwent d_getpwent
8864 : see if getservbyname exists
8865 set getservbyname d_getsbyname
8868 : see if getservbyport exists
8869 set getservbyport d_getsbyport
8872 : see if getservent exists
8873 set getservent d_getsent
8876 : see if prototypes for various getservxxx netdb.h functions are available
8878 set d_getservprotos getservent $i_netdb netdb.h
8881 : see if getspent exists
8882 set getspent d_getspent
8885 : see if getspnam exists
8886 set getspnam d_getspnam
8889 : see if gettimeofday or ftime exists
8890 set gettimeofday d_gettimeod
8892 case "$d_gettimeod" in
8898 val="$undef"; set d_ftime; eval $setvar
8901 case "$d_gettimeod$d_ftime" in
8904 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
8908 : see if this is an grp system
8914 xxx=`./findhdr grp.h`
8915 $cppstdin $cppflags $cppminus < $xxx >$$.h
8917 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
8929 set d_grpasswd; eval $setvar
8933 : see if hasmntopt exists
8934 set hasmntopt d_hasmntopt
8937 : see if this is a netinet/in.h or sys/in.h system
8938 set netinet/in.h i_niin sys/in.h i_sysin
8941 : see if arpa/inet.h has to be included
8942 set arpa/inet.h i_arpainet
8945 : see if htonl --and friends-- exists
8950 : Maybe they are macros.
8955 #include <sys/types.h>
8956 #$i_niin I_NETINET_IN
8958 #$i_arpainet I_ARPA_INET
8960 #include <netinet/in.h>
8966 #include <arpa/inet.h>
8969 printf("Defined as a macro.");
8972 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
8973 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
8975 echo "But it seems to be defined as a macro." >&4
8983 : see which of string.h or strings.h is needed
8985 strings=`./findhdr string.h`
8986 if $test "$strings" && $test -r "$strings"; then
8987 echo "Using <string.h> instead of <strings.h>." >&4
8991 strings=`./findhdr strings.h`
8992 if $test "$strings" && $test -r "$strings"; then
8993 echo "Using <strings.h> instead of <string.h>." >&4
8995 echo "No string header found -- You'll surely have problems." >&4
9001 "$undef") strings=`./findhdr strings.h`;;
9002 *) strings=`./findhdr string.h`;;
9007 if set index val -f; eval $csym; $val; then
9008 if set strchr val -f d_strchr; eval $csym; $val; then
9009 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9012 echo "strchr() found." >&4
9016 echo "index() found." >&4
9021 echo "index() found." >&4
9024 if set strchr val -f d_strchr; eval $csym; $val; then
9027 echo "strchr() found." >&4
9029 echo "No index() or strchr() found!" >&4
9034 set d_strchr; eval $setvar
9036 set d_index; eval $setvar
9038 : check whether inet_aton exists
9039 set inet_aton d_inetaton
9044 $cat >isascii.c <<'EOCP'
9056 if eval $compile; then
9057 echo "isascii() found." >&4
9060 echo "isascii() NOT found." >&4
9067 : see if killpg exists
9071 : see if lchown exists
9073 $cat > try.c <<'EOCP'
9074 /* System header to define __stub macros and hopefully few prototypes,
9075 which can conflict with char lchown(); below. */
9077 /* Override any gcc2 internal prototype to avoid an error. */
9078 /* We use char because int might match the return type of a gcc2
9079 builtin and then its argument prototype would still apply. */
9082 /* The GNU C library defines this for functions which it implements
9083 to always fail with ENOSYS. Some functions are actually named
9084 something starting with __ and the normal name is an alias. */
9085 #if defined (__stub_lchown) || defined (__stub___lchown)
9093 if eval $compile; then
9094 $echo "lchown() found." >&4
9097 $echo "lchown() NOT found." >&4
9103 : See if number of significant digits in a double precision number is known
9105 $cat >ldbl_dig.c <<EOM
9115 printf("Contains LDBL_DIG");
9118 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9119 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9120 echo "LDBL_DIG found." >&4
9123 echo "LDBL_DIG NOT found." >&4
9130 : see if link exists
9134 : see if localeconv exists
9135 set localeconv d_locconv
9138 : see if lockf exists
9142 : see if lstat exists
9146 : see if mblen exists
9150 : see if mbstowcs exists
9151 set mbstowcs d_mbstowcs
9154 : see if mbtowc exists
9158 : see if memchr exists
9162 : see if memcmp exists
9166 : see if memcpy exists
9170 : see if memmove exists
9171 set memmove d_memmove
9174 : see if memset exists
9178 : see if mkdir exists
9182 : see if mkfifo exists
9186 : see if mktime exists
9190 : see if msgctl exists
9194 : see if msgget exists
9198 : see if msgsnd exists
9202 : see if msgrcv exists
9206 : see how much of the 'msg*(2)' library is present.
9209 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9210 *"$undef"*) h_msg=false;;
9214 case "`ipcs 2>&1`" in
9215 "SVID messages"*"not configured"*)
9216 echo "Your $osname does not have the msg*(2) configured." >&4
9231 : we could also check for sys/ipc.h ...
9232 if $h_msg && $test `./findhdr sys/msg.h`; then
9233 echo "You have the full msg*(2) library." >&4
9236 echo "You don't have the full msg*(2) library." >&4
9242 : see if nice exists
9246 : see if POSIX threads are available
9247 set pthread.h i_pthread
9253 : how to create joinable pthreads
9254 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9256 echo "Checking what constant to use for creating joinable pthreads..." >&4
9257 $cat >try.c <<'EOCP'
9258 #include <pthread.h>
9260 int detachstate = JOINABLE;
9263 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9264 if eval $compile; then
9265 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9266 val="$undef" # Yes, undef.
9267 set d_old_pthread_create_joinable
9270 set old_pthread_create_joinable
9273 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9274 if eval $compile; then
9275 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9277 set d_old_pthread_create_joinable
9279 val=PTHREAD_CREATE_UNDETACHED
9280 set old_pthread_create_joinable
9283 set try -DJOINABLE=__UNDETACHED
9284 if eval $compile; then
9285 echo "You seem to use __UNDETACHED." >&4
9287 set d_old_pthread_create_joinable
9290 set old_pthread_create_joinable
9293 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9295 set d_old_pthread_create_joinable
9298 set old_pthread_create_joinable
9305 d_old_pthread_create_joinable="$undef"
9306 old_pthread_create_joinable=""
9309 : see if pause exists
9313 : see if pipe exists
9317 : see if poll exists
9322 : see whether the various POSIXish _yields exist
9324 #include <pthread.h>
9330 #ifdef PTHREAD_YIELD
9333 #ifdef PTHREAD_YIELD_NULL
9334 pthread_yield(NULL);
9340 : see if sched_yield exists
9341 set try -DSCHED_YIELD
9342 if eval $compile; then
9344 sched_yield='sched_yield()'
9348 case "$usethreads" in
9351 $define) echo 'sched_yield() found.' >&4 ;;
9352 *) echo 'sched_yield() NOT found.' >&4 ;;
9358 : see if pthread_yield exists
9359 set try -DPTHREAD_YIELD
9360 if eval $compile; then
9362 case "$sched_yield" in
9363 '') sched_yield='pthread_yield()' ;;
9366 set try -DPTHREAD_YIELD_NULL
9367 if eval $compile; then
9369 case "$sched_yield" in
9370 '') sched_yield='pthread_yield(NULL)' ;;
9376 case "$usethreads" in
9379 $define) echo 'pthread_yield() found.' >&4 ;;
9380 *) echo 'pthread_yield() NOT found.' >&4 ;;
9387 case "$sched_yield" in
9388 '') sched_yield=undef ;;
9393 : see if this is a pwd.h system
9399 xxx=`./findhdr pwd.h`
9400 $cppstdin $cppflags $cppminus < $xxx >$$.h
9402 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9410 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9418 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9426 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9434 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9442 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9450 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9458 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9470 set d_pwquota; eval $setvar
9471 set d_pwage; eval $setvar
9472 set d_pwchange; eval $setvar
9473 set d_pwclass; eval $setvar
9474 set d_pwexpire; eval $setvar
9475 set d_pwcomment; eval $setvar
9476 set d_pwgecos; eval $setvar
9477 set d_pwpasswd; eval $setvar
9481 : see if readdir and friends exist
9482 set readdir d_readdir
9484 set seekdir d_seekdir
9486 set telldir d_telldir
9488 set rewinddir d_rewinddir
9491 : see if readlink exists
9492 set readlink d_readlink
9495 : see if rename exists
9499 : see if rmdir exists
9503 : see if memory.h is available.
9508 : See if it conflicts with string.h
9514 $cppstdin $cppflags $cppminus < $strings > mem.h
9515 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9517 echo "We won't be including <memory.h>."
9527 : can bcopy handle overlapping blocks?
9532 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9539 $cat >>try.c <<'EOCP'
9542 # include <memory.h>
9545 # include <stdlib.h>
9548 # include <string.h>
9550 # include <strings.h>
9553 # include <unistd.h> /* Needed for NetBSD */
9557 char buf[128], abc[128];
9563 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9565 for (align = 7; align >= 0; align--) {
9566 for (len = 36; len; len--) {
9569 for (off = 1; off <= len; off++) {
9570 bcopy(b, b+off, len);
9571 bcopy(b+off, b, len);
9572 if (bcmp(b, abc, len))
9581 if eval $compile_ok; then
9582 if ./try 2>/dev/null; then
9586 echo "It can't, sorry."
9587 case "$d_memmove" in
9588 "$define") echo "But that's Ok since you have memmove()." ;;
9592 echo "(I can't compile the test program, so we'll assume not...)"
9593 case "$d_memmove" in
9594 "$define") echo "But that's Ok since you have memmove()." ;;
9599 $rm -f try.* try core
9603 : can memcpy handle overlapping blocks?
9608 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
9615 $cat >>try.c <<'EOCP'
9618 # include <memory.h>
9621 # include <stdlib.h>
9624 # include <string.h>
9626 # include <strings.h>
9629 # include <unistd.h> /* Needed for NetBSD */
9633 char buf[128], abc[128];
9639 /* Copy "abcde..." string to char abc[] so that gcc doesn't
9640 try to store the string in read-only memory. */
9641 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
9643 for (align = 7; align >= 0; align--) {
9644 for (len = 36; len; len--) {
9646 memcpy(b, abc, len);
9647 for (off = 1; off <= len; off++) {
9648 memcpy(b+off, b, len);
9649 memcpy(b, b+off, len);
9650 if (memcmp(b, abc, len))
9659 if eval $compile_ok; then
9660 if ./try 2>/dev/null; then
9664 echo "It can't, sorry."
9665 case "$d_memmove" in
9666 "$define") echo "But that's Ok since you have memmove()." ;;
9670 echo "(I can't compile the test program, so we'll assume not...)"
9671 case "$d_memmove" in
9672 "$define") echo "But that's Ok since you have memmove()." ;;
9677 $rm -f try.* try core
9681 : can memcmp be trusted to compare relative magnitude?
9686 echo "Checking if your memcmp() can compare relative magnitude..." >&4
9693 $cat >>try.c <<'EOCP'
9696 # include <memory.h>
9699 # include <stdlib.h>
9702 # include <string.h>
9704 # include <strings.h>
9707 # include <unistd.h> /* Needed for NetBSD */
9713 if ((a < b) && memcmp(&a, &b, 1) < 0)
9719 if eval $compile_ok; then
9720 if ./try 2>/dev/null; then
9724 echo "No, it can't (it uses signed chars)."
9727 echo "(I can't compile the test program, so we'll assume not...)"
9731 $rm -f try.* try core
9735 : see if select exists
9739 : see if semctl exists
9743 : see if semget exists
9747 : see if semop exists
9751 : see how much of the 'sem*(2)' library is present.
9754 case "$d_semctl$d_semget$d_semop" in
9755 *"$undef"*) h_sem=false;;
9759 case "`ipcs 2>&1`" in
9760 "SVID messages"*"not configured"*)
9761 echo "Your $osname does not have the sem*(2) configured." >&4
9774 : we could also check for sys/ipc.h ...
9775 if $h_sem && $test `./findhdr sys/sem.h`; then
9776 echo "You have the full sem*(2) library." >&4
9779 echo "You don't have the full sem*(2) library." >&4
9785 : see whether sys/sem.h defines union semun
9787 $cat > try.c <<'END'
9788 #include <sys/types.h>
9789 #include <sys/ipc.h>
9790 #include <sys/sem.h>
9791 int main () { union semun semun; semun.buf = 0; }
9794 if eval $compile; then
9795 echo "You have union semun in <sys/sem.h>." >&4
9798 echo "You do not have union semun in <sys/sem.h>." >&4
9801 $rm -f try try.c try.h
9805 : see how to do semctl IPC_STAT
9808 : see whether semctl IPC_STAT can use union semun
9813 # define S_IRUSR S_IREAD
9814 # define S_IWUSR S_IWRITE
9815 # define S_IXUSR S_IEXEC
9817 # define S_IRUSR 0400
9818 # define S_IWUSR 0200
9819 # define S_IXUSR 0100
9821 # define S_IRGRP (S_IRUSR>>3)
9822 # define S_IWGRP (S_IWUSR>>3)
9823 # define S_IXGRP (S_IXUSR>>3)
9824 # define S_IROTH (S_IRUSR>>6)
9825 # define S_IWOTH (S_IWUSR>>6)
9826 # define S_IXOTH (S_IXUSR>>6)
9829 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
9830 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
9831 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
9836 #include <sys/types.h>
9837 #include <sys/ipc.h>
9838 #include <sys/sem.h>
9839 #include <sys/stat.h>
9846 #$d_union_semun HAS_UNION_SEMUN
9849 #ifndef HAS_UNION_SEMUN
9852 struct semid_ds *buf;
9853 unsigned short *array;
9859 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9860 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9862 struct semid_ds argbuf;
9865 st = semctl(sem, 0, IPC_STAT, arg);
9869 # endif /* IPC_STAT */
9870 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9872 if (semctl(sem, 0, IPC_RMID, arg) != 0)
9873 # endif /* IPC_RMID */
9874 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9876 #endif /* IPC_PRIVATE && ... */
9877 printf("semget failed: errno = %d\n", errno);
9883 if eval $compile; then
9886 semun) val="$define" ;;
9892 case "$d_semctl_semun" in
9894 echo "You can use union semun for semctl IPC_STAT." >&4
9897 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
9902 : see whether semctl IPC_STAT can use struct semid_ds pointer
9903 $cat > try.c <<'END'
9904 #include <sys/types.h>
9905 #include <sys/ipc.h>
9906 #include <sys/sem.h>
9907 #include <sys/stat.h>
9915 struct semid_ds arg;
9918 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
9919 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
9922 st = semctl(sem, 0, IPC_STAT, &arg);
9924 printf("semid_ds\n");
9926 # endif /* IPC_STAT */
9927 printf("semctl IPC_STAT failed: errno = %d\n", errno);
9929 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
9930 # endif /* IPC_RMID */
9931 printf("semctl IPC_RMID failed: errno = %d\n", errno);
9933 #endif /* IPC_PRIVATE && ... */
9934 printf("semget failed: errno = %d\n", errno);
9941 if eval $compile; then
9944 semid_ds) val="$define" ;;
9948 set d_semctl_semid_ds
9950 case "$d_semctl_semid_ds" in
9952 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
9954 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
9961 # We do not have the full sem*(2) library, so assume we can not
9967 set d_semctl_semid_ds
9972 : see if setegid exists
9973 set setegid d_setegid
9976 : see if seteuid exists
9977 set seteuid d_seteuid
9980 : see if setgrent exists
9981 set setgrent d_setgrent
9984 : see if sethostent exists
9985 set sethostent d_sethent
9988 : see if setlinebuf exists
9989 set setlinebuf d_setlinebuf
9992 : see if setlocale exists
9993 set setlocale d_setlocale
9996 : see if setnetent exists
9997 set setnetent d_setnent
10000 : see if setprotoent exists
10001 set setprotoent d_setpent
10004 : see if setpgid exists
10005 set setpgid d_setpgid
10008 : see if setpgrp2 exists
10009 set setpgrp2 d_setpgrp2
10012 : see if setpriority exists
10013 set setpriority d_setprior
10016 : see if setpwent exists
10017 set setpwent d_setpwent
10020 : see if setregid exists
10021 set setregid d_setregid
10023 set setresgid d_setresgid
10026 : see if setreuid exists
10027 set setreuid d_setreuid
10029 set setresuid d_setresuid
10032 : see if setrgid exists
10033 set setrgid d_setrgid
10036 : see if setruid exists
10037 set setruid d_setruid
10040 : see if setservent exists
10041 set setservent d_setsent
10044 : see if setsid exists
10045 set setsid d_setsid
10048 : see if setspent exists
10049 set setspent d_setspent
10052 : see if setvbuf exists
10053 set setvbuf d_setvbuf
10056 : see if sfio.h is available
10061 : see if sfio library is available
10072 : Ok, but do we want to use it.
10076 true|$define|[yY]*) dflt='y';;
10079 echo "$package can use the sfio library, but it is experimental."
10080 rp="You seem to have sfio available, do you want to try using it?"
10084 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10086 : Remove sfio from list of libraries to use
10087 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10090 echo "libs = $libs" >&4
10094 *) case "$usesfio" in
10095 true|$define|[yY]*)
10096 echo "Sorry, cannot find sfio on this machine" >&4
10097 echo "Ignoring your setting of usesfio=$usesfio" >&4
10105 $define) usesfio='true';;
10106 *) usesfio='false';;
10109 : see if shmctl exists
10110 set shmctl d_shmctl
10113 : see if shmget exists
10114 set shmget d_shmget
10117 : see if shmat exists
10120 : see what shmat returns
10123 $cat >shmat.c <<'END'
10124 #include <sys/shm.h>
10127 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10132 echo "and it returns ($shmattype)." >&4
10133 : see if a prototype for shmat is available
10134 xxx=`./findhdr sys/shm.h`
10135 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10136 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10147 set d_shmatprototype
10150 : see if shmdt exists
10154 : see how much of the 'shm*(2)' library is present.
10157 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10158 *"$undef"*) h_shm=false;;
10162 case "`ipcs 2>&1`" in
10163 "SVID shared memory"*"not configured"*)
10164 echo "Your $osname does not have the shm*(2) configured." >&4
10167 set shmctl d_shmctl
10169 set shmget d_shmget
10179 : we could also check for sys/ipc.h ...
10180 if $h_shm && $test `./findhdr sys/shm.h`; then
10181 echo "You have the full shm*(2) library." >&4
10184 echo "You don't have the full shm*(2) library." >&4
10191 : see if we have sigaction
10192 if set sigaction val -f d_sigaction; eval $csym; $val; then
10193 echo 'sigaction() found.' >&4
10194 $cat > try.c <<'EOP'
10196 #include <sys/types.h>
10197 #include <signal.h>
10200 struct sigaction act, oact;
10202 oact.sa_handler = 0;
10206 if eval $compile_ok; then
10209 echo "But you don't seem to have a useable struct sigaction." >&4
10213 echo 'sigaction NOT found.' >&4
10216 set d_sigaction; eval $setvar
10217 $rm -f try try$_o try.c
10219 : see if sigsetjmp exists
10221 case "$d_sigsetjmp" in
10223 $cat >try.c <<'EOP'
10224 #include <setjmp.h>
10229 if (sigsetjmp(env,1))
10232 siglongjmp(env, 1);
10237 if eval $compile; then
10238 if ./try >/dev/null 2>&1; then
10239 echo "POSIX sigsetjmp found." >&4
10243 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10249 echo "sigsetjmp not found." >&4
10253 *) val="$d_sigsetjmp"
10254 case "$d_sigsetjmp" in
10255 $define) echo "POSIX sigsetjmp found." >&4;;
10256 $undef) echo "sigsetjmp not found." >&4;;
10264 : see if sqrtl exists
10268 : see if sys/stat.h is available
10269 set sys/stat.h i_sysstat
10273 : see if stat knows about block sizes
10275 echo "Checking to see if your struct stat has st_blocks field..." >&4
10276 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10280 : see if this is a sys/vfs.h system
10281 set sys/vfs.h i_sysvfs
10285 : see if this is a sys/statfs.h system
10286 set sys/statfs.h i_sysstatfs
10291 echo "Checking to see if your system supports struct statfs..." >&4
10292 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
10294 case "$d_statfs_s" in
10295 "$define") echo "Yup, it does." >&4 ;;
10296 *) echo "Nope, it doesn't." >&4 ;;
10301 : see if struct statfs knows about f_flags
10302 case "$d_statfs_s" in
10305 echo "Checking to see if your struct statfs has f_flags field..." >&4
10306 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
10310 set d_statfs_f_flags
10314 case "$d_statfs_f_flags" in
10315 "$define") echo "Yup, it does." >&4 ;;
10316 *) echo "Nope, it doesn't." >&4 ;;
10319 : see if _ptr and _cnt from stdio act std
10321 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10322 echo "(Looks like you have stdio.h from Linux.)"
10323 case "$stdio_ptr" in
10324 '') stdio_ptr='((fp)->_IO_read_ptr)'
10327 *) ptr_lval=$d_stdio_ptr_lval;;
10329 case "$stdio_cnt" in
10330 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10333 *) cnt_lval=$d_stdio_cnt_lval;;
10335 case "$stdio_base" in
10336 '') stdio_base='((fp)->_IO_read_base)';;
10338 case "$stdio_bufsiz" in
10339 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10342 case "$stdio_ptr" in
10343 '') stdio_ptr='((fp)->_ptr)'
10346 *) ptr_lval=$d_stdio_ptr_lval;;
10348 case "$stdio_cnt" in
10349 '') stdio_cnt='((fp)->_cnt)'
10352 *) cnt_lval=$d_stdio_cnt_lval;;
10354 case "$stdio_base" in
10355 '') stdio_base='((fp)->_base)';;
10357 case "$stdio_bufsiz" in
10358 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10361 : test whether _ptr and _cnt really work
10362 echo "Checking how std your stdio is..." >&4
10365 #define FILE_ptr(fp) $stdio_ptr
10366 #define FILE_cnt(fp) $stdio_cnt
10368 FILE *fp = fopen("try.c", "r");
10371 18 <= FILE_cnt(fp) &&
10372 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10380 if eval $compile; then
10382 echo "Your stdio acts pretty std."
10385 echo "Your stdio isn't very std."
10388 echo "Your stdio doesn't appear very std."
10394 : Can _ptr be used as an lvalue?
10395 case "$d_stdstdio$ptr_lval" in
10396 $define$define) val=$define ;;
10399 set d_stdio_ptr_lval
10402 : Can _cnt be used as an lvalue?
10403 case "$d_stdstdio$cnt_lval" in
10404 $define$define) val=$define ;;
10407 set d_stdio_cnt_lval
10410 : see if _base is also standard
10412 case "$d_stdstdio" in
10416 #define FILE_base(fp) $stdio_base
10417 #define FILE_bufsiz(fp) $stdio_bufsiz
10419 FILE *fp = fopen("try.c", "r");
10422 19 <= FILE_bufsiz(fp) &&
10423 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10430 if eval $compile; then
10432 echo "And its _base field acts std."
10435 echo "But its _base field isn't std."
10438 echo "However, it seems to be lacking the _base field."
10447 Checking how to access stdio streams by file descriptor number...
10449 case "$stdio_stream_array" in
10450 '') $cat >try.c <<EOCP
10453 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10457 for s in _iob __iob __sF
10459 set try -DSTDIO_STREAM_ARRAY=$s
10460 if eval $compile; then
10461 case "`./try$exe_ext`" in
10462 yes) stdio_stream_array=$s; break ;;
10466 $rm -f try.* try$exe_ext
10468 case "$stdio_stream_array" in
10470 I can't figure out how to access stdio streams by file descriptor number.
10472 d_stdio_stream_array="$undef"
10475 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10477 d_stdio_stream_array="$define"
10481 : see if strcoll exists
10482 set strcoll d_strcoll
10485 : check for structure copying
10487 echo "Checking to see if your C compiler can copy structs..." >&4
10488 $cat >try.c <<'EOCP'
10498 if $cc -c try.c >/dev/null 2>&1 ; then
10500 echo "Yup, it can."
10503 echo "Nope, it can't."
10509 : see if strerror and/or sys_errlist[] exist
10511 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10512 if set strerror val -f d_strerror; eval $csym; $val; then
10513 echo 'strerror() found.' >&4
10514 d_strerror="$define"
10515 d_strerrm='strerror(e)'
10516 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10517 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10518 d_syserrlst="$define"
10520 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10521 d_syserrlst="$undef"
10523 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10524 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10525 echo 'strerror() found in string header.' >&4
10526 d_strerror="$define"
10527 d_strerrm='strerror(e)'
10528 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10529 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10530 d_syserrlst="$define"
10532 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10533 d_syserrlst="$undef"
10535 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10536 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10537 d_strerror="$undef"
10538 d_syserrlst="$define"
10539 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10541 echo 'strerror() and sys_errlist[] NOT found.' >&4
10542 d_strerror="$undef"
10543 d_syserrlst="$undef"
10544 d_strerrm='"unknown"'
10548 : see if strtod exists
10549 set strtod d_strtod
10552 : see if strtol exists
10553 set strtol d_strtol
10556 : see if strtoul exists
10557 set strtoul d_strtoul
10560 : see if strtoull exists
10561 set strtoull d_strtoull
10564 : see if strxfrm exists
10565 set strxfrm d_strxfrm
10568 : see if symlink exists
10569 set symlink d_symlink
10572 : see if syscall exists
10573 set syscall d_syscall
10576 : see if sysconf exists
10577 set sysconf d_sysconf
10580 : see if system exists
10581 set system d_system
10584 : see if tcgetpgrp exists
10585 set tcgetpgrp d_tcgetpgrp
10588 : see if tcsetpgrp exists
10589 set tcsetpgrp d_tcsetpgrp
10592 : see if prototype for telldir is available
10594 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
10597 : define an is-a-typedef? function
10598 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10600 "") inclist="sys/types.h";;
10602 eval "varval=\$$var";
10606 for inc in $inclist; do
10607 echo "#include <$inc>" >>temp.c;
10609 echo "#ifdef $type" >> temp.c;
10610 echo "printf(\"We have $type\");" >> temp.c;
10611 echo "#endif" >> temp.c;
10612 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10613 if $contains $type temp.E >/dev/null 2>&1; then
10614 eval "$var=\$type";
10619 *) eval "$var=\$varval";;
10622 : define an is-a-typedef? function that prompts if the type is not available.
10623 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
10625 "") inclist="sys/types.h";;
10627 eval "varval=\$$var";
10631 for inc in $inclist; do
10632 echo "#include <$inc>" >>temp.c;
10634 echo "#ifdef $type" >> temp.c;
10635 echo "printf(\"We have $type\");" >> temp.c;
10636 echo "#endif" >> temp.c;
10637 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
10639 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
10640 if $contains $type temp.E >/dev/null 2>&1; then
10641 echo "$type found." >&4;
10642 eval "$var=\$type";
10644 echo "$type NOT found." >&4;
10650 *) eval "$var=\$varval";;
10653 : see if this is a sys/times.h system
10654 set sys/times.h i_systimes
10657 : see if times exists
10659 if set times val -f d_times; eval $csym; $val; then
10660 echo 'times() found.' >&4
10663 case "$i_systimes" in
10664 "$define") inc='sys/times.h';;
10666 rp="What is the type returned by times() on this system?"
10667 set clock_t clocktype long stdio.h sys/types.h $inc
10670 echo 'times() NOT found, hope that will do.' >&4
10675 : see if truncate exists
10676 set truncate d_truncate
10679 : see if tzname[] exists
10681 if set tzname val -a d_tzname; eval $csym; $val; then
10683 echo 'tzname[] found.' >&4
10686 echo 'tzname[] NOT found.' >&4
10691 : see if umask exists
10695 : see if ustat exists
10699 : backward compatibility for d_hvfork
10700 if test X$d_hvfork != X; then
10701 d_vfork="$d_hvfork"
10704 : see if there is a vfork
10709 : Ok, but do we want to use it. vfork is reportedly unreliable in
10710 : perl on Solaris 2.x, and probably elsewhere.
10714 case "$usevfork" in
10720 Perl can only use a vfork() that doesn't suffer from strict
10721 restrictions on calling functions or modifying global data in
10722 the child. For example, glibc-2.1 contains such a vfork()
10723 that is unsuitable. If your system provides a proper fork()
10724 call, chances are that you do NOT want perl to use vfork().
10727 rp="Do you still want to use vfork()?"
10732 echo "Ok, we won't use vfork()."
10741 $define) usevfork='true';;
10742 *) usevfork='false';;
10745 : see if this is an sysdir system
10746 set sys/dir.h i_sysdir
10749 : see if this is an sysndir system
10750 set sys/ndir.h i_sysndir
10753 : see if closedir exists
10754 set closedir d_closedir
10757 case "$d_closedir" in
10760 echo "Checking whether closedir() returns a status..." >&4
10761 cat > closedir.c <<EOM
10762 #$i_dirent I_DIRENT /**/
10763 #$i_sysdir I_SYS_DIR /**/
10764 #$i_sysndir I_SYS_NDIR /**/
10765 #$i_systypes I_SYS_TYPES /**/
10767 #if defined(I_SYS_TYPES)
10768 #include <sys/types.h>
10770 #if defined(I_DIRENT)
10771 #include <dirent.h>
10772 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10773 #include <sys/dir.h>
10777 #include <sys/ndir.h>
10781 #include <ndir.h> /* may be wrong in the future */
10783 #include <sys/dir.h>
10788 int main() { return closedir(opendir(".")); }
10791 if eval $compile_ok; then
10792 if ./closedir > /dev/null 2>&1 ; then
10793 echo "Yes, it does."
10796 echo "No, it doesn't."
10800 echo "(I can't seem to compile the test program--assuming it doesn't)"
10808 set d_void_closedir
10811 : check for volatile keyword
10813 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10814 $cat >try.c <<'EOCP'
10817 typedef struct _goo_struct goo_struct;
10818 goo_struct * volatile goo = ((goo_struct *)0);
10819 struct _goo_struct {
10824 typedef unsigned short foo_t;
10825 char *volatile foo;
10827 volatile foo_t blech;
10831 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10833 echo "Yup, it does."
10836 echo "Nope, it doesn't."
10842 : see if there is a wait4
10846 : see if waitpid exists
10847 set waitpid d_waitpid
10850 : see if wcstombs exists
10851 set wcstombs d_wcstombs
10854 : see if wctomb exists
10855 set wctomb d_wctomb
10858 : preserve RCS keywords in files with variable substitution, grrr
10863 Revision='$Revision'
10865 case "$crosscompile" in
10866 ''|[nN]*) crosscompile="$undef" ;;
10870 next|rhapsody) multiarch="$define" ;;
10872 case "$multiarch" in
10873 ''|[nN]*) multiarch="$undef" ;;
10876 : check for alignment requirements
10878 case "$crosscompile$multiarch" in
10881 You seem to be either cross-compiling or doing a multiarchitecture build,
10882 skipping the memory alignment check.
10885 case "$alignbytes" in
10886 '') alignbytes=8 ;;
10890 case "$alignbytes" in
10891 '') echo "Checking alignment constraints..." >&4
10892 $cat >try.c <<'EOCP'
10899 printf("%d\n", (char *)&try_algn.bar - (char *)&try_algn.foo);
10903 if eval $compile_ok; then
10907 echo "(I can't seem to compile the test program...)"
10910 *) dflt="$alignbytes"
10913 rp="Doubles must be aligned on a how-many-byte boundary?"
10921 : check for ordering of bytes in a long
10923 case "$crosscompile$multiarch" in
10926 You seem to be either cross-compiling or doing a multiarchitecture build,
10927 skipping the byteorder check.
10933 case "$byteorder" in
10936 In the following, larger digits indicate more significance. A big-endian
10937 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
10938 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
10939 machines may have weird orders like 3412. A Cray will report 87654321,
10940 an Alpha will report 12345678. If the test program works the default is
10942 I'm now running the test program...
10944 $cat >try.c <<'EOCP'
10951 char c[sizeof(long)];
10954 if (sizeof(long) > 4)
10955 u.l = (0x08070605L << 32) | 0x04030201L;
10958 for (i = 0; i < sizeof(long); i++)
10959 printf("%c", u.c[i]+'0');
10966 if eval $compile && ./try > /dev/null; then
10969 [1-4][1-4][1-4][1-4]|12345678|87654321)
10970 echo "(The test program ran ok.)"
10971 echo "byteorder=$dflt"
10974 ????|????????) echo "(The test program ran ok.)" ;;
10975 *) echo "(The test program didn't run right for some reason.)" ;;
10980 (I can't seem to compile the test program. Guessing big-endian...)
10983 case "$xxx_prompt" in
10985 rp="What is the order of bytes in a long?"
10999 : how do we catenate cpp tokens here?
11001 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11002 $cat >cpp_stuff.c <<'EOCP'
11003 #define RCAT(a,b)a/**/b
11004 #define ACAT(a,b)a ## b
11008 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11009 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11010 echo "Oh! Smells like ANSI's been here." >&4
11011 echo "We can catify or stringify, separately or together!"
11013 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11014 echo "Ah, yes! The good old days!" >&4
11015 echo "However, in the good old days we don't know how to stringify and"
11016 echo "catify at the same time."
11020 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11021 to have to edit the values of CAT[2-5] in config.h...
11023 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11027 : see if this is a db.h system
11033 : Check db version.
11035 echo "Checking Berkeley DB version ..." >&4
11041 #include <sys/types.h>
11046 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11047 int Major, Minor, Patch ;
11048 unsigned long Version ;
11049 (void)db_version(&Major, &Minor, &Patch) ;
11050 printf("You have Berkeley DB Version 2 or greater\n");
11052 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11053 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11054 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11055 Major, Minor, Patch) ;
11057 /* check that db.h & libdb are compatible */
11058 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11059 printf("db.h and libdb are incompatible\n") ;
11063 printf("db.h and libdb are compatible\n") ;
11065 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11066 + DB_VERSION_PATCH ;
11068 /* needs to be >= 2.3.4 */
11069 if (Version < 2003004) {
11070 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11071 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11077 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11078 printf("You have Berkeley DB Version 1\n");
11079 exit(0); /* DB version < 2: the coast is clear. */
11081 exit(1); /* <db.h> not Berkeley DB? */
11087 if eval $compile && ./try; then
11088 echo 'Looks OK.' >&4
11090 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11094 : Remove db from list of libraries to use
11095 echo "Removing unusable -ldb from library list" >&4
11096 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11099 echo "libs = $libs" >&4
11109 : Check the return type needed for hash
11111 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11117 #include <sys/types.h>
11120 #ifndef DB_VERSION_MAJOR
11121 u_int32_t hash_cb (ptr, size)
11129 info.hash = hash_cb;
11133 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11134 if $contains warning try.out >>/dev/null 2>&1 ; then
11137 db_hashtype='u_int32_t'
11140 : XXX Maybe we should just give up here.
11141 db_hashtype=u_int32_t
11143 echo "Help: I can't seem to compile the db test program." >&4
11144 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11147 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11149 *) db_hashtype=u_int32_t
11154 : Check the return type needed for prefix
11156 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11162 #include <sys/types.h>
11165 #ifndef DB_VERSION_MAJOR
11166 size_t prefix_cb (key1, key2)
11174 info.prefix = prefix_cb;
11178 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11179 if $contains warning try.out >>/dev/null 2>&1 ; then
11180 db_prefixtype='int'
11182 db_prefixtype='size_t'
11185 db_prefixtype='size_t'
11186 : XXX Maybe we should just give up here.
11188 echo "Help: I can't seem to compile the db test program." >&4
11189 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11192 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11194 *) db_prefixtype='size_t'
11198 : check for void type
11200 echo "Checking to see how well your C compiler groks the void type..." >&4
11201 case "$voidflags" in
11203 $cat >try.c <<'EOCP'
11209 extern void moo(); /* function returning void */
11210 void (*goo)(); /* ptr to func returning void */
11212 void *hue; /* generic ptr */
11225 int main() { sub(); }
11227 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11228 voidflags=$defvoidused
11229 echo "Good. It appears to support void to the level $package wants.">&4
11230 if $contains warning .out >/dev/null 2>&1; then
11231 echo "However, you might get some warnings that look like this:"
11235 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11236 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11237 echo "It supports 1..."
11238 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11239 echo "It also supports 2..."
11240 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11242 echo "And it supports 4 but not 8 definitely."
11244 echo "It doesn't support 4..."
11245 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11247 echo "But it supports 8."
11250 echo "Neither does it support 8."
11254 echo "It does not support 2..."
11255 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11257 echo "But it supports 4 and 8."
11259 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11261 echo "And it supports 4 but has not heard about 8."
11263 echo "However it supports 8 but not 4."
11268 echo "There is no support at all for void."
11273 case "$voidflags" in
11275 *) $cat >&4 <<'EOM'
11276 Support flag bits are:
11277 1: basic void declarations.
11278 2: arrays of pointers to functions returning void.
11279 4: operations between pointers to and addresses of void functions.
11280 8: generic void pointers.
11283 rp="Your void support flags add up to what?"
11291 : How can we generate normalized random numbers ?
11293 echo "Looking for a random number function..." >&4
11294 case "$randfunc" in
11296 if set drand48 val -f; eval $csym; $val; then
11298 echo "Good, found drand48()." >&4
11299 elif set random val -f; eval $csym; $val; then
11301 echo "OK, found random()." >&4
11304 echo "Yick, looks like I have to use rand()." >&4
11315 *-Dmy_rand=*|*-Dmy_srand=*)
11316 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11317 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11318 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11319 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11323 while $test "$cont"; do
11324 rp="Use which function to generate random numbers?"
11326 if $test "$ans" = "$dflt"; then
11332 if set $ans val -f; eval $csym; $val; then
11336 rp="I cannot find function $ans. Use that name anyway?"
11345 case "$randfunc" in
11347 drand01="drand48()"
11353 case "$randbits" in
11355 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11357 #$i_unistd I_UNISTD
11358 #$i_stdlib I_STDLIB
11361 # include <unistd.h>
11364 # include <stdlib.h>
11369 register unsigned long tmp;
11370 register unsigned long max = 0L;
11372 for (i = 1000; i; i--) {
11373 tmp = (unsigned long) $randfunc();
11374 if (tmp > max) max = tmp;
11376 for (i = 0; max; i++)
11382 if eval $compile_ok; then
11386 echo "(I can't seem to compile the test program...)"
11393 rp="How many bits does your $randfunc() function produce?"
11397 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11398 seedfunc="s$randfunc"
11399 randseedtype=unsigned
11403 rp="How many bits does your $randfunc() function produce?"
11406 seedfunc="s$randfunc"
11407 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11408 if set $seedfunc val -f; eval $csym; $val; then
11409 echo "(Using $seedfunc() to seed random generator)"
11411 echo "(Warning: no $seedfunc() to seed random generator)"
11414 randseedtype=unsigned
11422 echo "Determining whether or not we are on an EBCDIC system..." >&4
11423 $cat >tebcdic.c <<'EOM'
11426 if ('M'==0xd4) return 0;
11433 if eval $compile_ok; then
11435 echo "You have EBCDIC." >&4
11438 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11441 echo "I'm unable to compile the test program." >&4
11442 echo "I'll assume ASCII or some ISO Latin." >&4
11444 $rm -f tebcdic.c tebcdic
11450 Checking how to flush all pending stdio output...
11452 # I only know how to find the first 32 possibly open files on SunOS.
11453 # See also hints/sunos_4_1.sh and util.c --AD
11455 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11457 $cat >>try.c <<EOCP
11459 #$i_unistd I_UNISTD
11461 # include <unistd.h>
11463 #$d_sysconf HAS_SYSCONF
11464 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11465 #ifdef HAS_STDIO_STREAM_ARRAY
11466 # define STDIO_STREAM_ARRAY $stdio_stream_array
11469 FILE* p = fopen("try.out", "w");
11473 # ifdef TRY_FPRINTF
11477 #ifdef TRY_FFLUSH_NULL
11480 #ifdef TRY_FFLUSH_ALL
11482 long open_max = -1;
11483 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11484 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11486 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11487 open_max = sysconf(_SC_OPEN_MAX);
11490 open_max = FOPEN_MAX;
11493 open_max = OPEN_MAX;
11502 # ifdef HAS_STDIO_STREAM_ARRAY
11503 if (open_max > 0) {
11505 for (i = 0; i < open_max; i++)
11506 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11507 STDIO_STREAM_ARRAY[i]._file < open_max &&
11508 STDIO_STREAM_ARRAY[i]._flag)
11509 fflush(&STDIO_STREAM_ARRAY[i]);
11517 : first we have to find out how _not_ to flush
11518 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11520 set try -DTRY_FPUTC
11521 if eval $compile; then
11523 ./try$exe_ext 2>/dev/null
11524 if $test ! -s try.out -a "X$?" = X42; then
11530 set try -DTRY_FPRINTF
11532 if eval $compile; then
11534 ./try$exe_ext 2>/dev/null
11535 if $test ! -s try.out -a "X$?" = X42; then
11536 output=-DTRY_FPRINTF
11542 : check for fflush NULL behaviour
11543 case "$fflushNULL" in
11544 '') set try -DTRY_FFLUSH_NULL $output
11545 if eval $compile; then
11547 ./try$exe_ext 2>/dev/null
11549 if $test -s try.out -a "X$code" = X42; then
11550 fflushNULL="`$cat try.out`"
11552 if $test "X$code" != X42; then
11554 (If this test failed, don't worry, we'll try another method shortly.)
11559 $rm -f core try.core core.try.*
11560 case "$fflushNULL" in
11562 Your fflush(NULL) works okay.
11564 fflushNULL="$define"
11567 Your fflush(NULL) isn't working (contrary to ANSI C).
11569 fflushNULL="$undef"
11572 Cannot figure out whether your fflush(NULL) works or not.
11573 I'm assuming it doesn't (contrary to ANSI C).
11575 fflushNULL="$undef"
11579 $define|true|[yY]*)
11580 fflushNULL="$define"
11583 fflushNULL="$undef"
11586 : check explicit looping only if NULL did not work
11587 case "$fflushNULL" in
11589 : check for fflush all behaviour
11590 case "$fflushall" in
11591 '') set try -DTRY_FFLUSH_ALL $output
11592 if eval $compile; then
11594 (Now testing the other method--but note that also this may fail.)
11597 ./try$exe_ext 2>/dev/null
11598 if $test -s try.out -a "X$?" = X42; then
11599 fflushall="`$cat try.out`"
11602 $rm -f core try.core core.try.*
11603 case "$fflushall" in
11605 Whew. Flushing explicitly all the stdio streams works.
11607 fflushall="$define"
11610 Sigh. Flushing explicitly all the stdio streams doesn't work.
11615 Cannot figure out whether flushing stdio streams explicitly works or not.
11616 I'm assuming it doesn't.
11622 "$define"|true|[yY]*)
11623 fflushall="$define"
11630 *) fflushall="$undef"
11633 case "$fflushNULL$fflushall" in
11636 I cannot figure out how to flush pending stdio output.
11640 $rm -f try.* try$exe_ext
11642 : see what type file positions are declared as in the library
11643 rp="What is the type for file position used by fsetpos()?"
11644 set fpos_t fpostype long stdio.h sys/types.h
11647 : Store the full pathname to the ar program for use in the C program
11648 : Respect a hint or command line value for full_ar.
11653 : Store the full pathname to the sed program for use in the C program
11656 : see what type gids are declared as in the kernel
11658 echo "Looking for the type for group ids returned by getgid()."
11659 set gid_t gidtype xxx stdio.h sys/types.h
11663 xxx=`./findhdr sys/user.h`
11664 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
11666 unsigned) dflt="$1 $2" ;;
11670 *) dflt="$gidtype";;
11673 gid_t) echo "gid_t found." ;;
11674 *) rp="What is the type for group ids returned by getgid()?"
11680 : see if getgroups exists
11681 set getgroups d_getgrps
11684 : see if setgroups exists
11685 set setgroups d_setgrps
11689 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
11691 case "$d_getgrps$d_setgrps" in
11693 case "$groupstype" in
11694 '') dflt="$gidtype" ;;
11695 *) dflt="$groupstype" ;;
11698 What type of pointer is the second argument to getgroups() and setgroups()?
11699 Usually this is the same as group ids, $gidtype, but not always.
11702 rp='What type pointer is the second argument to getgroups() and setgroups()?'
11706 *) groupstype="$gidtype";;
11709 : see what type lseek is declared as in the kernel
11710 rp="What is the type used for lseek's offset on this system?"
11711 set off_t lseektype long stdio.h sys/types.h
11715 $echo $n "Checking to see how big your file offsets are...$c" >&4
11717 #include <sys/types.h>
11721 printf("%d\n", sizeof($lseektype));
11725 if eval $compile_ok; then
11727 $echo " $lseeksize bytes." >&4
11731 echo "(I can't seem to compile the test program. Guessing...)"
11732 rp="What is the size of your file offsets (in bytes)?"
11739 echo "Checking if your $make program sets \$(MAKE)..." >&4
11740 case "$make_set_make" in
11742 $sed 's/^X //' > testmake.mak << 'EOF'
11744 X @echo 'maketemp="$(MAKE)"'
11746 case "`$make -f testmake.mak 2>/dev/null`" in
11747 *maketemp=*) make_set_make='#' ;;
11748 *) make_set_make="MAKE=$make" ;;
11750 $rm -f testmake.mak
11753 case "$make_set_make" in
11754 '#') echo "Yup, it does.";;
11755 *) echo "Nope, it doesn't.";;
11758 : see what type is used for mode_t
11759 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
11760 set mode_t modetype int stdio.h sys/types.h
11763 : define a fucntion to check prototypes
11764 $cat > protochk <<EOSH
11767 optimize="$optimize"
11769 prototype="$prototype"
11774 $cat >> protochk <<'EOSH'
11779 while test $# -ge 2; do
11781 $define) echo "#include <$2>" >> try.c ;;
11782 literal) echo "$2" >> try.c ;;
11786 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
11787 cat >> try.c <<'EOCP'
11788 #ifdef CAN_PROTOTYPE
11789 #define _(args) args
11794 echo "$foo" >> try.c
11795 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
11796 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
11802 $eunicefix protochk
11804 : see what type is used for size_t
11805 rp="What is the type used for the length parameter for string functions?"
11806 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11809 : check for type of arguments to gethostbyaddr.
11810 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
11811 case "$d_gethbyaddr" in
11815 Checking to see what type of arguments are accepted by gethostbyaddr().
11817 hdrs="$define sys/types.h
11818 $d_socket sys/socket.h
11819 $i_niin netinet/in.h
11821 $i_unistd unistd.h"
11822 : The first arg can 'char *' or 'void *'
11823 : The second arg is some of integral type
11824 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
11825 for yyy in size_t long int; do
11826 case "$netdb_host_type" in
11827 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
11828 if ./protochk "$try" $hdrs; then
11829 echo "Your system accepts $xxx for the first arg."
11830 echo "...and $yyy for the second arg."
11831 netdb_host_type="$xxx"
11832 netdb_hlen_type="$yyy"
11838 : In case none of those worked, prompt the user.
11839 case "$netdb_host_type" in
11840 '') rp='What is the type for the 1st argument to gethostbyaddr?'
11843 netdb_host_type=$ans
11844 rp='What is the type for the 2nd argument to gethostbyaddr?'
11847 netdb_hlen_type=$ans
11851 *) : no gethostbyaddr, so pick harmless defaults
11852 netdb_host_type='char *'
11853 netdb_hlen_type="$sizetype"
11856 # Remove the "const" if needed. -- but then we'll have a
11858 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
11861 : check for type of argument to gethostbyname.
11862 if test "X$netdb_name_type" = X ; then
11863 case "$d_gethbyname" in
11867 Checking to see what type of argument is accepted by gethostbyname().
11869 hdrs="$define sys/types.h
11870 $d_socket sys/socket.h
11871 $i_niin netinet/in.h
11873 $i_unistd unistd.h"
11874 for xxx in "const char *" "char *"; do
11875 case "$netdb_name_type" in
11876 '') try="extern struct hostent *gethostbyname($xxx);"
11877 if ./protochk "$try" $hdrs; then
11878 echo "Your system accepts $xxx."
11879 netdb_name_type="$xxx"
11884 : In case none of those worked, prompt the user.
11885 case "$netdb_name_type" in
11886 '') rp='What is the type for the 1st argument to gethostbyname?'
11889 netdb_name_type=$ans
11893 *) : no gethostbyname, so pick harmless default
11894 netdb_name_type='char *'
11899 : check for type of 1st argument to getnetbyaddr.
11900 if test "X$netdb_net_type" = X ; then
11901 case "$d_getnbyaddr" in
11905 Checking to see what type of 1st argument is accepted by getnetbyaddr().
11907 hdrs="$define sys/types.h
11908 $d_socket sys/socket.h
11909 $i_niin netinet/in.h
11911 $i_unistd unistd.h"
11912 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
11913 case "$netdb_net_type" in
11914 '') try="extern struct netent *getnetbyaddr($xxx, int);"
11915 if ./protochk "$try" $hdrs; then
11916 echo "Your system accepts $xxx."
11917 netdb_net_type="$xxx"
11922 : In case none of those worked, prompt the user.
11923 case "$netdb_net_type" in
11924 '') rp='What is the type for the 1st argument to getnetbyaddr?'
11927 netdb_net_type=$ans
11931 *) : no getnetbyaddr, so pick harmless default
11932 netdb_net_type='long'
11936 : locate the preferred pager for this system
11950 '') dflt=/usr/ucb/more;;
11957 rp='What pager is used on your system?'
11961 : see what type pids are declared as in the kernel
11962 rp="What is the type of process ids on this system?"
11963 set pid_t pidtype int stdio.h sys/types.h
11966 : Find earliest binary compatible site_perl subdirectory perl can use.
11967 case "$bincompat5005" in
11968 "$define") xs_apiversion='5.005' ;;
11969 *) xs_apiversion=$apiversion ;; # The current site_perl version.
11971 : Find earliest pure perl site_perl subdirectory perl can use.
11972 : The versioned directories started at 5.005.
11973 pm_apiversion='5.005'
11975 : check for length of pointer
11979 $echo $n "Checking to see how big your pointers are...$c" >&4
11980 if test "$voidflags" -gt 7; then
11981 echo '#define VOID_PTR char *' > try.c
11983 echo '#define VOID_PTR void *' > try.c
11985 $cat >>try.c <<'EOCP'
11989 printf("%d\n", sizeof(VOID_PTR));
11994 if eval $compile_ok; then
11996 $echo " $ptrsize bytes." >&4
11999 echo "(I can't seem to compile the test program. Guessing...)" >&4
12000 rp="What is the size of a pointer (in bytes)?"
12008 : see if ar generates random libraries by itself
12010 echo "Checking how to generate random libraries on your machine..." >&4
12011 echo 'int bar1() { return bar2(); }' > bar1.c
12012 echo 'int bar2() { return 2; }' > bar2.c
12013 $cat > foo.c <<'EOP'
12014 int main() { printf("%d\n", bar1()); exit(0); }
12016 $cc $ccflags -c bar1.c >/dev/null 2>&1
12017 $cc $ccflags -c bar2.c >/dev/null 2>&1
12018 $cc $ccflags -c foo.c >/dev/null 2>&1
12019 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12020 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12021 ./foobar >/dev/null 2>&1; then
12022 echo "$ar appears to generate random libraries itself."
12025 elif $ar ts bar$_a >/dev/null 2>&1 &&
12026 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12027 ./foobar >/dev/null 2>&1; then
12028 echo "a table of contents needs to be added with '$ar ts'."
12035 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12036 $test -f $ranlib || ranlib=''
12039 if $test -n "$ranlib"; then
12040 echo "your system has '$ranlib'; we'll use that."
12043 echo "your system doesn't seem to support random libraries"
12044 echo "so we'll use lorder and tsort to order the libraries."
12051 : check for type of arguments to select.
12052 case "$selecttype" in
12053 '') case "$d_select" in
12056 Checking to see what type of arguments are accepted by select().
12058 hdrs="$define sys/types.h
12059 $i_systime sys/time.h
12060 $i_sysselct sys/select.h
12061 $d_socket sys/socket.h"
12062 : The first arg can be int, unsigned, or size_t
12063 : The last arg may or may not be 'const'
12065 : void pointer has been seen but using that
12066 : breaks the selectminbits test
12067 for xxx in 'fd_set *' 'int *'; do
12068 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12069 for tmo in 'struct timeval *' 'const struct timeval *'; do
12071 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12072 if ./protochk "$try" $hdrs; then
12073 echo "Your system accepts $xxx."
12082 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12083 case "$d_fd_set" in
12084 $define) dflt="fd_set *" ;;
12093 *) : no select, so pick a harmless default
12100 : check for the select 'width'
12101 case "$selectminbits" in
12102 '') case "$d_select" in
12106 Checking to see on how many bits at a time your select() operates...
12109 #include <sys/types.h>
12111 #$i_systime I_SYS_TIME
12112 #$i_systimek I_SYS_TIME_KERNEL
12117 # ifdef I_SYS_TIME_KERNEL
12120 # include <sys/time.h>
12121 # ifdef I_SYS_TIME_KERNEL
12125 #$i_sysselct I_SYS_SELECT
12126 #ifdef I_SYS_SELECT
12127 #include <sys/select.h>
12129 #$d_socket HAS_SOCKET
12131 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12135 #define S sizeof(*(b))
12137 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12138 #define NBITS (NBYTES * 8)
12147 fp = fopen("try.c", "r");
12153 b = ($selecttype)s;
12154 for (i = 0; i < NBITS; i++)
12158 select(fd + 1, b, 0, 0, &t);
12159 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12160 printf("%d\n", i + 1);
12165 if eval $compile_ok; then
12166 selectminbits=`./try`
12167 case "$selectminbits" in
12169 Cannot figure out on how many bits at a time your select() operates.
12170 I'll play safe and guess it is 32 bits.
12176 *) bits="$selectminbits bits" ;;
12178 echo "Your select() operates on $bits at a time." >&4
12180 rp='What is the minimum number of bits your select() operates on?'
12181 case "$byteorder" in
12182 1234|12345678) dflt=32 ;;
12187 selectminbits="$val"
12191 *) : no select, so pick a harmless default
12198 : Trace out the files included by signal.h, then look for SIGxxx names.
12199 : Remove SIGARRAYSIZE used by HPUX.
12200 : Remove SIGSTKSIZE used by Linux.
12201 : Remove SIGSTKSZ used by Posix.
12202 : Remove SIGTYP void lines used by OS2.
12203 xxx=`echo '#include <signal.h>' |
12204 $cppstdin $cppminus $cppflags 2>/dev/null |
12205 $grep '^[ ]*#.*include' |
12206 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
12207 : Check this list of files to be sure we have parsed the cpp output ok.
12208 : This will also avoid potentially non-existent files, such
12211 for xx in $xxx /dev/null ; do
12212 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
12214 : If we have found no files, at least try signal.h
12215 case "$xxxfiles" in
12216 '') xxxfiles=`./findhdr signal.h` ;;
12219 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
12220 print substr($2, 4, 20)
12222 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
12223 print substr($3, 4, 20)
12225 : Append some common names just in case the awk scan failed.
12226 xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
12227 xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
12228 xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
12229 xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
12230 : generate a few handy files for later
12231 $cat > signal.c <<'EOCP'
12232 #include <sys/types.h>
12233 #include <signal.h>
12237 /* Strange style to avoid deeply-nested #if/#else/#endif */
12240 # define NSIG (_NSIG)
12246 # define NSIG (SIGMAX+1)
12252 # define NSIG (SIG_MAX+1)
12258 # define NSIG (MAXSIG+1)
12264 # define NSIG (MAX_SIG+1)
12269 # ifdef SIGARRAYSIZE
12270 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
12276 # define NSIG (_sys_nsig) /* Solaris 2.5 */
12280 /* Default to some arbitrary number that's big enough to get most
12281 of the common signals.
12287 printf("NSIG %d\n", NSIG);
12293 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
12295 printf "#ifdef SIG"; printf $1; printf "\n"
12296 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
12297 printf $1; printf ");\n"
12301 printf "#endif /* JUST_NSIG */\n";
12305 $cat >signal.awk <<'EOP'
12306 BEGIN { ndups = 0 }
12307 $1 ~ /^NSIG$/ { nsig = $2 }
12308 ($1 !~ /^NSIG$/) && (NF == 2) {
12309 if ($2 > maxsig) { maxsig = $2 }
12310 if (sig_name[$2]) {
12311 dup_name[ndups] = $1
12312 dup_num[ndups] = $2
12324 printf("NSIG %d\n", nsig);
12325 for (n = 1; n < nsig; n++) {
12327 printf("%s %d\n", sig_name[n], sig_num[n])
12330 printf("NUM%d %d\n", n, n)
12333 for (n = 0; n < ndups; n++) {
12334 printf("%s %d\n", dup_name[n], dup_num[n])
12338 $cat >signal_cmd <<EOS
12340 if $test -s signal.lst; then
12341 echo "Using your existing signal.lst file"
12346 $cat >>signal_cmd <<'EOS'
12349 if eval $compile_ok; then
12350 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12352 echo "(I can't seem be able to compile the whole test program)" >&4
12353 echo "(I'll try it in little pieces.)" >&4
12354 set signal -DJUST_NSIG
12355 if eval $compile_ok; then
12356 ./signal$_exe > signal.nsg
12359 echo "I can't seem to figure out how many signals you have." >&4
12360 echo "Guessing 50." >&4
12361 echo 'NSIG 50' > signal.nsg
12363 : Now look at all the signal names, one at a time.
12364 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
12365 $cat > signal.c <<EOCP
12366 #include <sys/types.h>
12367 #include <signal.h>
12370 printf("$xx %d\n", SIG${xx});
12375 if eval $compile; then
12376 echo "SIG${xx} found."
12377 ./signal$_exe >> signal.ls1
12379 echo "SIG${xx} NOT found."
12382 if $test -s signal.ls1; then
12383 $cat signal.nsg signal.ls1 |
12384 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
12388 if $test -s signal.lst; then
12391 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
12392 echo 'kill -l' >signal
12393 set X `csh -f <signal`
12397 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
12399 echo $@ | $tr ' ' $trnl | \
12400 $awk '{ printf "%s %d\n", $1, ++s; }
12401 END { printf "NSIG %d\n", ++s }' >signal.lst
12403 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
12405 chmod a+x signal_cmd
12406 $eunicefix signal_cmd
12408 : generate list of signal names
12410 case "$sig_name_init" in
12412 *) case "$sig_num_init" in
12413 ''|*,*) doinit=yes ;;
12418 echo "Generating a list of signal names and numbers..." >&4
12420 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
12421 sig_name=`$awk 'BEGIN { printf "ZERO " }
12422 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
12423 sig_num=`$awk 'BEGIN { printf "0 " }
12424 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
12425 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
12426 !/^NSIG/ { printf "\"%s\", ", $1 }
12427 END { printf "0\n" }' signal.lst`
12428 sig_num_init=`$awk 'BEGIN { printf "0, " }
12429 !/^NSIG/ { printf "%d, ", $2}
12430 END { printf "0\n"}' signal.lst`
12433 echo "The following $sig_count signals are available:"
12435 echo $sig_name | $awk \
12436 'BEGIN { linelen = 0 }
12438 for (i = 1; i <= NF; i++) {
12439 name = "SIG" $i " "
12440 linelen = linelen + length(name)
12441 if (linelen > 70) {
12443 linelen = length(name)
12449 $rm -f signal signal.c signal.awk signal.lst signal_cmd
12451 : see what type is used for signed size_t
12452 set ssize_t ssizetype int stdio.h sys/types.h
12455 $cat > ssize.c <<EOM
12457 #include <sys/types.h>
12458 #define Size_t $sizetype
12459 #define SSize_t $dflt
12462 if (sizeof(Size_t) == sizeof(SSize_t))
12464 else if (sizeof(Size_t) == sizeof(int))
12473 if eval $compile_ok && ./ssize > /dev/null; then
12474 ssizetype=`./ssize`
12475 echo "I'll be using $ssizetype for functions returning a byte count." >&4
12478 Help! I can't compile and run the ssize_t test program: please enlighten me!
12479 (This is probably a misconfiguration in your system or libraries, and
12480 you really ought to fix it. Still, I'll try anyway.)
12482 I need a type that is the same size as $sizetype, but is guaranteed to
12483 be signed. Common values are ssize_t, int and long.
12486 rp="What signed type is the same size as $sizetype?"
12490 $rm -f ssize ssize.*
12492 : see what type of char stdio uses.
12494 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12495 echo "Your stdio uses unsigned chars." >&4
12496 stdchar="unsigned char"
12498 echo "Your stdio uses signed chars." >&4
12502 : see if time exists
12504 if test "X$d_time" = X -o X"$timetype" = X; then
12505 if set time val -f d_time; eval $csym; $val; then
12506 echo 'time() found.' >&4
12508 rp="What is the type returned by time() on this system?"
12509 set time_t timetype long stdio.h sys/types.h
12512 echo 'time() not found, hope that will do.' >&4
12520 : see what type uids are declared as in the kernel
12522 echo "Looking for the type for user ids returned by getuid()."
12523 set uid_t uidtype xxx stdio.h sys/types.h
12527 xxx=`./findhdr sys/user.h`
12528 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
12530 unsigned) dflt="$1 $2" ;;
12534 *) dflt="$uidtype";;
12537 uid_t) echo "uid_t found." ;;
12538 *) rp="What is the type for user ids returned by getuid()?"
12546 *_t) zzz="$uidtype" ;;
12549 echo "Checking the sign of $zzz..." >&4
12551 #include <sys/types.h>
12562 if eval $compile; then
12566 echo "(I can't execute the test program--guessing unsigned.)" >&4
12570 1) echo "Your $zzz is unsigned." ;;
12571 -1) echo "Your $zzz is signed." ;;
12577 echo "(I can't compile the test program--guessing unsigned.)" >&4
12581 : see if dbm.h is available
12582 : see if dbmclose exists
12583 set dbmclose d_dbmclose
12586 case "$d_dbmclose" in
12596 *) set rpcsvc/dbm.h i_rpcsvcdbm
12601 *) echo "We won't be including <dbm.h>"
12611 : see if this is a sys/file.h system
12616 : do we need to include sys/file.h ?
12620 if $h_sysfile; then
12622 echo "We'll be including <sys/file.h>." >&4
12625 echo "We won't be including <sys/file.h>." >&4
12635 : see if fcntl.h is there
12640 : see if we can include fcntl.h
12646 echo "We'll be including <fcntl.h>." >&4
12649 if $h_sysfile; then
12650 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12652 echo "We won't be including <fcntl.h>." >&4
12664 : see if locale.h is available
12665 set locale.h i_locale
12668 : see if mach cthreads are available
12669 if test "X$usethreads" = "X$define"; then
12670 set mach/cthreads.h i_machcthr
12673 i_machcthr="$undef"
12678 : see if this is a math.h system
12682 : see if this is a mntent.h system
12683 set mntent.h i_mntent
12686 : see if ndbm.h is available
12691 : see if dbm_open exists
12692 set dbm_open d_dbm_open
12694 case "$d_dbm_open" in
12697 echo "We won't be including <ndbm.h>"
12706 : see if net/errno.h is available
12708 set net/errno.h val
12711 : Unfortunately, it causes problems on some systems. Arrgh.
12714 cat > try.c <<'EOM'
12717 #include <net/errno.h>
12723 if $cc $ccflags -c try.c >/dev/null 2>&1; then
12724 echo "We'll be including <net/errno.h>." >&4
12726 echo "We won't be including <net/errno.h>." >&4
12735 : see if netinet/tcp.h is available
12736 set netinet/tcp.h i_netinettcp
12739 : see if this is a poll.h system
12743 : get C preprocessor symbols handy
12745 $echo $n "Hmm... $c"
12746 echo $al | $tr ' ' $trnl >Cppsym.know
12747 $cat <<EOSS >Cppsym
12755 case "\$list\$#" in
12758 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
12760 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
12763 unknown="\$unknown \$sym"
12773 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
12775 exit 0; _ _ _ _\1\\ \1\\
12778 echo "exit 1; _ _ _" >>Cppsym\$\$
12779 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
12781 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
12787 $rm -f Cppsym\$\$ Cppsym2\$\$
12792 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
12794 : now check the C compiler for additional symbols
12795 postprocess_cc_v=''
12797 aix) postprocess_cc_v="|$tr , ' '" ;;
12804 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
12807 -D*) echo "\$i" | $sed 's/^-D//';;
12808 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
12813 postprocess_cc_v=''
12816 ./ccsym > ccsym1.raw
12817 if $test -s ccsym1.raw; then
12818 $sort ccsym1.raw | $uniq >ccsym.raw
12820 mv ccsym1.raw ccsym.raw
12823 $awk '/\=/ { print $0; next }
12824 { print $0"=1" }' ccsym.raw >ccsym.list
12825 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
12826 $comm -13 ccsym.true ccsym.list >ccsym.own
12827 $comm -12 ccsym.true ccsym.list >ccsym.com
12828 $comm -23 ccsym.true ccsym.list >ccsym.cpp
12830 if $test -z ccsym.raw; then
12831 echo "Your C compiler doesn't seem to define any symbols!" >&4
12833 echo "However, your C preprocessor defines the following symbols:"
12836 cppsymbols=`$cat Cppsym.true`
12837 cppsymbols=`echo $cppsymbols`
12838 cppccsymbols="$cppsymbols"
12840 if $test -s ccsym.com; then
12841 echo "Your C compiler and pre-processor define these symbols:"
12842 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
12845 cppccsymbols=`$cat ccsym.com`
12846 cppccsymbols=`echo $cppccsymbols`
12847 $test "$silent" || sleep 1
12849 if $test -s ccsym.cpp; then
12850 $test "$also" && echo " "
12851 echo "Your C pre-processor ${also}defines the following symbols:"
12852 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
12854 cppsymbols=`$cat ccsym.cpp`
12855 cppsymbols=`echo $cppsymbols`
12856 $test "$silent" || sleep 1
12858 if $test -s ccsym.own; then
12859 $test "$also" && echo " "
12860 echo "Your C compiler ${also}defines the following cpp symbols:"
12861 $sed -e 's/\(.*\)=1/\1/' ccsym.own
12862 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
12863 ccsymbols=`$cat ccsym.own`
12864 ccsymbols=`echo $ccsymbols`
12865 $test "$silent" || sleep 1
12870 : see if this is a termio system
12874 if $test `./findhdr termios.h`; then
12875 set tcsetattr i_termios
12881 "$define") echo "You have POSIX termios.h... good!" >&4;;
12882 *) if ./Cppsym pyr; then
12883 case "`/bin/universe`" in
12884 ucb) if $test `./findhdr sgtty.h`; then
12886 echo "<sgtty.h> found." >&4
12888 echo "System is pyramid with BSD universe."
12889 echo "<sgtty.h> not found--you could have problems." >&4
12891 *) if $test `./findhdr termio.h`; then
12893 echo "<termio.h> found." >&4
12895 echo "System is pyramid with USG universe."
12896 echo "<termio.h> not found--you could have problems." >&4
12900 if $test `./findhdr termio.h`; then
12901 echo "<termio.h> found." >&4
12903 elif $test `./findhdr sgtty.h`; then
12904 echo "<sgtty.h> found." >&4
12907 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
12910 if $test `./findhdr sgtty.h`; then
12911 echo "<sgtty.h> found." >&4
12913 elif $test `./findhdr termio.h`; then
12914 echo "<termio.h> found." >&4
12917 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
12921 set i_termio; eval $setvar
12922 val=$val2; set i_sgtty; eval $setvar
12923 val=$val3; set i_termios; eval $setvar
12925 : see if this is a shadow.h system
12926 set shadow.h i_shadow
12929 : see if this is a socks.h system
12930 set socks.h i_socks
12933 : see if stdarg is available
12935 if $test `./findhdr stdarg.h`; then
12936 echo "<stdarg.h> found." >&4
12939 echo "<stdarg.h> NOT found." >&4
12943 : see if varags is available
12945 if $test `./findhdr varargs.h`; then
12946 echo "<varargs.h> found." >&4
12948 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
12951 : set up the varargs testing programs
12952 $cat > varargs.c <<EOP
12954 #include <stdarg.h>
12957 #include <varargs.h>
12961 int f(char *p, ...)
12975 p = va_arg(ap, char *);
12980 $cat > varargs <<EOP
12982 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
12991 : now check which varargs header should be included
12996 if `./varargs I_STDARG`; then
12998 elif `./varargs I_VARARGS`; then
13003 if `./varargs I_VARARGS`; then
13010 echo "I could not find the definition for va_dcl... You have problems..." >&4
13011 val="$undef"; set i_stdarg; eval $setvar
13012 val="$undef"; set i_varargs; eval $setvar
13017 case "$i_varhdr" in
13019 val="$define"; set i_stdarg; eval $setvar
13020 val="$undef"; set i_varargs; eval $setvar
13023 val="$undef"; set i_stdarg; eval $setvar
13024 val="$define"; set i_varargs; eval $setvar
13027 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13031 : see if stddef is available
13032 set stddef.h i_stddef
13035 : see if sys/access.h is available
13036 set sys/access.h i_sysaccess
13039 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13040 set sys/filio.h i_sysfilio
13043 if $test `./findhdr sys/ioctl.h`; then
13045 echo '<sys/ioctl.h> found.' >&4
13048 if $test $i_sysfilio = "$define"; then
13049 echo '<sys/ioctl.h> NOT found.' >&4
13051 $test $i_sgtty = "$define" && xxx="sgtty.h"
13052 $test $i_termio = "$define" && xxx="termio.h"
13053 $test $i_termios = "$define" && xxx="termios.h"
13054 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13060 : see if sys/resource.h has to be included
13061 set sys/resource.h i_sysresrc
13064 : see if sys/security.h is available
13065 set sys/security.h i_syssecrt
13068 : see if this is a sys/statvfs.h system
13069 set sys/statvfs.h i_sysstatvfs
13072 : see if this is a sys/uio.h system
13073 set sys/uio.h i_sysuio
13076 echo "Checking to see if your system supports struct iovec..." >&4
13077 set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
13079 case "$d_iovec_s" in
13080 "$define") echo "Yup, it does." >&4
13082 *) echo "Nope, it doesn't." >&4
13086 : see if this is a sys/un.h system
13087 set sys/un.h i_sysun
13090 : see if this is a syswait system
13091 set sys/wait.h i_syswait
13094 : see if this is a ustat.h system
13095 set ustat.h i_ustat
13098 : see if this is an utime system
13099 set utime.h i_utime
13102 : see if this is a values.h system
13103 set values.h i_values
13106 : see if this is a vfork system
13109 set vfork.h i_vfork
13117 : see if gdbm.h is available
13122 : see if gdbm_open exists
13123 set gdbm_open d_gdbm_open
13125 case "$d_gdbm_open" in
13128 echo "We won't be including <gdbm.h>"
13138 echo "Looking for extensions..." >&4
13139 : If we are using the old config.sh, known_extensions may contain
13140 : old or inaccurate or duplicate values.
13141 known_extensions=''
13142 nonxs_extensions=''
13143 : We do not use find because it might not be available.
13144 : We do not just use MANIFEST because the user may have dropped
13145 : some additional extensions into the source tree and expect them
13148 : Function to recursively find available extensions, ignoring DynaLoader
13149 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
13153 DynaLoader|dynaload) ;;
13155 if $test -f $xxx/$xxx.xs; then
13156 known_extensions="$known_extensions $1$xxx";
13157 elif $test -f $xxx/Makefile.PL; then
13158 nonxs_extensions="$nonxs_extensions $1$xxx";
13160 if $test -d $xxx -a $# -lt 10; then
13163 eval $find_extensions;
13175 eval $find_extensions
13176 set X $nonxs_extensions
13178 nonxs_extensions="$*"
13179 set X $known_extensions
13181 known_extensions="$*"
13184 : Now see which are supported on this system.
13186 for xxx in $known_extensions ; do
13190 $define) avail_ext="$avail_ext $xxx" ;;
13193 GDBM_File|gdbm_fil)
13195 $define) avail_ext="$avail_ext $xxx" ;;
13198 NDBM_File|ndbm_fil)
13200 $define) avail_ext="$avail_ext $xxx" ;;
13203 ODBM_File|odbm_fil)
13204 case "${i_dbm}${i_rpcsvcdbm}" in
13205 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13209 case "$useposix" in
13210 true|define|y) avail_ext="$avail_ext $xxx" ;;
13214 case "$useopcode" in
13215 true|define|y) avail_ext="$avail_ext $xxx" ;;
13219 case "$d_socket" in
13220 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13224 case "$usethreads" in
13225 true|$define|y) avail_ext="$avail_ext $xxx" ;;
13229 : XXX Do we need a useipcsysv variable here
13230 case "${d_msg}${d_sem}${d_shm}" in
13231 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
13234 *) avail_ext="$avail_ext $xxx"
13243 : Now see which nonxs extensions are supported on this system.
13244 : For now assume all are.
13246 for xxx in $nonxs_extensions ; do
13248 *) nonxs_ext="$nonxs_ext $xxx"
13260 A number of extensions are supplied with $package. You may choose to
13261 compile these extensions for dynamic loading (the default), compile
13262 them into the $package executable (static loading), or not include
13263 them at all. Answer "none" to include no extensions.
13264 Note that DynaLoader is always built and need not be mentioned here.
13267 case "$dynamic_ext" in
13268 '') dflt="$avail_ext" ;;
13269 *) dflt="$dynamic_ext"
13270 # Perhaps we are reusing an old out-of-date config.sh.
13273 if test X"$dynamic_ext" != X"$avail_ext"; then
13275 NOTICE: Your previous config.sh list may be incorrect.
13276 The extensions now available to you are
13278 but the default list from your previous config.sh is
13290 rp="What extensions do you wish to load dynamically?"
13293 none) dynamic_ext=' ' ;;
13294 *) dynamic_ext="$ans" ;;
13297 case "$static_ext" in
13299 : Exclude those already listed in dynamic linking
13301 for xxx in $avail_ext; do
13302 case " $dynamic_ext " in
13304 *) dflt="$dflt $xxx" ;;
13311 *) dflt="$static_ext"
13318 rp="What extensions do you wish to load statically?"
13321 none) static_ext=' ' ;;
13322 *) static_ext="$ans" ;;
13327 A number of extensions are supplied with $package. Answer "none"
13328 to include no extensions.
13329 Note that DynaLoader is always built and need not be mentioned here.
13332 case "$static_ext" in
13333 '') dflt="$avail_ext" ;;
13334 *) dflt="$static_ext"
13335 # Perhaps we are reusing an old out-of-date config.sh.
13338 if test X"$static_ext" != X"$avail_ext"; then
13340 NOTICE: Your previous config.sh list may be incorrect.
13341 The extensions now available to you are
13343 but the default list from your previous config.sh is
13352 : Exclude those that are not xs extensions
13356 rp="What extensions do you wish to include?"
13359 none) static_ext=' ' ;;
13360 *) static_ext="$ans" ;;
13365 set X $dynamic_ext $static_ext $nonxs_ext
13369 : Remove build directory name from cppstdin so it can be used from
13370 : either the present location or the final installed location.
13372 : Get out of the UU directory to get correct path name.
13374 case "$cppstdin" in
13376 echo "Stripping down cppstdin path name"
13382 : end of configuration questions
13384 echo "End of configuration questions."
13387 : back to where it started
13388 if test -d ../UU; then
13392 : configuration may be patched via a 'config.over' file
13393 if $test -f config.over; then
13396 rp='I see a config.over file. Do you wish to load it?'
13399 n*) echo "OK, I'll ignore it.";;
13401 echo "Configuration override changes have been loaded."
13406 : in case they want portability, strip down executable paths
13407 case "$d_portable" in
13410 echo "Stripping down executable paths..." >&4
13411 for file in $loclist $trylist; do
13413 eval $file=`basename $temp`
13418 : create config.sh file
13420 echo "Creating config.sh..." >&4
13421 $spitshell <<EOT >config.sh
13424 # This file was produced by running the Configure script. It holds all the
13425 # definitions figured out by Configure. Should you modify one of these values,
13426 # do not forget to propagate your changes by running "Configure -der". You may
13427 # instead choose to run each of the .SH files by yourself, or "Configure -S".
13430 # Package name : $package
13431 # Source directory : $src
13432 # Configuration time: $cf_time
13433 # Configured by : $cf_by
13434 # Target system : $myuname
13444 Revision='$Revision'
13451 alignbytes='$alignbytes'
13452 ansi2knr='$ansi2knr'
13453 aphostname='$aphostname'
13454 apiversion='$apiversion'
13457 archlibexp='$archlibexp'
13458 archname64='$archname64'
13459 archname='$archname'
13460 archobjs='$archobjs'
13465 bincompat5005='$bincompat5005'
13469 byteorder='$byteorder'
13471 castflags='$castflags'
13474 cccdlflags='$cccdlflags'
13475 ccdlflags='$ccdlflags'
13477 ccsymbols='$ccsymbols'
13479 cf_email='$cf_email'
13484 clocktype='$clocktype'
13486 compress='$compress'
13487 contains='$contains'
13491 cpp_stuff='$cpp_stuff'
13492 cppccsymbols='$cppccsymbols'
13493 cppflags='$cppflags'
13495 cppminus='$cppminus'
13497 cppstdin='$cppstdin'
13498 cppsymbols='$cppsymbols'
13499 crosscompile='$crosscompile'
13500 cryptlib='$cryptlib'
13502 d_Gconvert='$d_Gconvert'
13503 d_PRIEldbl='$d_PRIEldbl'
13504 d_PRIFldbl='$d_PRIFldbl'
13505 d_PRIGldbl='$d_PRIGldbl'
13506 d_PRIX64='$d_PRIX64'
13507 d_PRId64='$d_PRId64'
13508 d_PRIeldbl='$d_PRIeldbl'
13509 d_PRIfldbl='$d_PRIfldbl'
13510 d_PRIgldbl='$d_PRIgldbl'
13511 d_PRIi64='$d_PRIi64'
13512 d_PRIo64='$d_PRIo64'
13513 d_PRIu64='$d_PRIu64'
13514 d_PRIx64='$d_PRIx64'
13515 d_access='$d_access'
13516 d_accessx='$d_accessx'
13518 d_archlib='$d_archlib'
13521 d_attribut='$d_attribut'
13524 d_bincompat5005='$d_bincompat5005'
13526 d_bsdgetpgrp='$d_bsdgetpgrp'
13527 d_bsdsetpgrp='$d_bsdsetpgrp'
13529 d_casti32='$d_casti32'
13530 d_castneg='$d_castneg'
13531 d_charvspr='$d_charvspr'
13533 d_chroot='$d_chroot'
13534 d_chsize='$d_chsize'
13535 d_closedir='$d_closedir'
13539 d_cuserid='$d_cuserid'
13540 d_dbl_dig='$d_dbl_dig'
13541 d_difftime='$d_difftime'
13542 d_dirnamlen='$d_dirnamlen'
13543 d_dlerror='$d_dlerror'
13544 d_dlopen='$d_dlopen'
13545 d_dlsymun='$d_dlsymun'
13546 d_dosuid='$d_dosuid'
13547 d_drand48proto='$d_drand48proto'
13549 d_eaccess='$d_eaccess'
13550 d_endgrent='$d_endgrent'
13551 d_endhent='$d_endhent'
13552 d_endnent='$d_endnent'
13553 d_endpent='$d_endpent'
13554 d_endpwent='$d_endpwent'
13555 d_endsent='$d_endsent'
13556 d_endspent='$d_endspent'
13557 d_eofnblk='$d_eofnblk'
13558 d_eunice='$d_eunice'
13559 d_fchmod='$d_fchmod'
13560 d_fchown='$d_fchown'
13562 d_fd_macros='$d_fd_macros'
13563 d_fd_set='$d_fd_set'
13564 d_fds_bits='$d_fds_bits'
13565 d_fgetpos='$d_fgetpos'
13566 d_flexfnam='$d_flexfnam'
13569 d_fpathconf='$d_fpathconf'
13570 d_fpos64_t='$d_fpos64_t'
13571 d_fs_data_s='$d_fs_data_s'
13572 d_fseeko='$d_fseeko'
13573 d_fsetpos='$d_fsetpos'
13574 d_fstatfs='$d_fstatfs'
13575 d_fstatvfs='$d_fstatvfs'
13576 d_ftello='$d_ftello'
13578 d_getgrent='$d_getgrent'
13579 d_getgrps='$d_getgrps'
13580 d_gethbyaddr='$d_gethbyaddr'
13581 d_gethbyname='$d_gethbyname'
13582 d_gethent='$d_gethent'
13583 d_gethname='$d_gethname'
13584 d_gethostprotos='$d_gethostprotos'
13585 d_getlogin='$d_getlogin'
13586 d_getmnt='$d_getmnt'
13587 d_getmntent='$d_getmntent'
13588 d_getnbyaddr='$d_getnbyaddr'
13589 d_getnbyname='$d_getnbyname'
13590 d_getnent='$d_getnent'
13591 d_getnetprotos='$d_getnetprotos'
13592 d_getpbyname='$d_getpbyname'
13593 d_getpbynumber='$d_getpbynumber'
13594 d_getpent='$d_getpent'
13595 d_getpgid='$d_getpgid'
13596 d_getpgrp2='$d_getpgrp2'
13597 d_getpgrp='$d_getpgrp'
13598 d_getppid='$d_getppid'
13599 d_getprior='$d_getprior'
13600 d_getprotoprotos='$d_getprotoprotos'
13601 d_getpwent='$d_getpwent'
13602 d_getsbyname='$d_getsbyname'
13603 d_getsbyport='$d_getsbyport'
13604 d_getsent='$d_getsent'
13605 d_getservprotos='$d_getservprotos'
13606 d_getspent='$d_getspent'
13607 d_getspnam='$d_getspnam'
13608 d_gettimeod='$d_gettimeod'
13609 d_gnulibc='$d_gnulibc'
13610 d_grpasswd='$d_grpasswd'
13611 d_hasmntopt='$d_hasmntopt'
13614 d_inetaton='$d_inetaton'
13615 d_int64t='$d_int64t'
13616 d_iovec_s='$d_iovec_s'
13617 d_isascii='$d_isascii'
13618 d_killpg='$d_killpg'
13619 d_lchown='$d_lchown'
13620 d_ldbl_dig='$d_ldbl_dig'
13622 d_llseek='$d_llseek'
13623 d_locconv='$d_locconv'
13625 d_longdbl='$d_longdbl'
13626 d_longlong='$d_longlong'
13629 d_mbstowcs='$d_mbstowcs'
13630 d_mbtowc='$d_mbtowc'
13631 d_memchr='$d_memchr'
13632 d_memcmp='$d_memcmp'
13633 d_memcpy='$d_memcpy'
13634 d_memmove='$d_memmove'
13635 d_memset='$d_memset'
13637 d_mkfifo='$d_mkfifo'
13638 d_mktime='$d_mktime'
13640 d_msg_ctrunc='$d_msg_ctrunc'
13641 d_msg_dontroute='$d_msg_dontroute'
13642 d_msg_oob='$d_msg_oob'
13643 d_msg_peek='$d_msg_peek'
13644 d_msg_proxy='$d_msg_proxy'
13645 d_msgctl='$d_msgctl'
13646 d_msgget='$d_msgget'
13647 d_msgrcv='$d_msgrcv'
13648 d_msgsnd='$d_msgsnd'
13649 d_mymalloc='$d_mymalloc'
13651 d_off64_t='$d_off64_t'
13652 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
13653 d_oldpthreads='$d_oldpthreads'
13654 d_oldsock='$d_oldsock'
13656 d_pathconf='$d_pathconf'
13658 d_phostname='$d_phostname'
13661 d_portable='$d_portable'
13662 d_pthread_yield='$d_pthread_yield'
13664 d_pwchange='$d_pwchange'
13665 d_pwclass='$d_pwclass'
13666 d_pwcomment='$d_pwcomment'
13667 d_pwexpire='$d_pwexpire'
13668 d_pwgecos='$d_pwgecos'
13669 d_pwpasswd='$d_pwpasswd'
13670 d_pwquota='$d_pwquota'
13671 d_readdir='$d_readdir'
13672 d_readlink='$d_readlink'
13673 d_rename='$d_rename'
13674 d_rewinddir='$d_rewinddir'
13676 d_safebcpy='$d_safebcpy'
13677 d_safemcpy='$d_safemcpy'
13678 d_sanemcmp='$d_sanemcmp'
13679 d_sched_yield='$d_sched_yield'
13680 d_scm_rights='$d_scm_rights'
13681 d_seekdir='$d_seekdir'
13682 d_select='$d_select'
13684 d_semctl='$d_semctl'
13685 d_semctl_semid_ds='$d_semctl_semid_ds'
13686 d_semctl_semun='$d_semctl_semun'
13687 d_semget='$d_semget'
13689 d_setegid='$d_setegid'
13690 d_seteuid='$d_seteuid'
13691 d_setgrent='$d_setgrent'
13692 d_setgrps='$d_setgrps'
13693 d_sethent='$d_sethent'
13694 d_setlinebuf='$d_setlinebuf'
13695 d_setlocale='$d_setlocale'
13696 d_setnent='$d_setnent'
13697 d_setpent='$d_setpent'
13698 d_setpgid='$d_setpgid'
13699 d_setpgrp2='$d_setpgrp2'
13700 d_setpgrp='$d_setpgrp'
13701 d_setprior='$d_setprior'
13702 d_setpwent='$d_setpwent'
13703 d_setregid='$d_setregid'
13704 d_setresgid='$d_setresgid'
13705 d_setresuid='$d_setresuid'
13706 d_setreuid='$d_setreuid'
13707 d_setrgid='$d_setrgid'
13708 d_setruid='$d_setruid'
13709 d_setsent='$d_setsent'
13710 d_setsid='$d_setsid'
13711 d_setspent='$d_setspent'
13712 d_setvbuf='$d_setvbuf'
13716 d_shmatprototype='$d_shmatprototype'
13717 d_shmctl='$d_shmctl'
13719 d_shmget='$d_shmget'
13720 d_sigaction='$d_sigaction'
13721 d_sigsetjmp='$d_sigsetjmp'
13722 d_socket='$d_socket'
13723 d_sockpair='$d_sockpair'
13725 d_statblks='$d_statblks'
13726 d_statfs_f_flags='$d_statfs_f_flags'
13727 d_statfs_s='$d_statfs_s'
13728 d_statvfs='$d_statvfs'
13729 d_stdio_cnt_lval='$d_stdio_cnt_lval'
13730 d_stdio_ptr_lval='$d_stdio_ptr_lval'
13731 d_stdio_stream_array='$d_stdio_stream_array'
13732 d_stdiobase='$d_stdiobase'
13733 d_stdstdio='$d_stdstdio'
13734 d_strchr='$d_strchr'
13735 d_strcoll='$d_strcoll'
13736 d_strctcpy='$d_strctcpy'
13737 d_strerrm='$d_strerrm'
13738 d_strerror='$d_strerror'
13739 d_strtod='$d_strtod'
13740 d_strtol='$d_strtol'
13741 d_strtoul='$d_strtoul'
13742 d_strtoull='$d_strtoull'
13743 d_strxfrm='$d_strxfrm'
13744 d_suidsafe='$d_suidsafe'
13745 d_symlink='$d_symlink'
13746 d_syscall='$d_syscall'
13747 d_sysconf='$d_sysconf'
13748 d_sysernlst='$d_sysernlst'
13749 d_syserrlst='$d_syserrlst'
13750 d_system='$d_system'
13751 d_tcgetpgrp='$d_tcgetpgrp'
13752 d_tcsetpgrp='$d_tcsetpgrp'
13753 d_telldir='$d_telldir'
13754 d_telldirproto='$d_telldirproto'
13757 d_truncate='$d_truncate'
13758 d_tzname='$d_tzname'
13761 d_union_semun='$d_union_semun'
13763 d_vendorbin='$d_vendorbin'
13764 d_vendorlib='$d_vendorlib'
13766 d_void_closedir='$d_void_closedir'
13767 d_voidsig='$d_voidsig'
13768 d_voidtty='$d_voidtty'
13769 d_volatile='$d_volatile'
13770 d_vprintf='$d_vprintf'
13772 d_waitpid='$d_waitpid'
13773 d_wcstombs='$d_wcstombs'
13774 d_wctomb='$d_wctomb'
13777 db_hashtype='$db_hashtype'
13778 db_prefixtype='$db_prefixtype'
13779 defvoidused='$defvoidused'
13780 direntrytype='$direntrytype'
13783 doublesize='$doublesize'
13785 dynamic_ext='$dynamic_ext'
13791 eunicefix='$eunicefix'
13794 extensions='$extensions'
13795 fflushNULL='$fflushNULL'
13796 fflushall='$fflushall'
13798 firstmakefile='$firstmakefile'
13800 fpostype='$fpostype'
13801 freetype='$freetype'
13803 full_csh='$full_csh'
13804 full_sed='$full_sed'
13805 gccversion='$gccversion'
13809 groupcat='$groupcat'
13810 groupstype='$groupstype'
13813 h_sysfile='$h_sysfile'
13817 i_arpainet='$i_arpainet'
13818 i_bsdioctl='$i_bsdioctl'
13821 i_dirent='$i_dirent'
13828 i_inttypes='$i_inttypes'
13829 i_limits='$i_limits'
13830 i_locale='$i_locale'
13831 i_machcthr='$i_machcthr'
13832 i_malloc='$i_malloc'
13834 i_memory='$i_memory'
13835 i_mntent='$i_mntent'
13838 i_neterrno='$i_neterrno'
13839 i_netinettcp='$i_netinettcp'
13842 i_pthread='$i_pthread'
13844 i_rpcsvcdbm='$i_rpcsvcdbm'
13847 i_shadow='$i_shadow'
13849 i_stdarg='$i_stdarg'
13850 i_stddef='$i_stddef'
13851 i_stdlib='$i_stdlib'
13852 i_string='$i_string'
13853 i_sysaccess='$i_sysaccess'
13854 i_sysdir='$i_sysdir'
13855 i_sysfile='$i_sysfile'
13856 i_sysfilio='$i_sysfilio'
13858 i_sysioctl='$i_sysioctl'
13859 i_sysmount='$i_sysmount'
13860 i_sysndir='$i_sysndir'
13861 i_sysparam='$i_sysparam'
13862 i_sysresrc='$i_sysresrc'
13863 i_syssecrt='$i_syssecrt'
13864 i_sysselct='$i_sysselct'
13865 i_syssockio='$i_syssockio'
13866 i_sysstat='$i_sysstat'
13867 i_sysstatfs='$i_sysstatfs'
13868 i_sysstatvfs='$i_sysstatvfs'
13869 i_systime='$i_systime'
13870 i_systimek='$i_systimek'
13871 i_systimes='$i_systimes'
13872 i_systypes='$i_systypes'
13873 i_sysuio='$i_sysuio'
13875 i_sysvfs='$i_sysvfs'
13876 i_syswait='$i_syswait'
13877 i_termio='$i_termio'
13878 i_termios='$i_termios'
13880 i_unistd='$i_unistd'
13883 i_values='$i_values'
13884 i_varargs='$i_varargs'
13885 i_varhdr='$i_varhdr'
13887 ignore_versioned_solibs='$ignore_versioned_solibs'
13890 installarchlib='$installarchlib'
13891 installbin='$installbin'
13892 installman1dir='$installman1dir'
13893 installman3dir='$installman3dir'
13894 installprefix='$installprefix'
13895 installprefixexp='$installprefixexp'
13896 installprivlib='$installprivlib'
13897 installscript='$installscript'
13898 installsitearch='$installsitearch'
13899 installsitebin='$installsitebin'
13900 installsitelib='$installsitelib'
13901 installstyle='$installstyle'
13902 installusrbinperl='$installusrbinperl'
13903 installvendorbin='$installvendorbin'
13904 installvendorlib='$installvendorlib'
13906 known_extensions='$known_extensions'
13910 lddlflags='$lddlflags'
13912 ldlibpthname='$ldlibpthname'
13919 libswanted='$libswanted'
13925 locincpth='$locincpth'
13926 loclibpth='$loclibpth'
13927 longdblsize='$longdblsize'
13928 longlongsize='$longlongsize'
13929 longsize='$longsize'
13933 lseeksize='$lseeksize'
13934 lseektype='$lseektype'
13938 make_set_make='$make_set_make'
13939 mallocobj='$mallocobj'
13940 mallocsrc='$mallocsrc'
13941 malloctype='$malloctype'
13943 man1direxp='$man1direxp'
13946 man3direxp='$man3direxp'
13949 mips_type='$mips_type'
13952 modetype='$modetype'
13954 multiarch='$multiarch'
13956 myarchname='$myarchname'
13957 mydomain='$mydomain'
13958 myhostname='$myhostname'
13961 netdb_hlen_type='$netdb_hlen_type'
13962 netdb_host_type='$netdb_host_type'
13963 netdb_name_type='$netdb_name_type'
13964 netdb_net_type='$netdb_net_type'
13967 nm_so_opt='$nm_so_opt'
13968 nonxs_ext='$nonxs_ext'
13970 o_nonblock='$o_nonblock'
13972 old_pthread_create_joinable='$old_pthread_create_joinable'
13973 optimize='$optimize'
13974 orderlib='$orderlib'
13980 patchlevel='$patchlevel'
13981 path_sep='$path_sep'
13983 perladmin='$perladmin'
13984 perlpath='$perlpath'
13986 phostname='$phostname'
13989 pm_apiversion='$pm_apiversion'
13993 prefixexp='$prefixexp'
13995 privlibexp='$privlibexp'
13996 prototype='$prototype'
13998 randbits='$randbits'
13999 randfunc='$randfunc'
14000 randseedtype='$randseedtype'
14002 rd_nodata='$rd_nodata'
14006 sPRIEldbl='$sPRIEldbl'
14007 sPRIFldbl='$sPRIFldbl'
14008 sPRIGldbl='$sPRIGldbl'
14011 sPRIeldbl='$sPRIeldbl'
14012 sPRIfldbl='$sPRIfldbl'
14013 sPRIgldbl='$sPRIgldbl'
14018 sched_yield='$sched_yield'
14019 scriptdir='$scriptdir'
14020 scriptdirexp='$scriptdirexp'
14022 seedfunc='$seedfunc'
14023 selectminbits='$selectminbits'
14024 selecttype='$selecttype'
14025 sendmail='$sendmail'
14028 sharpbang='$sharpbang'
14029 shmattype='$shmattype'
14030 shortsize='$shortsize'
14033 sig_count='$sig_count'
14034 sig_name='$sig_name'
14035 sig_name_init='$sig_name_init'
14037 sig_num_init='$sig_num_init'
14038 signal_t='$signal_t'
14039 sitearch='$sitearch'
14040 sitearchexp='$sitearchexp'
14042 sitebinexp='$sitebinexp'
14044 sitelibexp='$sitelibexp'
14045 siteprefix='$siteprefix'
14046 siteprefixexp='$siteprefixexp'
14047 sizetype='$sizetype'
14052 sockethdr='$sockethdr'
14053 socketlib='$socketlib'
14055 spackage='$spackage'
14056 spitshell='$spitshell'
14059 ssizetype='$ssizetype'
14060 startperl='$startperl'
14062 static_ext='$static_ext'
14064 stdio_base='$stdio_base'
14065 stdio_bufsiz='$stdio_bufsiz'
14066 stdio_cnt='$stdio_cnt'
14067 stdio_filbuf='$stdio_filbuf'
14068 stdio_ptr='$stdio_ptr'
14069 stdio_stream_array='$stdio_stream_array'
14072 subversion='$subversion'
14079 timeincl='$timeincl'
14080 timetype='$timetype'
14089 use64bits='$use64bits'
14091 uselargefiles='$uselargefiles'
14092 uselongdouble='$uselongdouble'
14093 usemorebits='$usemorebits'
14094 usemultiplicity='$usemultiplicity'
14095 usemymalloc='$usemymalloc'
14097 useopcode='$useopcode'
14098 useperlio='$useperlio'
14099 useposix='$useposix'
14101 useshrplib='$useshrplib'
14102 usesocks='$usesocks'
14103 usethreads='$usethreads'
14104 usevendorprefix='$usevendorprefix'
14105 usevfork='$usevfork'
14108 vendorbin='$vendorbin'
14109 vendorbinexp='$vendorbinexp'
14110 vendorlib='$vendorlib'
14111 vendorlibexp='$vendorlibexp'
14112 vendorprefix='$vendorprefix'
14113 vendorprefixexp='$vendorprefixexp'
14116 voidflags='$voidflags'
14118 xs_apiversion='$xs_apiversion'
14123 : Add in command line options if available
14124 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
14126 : add special variables
14127 $test -f $src/patchlevel.h && \
14128 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
14129 echo "CONFIGDOTSH=true" >>config.sh
14131 : propagate old symbols
14132 if $test -f UU/config.sh; then
14133 <UU/config.sh sort | uniq >UU/oldconfig.sh
14134 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
14135 sort | uniq -u >UU/oldsyms
14136 set X `cat UU/oldsyms`
14142 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
14144 echo "# Variables propagated from previous config.sh file." >>config.sh
14145 for sym in `cat UU/oldsyms`; do
14146 echo " Propagating $hint variable "'$'"$sym..."
14147 eval 'tmp="$'"${sym}"'"'
14149 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
14155 : Finish up by extracting the .SH files
14169 If you'd like to make any changes to the config.sh file before I begin
14170 to configure things, do it as a shell escape now (e.g. !vi config.sh).
14173 rp="Press return or use a shell escape to edit config.sh:"
14178 *) : in case they cannot read
14179 sh 1>&4 -c "$ans";;
14184 : if this fails, just run all the .SH files by hand
14191 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
14198 Now you need to generate make dependencies by running "$make depend".
14199 You might prefer to run it in background: "$make depend > makedepend.out &"
14200 It can take a while, so you might not want to run it right now.
14205 rp="Run $make depend now?"
14209 $make depend && echo "Now you must run a $make."
14212 echo "You must run '$make depend' then '$make'."
14215 elif test -f [Mm]akefile; then
14217 echo "Now you must run a $make."
14222 if $test -f Policy.sh; then
14225 If you compile $package on a different machine or from a different object
14226 directory, copy the Policy.sh file from this object directory to the
14227 new one before you run Configure -- this will help you with most of
14228 the policy defaults.
14232 if $test -f config.msg; then
14233 echo "Hmm. I also noted the following information while running:"
14235 $cat config.msg >&4
14238 $rm -f kit*isdone ark*isdone