3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Tue Jan 18 23:09:49 EET 2000 [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
440 d_old_pthread_create_joinable=''
441 old_pthread_create_joinable=''
693 ignore_versioned_solibs=''
850 d_stdio_stream_array=''
851 stdio_stream_array=''
895 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
898 : We must find out about Eunice early
900 if test -f /etc/unixtovms; then
901 eunicefix=/etc/unixtovms
903 if test -f /etc/unixtovms.exe; then
904 eunicefix=/etc/unixtovms.exe
908 : list of known cpp symbols, sorted alphabetically
909 al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
910 al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
911 al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
912 al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
913 al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
914 al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
915 al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4 SVR5"
916 al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
917 al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
918 al="$al VMS Xenix286"
919 al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
920 al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
921 al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
922 al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
923 al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
924 al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
925 al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
926 al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
927 al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
928 al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
929 al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
930 al="$al __SVR4_2__ __UMAXV__"
931 al="$al ____386BSD____ __alpha __alpha__ __amiga"
932 al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
933 al="$al __host_mips__"
934 al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
935 al="$al __hp9000s500 __hp9000s700 __hp9000s800"
936 al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
937 al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
938 al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
939 al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
940 al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
941 al="$al __mc88100 __mc88100__ __mips __mips__"
942 al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
943 al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
944 al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
945 al="$al _host_mips _mips _unix"
946 al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
947 al="$al apollo ardent att386 att3b"
948 al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
949 al="$al cadmus clipper concurrent convex cray ctix"
950 al="$al dmert encore gcos gcx gimpel gould"
951 al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
952 al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
953 al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
954 al="$al i186 i286 i386 i486 i8086"
955 al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
956 al="$al ksr1 linux luna luna88k m68k m88100 m88k"
957 al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
958 al="$al mc68040 mc68060 mc68k mc68k32 mc700"
959 al="$al mc88000 mc88100 merlin mert mips mvs n16"
960 al="$al ncl_el ncl_mr"
961 al="$al news1500 news1700 news1800 news1900 news3700"
962 al="$al news700 news800 news900 ns16000 ns32000"
963 al="$al ns32016 ns32332 ns32k nsc32000 os osf"
964 al="$al parisc pc532 pdp11 plexus posix pyr"
965 al="$al riscix riscos scs sequent sgi sinix sony sony_news"
966 al="$al sonyrisc sparc sparclite spectrum stardent stratos"
967 al="$al sun sun3 sun386 svr4 sysV68 sysV88"
968 al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
969 al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
970 al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
973 : set useposix=false in your hint file to disable the POSIX extension.
975 : set useopcode=false in your hint file to disable the Opcode extension.
977 : Trailing extension. Override this in a hint file, if needed.
979 : Extra object files, if any, needed on this platform.
981 : Possible local include directories to search.
982 : Set locincpth to "" in a hint file to defeat local include searches.
983 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
984 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
986 : no include file wanted by default
990 : change the next line if compiling for Xenix/286 on Xenix/386
991 xlibpth='/usr/lib/386 /lib/386'
993 : Possible local library directories to search.
994 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
995 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
997 : general looking path for locating libraries
998 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
999 glibpth="$glibpth /lib /usr/lib $xlibpth"
1000 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
1001 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1003 : Private path used by Configure to find libraries. Its value
1004 : is prepended to libpth. This variable takes care of special
1005 : machines, like the mips. Usually, it should be empty.
1008 : default library list
1010 : some systems want to use only the non-versioned libso:s
1011 ignore_versioned_solibs=''
1012 : set usemultiplicity on the Configure command line to enable multiplicity.
1013 : set usesocks on the Configure command line to enable socks.
1014 : set usethreads on the Configure command line to enable threads.
1015 : full support for void wanted by default
1018 : List of libraries we want.
1019 : If anyone needs -lnet, put it in a hint file.
1020 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
1021 libswanted="$libswanted dld ld sun m c cposix posix"
1022 libswanted="$libswanted ndir dir crypt sec"
1023 libswanted="$libswanted ucb bsd BSD PW x"
1024 : We probably want to search /usr/shlib before most other libraries.
1025 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1026 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1027 glibpth="/usr/shlib $glibpth"
1028 : Do not use vfork unless overridden by a hint file.
1031 : Find the basic shell for Bourne shell scripts
1035 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1038 if test -f "$xxx"; then
1041 : Build up a list and do a single loop so we can 'break' out.
1042 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1043 for xxx in sh bash ksh pdksh ash; do
1045 try="$try ${p}/${xxx}"
1049 if test -f "$xxx"; then
1052 elif test -f "$xxx.exe"; then
1063 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1065 Usually it's in /bin/sh. How did you even get this far?
1066 Please contact me (Perl Maintainers) at perlbug@perl.com and
1067 we'll try to straighten this all out.
1073 : see if sh knows # comments
1074 if `$sh -c '#' >/dev/null 2>&1`; then
1078 test -f $xcat || xcat=/usr/bin/cat
1083 if test -s today; then
1086 echo "#! $xcat" > try
1090 if test -s today; then
1098 echo "Your $sh doesn't grok # comments--I will strip them later on."
1101 echo "exec grep -v '^[ ]*#'" >spitshell
1103 $eunicefix spitshell
1104 spitshell=`pwd`/spitshell
1106 echo "I presume that if # doesn't work, #! won't work either!"
1111 : figure out how to guarantee sh startup
1113 '') startsh=${sharpbang}${sh} ;;
1125 : echo "Yup, it does."
1127 echo "Hmm... '$startsh' does not guarantee sh startup..."
1128 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1133 : Save command line options in file UU/cmdline.opt for later use in
1134 : generating config.sh.
1135 cat > cmdline.opt <<EOSH
1136 # Configure command line arguments.
1143 cat >>cmdline.opt <<EOSH
1144 config_arg$argn='$arg'
1146 argn=`expr $argn + 1`
1149 : produce awk script to parse command line options
1150 cat >options.awk <<'EOF'
1152 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1154 len = length(optstr);
1155 for (i = 1; i <= len; i++) {
1156 c = substr(optstr, i, 1);
1157 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1168 if (substr(str, 1, 1) != "-") {
1169 printf("'%s'\n", str);
1173 for (i = 2; i <= len; i++) {
1174 c = substr(str, i, 1);
1176 printf("-%s\n", substr(str, i));
1182 printf("'%s'\n", substr(str, i + 1));
1195 : process the command line options
1196 set X `for arg in "$@"; do echo "X$arg"; done |
1197 sed -e s/X// | awk -f options.awk`
1202 : set up default values
1212 rm -f optdef.sh posthint.sh
1213 cat >optdef.sh <<EOS
1219 while test $# -gt 0; do
1221 -d) shift; fastread=yes;;
1222 -e) shift; alldone=cont;;
1226 if test -r "$1"; then
1229 echo "$me: cannot read config file $1." >&2
1234 -h) shift; error=true;;
1235 -r) shift; reuseval=true;;
1236 -s) shift; silent=true; realsilent=true;;
1237 -E) shift; alldone=exit;;
1238 -K) shift; knowitall=true;;
1239 -O) shift; override=true;;
1240 -S) shift; silent=true; extractsh=true;;
1245 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1246 echo "$me: ignoring -D $1" >&2
1249 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1250 *) echo "$1='define'" >> optdef.sh;;
1257 *=) echo "$1" >> optdef.sh;;
1259 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1260 echo "$me: ignoring -U $1" >&2
1262 *) echo "$1='undef'" >> optdef.sh;;
1273 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1277 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1278 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1284 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1285 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1286 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1287 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1288 *) xxx=`echo $yyy|sed 's!:.*!!'`
1289 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1295 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1297 echo "$yyy=''" >> posthint.sh ;;
1302 echo "$yyy='$zzz'" >> posthint.sh ;;
1304 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1306 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1311 echo "$yyy=$zzz" >> posthint.sh ;;
1312 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1315 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1318 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1326 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1327 [-U symbol] [-U symbol=] [-A command:symbol...]
1328 -d : use defaults for all answers.
1329 -e : go on without questioning past the production of config.sh.
1330 -f : specify an alternate default configuration file.
1331 -h : print this help message and exit (with an error status).
1332 -r : reuse C symbols value if possible (skips costly nm extraction).
1333 -s : silent mode, only echoes questions and essential information.
1334 -D : define symbol to have some value:
1335 -D symbol symbol gets the value 'define'
1336 -D symbol=value symbol gets the value 'value'
1337 -E : stop at the end of questions, after having produced config.sh.
1338 -K : do not use unless you know what you are doing.
1339 -O : let -D and -U override definitions from loaded configuration file.
1340 -S : perform variable substitutions on all .SH files (can mix with -f)
1341 -U : undefine symbol:
1342 -U symbol symbol gets the value 'undef'
1343 -U symbol= symbol gets completely empty
1344 -A : manipulate symbol after the platform specific hints have been applied:
1345 -A symbol=value append " "value to symbol
1346 -A append:symbol=value append value to symbol
1347 -A define:symbol=value define symbol to have value
1348 -A clear:symbol define symbol to be ''
1349 -A define:symbol define symbol to be 'define'
1350 -A eval:symbol=value define symbol to be eval of value
1351 -A prepend:symbol=value prepend value to symbol
1352 -A undef:symbol define symbol to be 'undef'
1353 -A undef:symbol= define symbol to be ''
1354 -V : print version number and exit (with a zero status).
1361 case "$fastread$alldone" in
1364 if test ! -t 0; then
1365 echo "Say 'sh Configure', not 'sh <Configure'"
1373 true) exec 1>/dev/null;;
1376 : run the defines and the undefines, if any, but leave the file out there...
1379 : create the posthint manipulation script and leave the file out there...
1384 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1385 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1386 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1387 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1388 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1391 : Some greps do not return status, grrr.
1392 echo "grimblepritz" >grimble
1393 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1395 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1401 : the following should work in any shell
1405 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1406 cat >contains <<'EOSS'
1407 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1412 : Find the path to the source tree
1415 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1418 *) src=`cd ../$src && pwd` ;;
1431 if test -f $rsrc/Configure && \
1432 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1434 : found it, so we are ok.
1437 for src in . .. ../.. ../../.. ../../../..; do
1438 if test -f ../$src/Configure && \
1439 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1450 Sorry, I can't seem to locate the source dir for $package. Please start
1451 Configure with an explicit path -- i.e. /some/path/Configure.
1459 echo "Sources for $package found in \"$src\"." >&4
1463 : script used to extract .SH files with variable substitutions
1464 cat >extract <<'EOS'
1466 echo "Doing variable substitutions on .SH files..."
1467 if test -f $src/MANIFEST; then
1468 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1470 echo "(Looking for .SH files under the source directory.)"
1471 set x `(cd $src; find . -name "*.SH" -print)`
1475 0) set x `(cd $src; echo *.SH)`; shift;;
1477 if test ! -f $src/$1; then
1483 while test $name; do
1484 if test ! -d "$name"; then
1485 create="$name $create";
1486 name=`echo $name | sed -e "s|^[^/]*$||"`;
1487 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1492 for file in $create; do
1501 dir=`expr X$file : 'X\(.*\)/'`
1502 file=`expr X$file : 'X.*/\(.*\)'`
1503 (cd $dir && . ./$file)
1513 dir=`expr X$file : 'X\(.*\)/'`
1514 file=`expr X$file : 'X.*/\(.*\)'`
1515 (set x $dir; shift; eval $mkdir_p)
1525 if test -f $src/config_h.SH; then
1526 if test ! -f config.h; then
1527 : oops, they left it out of MANIFEST, probably, so do it anyway.
1533 : extract files and exit if asked to do so
1534 case "$extractsh" in
1536 case "$realsilent" in
1540 case "$config_sh" in
1541 '') config_sh='config.sh';;
1544 echo "Fetching answers from $config_sh..."
1547 test "$override" && . ./optdef.sh
1556 : Eunice requires " " instead of "", can you believe it
1559 echo "Beginning of configuration questions for $package."
1561 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1563 : first determine how to suppress newline on echo command
1565 echo "Checking echo to see how to suppress newlines..."
1566 (echo "hi there\c" ; echo " ") >.echotmp
1567 if $contains c .echotmp >/dev/null 2>&1 ; then
1578 echo $n "The star should be here-->$c"
1582 : Now test for existence of everything in MANIFEST
1584 if test -f $rsrc/MANIFEST; then
1585 echo "First let's make sure your kit is complete. Checking..." >&4
1586 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1589 for filelist in x??; do
1590 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1592 if test -s missing; then
1596 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1598 You have the option of continuing the configuration process, despite the
1599 distinct possibility that your kit is damaged, by typing 'y'es. If you
1600 do, don't blame me if something goes wrong. I advise you to type 'n'o
1601 and contact the author (perlbug@perl.com).
1604 echo $n "Continue? [n] $c" >&4
1608 echo "Continuing..." >&4
1612 echo "ABORTING..." >&4
1617 echo "Looks good..."
1620 echo "There is no MANIFEST file. I hope your kit is complete !"
1625 : Find the appropriate value for a newline for tr
1626 if test -n "$DJGPP"; then
1629 if test X"$trnl" = X; then
1630 case "`echo foo|tr '\n' x 2>/dev/null`" in
1634 if test X"$trnl" = X; then
1635 case "`echo foo|tr '\012' x 2>/dev/null`" in
1636 foox) trnl='\012' ;;
1639 if test X"$trnl" = X; then
1642 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1648 : compute the number of columns on the terminal for proper question formatting
1653 : set up the echo used in my read
1654 myecho="case \"\$xxxm\" in
1655 '') echo $n \"\$rp $c\" >&4;;
1657 '') echo $n \"[\$xxxm] $c\";;
1659 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1661 echo $n \"[\$xxxm] $c\" >&4
1663 echo $n \"\$rp [\$xxxm] $c\" >&4
1669 : now set up to do reads with possible shell escape and default assignment
1675 case "\$fastread" in
1676 yes) case "\$dflt" in
1679 case "\$silent-\$rp" in
1684 *) case "\$silent" in
1685 true) case "\$rp" in
1690 while expr "X\$ans" : "X!" >/dev/null; do
1694 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1702 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1711 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1716 echo "(OK, I'll run with -d after this question.)" >&4
1719 echo "*** Sorry, \$1 not supported yet." >&4
1729 echo "*** Substitution done -- please confirm."
1731 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1736 echo "*** Error -- try again."
1743 case "\$ans\$xxxm\$nostick" in
1755 : create .config dir to save info across Configure sessions
1756 test -d ../.config || mkdir ../.config
1757 cat >../.config/README <<EOF
1758 This directory created by Configure to save information that should
1759 persist across sessions for $package.
1761 You may safely delete it if you wish.
1764 : general instructions
1767 user=`(logname) 2>/dev/null`
1769 '') user=`whoami 2>&1`;;
1771 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1774 rp='Would you like to see the instructions?'
1785 This installation shell script will examine your system and ask you questions
1786 to determine how the perl5 package should be installed. If you get
1787 stuck on a question, you may use a ! shell escape to start a subshell or
1788 execute a command. Many of the questions will have default answers in square
1789 brackets; typing carriage return will give you the default.
1791 On some of the questions which ask for file or directory names you are allowed
1792 to use the ~name construct to specify the login directory belonging to "name",
1793 even if you don't have a shell which knows about that. Questions where this is
1794 allowed will be marked "(~name ok)".
1798 dflt='Type carriage return to continue'
1802 The prompter used in this script allows you to use shell variables and
1803 backticks in your answers. You may use $1, $2, etc... to refer to the words
1804 in the default answer, as if the default line was a set of arguments given to a
1805 script shell. This means you may also use $* to repeat the whole default line,
1806 so you do not have to re-type everything to add something to the default.
1808 Everytime there is a substitution, you will have to confirm. If there is an
1809 error (e.g. an unmatched backtick), the default answer will remain unchanged
1810 and you will be prompted again.
1812 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1813 the questions and use the computed defaults (or the previous answers if there
1814 was already a config.sh file). Type 'Configure -h' for a list of options.
1815 You may also start interactively and then answer '& -d' at any prompt to turn
1816 on the non-interactive behaviour for the remainder of the execution.
1822 Much effort has been expended to ensure that this shell script will run on any
1823 Unix system. If despite that it blows up on yours, your best bet is to edit
1824 Configure and run it again. If you can't run Configure for some reason,
1825 you'll have to generate a config.sh file by hand. Whatever problems you
1826 have, let me (perlbug@perl.com) know how I blew it.
1828 This installation script affects things in two ways:
1830 1) it may do direct variable substitutions on some of the files included
1832 2) it builds a config.h file for inclusion in C programs. You may edit
1833 any of these files as the need arises after running this script.
1835 If you make a mistake on a question, there is no easy way to back up to it
1836 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1837 files. Configure will offer to let you do this before it runs the SH files.
1840 dflt='Type carriage return to continue'
1842 case "$firsttime" in
1843 true) echo $user >>../.config/instruct;;
1847 : find out where common programs are
1849 echo "Locating common programs..." >&4
1862 if test -d \$dir/\$thing; then
1868 for thisthing in \$dir/\$thing; do
1869 : just loop through to pick last item
1871 if test -f \$thisthing; then
1874 elif test -f \$dir/\$thing.exe; then
1875 if test -n "$DJGPP"; then
1876 echo \$dir/\$thing.exe
1878 : on Eunice apparently
1929 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1930 pth="$pth /lib /usr/lib"
1931 for file in $loclist; do
1935 if test -f "$xxx"; then
1938 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1939 xxx=`./loc $file $file $pth`
1942 '') xxx=`./loc $file $file $pth`;;
1943 *) xxx=`./loc $xxx $xxx $pth`;;
1949 echo $file is in $xxx.
1952 echo $file is in $xxx.
1955 echo "I don't know where '$file' is, and my life depends on it." >&4
1956 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1962 echo "Don't worry if any of the following aren't found..."
1964 for file in $trylist; do
1968 if test -f "$xxx"; then
1971 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1972 xxx=`./loc $file $file $pth`
1975 '') xxx=`./loc $file $file $pth`;;
1976 *) xxx=`./loc $xxx $xxx $pth`;;
1982 echo $file is in $xxx.
1985 echo $file is in $xxx.
1988 echo "I don't see $file out there, $say."
1995 echo "Substituting grep for egrep."
2001 echo "Substituting cp for ln."
2007 echo "Hopefully test is built into your sh."
2010 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2011 echo "Using the test built into your sh."
2019 echo "Hopefully echo is built into your sh."
2024 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2025 $echo $n "hi there$c" >foo1
2026 echo $n "hi there$c" >foo2
2027 if cmp foo1 foo2 >/dev/null 2>&1; then
2028 echo "They are compatible. In fact, they may be identical."
2035 They are not compatible! You are probably running ksh on a non-USG system.
2036 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2037 have echo built in and we may have to run some Bourne shell scripts. That
2038 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2041 $echo $n "The star should be here-->$c"
2048 : determine whether symbolic links are supported
2051 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2052 echo "Symbolic links are supported." >&4
2055 echo "Symbolic links are NOT supported." >&4
2060 : see whether [:lower:] and [:upper:] are supported character classes
2062 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2064 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2068 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2069 # (0xc9 and 0xd1), therefore that is a nice testing point.
2070 if test "X$up" = X -o "X$low" = X; then
2071 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2077 if test "X$up" = X -o "X$low" = X; then
2078 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2084 if test "X$up" = X -o "X$low" = X; then
2085 case "`echo IJ | od -x 2>/dev/null`" in
2087 echo "Hey, this might be EBCDIC." >&4
2088 if test "X$up" = X -o "X$low" = X; then
2089 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2090 ij) up='[A-IJ-RS-Z]'
2095 if test "X$up" = X -o "X$low" = X; then
2096 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2106 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2108 echo "Using $up and $low to convert case." >&4
2111 echo "I don't know how to translate letters from upper to lower case." >&4
2112 echo "Your tr is not acting any way I know of." >&4
2116 : set up the translation script tr, must be called with ./tr of course
2120 '[A-Z][a-z]') exec $tr '$up' '$low';;
2121 '[a-z][A-Z]') exec $tr '$low' '$up';;
2128 : Try to determine whether config.sh was made on this system
2129 case "$config_sh" in
2131 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
2132 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2133 # because the A-Z/a-z are not consecutive.
2134 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2135 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2136 newmyuname="$myuname"
2138 case "$knowitall" in
2140 if test -f ../config.sh; then
2141 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2142 eval "`grep myuname= ../config.sh`"
2144 if test "X$myuname" = "X$newmyuname"; then
2152 : Get old answers from old config file if Configure was run on the
2153 : same system, otherwise use the hints.
2156 if test -f config.sh; then
2158 rp="I see a config.sh file. Shall I use it to set the defaults?"
2161 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2162 *) echo "Fetching default answers from your old config.sh file..." >&4
2170 : Older versions did not always set $sh. Catch re-use of such
2179 if test ! -f config.sh; then
2182 First time through, eh? I have some defaults handy for some systems
2183 that need some extra help getting the Configure answers right:
2186 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2188 : Half the following guesses are probably wrong... If you have better
2189 : tests or hints, please send them to perlbug@perl.com
2190 : The metaconfig authors would also appreciate a copy...
2191 $test -f /irix && osname=irix
2192 $test -f /xenix && osname=sco_xenix
2193 $test -f /dynix && osname=dynix
2194 $test -f /dnix && osname=dnix
2195 $test -f /lynx.os && osname=lynxos
2196 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2197 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2198 $test -f /bin/mips && /bin/mips && osname=mips
2199 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2200 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2201 $test -d /usr/apollo/bin && osname=apollo
2202 $test -f /etc/saf/_sactab && osname=svr4
2203 $test -d /usr/include/minix && osname=minix
2204 if $test -d /MachTen -o -d /MachTen_Folder; then
2206 if $test -x /sbin/version; then
2207 osvers=`/sbin/version | $awk '{print $2}' |
2208 $sed -e 's/[A-Za-z]$//'`
2209 elif $test -x /usr/etc/version; then
2210 osvers=`/usr/etc/version | $awk '{print $2}' |
2211 $sed -e 's/[A-Za-z]$//'`
2217 $test -f /sys/posix.dll &&
2218 $test -f /usr/bin/what &&
2219 set X `/usr/bin/what /sys/posix.dll` &&
2220 $test "$3" = UWIN &&
2224 if $test -f $uname; then
2232 umips) osname=umips ;;
2235 [23]100) osname=mips ;;
2236 next*) osname=next ;;
2238 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2239 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2242 elif $test -f /etc/kconfig; then
2244 if test "$lns" = "$ln -s"; then
2246 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2248 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2255 if test -n "$DJGPP"; then
2264 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2266 'not found') osvers="$4"."$3" ;;
2267 '<3240'|'<>3240') osvers=3.2.0 ;;
2268 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2269 '=3250'|'>3250') osvers=3.2.5 ;;
2273 bsd386) osname=bsd386
2276 cygwin*) osname=cygwin
2279 *dc.osx) osname=dcosx
2285 domainos) osname=apollo
2291 dynixptx*) osname=dynixptx
2292 osvers=`echo "$4"|sed 's/^v//'`
2294 freebsd) osname=freebsd
2296 genix) osname=genix ;;
2298 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2314 netbsd*) osname=netbsd
2317 news-os) osvers="$3"
2319 4*) osname=newsos4 ;;
2323 next*) osname=next ;;
2324 POSIX-BC | posix-bc ) osname=posix-bc
2327 powerux | power_ux | powermax_os | powermaxos | \
2328 powerunix | power_unix) osname=powerux
2334 solaris) osname=solaris
2336 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2343 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2347 titanos) osname=titanos
2356 ultrix) osname=ultrix
2359 osf1|mls+) case "$5" in
2362 osvers=`echo "$3" | sed 's/^[xvt]//'`
2364 hp*) osname=hp_osf1 ;;
2365 mips) osname=mips_osf1 ;;
2368 unixware) osname=svr5
2374 $2) case "$osname" in
2378 : svr4.x or possibly later
2388 if test -f /stand/boot ; then
2389 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2390 if test -n "$INITPROG" -a -f "$INITPROG"; then
2391 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2392 if test -n "$isesix"; then
2400 *) if test -f /etc/systemid; then
2402 set `echo $3 | $sed 's/\./ /g'` $4
2403 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2405 elif $test -f $src/hints/sco_$1_$2.sh; then
2407 elif $test -f $src/hints/sco_$1.sh; then
2412 '') : Still unknown. Probably a generic Sys V.
2421 *) case "$osname" in
2422 '') : Still unknown. Probably a generic BSD.
2430 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2431 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2432 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2435 $rm -f UU/kernel.what
2436 elif test -d c:/.; then
2443 : Now look for a hint file osname_osvers, unless one has been
2444 : specified already.
2447 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2448 : Also try without trailing minor version numbers.
2449 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2450 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2451 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2452 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2455 *) case "$osvers" in
2458 *) if $test -f $src/hints/$file.sh ; then
2460 elif $test -f $src/hints/$xfile.sh ; then
2462 elif $test -f $src/hints/$xxfile.sh ; then
2464 elif $test -f $src/hints/$xxxfile.sh ; then
2466 elif $test -f $src/hints/$xxxxfile.sh ; then
2468 elif $test -f "$src/hints/${osname}.sh" ; then
2477 if $test -f Policy.sh ; then
2480 none) dflt="Policy" ;;
2481 *) dflt="Policy $dflt" ;;
2486 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2490 if $test -f Policy.sh ; then
2493 There's also a Policy hint file available, which should make the
2494 site-specific (policy) questions easier to answer.
2501 You may give one or more space-separated answers, or "none" if appropriate.
2502 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2503 is a good thing. DO NOT give a wrong version or a wrong OS.
2507 rp="Which of these apply, if any?"
2510 for file in $tans; do
2511 if $test X$file = XPolicy -a -f Policy.sh; then
2513 $cat Policy.sh >> UU/config.sh
2514 elif $test -f $src/hints/$file.sh; then
2515 . $src/hints/$file.sh
2516 $cat $src/hints/$file.sh >> UU/config.sh
2517 elif $test X$tans = X -o X$tans = Xnone ; then
2520 : Give one chance to correct a possible typo.
2521 echo "$file.sh does not exist"
2523 rp="hint to use instead?"
2525 for file in $ans; do
2526 if $test -f "$src/hints/$file.sh"; then
2527 . $src/hints/$file.sh
2528 $cat $src/hints/$file.sh >> UU/config.sh
2529 elif $test X$ans = X -o X$ans = Xnone ; then
2532 echo "$file.sh does not exist -- ignored."
2539 : Remember our hint file for later.
2540 if $test -f "$src/hints/$file.sh" ; then
2550 echo "Fetching default answers from $config_sh..." >&4
2554 cp $config_sh config.sh 2>/dev/null
2564 test "$override" && . ./optdef.sh
2565 myuname="$newmyuname"
2567 : Restore computed paths
2568 for file in $loclist $trylist; do
2569 eval $file="\$_$file"
2574 Configure uses the operating system name and version to set some defaults.
2575 The default value is probably right if the name rings a bell. Otherwise,
2576 since spelling matters for me, either accept the default or answer "none"
2583 ''|' '|none) dflt=none ;;
2584 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2587 *) dflt="$osname" ;;
2589 rp="Operating system name?"
2593 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2599 ''|' '|none) dflt=none ;;
2600 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2601 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2603 ''|' ') dflt=none ;;
2608 *) dflt="$osvers" ;;
2610 rp="Operating system version?"
2620 : who configured the system
2621 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2622 cf_by=`(logname) 2>/dev/null`
2625 cf_by=`(whoami) 2>/dev/null`
2627 "") cf_by=unknown ;;
2631 : set up the script used to warn in case of inconsistency
2638 echo "*** WHOA THERE!!! ***" >&4
2639 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2640 rp=" Keep the $hint value?"
2643 y) td=$was; tu=$was;;
2647 : function used to set $1 to $val
2648 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2650 $define$undef) . ./whoa; eval "$var=\$td";;
2651 $undef$define) . ./whoa; eval "$var=\$tu";;
2652 *) eval "$var=$val";;
2657 Perl can be built to take advantage of threads, on some systems.
2658 To do so, Configure must be run with -Dusethreads.
2660 Note that threading is a highly experimental feature, and
2661 some known race conditions still remain. If you choose to try
2662 it, be very sure to not actually deploy it for production
2663 purposes. README.threads has more details, and is required
2664 reading if you enable threads.
2666 case "$usethreads" in
2667 $define|true|[yY]*) dflt='y';;
2670 rp='Build a threading Perl?'
2673 y|Y) val="$define" ;;
2679 case "$usethreads" in
2683 As of 5.5.640, Perl has two different internal threading implementations,
2684 the 5.005 version (5005threads) and an interpreter-based version
2685 (ithreads) that has one interpreter per thread. Both are very
2686 experimental. This arrangement exists to help developers work out
2687 which one is better.
2689 : Default to ithreads unless overridden on command line or with
2692 case "$use5005threads" in
2693 $define|true|[yY]*) dflt='n';;
2695 case "$useithreads" in
2696 $undef|false|[nN]*) dflt='n';;
2698 rp='Use interpreter-based ithreads?'
2701 y|Y) val="$define" ;;
2706 : Now set use5005threads to the opposite value.
2707 case "$useithreads" in
2708 $define) val="$undef" ;;
2715 useithreads="$undef"
2716 use5005threads="$undef"
2720 case "$d_oldpthreads" in
2721 '') : Configure tests would be welcome here. For now, assume undef.
2723 *) val="$d_oldpthreads" ;;
2729 case "$usethreads" in
2730 "$define"|true|[yY]*)
2731 : Look for a hint-file generated 'call-back-unit'. If the
2732 : user has specified that a threading perl is to be built,
2733 : we may need to set or change some other defaults.
2734 if $test -f usethreads.cbu; then
2735 echo "Your platform has some specific hints for threaded builds, using them..."
2739 (Your platform doesn't have any specific hints for threaded builds.
2740 Assuming POSIX threads, then.)
2748 Perl can be built so that multiple Perl interpreters can coexist
2749 within the same Perl executable.
2752 case "$useithreads" in
2755 This multiple interpreter support is required for interpreter-based threads.
2760 echo 'Normally you do not need this and you should answer no.'
2761 case "$usemultiplicity" in
2762 $define|true|[yY]*) dflt='y';;
2765 rp='Build Perl for multiplicity?'
2768 y|Y) val="$define" ;;
2776 : determine where manual pages are on this system
2780 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2781 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2782 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2783 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2784 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2785 sysman=`./loc . /usr/man/man1 $syspath`
2788 if $test -d "$sysman"; then
2789 echo "System manual is in $sysman." >&4
2791 echo "Could not find manual pages in source form." >&4
2794 : see what memory models we can support
2797 $cat >pdp11.c <<'EOP'
2806 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2807 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2808 dflt='unsplit split'
2810 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2813 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2818 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2821 if $test -d /lib/large || $test -d /usr/lib/large; then
2824 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2833 Some systems have different model sizes. On most systems they are called
2834 small, medium, large, and huge. On the PDP11 they are called unsplit and
2835 split. If your system doesn't support different memory models, say "none".
2836 If you wish to force everything to one memory model, say "none" here and
2837 put the appropriate flags later when it asks you for other cc and ld flags.
2838 Venix systems may wish to put "none" and let the compiler figure things out.
2839 (In the following question multiple model names should be space separated.)
2841 The default for most systems is "none".
2844 rp="Which memory models are supported?"
2859 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2860 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2867 rp="What flag indicates separate I and D space?"
2875 *large*|*small*|*medium*|*huge*)
2882 rp="What flag indicates large model?"
2892 *huge*) case "$huge" in
2896 rp="What flag indicates huge model?"
2906 *medium*) case "$medium" in
2910 rp="What flag indicates medium model?"
2917 *) medium="$large";;
2920 *small*) case "$small" in
2924 rp="What flag indicates small model?"
2935 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2938 $rm -f pdp11.* pdp11
2940 : make some quick guesses about what we are up against
2942 $echo $n "Hmm... $c"
2952 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2953 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2955 echo "Looks kind of like an OSF/1 system, but we'll see..."
2957 elif test `echo abc | tr a-z A-Z` = Abc ; then
2958 xxx=`./loc addbib blurfl $pth`
2959 if $test -f $xxx; then
2960 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2964 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2965 echo "Looks kind of like an extended USG system, but we'll see..."
2967 echo "Looks kind of like a USG system, but we'll see..."
2971 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2972 echo "Looks kind of like a BSD system, but we'll see..."
2976 echo "Looks kind of like a Version 7 system, but we'll see..."
2979 case "$eunicefix" in
2982 There is, however, a strange, musty smell in the air that reminds me of
2983 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2987 : it so happens the Eunice I know will not run shell scripts in Unix format
2991 echo "Congratulations. You aren't running Eunice."
2995 : Detect OS2. The p_ variable is set above in the Head.U unit.
3000 I have the feeling something is not exactly right, however...don't tell me...
3001 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3006 if test -f /xenix; then
3007 echo "Actually, this looks more like a XENIX system..."
3012 echo "It's not Xenix..."
3017 if test -f /venix; then
3018 echo "Actually, this looks more like a VENIX system..."
3025 echo "Nor is it Venix..."
3028 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3029 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3032 : see if we need a special compiler
3040 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3041 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3055 On some older systems the default C compiler will not resolve multiple global
3056 references that happen to have the same name. On some such systems the "Mcc"
3057 command may be used to force these to be resolved. On other systems a "cc -M"
3058 command is required. (Note that the -M flag on other systems indicates a
3059 memory model to use!) If you have the Gnu C compiler, you might wish to use
3065 rp="Use which C compiler?"
3073 rp="Use which C compiler?"
3077 : Look for a hint-file generated 'call-back-unit'. Now that the
3078 : user has specified the compiler, we may need to set or change some
3080 if $test -f cc.cbu; then
3084 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3085 $cat >gccvers.c <<EOM
3090 printf("%s\n", __VERSION__);
3092 printf("%s\n", "1");
3098 if $cc -o gccvers gccvers.c; then
3099 gccversion=`./gccvers`
3100 case "$gccversion" in
3101 '') echo "You are not using GNU cc." ;;
3102 *) echo "You are using GNU cc $gccversion."
3107 echo "*** WHOA THERE!!! ***" >&4
3108 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3109 case "$knowitall" in
3111 echo " You'd better start hunting for one and let me know about it." >&4
3117 case "$gccversion" in
3118 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3121 : decide how portable to be. Allow command line overrides.
3122 case "$d_portable" in
3124 *) d_portable="$define" ;;
3127 : set up shell script to do ~ expansion
3133 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3136 if $test -f /bin/csh; then
3137 /bin/csh -f -c "glob \$1"
3142 name=\`$expr x\$1 : '..\([^/]*\)'\`
3143 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3144 if $test ! -d "\$dir"; then
3146 echo "\$me: can't locate home directory for: \$name" >&2
3151 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3167 : now set up to get a file name
3171 cat <<'EOSC' >>getfile
3187 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3188 fn=`echo $fn | sed 's/(.*)//'`
3194 loc_file=`expr $fn : '.*:\(.*\)'`
3195 fn=`expr $fn : '\(.*\):.*'`
3203 */*) fullpath=true;;
3212 *e*) exp_file=true;;
3215 *p*) nopath_ok=true;;
3220 *d*) type='Directory';;
3221 *l*) type='Locate';;
3226 Locate) what='File';;
3231 case "$d_portable" in
3239 while test "$type"; do
3244 true) rp="$rp (~name ok)";;
3247 if test -f UU/getfile.ok && \
3248 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3267 value=`UU/filexp $ans`
3270 if test "$ans" != "$value"; then
3271 echo "(That expands to $value on this system.)"
3285 /*) value="$ansexp" ;;
3290 echo "I shall only accept a full path name, as in /bin/ls." >&4
3291 echo "Use a ! shell escape if you wish to check pathnames." >&4
3294 echo "Please give a full path name, starting with slash." >&4
3297 echo "Note that using ~name is ok provided it expands well." >&4
3310 for fp in $gfpth; do
3311 if test "X$fp" = X.; then
3316 if test -f "$pf"; then
3318 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3320 echo "($value is not a plain file, but that's ok.)"
3323 if test X"$type" = X; then
3330 for fp in $gfpth; do
3331 if test "X$fp" = X.; then
3336 if test -d "$pf"; then
3344 if test -d "$ansexp"; then
3345 echo "(Looking for $loc_file in directory $value.)"
3346 value="$value/$loc_file"
3347 ansexp="$ansexp/$loc_file"
3349 if test -f "$ansexp"; then
3352 case "$nopath_ok" in
3353 true) case "$value" in
3355 *) echo "Assuming $value will be in people's path."
3371 if test "$fastread" = yes; then
3376 rp="$what $value doesn't exist. Use that name anyway?"
3395 test "X$gfpthkeep" != Xy && gfpth=""
3398 : What should the include directory be ?
3400 $echo $n "Hmm... $c"
3404 if $test -f /bin/mips && /bin/mips; then
3405 echo "Looks like a MIPS system..."
3406 $cat >usr.c <<'EOCP'
3407 #ifdef SYSTYPE_BSD43
3411 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3412 dflt='/bsd43/usr/include'
3416 mips_type='System V'
3418 $rm -f usr.c usr.out
3419 echo "and you're compiling with the $mips_type compiler and libraries."
3423 echo "Doesn't look like a MIPS system."
3433 case "$xxx_prompt" in
3436 rp='Where are the include files you want to use?'
3444 : see how we invoke the C preprocessor
3446 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3447 cat <<'EOT' >testcpp.c
3453 if test ! -f cppstdin; then
3454 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3455 # AIX cc -E doesn't show the absolute headerfile
3456 # locations but we'll cheat by using the -M flag.
3457 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
3459 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3462 echo "Keeping your $hint cppstdin wrapper."
3465 wrapper=`pwd`/cppstdin
3469 if $test "X$cppstdin" != "X" && \
3470 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3471 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3473 echo "You used to use $cppstdin $cppminus so we'll use that again."
3475 '') echo "But let's see if we can live without a wrapper..." ;;
3477 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3478 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3480 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3483 echo "(However, $cpprun $cpplast does not work, let's see...)"
3491 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3498 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3499 $cc -E <testcpp.c >testcpp.out 2>&1; \
3500 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3501 echo "Yup, it does."
3504 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3505 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3506 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3507 echo "Yup, it does."
3510 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3511 $cc -P <testcpp.c >testcpp.out 2>&1; \
3512 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3513 echo "Yipee, that works!"
3516 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3517 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3518 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3519 echo "At long last!"
3522 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3523 $cpp <testcpp.c >testcpp.out 2>&1; \
3524 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3528 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3529 $cpp - <testcpp.c >testcpp.out 2>&1; \
3530 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3531 echo "Hooray, it works! I was beginning to wonder."
3534 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3535 $wrapper <testcpp.c >testcpp.out 2>&1; \
3536 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3542 rp="No dice. I can't find a C preprocessor. Name one:"
3546 $x_cpp <testcpp.c >testcpp.out 2>&1
3547 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3548 echo "OK, that will do." >&4
3550 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3565 echo "Perhaps can we force $cc -E using a wrapper..."
3566 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3567 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3573 echo "Nope, we'll have to live without it..."
3587 "$wrapper"|'cppstdin') ;;
3588 *) $rm -f $wrapper;;
3590 $rm -f testcpp.c testcpp.out
3592 : Set private lib path
3595 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3600 '') dlist="$loclibpth $plibpth $glibpth";;
3601 *) dlist="$libpth";;
3604 : Now check and see which directories actually exist, avoiding duplicates
3608 if $test -d $xxx; then
3611 *) libpth="$libpth $xxx";;
3617 Some systems have incompatible or broken versions of libraries. Among
3618 the directories listed in the question below, please remove any you
3619 know not to be holding relevant libraries, and add any that are needed.
3620 Say "none" for none.
3631 rp="Directories to use for library searches?"
3638 : compute shared library extension
3641 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3651 On some systems, shared libraries may be available. Answer 'none' if
3652 you want to suppress searching of shared libraries for the remaining
3653 of this configuration.
3656 rp='What is the file extension used for shared libraries?'
3660 : Define several unixisms.
3661 : Hints files or command line option can be used to override them.
3662 : The convoluted testing is in case hints files set either the old
3665 '') case "$exe_ext" in
3667 *) _exe="$exe_ext" ;;
3672 '') case "$lib_ext" in
3679 '') case "$obj_ext" in
3686 '') case "$path_sep" in
3697 : Which makefile gets called first. This is used by make depend.
3698 case "$firstmakefile" in
3699 '') firstmakefile='makefile';;
3704 Perl can be built to use the SOCKS proxy protocol library. To do so,
3705 Configure must be run with -Dusesocks.
3707 Normally you do not need this and you should answer no.
3711 $define|true|[yY]*) dflt='y';;
3714 rp='Build Perl for SOCKS?'
3717 y|Y) val="$define" ;;
3723 : Looking for optional libraries
3725 echo "Checking for optional libraries..." >&4
3730 case "$libswanted" in
3731 '') libswanted='c_s';;
3735 libswanted="$libswanted socks5 socks5_sh"
3738 for thislib in $libswanted; do
3740 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3741 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3742 echo "Found -l$thislib (shared)."
3745 *) dflt="$dflt -l$thislib";;
3747 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3748 echo "Found -l$thislib (shared)."
3751 *) dflt="$dflt -l$thislib";;
3753 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3754 echo "Found -l$thislib."
3757 *) dflt="$dflt -l$thislib";;
3759 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3760 echo "Found -l$thislib."
3763 *) dflt="$dflt -l$thislib";;
3765 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3766 echo "Found -l${thislib}_s."
3769 *) dflt="$dflt -l${thislib}_s";;
3771 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3772 echo "Found -l$thislib."
3775 *) dflt="$dflt -l$thislib";;
3778 echo "No -l$thislib."
3789 ' '|'') dflt='none';;
3794 In order to compile $package on your machine, a number of libraries
3795 are usually needed. Include any other special libraries here as well.
3796 Say "none" for none. The default list is almost always right.
3800 rp="What libraries to use?"
3807 : determine optimization, if desired, or use for debug flag also
3809 ' '|$undef) dflt='none';;
3811 *) dflt="$optimize";;
3815 By default, $package compiles with the -O flag to use the optimizer.
3816 Alternately, you might want to use the symbolic debugger, which uses
3817 the -g flag (on traditional Unix systems). Either flag can be
3818 specified here. To use neither flag, specify the word "none".
3821 rp="What optimizer/debugger flag should be used?"
3825 'none') optimize=" ";;
3829 : We will not override a previous value, but we might want to
3830 : augment a hint file
3832 default|recommended)
3833 case "$gccversion" in
3834 1*) dflt='-fpcc-struct-return' ;;
3837 *-g*) dflt="$dflt -DDEBUGGING";;
3839 case "$gccversion" in
3840 2*) if test -d /etc/conf/kconfig.d &&
3841 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3847 case "$gccversion" in
3851 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3852 echo 'int main(void) { return 0; }' > gcctest.c
3853 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3854 echo "Yes, it does." 2>&1
3857 echo "Leaving current flags $ccflags alone." 2>&1
3859 *) dflt="$dflt -fno-strict-aliasing" ;;
3862 echo "Nope, it doesn't, but that's ok." 2>&1
3869 case "$mips_type" in
3870 *BSD*|'') inclwanted="$locincpth $usrinc";;
3871 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3873 for thisincl in $inclwanted; do
3874 if $test -d $thisincl; then
3875 if $test x$thisincl != x$usrinc; then
3878 *) dflt="$dflt -I$thisincl";;
3884 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3886 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3894 *) dflt="$dflt -D$2";;
3898 set signal.h LANGUAGE_C; eval $inctest
3902 ccflags="$ccflags -DSOCKS"
3907 default|recommended) dflt="$ccflags $dflt" ;;
3908 *) dflt="$ccflags";;
3916 Your C compiler may want other flags. For this question you should include
3917 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3918 but you should NOT include libraries or ld flags like -lwhatever. If you
3919 want $package to honor its debug switch, you should include -DDEBUGGING here.
3920 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3922 To use no flags, specify the word "none".
3928 rp="Any additional cc flags?"
3935 : the following weeds options from ccflags that are of no interest to cpp
3937 case "$gccversion" in
3938 1*) cppflags="$cppflags -D__GNUC__"
3940 case "$mips_type" in
3942 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3948 echo "Let me guess what the preprocessor flags are..." >&4
3962 *) ftry="$previous $flag";;
3964 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3965 >cpp1.out 2>/dev/null && \
3966 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3967 >cpp2.out 2>/dev/null && \
3968 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3969 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3971 cppflags="$cppflags $ftry"
3981 *-*) echo "They appear to be: $cppflags";;
3983 $rm -f cpp.c cpp?.out
3987 : flags used in final linking phase
3989 '') if ./venix; then
3995 *-posix*) dflt="$dflt -posix" ;;
3998 *) dflt="$ldflags";;
4001 : Try to guess additional flags to pick up local libraries.
4002 for thislibdir in $libpth; do
4003 case " $loclibpth " in
4006 *"-L$thislibdir "*) ;;
4007 *) dflt="$dflt -L$thislibdir" ;;
4019 Your C linker may need flags. For this question you should
4020 include -L/whatever and any other flags used by the C linker, but you
4021 should NOT include libraries like -lwhatever.
4023 Make sure you include the appropriate -L/path flags if your C linker
4024 does not normally search all of the directories you specified above,
4027 To use no flags, specify the word "none".
4031 rp="Any additional ld flags (NOT including libraries)?"
4037 rmlist="$rmlist pdp11"
4041 echo "Checking your choice of C compiler and flags for coherency..." >&4
4042 $cat > try.c <<'EOF'
4044 int main() { printf("Ok\n"); exit(0); }
4046 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4048 $cat >try.msg <<'EOM'
4049 I've tried to compile and run the following simple program:
4052 $cat try.c >> try.msg
4054 $cat >> try.msg <<EOM
4061 and I got the following output:
4065 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4066 if sh -c './try' >>try.msg 2>&1; then
4070 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4073 cat >> try.msg <<'EOQS'
4074 If $libs contains -lsfio, and sfio is mis-configured, then it
4075 sometimes (apparently) runs and exits with a 0 status, but with no
4076 output! It may have to do with sfio's use of _exit vs. exit.
4079 rp="You have a big problem. Shall I abort Configure"
4086 echo "The program compiled OK, but exited with status $?." >>try.msg
4087 rp="You have a problem. Shall I abort Configure"
4091 echo "I can't compile the test program." >>try.msg
4092 rp="You have a BIG problem. Shall I abort Configure"
4098 case "$knowitall" in
4100 echo "(The supplied flags or libraries might be incorrect.)"
4108 *) echo "Ok. Stopping Configure." >&4
4113 n) echo "OK, that should do.";;
4115 $rm -f try try.* core
4117 : define an is-a-typedef? function
4118 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4120 "") inclist="sys/types.h";;
4122 eval "varval=\$$var";
4126 for inc in $inclist; do
4127 echo "#include <$inc>" >>temp.c;
4129 echo "#ifdef $type" >> temp.c;
4130 echo "printf(\"We have $type\");" >> temp.c;
4131 echo "#endif" >> temp.c;
4132 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4133 if $contains $type temp.E >/dev/null 2>&1; then
4139 *) eval "$var=\$varval";;
4142 : define an is-a-typedef? function that prompts if the type is not available.
4143 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4145 "") inclist="sys/types.h";;
4147 eval "varval=\$$var";
4151 for inc in $inclist; do
4152 echo "#include <$inc>" >>temp.c;
4154 echo "#ifdef $type" >> temp.c;
4155 echo "printf(\"We have $type\");" >> temp.c;
4156 echo "#endif" >> temp.c;
4157 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4159 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4160 if $contains $type temp.E >/dev/null 2>&1; then
4161 echo "$type found." >&4;
4164 echo "$type NOT found." >&4;
4170 *) eval "$var=\$varval";;
4173 : define a shorthand compile call
4177 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4178 : define a shorthand compile call for compilations that should be ok.
4182 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4184 : check for lengths of integral types
4188 echo "Checking to see how big your integers are..." >&4
4189 $cat >intsize.c <<'EOCP'
4193 printf("intsize=%d;\n", (int)sizeof(int));
4194 printf("longsize=%d;\n", (int)sizeof(long));
4195 printf("shortsize=%d;\n", (int)sizeof(short));
4200 if eval $compile_ok && ./intsize > /dev/null; then
4202 echo "Your integers are $intsize bytes long."
4203 echo "Your long integers are $longsize bytes long."
4204 echo "Your short integers are $shortsize bytes long."
4208 Help! I can't compile and run the intsize test program: please enlighten me!
4209 (This is probably a misconfiguration in your system or libraries, and
4210 you really ought to fix it. Still, I'll try anyway.)
4214 rp="What is the size of an integer (in bytes)?"
4218 rp="What is the size of a long integer (in bytes)?"
4222 rp="What is the size of a short integer (in bytes)?"
4228 $rm -f intsize intsize.*
4230 : see what type lseek is declared as in the kernel
4231 rp="What is the type used for lseek's offset on this system?"
4232 set off_t lseektype long stdio.h sys/types.h
4236 $echo $n "Checking to see how big your file offsets are...$c" >&4
4238 #include <sys/types.h>
4242 printf("%d\n", (int)sizeof($lseektype));
4247 if eval $compile_ok; then
4249 $echo " $lseeksize bytes." >&4
4253 echo "(I can't seem to compile the test program. Guessing...)"
4254 rp="What is the size of your file offsets (in bytes)?"
4260 : see what type file positions are declared as in the library
4261 rp="What is the type for file position used by fsetpos()?"
4262 set fpos_t fpostype long stdio.h sys/types.h
4267 *_t) zzz="$fpostype" ;;
4270 $echo $n "Checking the size of $zzz...$c" >&4
4272 #include <sys/types.h>
4275 printf("%d\n", (int)sizeof($fpostype));
4280 if eval $compile_ok; then
4285 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4288 echo " $fpossize bytes."
4294 echo "(I can't compile the test program. Guessing...)" >&4
4295 rp="What is the size of your file positions (in bytes)?"
4302 case "$lseeksize:$fpossize" in
4305 You can have files larger than 2 gigabytes.
4310 Perl can be built to understand large files (files larger than 2 gigabytes)
4311 on some systems. To do so, Configure must be run with -Duselargefiles.
4313 If this doesn't make any sense to you, just accept the default 'y'.
4315 case "$uselargefiles" in
4316 "$undef"|false|[nN]*) dflt='n' ;;
4319 rp='Try to understand large files, if available?'
4322 y|Y) val="$define" ;;
4329 case "$uselargefiles" in
4331 : Look for a hint-file generated 'call-back-unit'. If the
4332 : user has specified that a large files perl is to be built,
4333 : we may need to set or change some other defaults.
4334 if $test -f uselfs.cbu; then
4335 echo "Your platform has some specific hints for large file builds, using them..."
4338 $echo $n "Rechecking to see how big your file offsets are...$c" >&4
4340 #include <sys/types.h>
4344 printf("%d\n", (int)sizeof($lseektype));
4349 if eval $compile_ok; then
4351 $echo " $lseeksize bytes." >&4
4355 echo "(I can't seem to compile the test program. Guessing...)"
4356 rp="What is the size of your file offsets (in bytes)?"
4361 *_t) zzz="$fpostype" ;;
4364 $echo $n "Rechecking the size of $zzz...$c" >&4
4366 #include <sys/types.h>
4369 printf("%d\n", (int)sizeof($fpostype));
4374 if eval $compile_ok; then
4379 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4382 echo " $fpossize bytes."
4388 echo "(I can't compile the test program. Guessing...)" >&4
4389 rp="What is the size of your file positions (in bytes)?"
4399 case "$usemorebits" in
4400 "$define"|true|[yY]*)
4402 uselongdouble="$define"
4403 usemorebits="$define"
4405 *) usemorebits="$undef"
4410 case "$intsize:$longsize" in
4413 You have natively 64-bit integers.
4418 Perl can be built to take advantage of 64-bit integer types
4419 on some systems. To do so, Configure must be run with -Duse64bits.
4421 If this doesn't make any sense to you, just accept the default.
4423 case "$use64bits" in
4424 $define|true|[yY]*) dflt='y';;
4427 rp='Try to use 64-bit integers, if available?'
4430 y|Y) val="$define" ;;
4438 case "$archname64" in
4439 '') archname64='' ;; # not a typo
4442 case "$use64bits" in
4443 "$define"|true|[yY]*)
4444 : Look for a hint-file generated 'call-back-unit'. If the
4445 : user has specified that a 64-bit perl is to be built,
4446 : we may need to set or change some other defaults.
4447 if $test -f use64bits.cbu; then
4448 echo "Your platform has some specific hints for 64-bit builds, using them..."
4452 (Your platform doesn't have any specific hints for 64-bit builds.)
4454 case "$intsize:$longsize" in
4456 (This is probably okay, as your system is a natively 64-bit system.)
4460 case "$gccversion" in
4462 *) case "$ccflags" in
4463 *-DUSE_LONG_LONG*) ;;
4465 But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
4466 to the compilation flags.
4468 ccflags="$ccflags -DUSE_LONG_LONG"
4477 : determine the architecture name
4479 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4480 tarch=`arch`"-$osname"
4481 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4482 if uname -m > tmparch 2>&1 ; then
4483 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4484 -e 's/$/'"-$osname/" tmparch`
4492 case "$myarchname" in
4495 echo "(Your architecture name used to be $myarchname.)"
4502 *) dflt="$archname";;
4504 rp='What is your architecture name'
4507 case "$usethreads" in
4509 echo "Threads selected." >&4
4511 *-thread*) echo "...and architecture name already has -thread." >&4
4513 *) archname="$archname-thread"
4514 echo "...setting architecture name to $archname." >&4
4519 case "$usemultiplicity" in
4521 echo "Multiplicity selected." >&4
4523 *-multi*) echo "...and architecture name already has -multi." >&4
4525 *) archname="$archname-multi"
4526 echo "...setting architecture name to $archname." >&4
4531 case "$use64bits" in
4533 case "$archname64" in
4538 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4540 *) archname="$archname-$archname64"
4541 echo "...setting architecture name to $archname." >&4
4548 : determine root of directory hierarchy where package will be installed.
4551 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4559 By default, $package will be installed in $dflt/bin, manual pages
4560 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4561 installation directories. Typically this is something like /usr/local.
4562 If you wish to have binaries under /usr/bin but other parts of the
4563 installation under /usr/local, that's ok: you will be prompted
4564 separately for each of the installation directories, the prefix being
4565 only used to set the defaults.
4569 rp='Installation prefix to use?'
4577 *) oldprefix="$prefix";;
4587 $define|true) afs=true ;;
4588 $undef|false) afs=false ;;
4589 *) if test -d /afs; then
4597 echo "AFS may be running... I'll be extra cautious then..." >&4
4599 echo "AFS does not seem to be running..." >&4
4602 : determine installation prefix for where package is to be installed.
4606 Since you are running AFS, I need to distinguish the directory in which
4607 files will reside from the directory in which they are installed (and from
4608 which they are presumably copied to the former directory by occult means).
4611 case "$installprefix" in
4612 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4613 *) dflt="$installprefix";;
4618 In some special cases, particularly when building $package for distribution,
4619 it is convenient to distinguish between the directory in which files should
4620 be installed from the directory ($prefix) in which they
4621 will eventually reside. For most users, these two directories are the same.
4624 case "$installprefix" in
4626 *) dflt=$installprefix;;
4630 rp='What installation prefix should I use for installing files?'
4632 installprefix="$ans"
4633 installprefixexp="$ansexp"
4635 : set the prefixit variable, to compute a suitable default value
4636 prefixit='case "$3" in
4638 case "$oldprefix" in
4639 "") eval "$1=\"\$$2\"";;
4646 ""|" ") eval "$1=\"\$$2\"";;
4652 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4654 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4655 /*-$oldprefix/*|\~*-$oldprefix/*)
4656 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4657 *) eval "$1=\"\$$2\"";;
4661 : set the base revision
4665 : get the patchlevel
4667 echo "Getting the current patchlevel..." >&4
4668 if $test -r $rsrc/patchlevel.h;then
4669 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4670 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4671 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4672 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4673 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4681 $echo $n "(You have $package" $c
4684 *) $echo $n " $baserev" $c ;;
4686 $echo $n " patchlevel $patchlevel" $c
4687 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4690 dos|cygwin|vms|win32)
4691 : XXX Should be a Configure test for double-dots in filenames.
4692 version=`echo $baserev $patchlevel $subversion | \
4693 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4694 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4695 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4698 version=`echo $baserev $patchlevel $subversion | \
4699 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4700 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4701 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4704 : Special case the 5.005_xx maintenance series, which used 5.005
4705 : without any subversion label as a subdirectory in $sitelib
4706 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4707 api_versionstring='5.005'
4710 : determine installation style
4711 : For now, try to deduce it from prefix unless it is already set.
4712 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4713 case "$installstyle" in
4714 '') case "$prefix" in
4715 *perl*) dflt='lib';;
4716 *) dflt='lib/perl5' ;;
4719 *) dflt='lib/perl5' ;;
4721 : Probably not worth prompting for this since we prompt for all
4722 : the directories individually, and the prompt would be too long and
4726 : determine where private library files go
4727 : Usual default is /usr/local/lib/perl5/$version.
4728 : Also allow things like /opt/perl/lib/$version, since
4729 : /opt/perl/lib/perl5... would be redundant.
4730 : The default "style" setting is made in installstyle.U
4731 case "$installstyle" in
4732 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4733 *) set dflt privlib lib/$version ;;
4738 There are some auxiliary files for $package that need to be put into a
4739 private library directory that is accessible by everyone.
4743 rp='Pathname where the private library files will reside?'
4746 privlibexp="$ansexp"
4747 : Change installation prefix, if necessary.
4748 if $test X"$prefix" != X"$installprefix"; then
4749 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4751 installprivlib="$privlibexp"
4754 : set the prefixup variable, to restore leading tilda escape
4755 prefixup='case "$prefixexp" in
4757 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4760 : determine where public architecture dependent libraries go
4763 : privlib default is /usr/local/lib/$package/$version
4764 : archlib default is /usr/local/lib/$package/$version/$archname
4765 : privlib may have an optional trailing /share.
4766 tdflt=`echo $privlib | $sed 's,/share$,,'`
4767 tdflt=$tdflt/$archname
4776 $spackage contains architecture-dependent library files. If you are
4777 sharing libraries in a heterogeneous environment, you might store
4778 these files in a separate location. Otherwise, you can just include
4779 them with the rest of the public library files.
4783 rp='Where do you want to put the public architecture-dependent libraries?'
4786 archlibexp="$ansexp"
4787 if $test X"$archlib" = X"$privlib"; then
4792 : Change installation prefix, if necessary.
4793 if $test X"$prefix" != X"$installprefix"; then
4794 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4796 installarchlib="$archlibexp"
4800 : Binary compatibility with 5.005 is not possible for builds
4801 : with advanced features
4802 case "$usethreads$usemultiplicity" in
4804 bincompat5005="$undef"
4805 d_bincompat5005="$undef"
4809 Perl 5.006 can be compiled for binary compatibility with 5.005.
4810 If you decide to do so, you will be able to continue using most
4811 of the extensions that were compiled for Perl 5.005.
4814 case "$bincompat5005$d_bincompat5005" in
4815 *"$undef"*) dflt=n ;;
4818 rp='Binary compatibility with Perl 5.005?'
4821 y*) val="$define" ;;
4826 case "$d_bincompat5005" in
4828 bincompat5005="$define"
4830 *) bincompat5005="$undef"
4831 d_bincompat5005="$undef"
4838 : see if setuid scripts can be secure
4841 Some kernels have a bug that prevents setuid #! scripts from being
4842 secure. Some sites have disabled setuid #! scripts because of this.
4844 First let's decide if your kernel supports secure setuid #! scripts.
4845 (If setuid #! scripts would be secure but have been disabled anyway,
4846 don't say that they are secure if asked.)
4851 if $test -d /dev/fd; then
4852 echo "#!$ls" >reflect
4853 chmod +x,u+s reflect
4854 ./reflect >flect 2>&1
4855 if $contains "/dev/fd" flect >/dev/null; then
4856 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4860 If you are not sure if they are secure, I can check but I'll need a
4861 username and password different from the one you are using right now.
4862 If you don't have such a username or don't want me to test, simply
4866 rp='Other username to test security of setuid scripts with?'
4871 case "$d_suidsafe" in
4872 '') echo "I'll assume setuid scripts are *not* secure." >&4
4875 echo "Well, the $hint value is *not* secure." >&4
4877 *) echo "Well, the $hint value *is* secure." >&4
4882 $rm -f reflect flect
4883 echo "#!$ls" >reflect
4884 chmod +x,u+s reflect
4887 echo '"su" will (probably) prompt you for '"$ans's password."
4888 su $ans -c './reflect >flect'
4889 if $contains "/dev/fd" flect >/dev/null; then
4890 echo "Okay, it looks like setuid scripts are secure." >&4
4893 echo "I don't think setuid scripts are secure." >&4
4898 rp='Does your kernel have *secure* setuid scripts?'
4901 [yY]*) val="$define";;
4906 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4907 echo "(That's for file descriptors, not floppy disks.)"
4913 $rm -f reflect flect
4915 : now see if they want to do setuid emulation
4918 case "$d_suidsafe" in
4921 echo "No need to emulate SUID scripts since they are secure here." >& 4
4925 Some systems have disabled setuid scripts, especially systems where
4926 setuid scripts cannot be secure. On systems where setuid scripts have
4927 been disabled, the setuid/setgid bits on scripts are currently
4928 useless. It is possible for $package to detect those bits and emulate
4929 setuid/setgid in a secure fashion. This emulation will only work if
4930 setuid scripts have been disabled in your kernel.
4934 "$define") dflt=y ;;
4937 rp="Do you want to do setuid/setgid emulation?"
4940 [yY]*) val="$define";;
4948 : determine filename position in cpp output
4950 echo "Computing filename position in cpp output for #include directives..." >&4
4951 echo '#include <stdio.h>' > foo.c
4954 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4955 $grep '^[ ]*#.*stdio\.h' | \
4956 while read cline; do
4959 while $test \$# -gt 0; do
4960 if $test -r \`echo \$1 | $tr -d '"'\`; then
4965 pos=\`expr \$pos + 1\`
4977 *) pos="${fieldn}th";;
4979 echo "Your cpp writes the filename in the $pos field of the line."
4981 : locate header file
4986 for usrincdir in $usrinc
4988 if test -f \$usrincdir/\$wanted; then
4989 echo "\$usrincdir/\$wanted"
4993 awkprg='{ print \$$fieldn }'
4994 echo "#include <\$wanted>" > foo\$\$.c
4995 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4996 $grep "^[ ]*#.*\$wanted" | \
4997 while read cline; do
4998 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5000 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5001 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5006 # status = 0: grep returned 0 lines, case statement not executed
5007 # status = 1: headerfile found
5008 # status = 2: while loop executed, no headerfile found
5012 if test \$status -eq 1; then
5019 : define an alternate in-header-list? function
5020 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5021 cont=true; xxf="echo \"<\$1> found.\" >&4";
5022 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5023 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5025 case $# in 4) instead=instead;; *) instead="at last";; esac;
5026 while $test "$cont"; do
5028 var=$2; eval "was=\$$2";
5029 if $test "$xxx" && $test -r "$xxx";
5031 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5034 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5035 set $yyy; shift; shift; yyy=$@;
5036 case $# in 0) cont="";;
5037 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5038 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5039 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5040 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5044 do set $yyy; var=$2; eval "was=\$$2";
5045 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5046 set $yyy; shift; shift; yyy=$@;
5049 : see if this is a malloc.h system
5050 set malloc.h i_malloc
5053 : see if stdlib is available
5054 set stdlib.h i_stdlib
5057 : determine which malloc to compile in
5059 case "$usemymalloc" in
5060 ''|[yY]*|true|$define) dflt='y' ;;
5063 rp="Do you wish to attempt to use the malloc that comes with $package?"
5069 mallocsrc='malloc.c'
5070 mallocobj="malloc$_o"
5071 d_mymalloc="$define"
5074 : Remove malloc from list of libraries to use
5075 echo "Removing unneeded -lmalloc from library list" >&4
5076 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5079 echo "libs = $libs" >&4
5091 : compute the return types of malloc and free
5093 $cat >malloc.c <<END
5097 #include <sys/types.h>
5111 case "$malloctype" in
5113 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5120 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5124 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5131 echo "Your system uses $freetype free(), it would seem." >&4
5135 The installation process will also create a directory for
5136 vendor-supplied add-ons. Vendors who supply perl with their system
5137 may find it convenient to place all vendor-supplied files in this
5138 directory rather than in the main distribution directory. This will
5139 ease upgrades between binary-compatible maintenance versions of perl.
5141 Of course you may also use these directories in whatever way you see
5142 fit. For example, you might use them to access modules shared over a
5143 company-wide network.
5145 The default answer should be fine for most people.
5146 This causes further questions about vendor add-ons to be skipped
5147 and no vendor-specific directories will be configured for perl.
5150 rp='Do you want to configure vendor-specific add-on directories?'
5151 case "$usevendorprefix" in
5152 define|true|[yY]*) dflt=y ;;
5158 rp='Installation prefix to use for vendor-supplied add-ons?'
5159 case "$vendorprefix" in
5161 *) dflt=$vendorprefix ;;
5165 case "$vendorprefix" in
5169 *) oldvendorprefix="$prefix";;
5173 usevendorprefix="$define"
5175 vendorprefixexp="$ansexp"
5177 *) usevendorprefix="$undef"
5183 case "$vendorprefix" in
5184 '') d_vendorlib="$undef"
5188 *) d_vendorlib="$define"
5189 : determine where vendor-supplied modules go.
5190 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5191 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5192 case "$installstyle" in
5193 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5194 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5197 rp='Pathname for the vendor-supplied library files?'
5200 vendorlibexp="$ansexp"
5201 : Change installation prefix, if necessary.
5202 if $test X"$prefix" != X"$installprefix"; then
5203 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5205 installvendorlib="$vendorlibexp"
5210 : Cruising for prototypes
5212 echo "Checking out function prototypes..." >&4
5213 $cat >prototype.c <<'EOCP'
5214 int main(int argc, char *argv[]) {
5217 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5218 echo "Your C compiler appears to support function prototypes."
5221 echo "Your C compiler doesn't seem to understand function prototypes."
5228 case "$prototype" in
5230 *) ansi2knr='ansi2knr'
5235 This version of $package can only be compiled by a compiler that
5236 understands function prototypes. Unfortunately, your C compiler
5238 doesn't seem to understand them. Sorry about that.
5240 If GNU cc is available for your system, perhaps you could try that instead.
5242 Eventually, we hope to support building Perl with pre-ANSI compilers.
5243 If you would like to help in that effort, please contact <perlbug@perl.org>.
5245 Aborting Configure now.
5251 : determine where public executables go
5256 rp='Pathname where the public executables will reside?'
5258 if $test "X$ansexp" != "X$binexp"; then
5263 : Change installation prefix, if necessary.
5264 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5265 if $test X"$prefix" != X"$installprefix"; then
5266 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5268 installbin="$binexp"
5273 After $package is installed, you may wish to install various
5274 add-on modules and utilities. Typically, these add-ons will
5275 be installed under $prefix with the rest
5276 of this package. However, you may wish to install such add-ons
5277 elsewhere under a different prefix.
5279 If you do not wish to put everything under a single prefix, that's
5280 ok. You will be prompted for the individual locations; this siteprefix
5281 is only used to suggest the defaults.
5283 The default should be fine for most people.
5287 rp='Installation prefix to use for add-on modules and utilities?'
5288 : XXX Here might be another good place for an installstyle setting.
5289 case "$siteprefix" in
5291 *) dflt=$siteprefix ;;
5295 case "$siteprefix" in
5300 *) oldsiteprefix="$prefix";;
5305 siteprefixexp="$ansexp"
5307 : determine where site specific libraries go.
5308 : Usual default is /usr/local/lib/perl5/site_perl/$version
5309 : The default "style" setting is made in installstyle.U
5310 : XXX No longer works with Prefixit stuff.
5311 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5312 case "$installstyle" in
5313 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5314 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5318 The installation process will create a directory for
5319 site-specific extensions and modules. Most users find it convenient
5320 to place all site-specific files in this directory rather than in the
5321 main distribution directory.
5325 rp='Pathname for the site-specific library files?'
5328 sitelibexp="$ansexp"
5329 : Change installation prefix, if necessary.
5330 if $test X"$prefix" != X"$installprefix"; then
5331 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
5333 installsitelib="$sitelibexp"
5336 : Determine list of previous versions to include in @INC
5337 $cat > getverlist <<EOPL
5340 \$api_versionstring = "$api_versionstring";
5341 \$version = "$version";
5342 \$sitelib = "$sitelib";
5343 \$archname = "$archname";
5345 $cat >> getverlist <<'EOPL'
5346 # Can't have leading @ because metaconfig interprets it as a command!
5347 ;@inc_version_list=();
5348 $stem=dirname($sitelib);
5349 # Redo to do opendir/readdir?
5352 ;@candidates = glob("5.*");
5358 # XXX ToDo: These comparisons must be reworked when two-digit
5359 # subversions come along, so that 5.7.10 compares as greater than
5360 # 5.7.3! By that time, hope that 5.6.x is sufficiently
5361 # widespread that we can use the built-in version vectors rather
5362 # than reinventing them here. For 5.6.0, however, we must
5363 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
5364 foreach $d (@candidates) {
5365 if ($d lt $version) {
5366 if ($d ge $api_versionstring) {
5367 unshift(@inc_version_list, "$d/$archname", $d);
5369 elsif ($d ge "5.005") {
5370 unshift(@inc_version_list, $d);
5374 # Skip newer version. I.e. don't look in
5375 # 5.7.0 if we're installing 5.6.1.
5379 if (@inc_version_list) {
5381 print join('", "', @inc_version_list);
5385 # Blank space to preserve value for next Configure run.
5390 case "$inc_version_list" in
5391 '') if test -x $perl; then
5392 dflt=`$perl getverlist`
5397 *) dflt="$inc_version_list" ;;
5401 In order to ease the process of upgrading, this version of perl
5402 can be configured to use modules built and installed with earlier
5403 versions of perl that were installed under $prefix. Specify here
5404 the list of earlier versions that this version of perl should check.
5405 If Configure detected no earlier versions of perl installed under
5406 $prefix, then the list will be empty.
5408 The default should almost always be sensible, so if you're not sure,
5409 just accept the default.
5412 rp='list of earlier versions to include in @INC?'
5414 inc_version_list="$ans"
5417 : determine whether to install perl also as /usr/bin/perl
5420 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5422 Many scripts expect to perl to be installed as /usr/bin/perl.
5423 I can install the perl you are about to compile also as /usr/bin/perl
5424 (in addition to $installbin/perl).
5426 case "$installusrbinperl" in
5427 "$undef"|[nN]*) dflt='n';;
5430 rp="Do you want to install perl as /usr/bin/perl?"
5433 [yY]*) val="$define";;
5439 set installusrbinperl
5443 echo "Checking for GNU C Library..." >&4
5444 cat >gnulibc.c <<EOM
5456 if eval $compile_ok && ./gnulibc; then
5458 echo "You are using the GNU C Library"
5461 echo "You are not using the GNU C Library"
5467 : see if nm is to be used to determine whether a symbol is defined or not
5471 case "$d_gnulibc" in
5474 echo "nm probably won't work on the GNU C Library." >&4
5480 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5482 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5483 echo "'nm' won't be sufficient on this sytem." >&4
5489 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5490 if $test $dflt -gt 20; then
5500 true|$define) dflt=y;;
5507 I can use $nm to extract the symbols from your C libraries. This
5508 is a time consuming task which may generate huge output on the disk (up
5509 to 3 megabytes) but that should make the symbols extraction faster. The
5510 alternative is to skip the 'nm' extraction part and to compile a small
5511 test program instead to determine whether each symbol is present. If
5512 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5513 this may be the best solution.
5515 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5518 rp="Shall I use $nm to extract C symbols from the libraries?"
5521 [Nn]*) usenm=false;;
5530 : nm options which may be necessary
5532 '') if $test -f /mach_boot; then
5534 elif $test -d /usr/ccs/lib; then
5535 nm_opt='-p' # Solaris (and SunOS?)
5536 elif $test -f /dgux; then
5538 elif $test -f /lib64/rld; then
5539 nm_opt='-p' # 64-bit Irix
5545 : nm options which may be necessary for shared libraries but illegal
5546 : for archive libraries. Thank you, Linux.
5547 case "$nm_so_opt" in
5548 '') case "$myuname" in
5550 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5551 nm_so_opt='--dynamic'
5560 : get list of predefined functions in a handy place
5565 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5572 *) for thislib in $libs; do
5575 : Handle C library specially below.
5578 thislib=`echo $thislib | $sed -e 's/^-l//'`
5579 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5581 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5583 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5585 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5587 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5589 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5591 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5596 libnames="$libnames $try"
5598 *) libnames="$libnames $thislib" ;;
5607 for xxx in $libpth; do
5608 $test -r $1 || set $xxx/libc.$so
5609 : The messy sed command sorts on library version numbers.
5611 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5612 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5614 s/[0-9][0-9]*/0000&/g
5615 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5618 sort | $sed -e 's/^.* //'`
5621 $test -r $1 || set /usr/ccs/lib/libc.$so
5622 $test -r $1 || set /lib/libsys_s$_a
5628 if $test -r "$1"; then
5629 echo "Your (shared) C library seems to be in $1."
5631 elif $test -r /lib/libc && $test -r /lib/clib; then
5632 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5634 libc='/lib/clib /lib/libc'
5635 if $test -r /lib/syslib; then
5636 echo "(Your math library is in /lib/syslib.)"
5637 libc="$libc /lib/syslib"
5639 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5640 echo "Your C library seems to be in $libc, as you said before."
5641 elif $test -r $incpath/usr/lib/libc$_a; then
5642 libc=$incpath/usr/lib/libc$_a;
5643 echo "Your C library seems to be in $libc. That's fine."
5644 elif $test -r /lib/libc$_a; then
5646 echo "Your C library seems to be in $libc. You're normal."
5648 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5650 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5651 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5652 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5654 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5656 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5659 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5661 if $test -r "$tans"; then
5662 echo "Your C library seems to be in $tans, of all places."
5668 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5672 If the guess above is wrong (which it might be if you're using a strange
5673 compiler, or your machine supports multiple models), you can override it here.
5678 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5680 I can't seem to find your C library. I've looked in the following places:
5683 $sed 's/^/ /' libpath
5686 None of these seems to contain your C library. I need to get its name...
5691 rp='Where is your C library?'
5696 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5697 set X `cat libnames`
5700 case $# in 1) xxx=file; esac
5701 echo "Extracting names from the following $xxx for later perusal:" >&4
5703 $sed 's/^/ /' libnames >&4
5705 $echo $n "This may take a while...$c" >&4
5709 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5710 *) $nm $nm_opt $file 2>/dev/null;;
5715 $grep fprintf libc.tmp > libc.ptf
5716 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5717 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5719 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5721 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5723 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5725 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5727 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5729 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5731 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5733 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5735 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5737 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5739 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5741 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5743 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5744 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5746 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5748 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5750 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5752 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5754 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5756 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5758 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5760 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5762 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5764 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5766 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5768 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5770 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5772 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5774 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5777 $nm -p $* 2>/dev/null >libc.tmp
5778 $grep fprintf libc.tmp > libc.ptf
5779 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5780 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5786 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5788 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5789 for thisname in $libnames $libc; do
5790 $ar t $thisname >>libc.tmp
5792 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5794 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5795 # Repeat libc to extract forwarders to DLL entries too
5796 for thisname in $libnames $libc; do
5797 $ar tv $thisname >>libc.tmp
5798 # Revision 50 of EMX has bug in $ar.
5799 # it will not extract forwarders to DLL entries
5800 # Use emximp which will extract exactly them.
5801 emximp -o tmp.imp $thisname \
5803 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5804 < tmp.imp >>libc.tmp
5807 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5810 echo "$ar didn't seem to work right." >&4
5811 echo "Maybe this is a Cray...trying bld instead..." >&4
5812 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5814 for thisname in $libnames; do
5816 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5817 $ar t $thisname >>libc.tmp
5821 echo "That didn't work either. Giving up." >&4
5828 if $test -f /lib/syscalls.exp; then
5830 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5831 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5835 $rm -f libnames libpath
5837 : see if dld is available
5841 : is a C symbol defined?
5844 -v) tf=libc.tmp; tc=""; tdc="";;
5845 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5846 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5849 case "$reuseval-$4" in
5851 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5857 if $contains $tlook $tf >/dev/null 2>&1;
5862 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5863 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5871 $define) tval=true;;
5877 : define an is-in-libc? function
5878 inlibc='echo " "; td=$define; tu=$undef;
5879 sym=$1; var=$2; eval "was=\$$2";
5881 case "$reuseval$was" in
5891 echo "$sym() found." >&4;
5892 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5894 echo "$sym() NOT found." >&4;
5895 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5899 $define) echo "$sym() found." >&4;;
5900 *) echo "$sym() NOT found." >&4;;
5904 : see if dlopen exists
5911 : determine which dynamic loading, if any, to compile in
5913 dldir="ext/DynaLoader"
5926 $define) dflt='y' ;;
5929 $define) dflt='y' ;;
5931 : Does a dl_xxx.xs file exist for this operating system
5932 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5935 rp="Do you wish to use dynamic loading?"
5942 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5943 dflt="$dldir/dl_${osname}.xs"
5944 elif $test "$d_dlopen" = "$define" ; then
5945 dflt="$dldir/dl_dlopen.xs"
5946 elif $test "$i_dld" = "$define" ; then
5947 dflt="$dldir/dl_dld.xs"
5952 *) dflt="$dldir/$dlsrc"
5955 echo "The following dynamic loading files are available:"
5956 : Can not go over to $dldir because getfile has path hard-coded in.
5957 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5958 rp="Source file to use for dynamic loading"
5964 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5968 Some systems may require passing special flags to $cc -c to
5969 compile modules that will be used to create a shared library.
5970 To use no flags, say "none".
5973 case "$cccdlflags" in
5974 '') case "$gccversion" in
5975 '') case "$osname" in
5977 next) dflt='none' ;;
5978 irix*) dflt='-KPIC' ;;
5979 svr4*|esix*|solaris) dflt='-KPIC' ;;
5980 sunos) dflt='-pic' ;;
5984 *) case "$osname" in
5985 svr4*|esix*|solaris) dflt='-fPIC' ;;
5990 *) dflt="$cccdlflags" ;;
5992 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5995 none) cccdlflags=' ' ;;
5996 *) cccdlflags="$ans" ;;
6001 Some systems use ld to create libraries that can be dynamically loaded,
6002 while other systems (such as those using ELF) use $cc.
6006 '') $cat >try.c <<'EOM'
6007 /* Test for whether ELF binaries are produced */
6012 int i = open("a.out",O_RDONLY);
6015 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6016 exit(0); /* succeed (yes, it's ELF) */
6021 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6023 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6027 echo "I'll use ld to build dynamic libraries."
6036 rp="What command should be used to create dynamic libraries?"
6042 Some systems may require passing special flags to $ld to create a
6043 library that can be dynamically loaded. If your ld flags include
6044 -L/other/path options to locate libraries outside your loader's normal
6045 search path, you may need to specify those -L options here as well. To
6046 use no flags, say "none".
6049 case "$lddlflags" in
6050 '') case "$osname" in
6051 beos) dflt='-nostart' ;;
6053 linux|irix*) dflt='-shared' ;;
6054 next) dflt='none' ;;
6055 solaris) dflt='-G' ;;
6056 sunos) dflt='-assert nodefinitions' ;;
6057 svr4*|esix*) dflt="-G $ldflags" ;;
6061 *) dflt="$lddlflags" ;;
6064 : Try to guess additional flags to pick up local libraries.
6065 : Be careful not to append to a plain 'none'
6069 for thisflag in $ldflags; do
6074 *) dflt="$dflt $thisflag" ;;
6081 ''|' ') dflt='none' ;;
6084 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6087 none) lddlflags=' ' ;;
6088 *) lddlflags="$ans" ;;
6093 Some systems may require passing special flags to $cc to indicate that
6094 the resulting executable will use dynamic linking. To use no flags,
6098 case "$ccdlflags" in
6099 '') case "$osname" in
6100 hpux) dflt='-Wl,-E' ;;
6101 linux) dflt='-rdynamic' ;;
6102 next) dflt='none' ;;
6103 sunos) dflt='none' ;;
6107 *) dflt="$ccdlflags" ;;
6109 rp="Any special flags to pass to $cc to use dynamic loading?"
6112 none) ccdlflags=' ' ;;
6113 *) ccdlflags="$ans" ;;
6127 # No dynamic loading being used, so don't bother even to prompt.
6130 *) case "$useshrplib" in
6131 '') case "$osname" in
6132 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6134 also='Building a shared libperl is required for dynamic loading to work on your system.'
6139 also='Building a shared libperl is needed for MAB support.'
6157 The perl executable is normally obtained by linking perlmain.c with
6158 libperl${_a}, any static extensions (usually just DynaLoader), and
6159 any other libraries needed on this system (such as -lm, etc.). Since
6160 your system supports dynamic loading, it is probably possible to build
6161 a shared libperl.$so. If you will have more than one executable linked
6162 to libperl.$so, this will significantly reduce the size of each
6163 executable, but it may have a noticeable affect on performance. The
6164 default is probably sensible for your system.
6168 rp="Build a shared libperl.$so (y/n)"
6172 useshrplib='true' ;;
6173 *) useshrplib='false' ;;
6178 case "$useshrplib" in
6182 # Figure out a good name for libperl.so. Since it gets stored in
6183 # a version-specific architecture-dependent library, the version
6184 # number isn't really that important, except for making cc/ld happy.
6186 # A name such as libperl.so.3.1
6187 majmin="libperl.$so.$patchlevel.$subversion"
6188 # A name such as libperl.so.301
6189 majonly=`echo $patchlevel $subversion |
6190 $awk '{printf "%d%02d", $1, $2}'`
6191 majonly=libperl.$so.$majonly
6192 # I'd prefer to keep the os-specific stuff here to a minimum, and
6193 # rely on figuring it out from the naming of libc.
6194 case "${osname}${osvers}" in
6197 # XXX How handle the --version stuff for MAB?
6199 linux*) # ld won't link with a bare -lperl otherwise.
6202 cygwin*) # include version
6203 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6205 *) # Try to guess based on whether libc has major.minor.
6207 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6208 *libc.$so.[0-9]*) dflt=$majonly ;;
6209 *) dflt=libperl.$so ;;
6219 I need to select a good name for the shared libperl. If your system uses
6220 library names with major and minor numbers, then you might want something
6221 like $majmin. Alternatively, if your system uses a single version
6222 number for shared libraries, then you might want to use $majonly.
6223 Or, your system might be quite happy with a simple libperl.$so.
6225 Since the shared libperl will get installed into a version-specific
6226 architecture-dependent directory, the version number of the shared perl
6227 library probably isn't important, so the default should be o.k.
6230 rp='What name do you want to give to the shared libperl?'
6233 echo "Ok, I'll use $libperl"
6236 libperl="libperl${_a}"
6240 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6244 WARNING: Use of the shrpdir variable for the installation location of
6245 the shared $libperl is not supported. It was never documented and
6246 will not work in this version. Let me (perlbug@perl.com)
6247 know of any problems this may cause.
6253 But your current setting of $shrpdir is
6254 the default anyway, so it's harmless.
6259 Further, your current attempted setting of $shrpdir
6260 conflicts with the value of $archlibexp/CORE
6261 that installperl will use.
6268 # How will the perl executable find the installed shared $libperl?
6269 # Add $xxx to ccdlflags.
6270 # If we can't figure out a command-line option, use $shrpenv to
6271 # set env LD_RUN_PATH. The main perl makefile uses this.
6272 shrpdir=$archlibexp/CORE
6275 if "$useshrplib"; then
6278 # We'll set it in Makefile.SH...
6284 xxx="-Wl,-R$shrpdir"
6286 linux|irix*|dec_osf)
6287 xxx="-Wl,-rpath,$shrpdir"
6290 # next doesn't like the default...
6293 # beos doesn't like the default, either.
6296 # hpux doesn't like the default, either.
6297 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6300 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6306 # Only add $xxx if it isn't already in ccdlflags.
6307 case " $ccdlflags " in
6309 *) ccdlflags="$ccdlflags $xxx"
6312 Adding $xxx to the flags
6313 passed to $ld so that the perl executable will find the
6314 installed shared $libperl.
6322 # Fix ccdlflags in AIX for building external extensions.
6323 # (For building Perl itself bare -bE:perl.exp is needed,
6324 # Makefile.SH takes care of this.)
6326 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6328 # Respect a hint or command-line value.
6330 '') shrpenv="$tmp_shrpenv" ;;
6332 case "$ldlibpthname" in
6333 '') ldlibpthname=LD_LIBRARY_PATH ;;
6334 none) ldlibpthname='' ;;
6337 : determine where manual pages go
6338 set man1dir man1dir none
6342 $spackage has manual pages available in source form.
6346 echo "However, you don't have nroff, so they're probably useless to you."
6348 '') man1dir="none";;
6351 echo "If you don't want the manual sources installed, answer 'none'."
6356 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6357 lookpath="$lookpath $prefixexp/man/p_man/man1"
6358 lookpath="$lookpath $prefixexp/man/u_man/man1"
6359 lookpath="$lookpath $prefixexp/man/man.1"
6361 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6362 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6372 rp="Where do the main $spackage manual pages (source) go?"
6374 if $test "X$man1direxp" != "X$ansexp"; then
6378 man1direxp="$ansexp"
6384 : Change installation prefix, if necessary.
6385 if $test X"$prefix" != X"$installprefix"; then
6386 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6388 installman1dir="$man1direxp"
6391 : What suffix to use on installed man pages
6398 rp="What suffix should be used for the main $spackage man pages?"
6400 '') case "$man1dir" in
6414 *) dflt="$man1ext";;
6421 : see if we can have long filenames
6423 rmlist="$rmlist /tmp/cf$$"
6424 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6425 first=123456789abcdef
6426 second=/tmp/cf$$/$first
6427 $rm -f $first $second
6428 if (echo hi >$first) 2>/dev/null; then
6429 if $test -f 123456789abcde; then
6430 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6433 if (echo hi >$second) 2>/dev/null; then
6434 if $test -f /tmp/cf$$/123456789abcde; then
6436 That's peculiar... You can have filenames longer than 14 characters, but only
6437 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6438 I shall consider your system cannot support long filenames at all.
6442 echo 'You can have filenames longer than 14 characters.' >&4
6447 How confusing! Some of your filesystems are sane enough to allow filenames
6448 longer than 14 characters but some others like /tmp can't even think about them.
6449 So, for now on, I shall assume your kernel does not allow them at all.
6456 You can't have filenames longer than 14 chars. You can't even think about them!
6462 $rm -rf /tmp/cf$$ 123456789abcde*
6464 : determine where library module manual pages go
6465 set man3dir man3dir none
6469 $spackage has manual pages for many of the library modules.
6475 However, you don't have nroff, so they're probably useless to you.
6478 '') man3dir="none";;
6482 case "$d_flexfnam" in
6485 However, your system can't handle the long file names like File::Basename.3.
6488 '') man3dir="none";;
6492 echo "If you don't want the manual sources installed, answer 'none'."
6493 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6495 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6496 if $test -d "$privlib/man/man3"; then
6499 WARNING: Previous versions of perl installed man3 pages into
6500 $privlib/man/man3. This version will suggest a
6501 new default of $dflt.
6505 rp='Do you wish to preserve the old behavior?(y/n)'
6508 y*) dflt="$privlib/man/man3" ;;
6514 *) dflt="$man3dir" ;;
6518 rp="Where do the $package library man pages (source) go?"
6521 man3direxp="$ansexp"
6527 : Change installation prefix, if necessary.
6528 if $test X"$prefix" != X"$installprefix"; then
6529 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6531 installman3dir="$man3direxp"
6534 : What suffix to use on installed man pages
6540 rp="What suffix should be used for the $package library man pages?"
6542 '') case "$man3dir" in
6556 *) dflt="$man3ext";;
6563 : see if we have to deal with yellow pages, now NIS.
6564 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6565 if $test -f /usr/etc/nibindd; then
6567 echo "I'm fairly confident you're on a NeXT."
6569 rp='Do you get the hosts file via NetInfo?'
6578 y*) hostcat='nidump hosts .';;
6579 *) case "$hostcat" in
6580 nidump*) hostcat='';;
6590 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6598 rp='Are you getting the hosts file via yellow pages?'
6601 y*) hostcat='ypcat hosts';;
6602 *) hostcat='cat /etc/hosts';;
6608 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6611 '') test -f /etc/group && groupcat='cat /etc/group';;
6614 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6617 : now get the host name
6619 echo "Figuring out host name..." >&4
6620 case "$myhostname" in
6622 echo 'Maybe "hostname" will work...'
6623 if tans=`sh -c hostname 2>&1` ; then
6631 if $test "$cont"; then
6633 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6634 if tans=`cat /etc/systemid 2>&1` ; then
6636 phostname='cat /etc/systemid'
6637 echo "Whadyaknow. Xenix always was a bit strange..."
6640 elif $test -r /etc/systemid; then
6641 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6644 if $test "$cont"; then
6645 echo 'No, maybe "uuname -l" will work...'
6646 if tans=`sh -c 'uuname -l' 2>&1` ; then
6648 phostname='uuname -l'
6650 echo 'Strange. Maybe "uname -n" will work...'
6651 if tans=`sh -c 'uname -n' 2>&1` ; then
6653 phostname='uname -n'
6655 echo 'Oh well, maybe I can mine it out of whoami.h...'
6656 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6657 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6658 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6660 case "$myhostname" in
6661 '') echo "Does this machine have an identity crisis or something?"
6664 echo "Well, you said $myhostname before..."
6665 phostname='echo $myhostname';;
6671 : you do not want to know about this
6676 if $test "$myhostname" ; then
6678 rp='Your host name appears to be "'$myhostname'".'" Right?"
6686 : bad guess or no guess
6687 while $test "X$myhostname" = X ; do
6689 rp="Please type the (one word) name of your host:"
6694 : translate upper to lower if necessary
6695 case "$myhostname" in
6697 echo "(Normalizing case in your host name)"
6698 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6702 case "$myhostname" in
6704 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6705 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6706 echo "(Trimming domain name from host name--host name is now $myhostname)"
6708 *) case "$mydomain" in
6711 test "X$hostcat" = "Xypcat hosts" &&
6712 ypmatch "$myhostname" hosts 2>/dev/null |\
6713 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6716 test "X$hostcat" != "X" &&
6717 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6718 /[ ]$myhostname[ . ]/p" > hosts
6721 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6722 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6723 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6724 hosts | $sort | $uniq | \
6725 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6726 case `$echo X$dflt` in
6727 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6730 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6735 tans=`./loc resolv.conf X /etc /usr/etc`
6736 if $test -f "$tans"; then
6737 echo "(Attempting domain name extraction from $tans)"
6738 dflt=.`$sed -n -e 's/ / /g' \
6739 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6740 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6742 .) dflt=.`$sed -n -e 's/ / /g' \
6743 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6744 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6751 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6752 dflt=.`sh -c domainname 2>/dev/null`
6755 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6760 .) echo "(Lost all hope -- silly guess then)"
6766 *) dflt="$mydomain";;
6770 rp="What is your domain name?"
6780 : translate upper to lower if necessary
6783 echo "(Normalizing case in your domain name)"
6784 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6788 : a little sanity check here
6789 case "$phostname" in
6792 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6793 $myhostname$mydomain|$myhostname) ;;
6795 case "$phostname" in
6797 echo "(That doesn't agree with your whoami.h file, by the way.)"
6800 echo "(That doesn't agree with your $phostname command, by the way.)"
6810 I need to get your e-mail address in Internet format if possible, i.e.
6811 something like user@host.domain. Please answer accurately since I have
6812 no easy means to double check it. The default value provided below
6813 is most probably close to the reality but may not be valid from outside
6814 your organization...
6818 while test "$cont"; do
6820 '') dflt="$cf_by@$myhostname$mydomain";;
6821 *) dflt="$cf_email";;
6823 rp='What is your e-mail address?'
6829 rp='Address does not look like an Internet one. Use it anyway?'
6845 If you or somebody else will be maintaining perl at your site, please
6846 fill in the correct e-mail address here so that they may be contacted
6847 if necessary. Currently, the "perlbug" program included with perl
6848 will send mail to this address in addition to perlbug@perl.com. You may
6849 enter "none" for no administrator.
6852 case "$perladmin" in
6853 '') dflt="$cf_email";;
6854 *) dflt="$perladmin";;
6856 rp='Perl administrator e-mail address'
6860 : figure out how to guarantee perl startup
6861 case "$startperl" in
6863 case "$sharpbang" in
6867 I can use the #! construct to start perl on your system. This will
6868 make startup of perl scripts faster, but may cause problems if you
6869 want to share those scripts and perl is not in a standard place
6870 ($binexp/perl) on all your platforms. The alternative is to force
6871 a shell by starting the script with a single ':' character.
6875 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6878 none) startperl=": # use perl";;
6879 *) startperl="#!$ans"
6880 if $test 30 -lt `echo "$ans" | wc -c`; then
6883 WARNING: Some systems limit the #! command to 32 characters.
6884 If you experience difficulty running Perl scripts with #!, try
6885 installing Perl in a directory with a shorter pathname.
6891 *) startperl=": # use perl"
6896 echo "I'll use $startperl to start perl scripts."
6898 : figure best path for perl in scripts
6901 perlpath="$binexp/perl"
6902 case "$startperl" in
6907 I will use the "eval 'exec'" idiom to start Perl on your system.
6908 I can use the full path of your Perl binary for this purpose, but
6909 doing so may cause problems if you want to share those scripts and
6910 Perl is not always in a standard place ($binexp/perl).
6914 rp="What path shall I use in \"eval 'exec'\"?"
6921 case "$startperl" in
6923 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6926 : determine where public executable scripts go
6927 set scriptdir scriptdir
6929 case "$scriptdir" in
6932 : guess some guesses
6933 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6934 $test -d /usr/share/bin && dflt=/usr/share/bin
6935 $test -d /usr/local/script && dflt=/usr/local/script
6936 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6937 $test -d $prefixexp/script && dflt=$prefixexp/script
6941 *) dflt="$scriptdir"
6946 Some installations have a separate directory just for executable scripts so
6947 that they can mount it across multiple architectures but keep the scripts in
6948 one spot. You might, for example, have a subdirectory of /usr/share for this.
6949 Or you might just lump your scripts in with all your other executables.
6953 rp='Where do you keep publicly executable scripts?'
6955 if $test "X$ansexp" != "X$scriptdirexp"; then
6959 scriptdirexp="$ansexp"
6960 : Change installation prefix, if necessary.
6961 if $test X"$prefix" != X"$installprefix"; then
6962 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6964 installscript="$scriptdirexp"
6967 : determine where site specific architecture-dependent libraries go.
6968 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6969 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6970 : sitelib may have an optional trailing /share.
6971 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6972 tdflt="$tdflt/$archname"
6973 set sitearch sitearch none
6976 '') dflt="$tdflt" ;;
6977 *) dflt="$sitearch" ;;
6981 The installation process will also create a directory for
6982 architecture-dependent site-specific extensions and modules.
6986 rp='Pathname for the site-specific architecture-dependent library files?'
6989 sitearchexp="$ansexp"
6990 : Change installation prefix, if necessary.
6991 if $test X"$prefix" != X"$installprefix"; then
6992 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6994 installsitearch="$sitearchexp"
6997 : determine where add-on public executables go
6999 '') dflt=$siteprefix/bin ;;
7003 rp='Pathname where the add-on public executables should be installed?'
7006 sitebinexp="$ansexp"
7007 : Change installation prefix, if necessary.
7008 if $test X"$prefix" != X"$installprefix"; then
7009 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7011 installsitebin="$sitebinexp"
7016 Perl can be built to take advantage of long doubles which
7017 (if available) may give more accuracy and range for floating point numbers.
7019 If this doesn't make any sense to you, just accept the default 'n'.
7023 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
7026 case "$uselongdouble" in
7027 $define|true|[yY]*) dflt='y';;
7030 rp='Try to use long doubles if available?'
7033 y|Y) val="$define" ;;
7039 case "$uselongdouble" in
7040 true|[yY]*) uselongdouble="$define" ;;
7043 case "$uselongdouble" in
7045 : Look for a hint-file generated 'call-back-unit'. If the
7046 : user has specified that long doubles should be used,
7047 : we may need to set or change some other defaults.
7048 if $test -f uselongdouble.cbu; then
7049 echo "Your platform has some specific hints for long doubles, using them..."
7050 . ./uselongdouble.cbu
7053 (Your platform doesn't have any specific hints for long doubles.)
7061 Perl can be built to take advantage of long longs which
7062 (if available) may give more range for integer numbers.
7064 If this doesn't make any sense to you, just accept the default 'n'.
7068 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
7071 case "$uselonglong" in
7072 $define|true|[yY]*) dflt='y';;
7075 rp='Try to use long longs if available?'
7078 y|Y) val="$define" ;;
7084 case "$uselonglong" in
7085 true|[yY]*) uselonglong="$define" ;;
7088 case "$uselonglong" in
7090 : Look for a hint-file generated 'call-back-unit'. If the
7091 : user has specified that long longs should be used,
7092 : we may need to set or change some other defaults.
7093 if $test -f uselonglong.cbu; then
7094 echo "Your platform has some specific hints for long longs, using them..."
7098 (Your platform doesn't have any specific hints for long longs.)
7106 Previous version of $package used the standard IO mechanisms as defined
7107 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7108 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7109 the default. This abstraction layer can use AT&T's sfio (if you already
7110 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7111 problems with some extension modules. Using PerlIO with stdio is safe,
7112 but it is slower than plain stdio and therefore is not the default.
7114 If this doesn't make any sense to you, just accept the default 'n'.
7116 case "$useperlio" in
7117 $define|true|[yY]*) dflt='y';;
7120 rp='Use the experimental PerlIO abstraction layer?'
7127 echo "Ok, doing things the stdio way"
7134 case "$vendorprefix" in
7135 '') d_vendorbin="$undef"
7139 *) d_vendorbin="$define"
7140 : determine where vendor-supplied executables go.
7141 dflt=$vendorprefix/bin
7143 rp='Pathname for the vendor-supplied executables directory?'
7146 vendorbinexp="$ansexp"
7147 : Change installation prefix, if necessary.
7148 if $test X"$prefix" != X"$installprefix"; then
7149 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7151 installvendorbin="$vendorbinexp"
7156 : check for length of double
7158 case "$doublesize" in
7160 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7161 $cat >try.c <<'EOCP'
7165 printf("%d\n", (int)sizeof(double));
7170 if eval $compile_ok; then
7172 $echo " $doublesize bytes." >&4
7175 echo "(I can't seem to compile the test program. Guessing...)"
7176 rp="What is the size of a double precision number (in bytes)?"
7184 : check for long doubles
7186 $echo $n "Checking to see if your system supports long double..." $c >&4
7187 echo 'int main() { long double x = 7.0; }' > try.c
7189 if eval $compile; then
7191 echo " Yes, it does." >&4
7194 echo " No, it doesn't." >&4
7200 : check for length of long double
7201 case "${d_longdbl}${longdblsize}" in
7204 $echo $n "Checking to see how big your long doubles are..." $c >&4
7205 $cat >try.c <<'EOCP'
7209 printf("%d\n", sizeof(long double));
7214 if eval $compile; then
7215 longdblsize=`./try$exe_ext`
7216 $echo " $longdblsize bytes." >&4
7220 echo "(I can't seem to compile the test program. Guessing...)" >&4
7221 rp="What is the size of a long double (in bytes)?"
7225 if $test "X$doublesize" = "X$longdblsize"; then
7226 echo "(That isn't any different from an ordinary double.)"
7232 : Check how to convert floats to strings.
7233 if test "X$d_Gconvert" = X; then
7235 echo "Checking for an efficient way to convert floats to strings."
7238 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7239 char *myname = "gconvert";
7242 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7243 char *myname = "gcvt";
7246 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7247 char *myname = "qgcvt";
7248 #define DOUBLETYPE long double
7251 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7252 char *myname = "sprintf";
7256 #define DOUBLETYPE double
7266 checkit(expect, got)
7270 if (strcmp(expect, got)) {
7271 printf("%s oddity: Expected %s, got %s\n",
7272 myname, expect, got);
7282 /* This must be 1st test on (which?) platform */
7283 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7284 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7285 checkit("0.1", buf);
7287 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7290 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7293 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7296 /* Some Linux gcvt's give 1.e+5 here. */
7297 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7298 checkit("100000", buf);
7300 /* Some Linux gcvt's give -1.e+5 here. */
7301 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7302 checkit("-100000", buf);
7307 case "$d_Gconvert" in
7308 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7309 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7310 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7311 *) xxx_list='gconvert gcvt sprintf' ;;
7314 case "$d_longdbl$uselongdouble" in
7315 definedefine) xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
7318 for xxx_convert in $xxx_list; do
7319 echo "Trying $xxx_convert..."
7321 set try -DTRY_$xxx_convert
7322 if eval $compile; then
7323 echo "$xxx_convert() found." >&4
7325 echo "I'll use $xxx_convert to convert floats into a string." >&4
7328 echo "...But $xxx_convert didn't work as I expected."
7331 echo "$xxx_convert NOT found." >&4
7335 case "$xxx_convert" in
7336 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7337 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7338 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7339 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7345 if $test X"$d_longdbl" = X"$define"; then
7347 echo "Checking how to print long doubles..." >&4
7349 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7350 $cat >try.c <<'EOCP'
7351 #include <sys/types.h>
7355 printf("%.3f\n", d);
7359 if eval $compile; then
7363 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7364 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7365 echo "We will use %f."
7371 if $test X"$sPRIfldbl" = X; then
7372 $cat >try.c <<'EOCP'
7373 #include <sys/types.h>
7376 long double d = 123.456;
7377 printf("%.3llf\n", d);
7381 if eval $compile; then
7385 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7386 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7387 echo "We will use %llf."
7393 if $test X"$sPRIfldbl" = X; then
7394 $cat >try.c <<'EOCP'
7395 #include <sys/types.h>
7398 long double d = 123.456;
7399 printf("%.3Lf\n", d);
7403 if eval $compile; then
7407 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7408 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7409 echo "We will use %Lf."
7415 if $test X"$sPRIfldbl" = X; then
7416 $cat >try.c <<'EOCP'
7417 #include <sys/types.h>
7420 long double d = 123.456;
7421 printf("%.3lf\n", d);
7425 if eval $compile; then
7429 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7430 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7431 echo "We will use %lf."
7437 if $test X"$sPRIfldbl" = X; then
7438 echo "Cannot figure out how to print long doubles." >&4
7445 case "$sPRIfldbl" in
7446 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7447 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7449 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7450 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7454 : Initialize h_fcntl
7457 : Initialize h_sysfile
7460 : access call always available on UNIX
7464 : locate the flags for 'access()'
7468 $cat >access.c <<'EOCP'
7469 #include <sys/types.h>
7474 #include <sys/file.h>
7483 : check sys/file.h first, no particular reason here
7484 if $test `./findhdr sys/file.h` && \
7485 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7487 echo "<sys/file.h> defines the *_OK access constants." >&4
7488 elif $test `./findhdr fcntl.h` && \
7489 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7491 echo "<fcntl.h> defines the *_OK access constants." >&4
7492 elif $test `./findhdr unistd.h` && \
7493 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7494 echo "<unistd.h> defines the *_OK access constants." >&4
7496 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7502 : see if accessx exists
7503 set accessx d_accessx
7506 : see if alarm exists
7510 : see if atolf exists
7514 : see if atoll exists
7518 : Look for GNU-cc style attribute checking
7520 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7521 $cat >attrib.c <<'EOCP'
7523 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7525 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7526 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7527 echo "Your C compiler doesn't fully support __attribute__."
7530 echo "Your C compiler supports __attribute__."
7534 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7541 : see if bcmp exists
7545 : see if bcopy exists
7549 : see if this is a unistd.h system
7550 set unistd.h i_unistd
7553 : see if getpgrp exists
7554 set getpgrp d_getpgrp
7557 case "$d_getpgrp" in
7560 echo "Checking to see which flavor of getpgrp is in use..."
7563 #include <sys/types.h>
7565 # include <unistd.h>
7569 if (getuid() == 0) {
7570 printf("(I see you are running Configure as super-user...)\n");
7574 if (getpgrp(1) == 0)
7583 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7584 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7586 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7587 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7590 echo "I can't seem to compile and run the test program."
7592 xxx="a USG one, i.e. you use getpgrp()."
7594 # SVR4 systems can appear rather BSD-ish.
7597 xxx="a BSD one, i.e. you use getpgrp(pid)."
7601 xxx="probably a USG one, i.e. you use getpgrp()."
7606 echo "Assuming your getpgrp is $xxx" >&4
7615 : see if setpgrp exists
7616 set setpgrp d_setpgrp
7619 case "$d_setpgrp" in
7622 echo "Checking to see which flavor of setpgrp is in use..."
7625 #include <sys/types.h>
7627 # include <unistd.h>
7631 if (getuid() == 0) {
7632 printf("(I see you are running Configure as super-user...)\n");
7636 if (-1 == setpgrp(1, 1))
7639 if (setpgrp() != -1)
7645 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7646 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7648 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7649 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7652 echo "(I can't seem to compile and run the test program.)"
7654 xxx="a USG one, i.e. you use setpgrp()."
7656 # SVR4 systems can appear rather BSD-ish.
7659 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7663 xxx="probably a USG one, i.e. you use setpgrp()."
7668 echo "Assuming your setpgrp is $xxx" >&4
7676 : see if bzero exists
7680 : see if signal is declared as pointer to function returning int or void
7682 xxx=`./findhdr signal.h`
7683 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7684 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7685 echo "You have int (*signal())() instead of void." >&4
7687 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7688 echo "You have void (*signal())()." >&4
7690 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7691 echo "You have int (*signal())() instead of void." >&4
7693 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7694 echo "You have void (*signal())()." >&4
7697 case "$d_voidsig" in
7699 echo "I can't determine whether signal handler returns void or int..." >&4
7701 rp="What type does your signal handler return?"
7708 echo "As you already told me, signal handler returns void." >&4
7711 *) echo "As you already told me, signal handler returns int." >&4
7718 case "$d_voidsig" in
7719 "$define") signal_t="void";;
7724 : check for ability to cast large floats to 32-bit ints.
7726 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7727 if $test "$intsize" -ge 4; then
7734 #include <sys/types.h>
7736 $signal_t blech(s) int s; { exit(3); }
7743 signal(SIGFPE, blech);
7745 /* Don't let compiler optimize the test away. Store the number
7746 in a writable string for gcc to pass to sscanf under HP/UX.
7748 sprintf(str, "2147483647");
7749 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7753 /* x86 processors will probably give 0x8000 0000, which is a
7754 sign change. We don't want that. We want to mimic SPARC
7755 behavior here, which is to preserve the sign and give
7758 if (i32 != ($xxx) f)
7764 if eval $compile_ok; then
7768 echo "(I can't seem to compile the test program--assuming it can't)"
7776 echo "Nope, it can't."
7783 : check for ability to cast negative floats to unsigned
7785 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7788 #include <sys/types.h>
7790 $signal_t blech(s) int s; { exit(7); }
7791 $signal_t blech_in_list(s) int s; { exit(4); }
7792 unsigned long dummy_long(p) unsigned long p; { return p; }
7793 unsigned int dummy_int(p) unsigned int p; { return p; }
7794 unsigned short dummy_short(p) unsigned short p; { return p; }
7798 unsigned long along;
7800 unsigned short ashort;
7804 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7805 a direct f = -123. assignment. gcc-2.8.0 reportedly
7806 optimized the whole file away
7808 /* Store the number in a writable string for gcc to pass to
7811 sprintf(str, "-123");
7812 sscanf(str, "%lf", &f); /* f = -123.; */
7814 signal(SIGFPE, blech);
7815 along = (unsigned long)f;
7816 aint = (unsigned int)f;
7817 ashort = (unsigned short)f;
7818 if (along != (unsigned long)-123)
7820 if (aint != (unsigned int)-123)
7822 if (ashort != (unsigned short)-123)
7824 sprintf(str, "1073741824.");
7825 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7828 along = (unsigned long)f;
7829 if (along != 0x80000000)
7833 along = (unsigned long)f;
7834 if (along != 0x7fffffff)
7838 along = (unsigned long)f;
7839 if (along != 0x80000001)
7843 signal(SIGFPE, blech_in_list);
7844 sprintf(str, "123.");
7845 sscanf(str, "%lf", &f); /* f = 123.; */
7846 along = dummy_long((unsigned long)f);
7847 aint = dummy_int((unsigned int)f);
7848 ashort = dummy_short((unsigned short)f);
7849 if (along != (unsigned long)123)
7851 if (aint != (unsigned int)123)
7853 if (ashort != (unsigned short)123)
7860 if eval $compile_ok; then
7864 echo "(I can't seem to compile the test program--assuming it can't)"
7867 case "$castflags" in
7872 echo "Nope, it can't."
7879 : see if vprintf exists
7881 if set vprintf val -f d_vprintf; eval $csym; $val; then
7882 echo 'vprintf() found.' >&4
7884 $cat >vprintf.c <<'EOF'
7885 #include <varargs.h>
7887 int main() { xxx("foo"); }
7896 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7900 if eval $compile && ./vprintf; then
7901 echo "Your vsprintf() returns (int)." >&4
7904 echo "Your vsprintf() returns (char*)." >&4
7908 echo 'vprintf() NOT found.' >&4
7918 : see if chown exists
7922 : see if chroot exists
7926 : see if chsize exists
7930 : check for const keyword
7932 echo 'Checking to see if your C compiler knows about "const"...' >&4
7933 $cat >const.c <<'EOCP'
7934 typedef struct spug { int drokk; } spug;
7941 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7943 echo "Yup, it does."
7946 echo "Nope, it doesn't."
7951 : see if crypt exists
7953 if set crypt val -f d_crypt; eval $csym; $val; then
7954 echo 'crypt() found.' >&4
7958 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7959 if $test -z "$cryptlib"; then
7960 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7964 if $test -z "$cryptlib"; then
7965 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7969 if $test -z "$cryptlib"; then
7970 cryptlib=`./loc libcrypt$_a "" $libpth`
7974 if $test -z "$cryptlib"; then
7975 echo 'crypt() NOT found.' >&4
7984 : get csh whereabouts
7986 'csh') val="$undef" ;;
7991 : Respect a hint or command line value for full_csh.
7993 '') full_csh=$csh ;;
7996 : see if cuserid exists
7997 set cuserid d_cuserid
8000 : see if this is a limits.h system
8001 set limits.h i_limits
8004 : see if this is a float.h system
8008 : See if number of significant digits in a double precision number is known
8010 $cat >dbl_dig.c <<EOM
8020 printf("Contains DBL_DIG");
8023 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8024 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8025 echo "DBL_DIG found." >&4
8028 echo "DBL_DIG NOT found." >&4
8035 : see if difftime exists
8036 set difftime d_difftime
8039 : see if this is a dirent system
8041 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8043 echo "<dirent.h> found." >&4
8046 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8047 echo "<sys/dir.h> found." >&4
8050 xinc=`./findhdr sys/ndir.h`
8052 echo "<dirent.h> NOT found." >&4
8057 : Look for type of directory structure.
8059 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8061 case "$direntrytype" in
8064 $define) guess1='struct dirent' ;;
8065 *) guess1='struct direct' ;;
8068 *) guess1="$direntrytype"
8073 'struct dirent') guess2='struct direct' ;;
8074 *) guess2='struct dirent' ;;
8077 if $contains "$guess1" try.c >/dev/null 2>&1; then
8078 direntrytype="$guess1"
8079 echo "Your directory entries are $direntrytype." >&4
8080 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8081 direntrytype="$guess2"
8082 echo "Your directory entries seem to be $direntrytype." >&4
8084 echo "I don't recognize your system's directory entries." >&4
8085 rp="What type is used for directory entries on this system?"
8093 : see if the directory entry stores field length
8095 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8096 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8097 echo "Good, your directory entry keeps length information in d_namlen." >&4
8100 echo "Your directory entry does not know about the d_namlen field." >&4
8107 : see if dlerror exists
8110 set dlerror d_dlerror
8114 : see if dlfcn is available
8122 On a few systems, the dynamically loaded modules that perl generates and uses
8123 will need a different extension than shared libs. The default will probably
8131 rp='What is the extension of dynamically loaded modules'
8140 : Check if dlsym need a leading underscore
8146 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8147 $cat >dyna.c <<'EOM'
8156 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8158 #include <sys/types.h>
8172 int mode = RTLD_LAZY ;
8174 handle = dlopen("./dyna.$dlext", mode) ;
8175 if (handle == NULL) {
8180 symbol = dlsym(handle, "fred") ;
8181 if (symbol == NULL) {
8182 /* try putting a leading underscore */
8183 symbol = dlsym(handle, "_fred") ;
8184 if (symbol == NULL) {
8197 : Call the object file tmp-dyna.o in case dlext=o.
8198 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8199 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8200 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8201 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8204 1) echo "Test program failed using dlopen." >&4
8205 echo "Perhaps you should not use dynamic loading." >&4;;
8206 2) echo "Test program failed using dlsym." >&4
8207 echo "Perhaps you should not use dynamic loading." >&4;;
8208 3) echo "dlsym needs a leading underscore" >&4
8210 4) echo "dlsym doesn't need a leading underscore." >&4;;
8213 echo "I can't compile and run the test program." >&4
8214 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8219 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8224 hasproto='varname=$1; func=$2; shift; shift;
8225 while $test $# -ge 2; do
8227 $define) echo "#include <$2>";;
8231 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8232 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8233 echo "$func() prototype found.";
8236 echo "$func() prototype NOT found.";
8241 $rm -f try.c tryout.c'
8243 : see if prototype for drand48 is available
8245 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8248 : see if dup2 exists
8252 : see if eaccess exists
8253 set eaccess d_eaccess
8256 : see if endgrent exists
8257 set endgrent d_endgrent
8260 : see if endhostent exists
8261 set endhostent d_endhent
8264 : see if endnetent exists
8265 set endnetent d_endnent
8268 : see if endprotoent exists
8269 set endprotoent d_endpent
8272 : see if endpwent exists
8273 set endpwent d_endpwent
8276 : see if endservent exists
8277 set endservent d_endsent
8280 : see if endspent exists
8281 set endspent d_endspent
8284 : Locate the flags for 'open()'
8286 $cat >open3.c <<'EOCP'
8287 #include <sys/types.h>
8292 #include <sys/file.h>
8303 : check sys/file.h first to get FREAD on Sun
8304 if $test `./findhdr sys/file.h` && \
8305 set open3 -DI_SYS_FILE && eval $compile; then
8307 echo "<sys/file.h> defines the O_* constants..." >&4
8309 echo "and you have the 3 argument form of open()." >&4
8312 echo "but not the 3 argument form of open(). Oh, well." >&4
8315 elif $test `./findhdr fcntl.h` && \
8316 set open3 -DI_FCNTL && eval $compile; then
8318 echo "<fcntl.h> defines the O_* constants..." >&4
8320 echo "and you have the 3 argument form of open()." >&4
8323 echo "but not the 3 argument form of open(). Oh, well." >&4
8328 echo "I can't find the O_* constant definitions! You got problems." >&4
8334 : see which of string.h or strings.h is needed
8336 strings=`./findhdr string.h`
8337 if $test "$strings" && $test -r "$strings"; then
8338 echo "Using <string.h> instead of <strings.h>." >&4
8342 strings=`./findhdr strings.h`
8343 if $test "$strings" && $test -r "$strings"; then
8344 echo "Using <strings.h> instead of <string.h>." >&4
8346 echo "No string header found -- You'll surely have problems." >&4
8352 "$undef") strings=`./findhdr strings.h`;;
8353 *) strings=`./findhdr string.h`;;
8356 : check for non-blocking I/O stuff
8357 case "$h_sysfile" in
8358 true) echo "#include <sys/file.h>" > head.c;;
8361 true) echo "#include <fcntl.h>" > head.c;;
8362 *) echo "#include <sys/fcntl.h>" > head.c;;
8367 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8368 case "$o_nonblock" in
8371 $cat >>try.c <<'EOCP'
8375 printf("O_NONBLOCK\n");
8379 printf("O_NDELAY\n");
8383 printf("FNDELAY\n");
8390 if eval $compile_ok; then
8392 case "$o_nonblock" in
8393 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8394 *) echo "Seems like we can use $o_nonblock.";;
8397 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8400 *) echo "Using $hint value $o_nonblock.";;
8402 $rm -f try try.* .out core
8405 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8411 #include <sys/types.h>
8414 #define MY_O_NONBLOCK $o_nonblock
8415 #ifndef errno /* XXX need better Configure test */
8425 #include <strings.h>
8427 $signal_t blech(x) int x; { exit(3); }
8429 $cat >> try.c <<'EOCP'
8437 pipe(pd); /* Down: child -> parent */
8438 pipe(pu); /* Up: parent -> child */
8441 close(pd[1]); /* Parent reads from pd[0] */
8442 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8443 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8445 signal(SIGALRM, blech);
8447 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8449 sprintf(string, "%d\n", ret);
8450 write(2, string, strlen(string));
8453 if (errno == EAGAIN) {
8459 if (errno == EWOULDBLOCK)
8460 printf("EWOULDBLOCK\n");
8463 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8464 sleep(2); /* Give it time to close our pipe */
8466 ret = read(pd[0], buf, 1); /* Should read EOF */
8468 sprintf(string, "%d\n", ret);
8469 write(3, string, strlen(string));
8473 close(pd[0]); /* We write to pd[1] */
8474 close(pu[1]); /* We read from pu[0] */
8475 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8476 close(pd[1]); /* Pipe pd is now fully closed! */
8477 exit(0); /* Bye bye, thank you for playing! */
8481 if eval $compile_ok; then
8482 echo "$startsh" >mtry
8483 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8485 ./mtry >/dev/null 2>&1
8487 0) eagain=`$cat try.out`;;
8488 1) echo "Could not perform non-blocking setting!";;
8489 2) echo "I did a successful read() for something that was not there!";;
8490 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8491 *) echo "Something terribly wrong happened during testing.";;
8493 rd_nodata=`$cat try.ret`
8494 echo "A read() system call with no data present returns $rd_nodata."
8495 case "$rd_nodata" in
8498 echo "(That's peculiar, fixing that to be -1.)"
8504 echo "Forcing errno EAGAIN on read() with no data available."
8508 echo "Your read() sets errno to $eagain when no data is available."
8511 status=`$cat try.err`
8513 0) echo "And it correctly returns 0 to signal EOF.";;
8514 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8515 *) echo "However, your read() returns '$status' on EOF??";;
8518 if test "$status" = "$rd_nodata"; then
8519 echo "WARNING: you can't distinguish between EOF and no data!"
8523 echo "I can't compile the test program--assuming errno EAGAIN will do."
8530 echo "Using $hint value $eagain."
8531 echo "Your read() returns $rd_nodata when no data is present."
8532 case "$d_eofnblk" in
8533 "$define") echo "And you can see EOF because read() returns 0.";;
8534 "$undef") echo "But you can't see EOF status from read() returned value.";;
8536 echo "(Assuming you can't see EOF status from read anyway.)"
8542 $rm -f try try.* .out core head.c mtry
8544 : see if fchmod exists
8548 : see if fchown exists
8552 : see if this is an fcntl system
8556 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8557 while $test $# -ge 2; do
8559 $define) echo "#include <$2>";;
8563 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8565 if eval $compile; then
8576 : see whether socket exists
8578 $echo $n "Hmm... $c" >&4
8579 if set socket val -f d_socket; eval $csym; $val; then
8580 echo "Looks like you have Berkeley networking support." >&4
8582 if set setsockopt val -f; eval $csym; $val; then
8585 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8589 if $contains socklib libc.list >/dev/null 2>&1; then
8590 echo "Looks like you have Berkeley networking support." >&4
8592 : we will have to assume that it supports the 4.2 BSD interface
8595 echo "You don't have Berkeley networking in libc$_a..." >&4
8596 if test "X$d_socket" = "X$define"; then
8597 echo "...but you seem to believe that you have sockets." >&4
8599 for net in net socket
8601 if test -f /usr/lib/lib$net$_a; then
8602 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8603 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8604 if $contains socket libc.list >/dev/null 2>&1; then
8609 echo "...but the Wollongong group seems to have hacked it in." >&4
8610 sockethdr="-I/usr/netinclude"
8613 echo "Found Berkeley sockets interface in lib$net." >& 4
8614 if $contains setsockopt libc.list >/dev/null 2>&1; then
8617 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8624 if test "X$d_socket" != "X$define"; then
8625 echo "or anywhere else I see." >&4
8633 : see if socketpair exists
8634 set socketpair d_sockpair
8639 echo "Checking the availability of certain socket constants..." >& 4
8640 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8641 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8643 #include <sys/types.h>
8644 #include <sys/socket.h>
8650 set try; if eval $compile; then
8653 set d_${enum}; eval $setvar
8657 : see if sys/select.h has to be included
8658 set sys/select.h i_sysselct
8661 : see if we should include time.h, sys/time.h, or both
8663 if test "X$timeincl" = X; then
8664 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8665 $echo $n "I'm now running the test program...$c"
8666 $cat >try.c <<'EOCP'
8667 #include <sys/types.h>
8672 #ifdef SYSTIMEKERNEL
8675 #include <sys/time.h>
8678 #include <sys/select.h>
8687 struct timezone tzp;
8689 if (foo.tm_sec == foo.tm_sec)
8692 if (bar.tv_sec == bar.tv_sec)
8699 for s_timezone in '-DS_TIMEZONE' ''; do
8701 for s_timeval in '-DS_TIMEVAL' ''; do
8702 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8703 for i_time in '' '-DI_TIME'; do
8704 for i_systime in '-DI_SYSTIME' ''; do
8707 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8708 if eval $compile; then
8709 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8713 $echo $n "Succeeded with $flags$c"
8725 *SYSTIMEKERNEL*) i_systimek="$define"
8726 timeincl=`./findhdr sys/time.h`
8727 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8728 *) i_systimek="$undef";;
8731 *I_TIME*) i_time="$define"
8732 timeincl=`./findhdr time.h`" $timeincl"
8733 echo "We'll include <time.h>." >&4;;
8734 *) i_time="$undef";;
8737 *I_SYSTIME*) i_systime="$define"
8738 timeincl=`./findhdr sys/time.h`" $timeincl"
8739 echo "We'll include <sys/time.h>." >&4;;
8740 *) i_systime="$undef";;
8745 : check for fd_set items
8748 Checking to see how well your C compiler handles fd_set and friends ...
8750 $cat >fd_set.c <<EOCP
8751 #$i_systime I_SYS_TIME
8752 #$i_sysselct I_SYS_SELECT
8753 #$d_socket HAS_SOCKET
8754 #include <sys/types.h>
8756 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8759 #include <sys/time.h>
8762 #include <sys/select.h>
8771 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8778 set fd_set -DTRYBITS
8779 if eval $compile; then
8780 d_fds_bits="$define"
8782 echo "Well, your system knows about the normal fd_set typedef..." >&4
8784 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8785 d_fd_macros="$define"
8788 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8790 d_fd_macros="$undef"
8794 Hmm, your compiler has some difficulty with fd_set. Checking further...
8797 if eval $compile; then
8800 echo "Well, your system has some sort of fd_set available..." >&4
8802 echo "and you have the normal fd_set macros." >&4
8803 d_fd_macros="$define"
8806 but not the normal fd_set macros! Gross! More work for me...
8808 d_fd_macros="$undef"
8811 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8814 d_fd_macros="$undef"
8819 : see if fgetpos exists
8820 set fgetpos d_fgetpos
8823 : see if flock exists
8827 : see if fork exists
8831 : see if pathconf exists
8832 set pathconf d_pathconf
8835 : see if fpathconf exists
8836 set fpathconf d_fpathconf
8842 echo "Checking to see if your system supports off64_t..." >&4
8844 #include <sys/types.h>
8846 int main() { off64_t x = 7; }'
8849 if eval $compile; then
8851 echo "Yes, it does."
8854 echo "No, it doesn't."
8855 case "$lseeksize" in
8856 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
8863 : check for fpos64_t
8865 echo "Checking to see if your system supports fpos64_t..." >&4
8867 #include <sys/stdio.h>
8868 int main() { fpos64_t x x = 7; }'
8871 if eval $compile; then
8873 echo "Yes, it does."
8876 echo "No, it doesn't."
8878 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
8885 hasstruct='varname=$1; struct=$2; shift; shift;
8886 while $test $# -ge 2; do
8888 $define) echo "#include <$2>";;
8892 echo "int main () { struct $struct foo; }" >> try.c;
8894 if eval $compile; then
8903 : see if this is a sys/param system
8904 set sys/param.h i_sysparam
8907 : see if this is a sys/mount.h system
8908 set sys/mount.h i_sysmount
8911 : see if sys/types.h has to be included
8912 set sys/types.h i_systypes
8917 echo "Checking to see if your system supports struct fs_data..." >&4
8918 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8920 case "$d_fs_data_s" in
8921 "$define") echo "Yes, it does." ;;
8922 *) echo "No, it doesn't." ;;
8925 : see if fseeko exists
8929 8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;;
8932 : see if fsetpos exists
8933 set fsetpos d_fsetpos
8937 : see if fstatfs exists
8938 set fstatfs d_fstatfs
8942 : see if statvfs exists
8943 set statvfs d_statvfs
8946 : see if fstatvfs exists
8947 set fstatvfs d_fstatvfs
8951 : see if ftello exists
8955 8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;;
8958 : see if getgrent exists
8959 set getgrent d_getgrent
8962 : see if gethostbyaddr exists
8963 set gethostbyaddr d_gethbyaddr
8966 : see if gethostbyname exists
8967 set gethostbyname d_gethbyname
8970 : see if gethostent exists
8971 set gethostent d_gethent
8974 : see how we will look up host name
8977 if set gethostname val -f d_gethname; eval $csym; $val; then
8978 echo 'gethostname() found.' >&4
8979 d_gethname="$define"
8982 if set uname val -f d_uname; eval $csym; $val; then
8985 uname() was found, but you're running xenix, and older versions of xenix
8986 have a broken uname(). If you don't really know whether your xenix is old
8987 enough to have a broken system call, use the default answer.
8994 rp='Is your uname() broken?'
8997 n*) d_uname="$define"; call=uname;;
9000 echo 'uname() found.' >&4
9007 case "$d_gethname" in
9008 '') d_gethname="$undef";;
9011 '') d_uname="$undef";;
9013 case "$d_uname$d_gethname" in
9018 Every now and then someone has a $call() that lies about the hostname
9019 but can't be fixed for political or economic reasons. If you wish, I can
9020 pretend $call() isn't there and maybe compute hostname at run-time
9021 thanks to the '$phostname' command.
9024 rp="Shall I ignore $call() from now on?"
9027 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9030 case "$phostname" in
9032 *) case "$aphostname" in
9038 file=`./loc $file $file $pth`
9039 aphostname=`echo $file $*`
9044 case "$d_uname$d_gethname" in
9047 case "$phostname" in
9049 echo "There will be no way for $package to get your hostname." >&4;;
9051 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9055 case "$d_phostname" in
9056 '') d_phostname="$undef";;
9059 : see if this is a netdb.h system
9063 : see if prototypes for various gethostxxx netdb.h functions are available
9065 set d_gethostprotos gethostent $i_netdb netdb.h
9068 : see if getlogin exists
9069 set getlogin d_getlogin
9072 : see if getmnt exists
9076 : see if getmntent exists
9077 set getmntent d_getmntent
9080 : see if getnetbyaddr exists
9081 set getnetbyaddr d_getnbyaddr
9084 : see if getnetbyname exists
9085 set getnetbyname d_getnbyname
9088 : see if getnetent exists
9089 set getnetent d_getnent
9092 : see if prototypes for various getnetxxx netdb.h functions are available
9094 set d_getnetprotos getnetent $i_netdb netdb.h
9098 : see if getprotobyname exists
9099 set getprotobyname d_getpbyname
9102 : see if getprotobynumber exists
9103 set getprotobynumber d_getpbynumber
9106 : see if getprotoent exists
9107 set getprotoent d_getpent
9110 : see if getpgid exists
9111 set getpgid d_getpgid
9114 : see if getpgrp2 exists
9115 set getpgrp2 d_getpgrp2
9118 : see if getppid exists
9119 set getppid d_getppid
9122 : see if getpriority exists
9123 set getpriority d_getprior
9126 : see if prototypes for various getprotoxxx netdb.h functions are available
9128 set d_getprotoprotos getprotoent $i_netdb netdb.h
9131 : see if getpwent exists
9132 set getpwent d_getpwent
9136 : see if getservbyname exists
9137 set getservbyname d_getsbyname
9140 : see if getservbyport exists
9141 set getservbyport d_getsbyport
9144 : see if getservent exists
9145 set getservent d_getsent
9148 : see if prototypes for various getservxxx netdb.h functions are available
9150 set d_getservprotos getservent $i_netdb netdb.h
9153 : see if getspent exists
9154 set getspent d_getspent
9157 : see if getspnam exists
9158 set getspnam d_getspnam
9161 : see if gettimeofday or ftime exists
9162 set gettimeofday d_gettimeod
9164 case "$d_gettimeod" in
9170 val="$undef"; set d_ftime; eval $setvar
9173 case "$d_gettimeod$d_ftime" in
9176 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9180 : see if this is an grp system
9186 xxx=`./findhdr grp.h`
9187 $cppstdin $cppflags $cppminus < $xxx >$$.h
9189 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9201 set d_grpasswd; eval $setvar
9205 : see if hasmntopt exists
9206 set hasmntopt d_hasmntopt
9209 : see if this is a netinet/in.h or sys/in.h system
9210 set netinet/in.h i_niin sys/in.h i_sysin
9213 : see if arpa/inet.h has to be included
9214 set arpa/inet.h i_arpainet
9217 : see if htonl --and friends-- exists
9222 : Maybe they are macros.
9227 #include <sys/types.h>
9228 #$i_niin I_NETINET_IN
9230 #$i_arpainet I_ARPA_INET
9232 #include <netinet/in.h>
9238 #include <arpa/inet.h>
9241 printf("Defined as a macro.");
9244 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9245 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9247 echo "But it seems to be defined as a macro." >&4
9257 if set index val -f; eval $csym; $val; then
9258 if set strchr val -f d_strchr; eval $csym; $val; then
9259 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9262 echo "strchr() found." >&4
9266 echo "index() found." >&4
9271 echo "index() found." >&4
9274 if set strchr val -f d_strchr; eval $csym; $val; then
9277 echo "strchr() found." >&4
9279 echo "No index() or strchr() found!" >&4
9284 set d_strchr; eval $setvar
9286 set d_index; eval $setvar
9288 : check whether inet_aton exists
9289 set inet_aton d_inetaton
9294 $cat >isascii.c <<'EOCP'
9306 if eval $compile; then
9307 echo "isascii() found." >&4
9310 echo "isascii() NOT found." >&4
9317 : see if killpg exists
9321 : see if lchown exists
9323 $cat > try.c <<'EOCP'
9324 /* System header to define __stub macros and hopefully few prototypes,
9325 which can conflict with char lchown(); below. */
9327 /* Override any gcc2 internal prototype to avoid an error. */
9328 /* We use char because int might match the return type of a gcc2
9329 builtin and then its argument prototype would still apply. */
9332 /* The GNU C library defines this for functions which it implements
9333 to always fail with ENOSYS. Some functions are actually named
9334 something starting with __ and the normal name is an alias. */
9335 #if defined (__stub_lchown) || defined (__stub___lchown)
9343 if eval $compile; then
9344 $echo "lchown() found." >&4
9347 $echo "lchown() NOT found." >&4
9353 : See if number of significant digits in a double precision number is known
9355 $cat >ldbl_dig.c <<EOM
9365 printf("Contains LDBL_DIG");
9368 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9369 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9370 echo "LDBL_DIG found." >&4
9373 echo "LDBL_DIG NOT found." >&4
9380 : see if link exists
9384 : see if localeconv exists
9385 set localeconv d_locconv
9388 : see if lockf exists
9392 : check for long long
9394 $echo $n "Checking to see if your system supports long long..." $c >&4
9395 echo 'int main() { long long x = 7; return 0; }' > try.c
9397 if eval $compile; then
9399 echo " Yes, it does." >&4
9402 echo " No, it doesn't." >&4
9408 : check for length of long long
9409 case "${d_longlong}${longlongsize}" in
9412 $echo $n "Checking to see how big your long longs are..." $c >&4
9413 $cat >try.c <<'EOCP'
9417 printf("%d\n", (int)sizeof(long long));
9422 if eval $compile_ok; then
9423 longlongsize=`./try$exe_ext`
9424 $echo " $longlongsize bytes." >&4
9428 echo "(I can't seem to compile the test program. Guessing...)"
9429 rp="What is the size of a long long (in bytes)?"
9433 if $test "X$longsize" = "X$longlongsize"; then
9434 echo "(That isn't any different from an ordinary long.)"
9440 : see if lstat exists
9444 : see if mblen exists
9448 : see if mbstowcs exists
9449 set mbstowcs d_mbstowcs
9452 : see if mbtowc exists
9456 : see if memchr exists
9460 : see if memcmp exists
9464 : see if memcpy exists
9468 : see if memmove exists
9469 set memmove d_memmove
9472 : see if memset exists
9476 : see if mkdir exists
9480 : see if mkfifo exists
9484 : see if mktime exists
9488 : see if msgctl exists
9492 : see if msgget exists
9496 : see if msgsnd exists
9500 : see if msgrcv exists
9504 : see how much of the 'msg*(2)' library is present.
9507 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9508 *"$undef"*) h_msg=false;;
9512 case "`ipcs 2>&1`" in
9513 "SVID messages"*"not configured"*)
9514 echo "Your $osname does not have the msg*(2) configured." >&4
9529 : we could also check for sys/ipc.h ...
9530 if $h_msg && $test `./findhdr sys/msg.h`; then
9531 echo "You have the full msg*(2) library." >&4
9534 echo "You don't have the full msg*(2) library." >&4
9540 : see if nice exists
9544 : see if POSIX threads are available
9545 set pthread.h i_pthread
9551 : how to create joinable pthreads
9552 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9554 echo "Checking what constant to use for creating joinable pthreads..." >&4
9555 $cat >try.c <<'EOCP'
9556 #include <pthread.h>
9558 int detachstate = JOINABLE;
9561 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9562 if eval $compile; then
9563 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9564 val="$undef" # Yes, undef.
9565 set d_old_pthread_create_joinable
9568 set old_pthread_create_joinable
9571 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9572 if eval $compile; then
9573 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9575 set d_old_pthread_create_joinable
9577 val=PTHREAD_CREATE_UNDETACHED
9578 set old_pthread_create_joinable
9581 set try -DJOINABLE=__UNDETACHED
9582 if eval $compile; then
9583 echo "You seem to use __UNDETACHED." >&4
9585 set d_old_pthread_create_joinable
9588 set old_pthread_create_joinable
9591 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9593 set d_old_pthread_create_joinable
9596 set old_pthread_create_joinable
9603 d_old_pthread_create_joinable="$undef"
9604 old_pthread_create_joinable=""
9607 : see if pause exists
9611 : see if pipe exists
9615 : see if poll exists
9620 : see whether the various POSIXish _yields exist
9622 #include <pthread.h>
9628 #ifdef PTHREAD_YIELD
9631 #ifdef PTHREAD_YIELD_NULL
9632 pthread_yield(NULL);
9638 : see if sched_yield exists
9639 set try -DSCHED_YIELD
9640 if eval $compile; then
9642 sched_yield='sched_yield()'
9646 case "$usethreads" in
9649 $define) echo 'sched_yield() found.' >&4 ;;
9650 *) echo 'sched_yield() NOT found.' >&4 ;;
9656 : see if pthread_yield exists
9657 set try -DPTHREAD_YIELD
9658 if eval $compile; then
9660 case "$sched_yield" in
9661 '') sched_yield='pthread_yield()' ;;
9664 set try -DPTHREAD_YIELD_NULL
9665 if eval $compile; then
9667 case "$sched_yield" in
9668 '') sched_yield='pthread_yield(NULL)' ;;
9674 case "$usethreads" in
9677 $define) echo 'pthread_yield() found.' >&4 ;;
9678 *) echo 'pthread_yield() NOT found.' >&4 ;;
9685 case "$sched_yield" in
9686 '') sched_yield=undef ;;
9691 : see if this is a pwd.h system
9697 xxx=`./findhdr pwd.h`
9698 $cppstdin $cppflags $cppminus < $xxx >$$.h
9700 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
9708 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
9716 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
9724 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
9732 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
9740 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
9748 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
9756 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
9768 set d_pwquota; eval $setvar
9769 set d_pwage; eval $setvar
9770 set d_pwchange; eval $setvar
9771 set d_pwclass; eval $setvar
9772 set d_pwexpire; eval $setvar
9773 set d_pwcomment; eval $setvar
9774 set d_pwgecos; eval $setvar
9775 set d_pwpasswd; eval $setvar
9779 : see if inttypes.h is available
9780 : we want a real compile instead of Inhdr because some systems
9781 : have an inttypes.h which includes non-existent headers
9784 #include <inttypes.h>
9786 static int32_t foo32 = 0x12345678;
9790 if eval $compile; then
9791 echo "<inttypes.h> found." >&4
9794 echo "<inttypes.h> NOT found." >&4
9803 $echo $n "Checking to see if your system supports int64_t...$c" >&4
9805 #include <sys/types.h>
9806 #$i_inttypes I_INTTYPES
9808 #include <inttypes.h>
9810 int main() { int64_t x = 7; }
9813 if eval $compile; then
9815 echo " Yes, it does." >&4
9818 echo " No, it doesn't." >&4
9826 echo "Checking which 64-bit integer type we could use..." >&4
9832 val='"unsigned int"'
9837 *) case "$longsize" in
9841 val='"unsigned long"'
9846 *) case "$uselonglong:$d_longlong:$longlongsize" in
9851 val='"unsigned long long"'
9856 *) case "$d_int64t" in
9875 '') case "$uselonglong:$d_longlong:$longlongsize" in
9877 echo "(You would have 'long long', but you are not using it.)" >&4 ;;
9878 *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
9882 *) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
9887 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9892 : see if readdir and friends exist
9893 set readdir d_readdir
9895 set seekdir d_seekdir
9897 set telldir d_telldir
9899 set rewinddir d_rewinddir
9902 : see if readlink exists
9903 set readlink d_readlink
9906 : see if rename exists
9910 : see if rmdir exists
9914 : see if memory.h is available.
9919 : See if it conflicts with string.h
9925 $cppstdin $cppflags $cppminus < $strings > mem.h
9926 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
9928 echo "We won't be including <memory.h>."
9938 : can bcopy handle overlapping blocks?
9943 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
9950 $cat >>try.c <<'EOCP'
9953 # include <memory.h>
9956 # include <stdlib.h>
9959 # include <string.h>
9961 # include <strings.h>
9964 # include <unistd.h> /* Needed for NetBSD */
9968 char buf[128], abc[128];
9974 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
9976 for (align = 7; align >= 0; align--) {
9977 for (len = 36; len; len--) {
9980 for (off = 1; off <= len; off++) {
9981 bcopy(b, b+off, len);
9982 bcopy(b+off, b, len);
9983 if (bcmp(b, abc, len))
9992 if eval $compile_ok; then
9993 if ./try 2>/dev/null; then
9997 echo "It can't, sorry."
9998 case "$d_memmove" in
9999 "$define") echo "But that's Ok since you have memmove()." ;;
10003 echo "(I can't compile the test program, so we'll assume not...)"
10004 case "$d_memmove" in
10005 "$define") echo "But that's Ok since you have memmove()." ;;
10010 $rm -f try.* try core
10014 : can memcpy handle overlapping blocks?
10016 case "$d_memcpy" in
10019 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10021 #$i_memory I_MEMORY
10022 #$i_stdlib I_STDLIB
10023 #$i_string I_STRING
10024 #$i_unistd I_UNISTD
10026 $cat >>try.c <<'EOCP'
10029 # include <memory.h>
10032 # include <stdlib.h>
10035 # include <string.h>
10037 # include <strings.h>
10040 # include <unistd.h> /* Needed for NetBSD */
10044 char buf[128], abc[128];
10050 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10051 try to store the string in read-only memory. */
10052 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10054 for (align = 7; align >= 0; align--) {
10055 for (len = 36; len; len--) {
10057 memcpy(b, abc, len);
10058 for (off = 1; off <= len; off++) {
10059 memcpy(b+off, b, len);
10060 memcpy(b, b+off, len);
10061 if (memcmp(b, abc, len))
10070 if eval $compile_ok; then
10071 if ./try 2>/dev/null; then
10072 echo "Yes, it can."
10075 echo "It can't, sorry."
10076 case "$d_memmove" in
10077 "$define") echo "But that's Ok since you have memmove()." ;;
10081 echo "(I can't compile the test program, so we'll assume not...)"
10082 case "$d_memmove" in
10083 "$define") echo "But that's Ok since you have memmove()." ;;
10088 $rm -f try.* try core
10092 : can memcmp be trusted to compare relative magnitude?
10094 case "$d_memcmp" in
10097 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10099 #$i_memory I_MEMORY
10100 #$i_stdlib I_STDLIB
10101 #$i_string I_STRING
10102 #$i_unistd I_UNISTD
10104 $cat >>try.c <<'EOCP'
10107 # include <memory.h>
10110 # include <stdlib.h>
10113 # include <string.h>
10115 # include <strings.h>
10118 # include <unistd.h> /* Needed for NetBSD */
10124 if ((a < b) && memcmp(&a, &b, 1) < 0)
10130 if eval $compile_ok; then
10131 if ./try 2>/dev/null; then
10132 echo "Yes, it can."
10135 echo "No, it can't (it uses signed chars)."
10138 echo "(I can't compile the test program, so we'll assume not...)"
10142 $rm -f try.* try core
10146 : see if select exists
10147 set select d_select
10150 : see if semctl exists
10151 set semctl d_semctl
10154 : see if semget exists
10155 set semget d_semget
10158 : see if semop exists
10162 : see how much of the 'sem*(2)' library is present.
10165 case "$d_semctl$d_semget$d_semop" in
10166 *"$undef"*) h_sem=false;;
10170 case "`ipcs 2>&1`" in
10171 "SVID messages"*"not configured"*)
10172 echo "Your $osname does not have the sem*(2) configured." >&4
10175 set semctl d_semctl
10177 set semget d_semget
10185 : we could also check for sys/ipc.h ...
10186 if $h_sem && $test `./findhdr sys/sem.h`; then
10187 echo "You have the full sem*(2) library." >&4
10190 echo "You don't have the full sem*(2) library." >&4
10196 : see whether sys/sem.h defines union semun
10198 $cat > try.c <<'END'
10199 #include <sys/types.h>
10200 #include <sys/ipc.h>
10201 #include <sys/sem.h>
10202 int main () { union semun semun; semun.buf = 0; }
10205 if eval $compile; then
10206 echo "You have union semun in <sys/sem.h>." >&4
10209 echo "You do not have union semun in <sys/sem.h>." >&4
10212 $rm -f try try.c try.h
10216 : see how to do semctl IPC_STAT
10219 : see whether semctl IPC_STAT can use union semun
10224 # define S_IRUSR S_IREAD
10225 # define S_IWUSR S_IWRITE
10226 # define S_IXUSR S_IEXEC
10228 # define S_IRUSR 0400
10229 # define S_IWUSR 0200
10230 # define S_IXUSR 0100
10232 # define S_IRGRP (S_IRUSR>>3)
10233 # define S_IWGRP (S_IWUSR>>3)
10234 # define S_IXGRP (S_IXUSR>>3)
10235 # define S_IROTH (S_IRUSR>>6)
10236 # define S_IWOTH (S_IWUSR>>6)
10237 # define S_IXOTH (S_IXUSR>>6)
10240 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10241 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10242 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10247 #include <sys/types.h>
10248 #include <sys/ipc.h>
10249 #include <sys/sem.h>
10250 #include <sys/stat.h>
10257 #$d_union_semun HAS_UNION_SEMUN
10260 #ifndef HAS_UNION_SEMUN
10263 struct semid_ds *buf;
10264 unsigned short *array;
10270 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10271 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10273 struct semid_ds argbuf;
10276 st = semctl(sem, 0, IPC_STAT, arg);
10280 # endif /* IPC_STAT */
10281 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10283 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10284 # endif /* IPC_RMID */
10285 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10287 #endif /* IPC_PRIVATE && ... */
10288 printf("semget failed: errno = %d\n", errno);
10294 if eval $compile; then
10297 semun) val="$define" ;;
10303 case "$d_semctl_semun" in
10305 echo "You can use union semun for semctl IPC_STAT." >&4
10308 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10313 : see whether semctl IPC_STAT can use struct semid_ds pointer
10314 $cat > try.c <<'END'
10315 #include <sys/types.h>
10316 #include <sys/ipc.h>
10317 #include <sys/sem.h>
10318 #include <sys/stat.h>
10326 struct semid_ds arg;
10329 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10330 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10333 st = semctl(sem, 0, IPC_STAT, &arg);
10335 printf("semid_ds\n");
10337 # endif /* IPC_STAT */
10338 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10340 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10341 # endif /* IPC_RMID */
10342 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10344 #endif /* IPC_PRIVATE && ... */
10345 printf("semget failed: errno = %d\n", errno);
10352 if eval $compile; then
10355 semid_ds) val="$define" ;;
10359 set d_semctl_semid_ds
10361 case "$d_semctl_semid_ds" in
10363 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10365 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10372 # We do not have the full sem*(2) library, so assume we can not
10378 set d_semctl_semid_ds
10383 : see if setegid exists
10384 set setegid d_setegid
10387 : see if seteuid exists
10388 set seteuid d_seteuid
10391 : see if setgrent exists
10392 set setgrent d_setgrent
10395 : see if sethostent exists
10396 set sethostent d_sethent
10399 : see if setlinebuf exists
10400 set setlinebuf d_setlinebuf
10403 : see if setlocale exists
10404 set setlocale d_setlocale
10407 : see if setnetent exists
10408 set setnetent d_setnent
10411 : see if setprotoent exists
10412 set setprotoent d_setpent
10415 : see if setpgid exists
10416 set setpgid d_setpgid
10419 : see if setpgrp2 exists
10420 set setpgrp2 d_setpgrp2
10423 : see if setpriority exists
10424 set setpriority d_setprior
10427 : see if setpwent exists
10428 set setpwent d_setpwent
10431 : see if setregid exists
10432 set setregid d_setregid
10434 set setresgid d_setresgid
10437 : see if setreuid exists
10438 set setreuid d_setreuid
10440 set setresuid d_setresuid
10443 : see if setrgid exists
10444 set setrgid d_setrgid
10447 : see if setruid exists
10448 set setruid d_setruid
10451 : see if setservent exists
10452 set setservent d_setsent
10455 : see if setsid exists
10456 set setsid d_setsid
10459 : see if setspent exists
10460 set setspent d_setspent
10463 : see if setvbuf exists
10464 set setvbuf d_setvbuf
10467 : see if sfio.h is available
10472 : see if sfio library is available
10483 : Ok, but do we want to use it.
10487 true|$define|[yY]*) dflt='y';;
10490 echo "$package can use the sfio library, but it is experimental."
10491 rp="You seem to have sfio available, do you want to try using it?"
10495 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10497 : Remove sfio from list of libraries to use
10498 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10501 echo "libs = $libs" >&4
10505 *) case "$usesfio" in
10506 true|$define|[yY]*)
10507 echo "Sorry, cannot find sfio on this machine" >&4
10508 echo "Ignoring your setting of usesfio=$usesfio" >&4
10516 $define) usesfio='true';;
10517 *) usesfio='false';;
10520 : see if shmctl exists
10521 set shmctl d_shmctl
10524 : see if shmget exists
10525 set shmget d_shmget
10528 : see if shmat exists
10531 : see what shmat returns
10534 $cat >shmat.c <<'END'
10535 #include <sys/shm.h>
10538 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10543 echo "and it returns ($shmattype)." >&4
10544 : see if a prototype for shmat is available
10545 xxx=`./findhdr sys/shm.h`
10546 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10547 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10558 set d_shmatprototype
10561 : see if shmdt exists
10565 : see how much of the 'shm*(2)' library is present.
10568 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10569 *"$undef"*) h_shm=false;;
10573 case "`ipcs 2>&1`" in
10574 "SVID shared memory"*"not configured"*)
10575 echo "Your $osname does not have the shm*(2) configured." >&4
10578 set shmctl d_shmctl
10580 set shmget d_shmget
10590 : we could also check for sys/ipc.h ...
10591 if $h_shm && $test `./findhdr sys/shm.h`; then
10592 echo "You have the full shm*(2) library." >&4
10595 echo "You don't have the full shm*(2) library." >&4
10602 : see if we have sigaction
10603 if set sigaction val -f d_sigaction; eval $csym; $val; then
10604 echo 'sigaction() found.' >&4
10605 $cat > try.c <<'EOP'
10607 #include <sys/types.h>
10608 #include <signal.h>
10611 struct sigaction act, oact;
10613 oact.sa_handler = 0;
10614 /* so that act and oact are used */
10615 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10619 if eval $compile_ok; then
10622 echo "But you don't seem to have a useable struct sigaction." >&4
10626 echo 'sigaction NOT found.' >&4
10629 set d_sigaction; eval $setvar
10630 $rm -f try try$_o try.c
10632 : see if sigsetjmp exists
10634 case "$d_sigsetjmp" in
10636 $cat >try.c <<'EOP'
10637 #include <setjmp.h>
10642 if (sigsetjmp(env,1))
10645 siglongjmp(env, 1);
10650 if eval $compile; then
10651 if ./try >/dev/null 2>&1; then
10652 echo "POSIX sigsetjmp found." >&4
10656 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10662 echo "sigsetjmp not found." >&4
10666 *) val="$d_sigsetjmp"
10667 case "$d_sigsetjmp" in
10668 $define) echo "POSIX sigsetjmp found." >&4;;
10669 $undef) echo "sigsetjmp not found." >&4;;
10677 : see if sqrtl exists
10681 : see if sys/stat.h is available
10682 set sys/stat.h i_sysstat
10686 : see if stat knows about block sizes
10688 echo "Checking to see if your struct stat has st_blocks field..." >&4
10689 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10693 : see if this is a sys/vfs.h system
10694 set sys/vfs.h i_sysvfs
10698 : see if this is a sys/statfs.h system
10699 set sys/statfs.h i_sysstatfs
10704 echo "Checking to see if your system supports struct statfs..." >&4
10705 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
10707 case "$d_statfs_s" in
10708 "$define") echo "Yes, it does." ;;
10709 *) echo "No, it doesn't." ;;
10714 : see if struct statfs knows about f_flags
10715 case "$d_statfs_s" in
10718 echo "Checking to see if your struct statfs has f_flags field..." >&4
10719 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
10723 set d_statfs_f_flags
10727 case "$d_statfs_f_flags" in
10728 "$define") echo "Yes, it does." ;;
10729 *) echo "No, it doesn't." ;;
10732 : see if _ptr and _cnt from stdio act std
10734 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10735 echo "(Looks like you have stdio.h from Linux.)"
10736 case "$stdio_ptr" in
10737 '') stdio_ptr='((fp)->_IO_read_ptr)'
10740 *) ptr_lval=$d_stdio_ptr_lval;;
10742 case "$stdio_cnt" in
10743 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10746 *) cnt_lval=$d_stdio_cnt_lval;;
10748 case "$stdio_base" in
10749 '') stdio_base='((fp)->_IO_read_base)';;
10751 case "$stdio_bufsiz" in
10752 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10755 case "$stdio_ptr" in
10756 '') stdio_ptr='((fp)->_ptr)'
10759 *) ptr_lval=$d_stdio_ptr_lval;;
10761 case "$stdio_cnt" in
10762 '') stdio_cnt='((fp)->_cnt)'
10765 *) cnt_lval=$d_stdio_cnt_lval;;
10767 case "$stdio_base" in
10768 '') stdio_base='((fp)->_base)';;
10770 case "$stdio_bufsiz" in
10771 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10774 : test whether _ptr and _cnt really work
10775 echo "Checking how std your stdio is..." >&4
10778 #define FILE_ptr(fp) $stdio_ptr
10779 #define FILE_cnt(fp) $stdio_cnt
10781 FILE *fp = fopen("try.c", "r");
10784 18 <= FILE_cnt(fp) &&
10785 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10793 if eval $compile; then
10795 echo "Your stdio acts pretty std."
10798 echo "Your stdio isn't very std."
10801 echo "Your stdio doesn't appear very std."
10807 : Can _ptr be used as an lvalue?
10808 case "$d_stdstdio$ptr_lval" in
10809 $define$define) val=$define ;;
10812 set d_stdio_ptr_lval
10815 : Can _cnt be used as an lvalue?
10816 case "$d_stdstdio$cnt_lval" in
10817 $define$define) val=$define ;;
10820 set d_stdio_cnt_lval
10823 : see if _base is also standard
10825 case "$d_stdstdio" in
10829 #define FILE_base(fp) $stdio_base
10830 #define FILE_bufsiz(fp) $stdio_bufsiz
10832 FILE *fp = fopen("try.c", "r");
10835 19 <= FILE_bufsiz(fp) &&
10836 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
10843 if eval $compile; then
10845 echo "And its _base field acts std."
10848 echo "But its _base field isn't std."
10851 echo "However, it seems to be lacking the _base field."
10860 Checking how to access stdio streams by file descriptor number...
10862 case "$stdio_stream_array" in
10863 '') $cat >try.c <<EOCP
10866 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
10870 for s in _iob __iob __sF
10872 set try -DSTDIO_STREAM_ARRAY=$s
10873 if eval $compile; then
10874 case "`./try$exe_ext`" in
10875 yes) stdio_stream_array=$s; break ;;
10879 $rm -f try.* try$exe_ext
10881 case "$stdio_stream_array" in
10883 I can't figure out how to access stdio streams by file descriptor number.
10885 d_stdio_stream_array="$undef"
10888 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
10890 d_stdio_stream_array="$define"
10894 : see if strcoll exists
10895 set strcoll d_strcoll
10898 : check for structure copying
10900 echo "Checking to see if your C compiler can copy structs..." >&4
10901 $cat >try.c <<'EOCP'
10911 if $cc -c try.c >/dev/null 2>&1 ; then
10913 echo "Yup, it can."
10916 echo "Nope, it can't."
10922 : see if strerror and/or sys_errlist[] exist
10924 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
10925 if set strerror val -f d_strerror; eval $csym; $val; then
10926 echo 'strerror() found.' >&4
10927 d_strerror="$define"
10928 d_strerrm='strerror(e)'
10929 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10930 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
10931 d_syserrlst="$define"
10933 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
10934 d_syserrlst="$undef"
10936 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
10937 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
10938 echo 'strerror() found in string header.' >&4
10939 d_strerror="$define"
10940 d_strerrm='strerror(e)'
10941 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10942 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
10943 d_syserrlst="$define"
10945 echo "(You don't appear to have any sys_errlist[], how can this be?)"
10946 d_syserrlst="$undef"
10948 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
10949 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
10950 d_strerror="$undef"
10951 d_syserrlst="$define"
10952 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
10954 echo 'strerror() and sys_errlist[] NOT found.' >&4
10955 d_strerror="$undef"
10956 d_syserrlst="$undef"
10957 d_strerrm='"unknown"'
10961 : see if strtod exists
10962 set strtod d_strtod
10965 : see if strtol exists
10966 set strtol d_strtol
10969 : see if strtold exists
10970 set strtold d_strtold
10973 : see if strtoll exists
10974 set strtoll d_strtoll
10977 : see if strtoul exists
10978 set strtoul d_strtoul
10981 : see if strtoull exists
10982 set strtoull d_strtoull
10985 : see if strtouq exists
10986 set strtouq d_strtouq
10989 : see if strxfrm exists
10990 set strxfrm d_strxfrm
10993 : see if symlink exists
10994 set symlink d_symlink
10997 : see if syscall exists
10998 set syscall d_syscall
11001 : see if sysconf exists
11002 set sysconf d_sysconf
11005 : see if system exists
11006 set system d_system
11009 : see if tcgetpgrp exists
11010 set tcgetpgrp d_tcgetpgrp
11013 : see if tcsetpgrp exists
11014 set tcsetpgrp d_tcsetpgrp
11017 : see if prototype for telldir is available
11019 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11022 : see if this is a sys/times.h system
11023 set sys/times.h i_systimes
11026 : see if times exists
11028 if set times val -f d_times; eval $csym; $val; then
11029 echo 'times() found.' >&4
11032 case "$i_systimes" in
11033 "$define") inc='sys/times.h';;
11035 rp="What is the type returned by times() on this system?"
11036 set clock_t clocktype long stdio.h sys/types.h $inc
11039 echo 'times() NOT found, hope that will do.' >&4
11044 : see if truncate exists
11045 set truncate d_truncate
11048 : see if tzname[] exists
11050 if set tzname val -a d_tzname; eval $csym; $val; then
11052 echo 'tzname[] found.' >&4
11055 echo 'tzname[] NOT found.' >&4
11060 : see if umask exists
11064 : see if ustat exists
11068 : backward compatibility for d_hvfork
11069 if test X$d_hvfork != X; then
11070 d_vfork="$d_hvfork"
11073 : see if there is a vfork
11078 : Ok, but do we want to use it. vfork is reportedly unreliable in
11079 : perl on Solaris 2.x, and probably elsewhere.
11083 case "$usevfork" in
11089 Perl can only use a vfork() that doesn't suffer from strict
11090 restrictions on calling functions or modifying global data in
11091 the child. For example, glibc-2.1 contains such a vfork()
11092 that is unsuitable. If your system provides a proper fork()
11093 call, chances are that you do NOT want perl to use vfork().
11096 rp="Do you still want to use vfork()?"
11101 echo "Ok, we won't use vfork()."
11110 $define) usevfork='true';;
11111 *) usevfork='false';;
11114 : see if this is an sysdir system
11115 set sys/dir.h i_sysdir
11118 : see if this is an sysndir system
11119 set sys/ndir.h i_sysndir
11122 : see if closedir exists
11123 set closedir d_closedir
11126 case "$d_closedir" in
11129 echo "Checking whether closedir() returns a status..." >&4
11130 cat > closedir.c <<EOM
11131 #$i_dirent I_DIRENT /**/
11132 #$i_sysdir I_SYS_DIR /**/
11133 #$i_sysndir I_SYS_NDIR /**/
11134 #$i_systypes I_SYS_TYPES /**/
11136 #if defined(I_SYS_TYPES)
11137 #include <sys/types.h>
11139 #if defined(I_DIRENT)
11140 #include <dirent.h>
11141 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11142 #include <sys/dir.h>
11146 #include <sys/ndir.h>
11150 #include <ndir.h> /* may be wrong in the future */
11152 #include <sys/dir.h>
11157 int main() { return closedir(opendir(".")); }
11160 if eval $compile_ok; then
11161 if ./closedir > /dev/null 2>&1 ; then
11162 echo "Yes, it does."
11165 echo "No, it doesn't."
11169 echo "(I can't seem to compile the test program--assuming it doesn't)"
11177 set d_void_closedir
11180 : check for volatile keyword
11182 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11183 $cat >try.c <<'EOCP'
11186 typedef struct _goo_struct goo_struct;
11187 goo_struct * volatile goo = ((goo_struct *)0);
11188 struct _goo_struct {
11193 typedef unsigned short foo_t;
11194 char *volatile foo;
11196 volatile foo_t blech;
11200 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11202 echo "Yup, it does."
11205 echo "Nope, it doesn't."
11211 : see if there is a wait4
11215 : see if waitpid exists
11216 set waitpid d_waitpid
11219 : see if wcstombs exists
11220 set wcstombs d_wcstombs
11223 : see if wctomb exists
11224 set wctomb d_wctomb
11227 : preserve RCS keywords in files with variable substitution, grrr
11232 Revision='$Revision'
11234 case "$crosscompile" in
11235 ''|[nN]*) crosscompile="$undef" ;;
11239 next|rhapsody) multiarch="$define" ;;
11241 case "$multiarch" in
11242 ''|[nN]*) multiarch="$undef" ;;
11245 : check for alignment requirements
11247 case "$crosscompile$multiarch" in
11250 You seem to be either cross-compiling or doing a multiarchitecture build,
11251 skipping the memory alignment check.
11254 case "$alignbytes" in
11255 '') alignbytes=8 ;;
11259 case "$alignbytes" in
11260 '') echo "Checking alignment constraints..." >&4
11261 $cat >try.c <<'EOCP'
11269 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11274 if eval $compile_ok; then
11278 echo "(I can't seem to compile the test program...)"
11281 *) dflt="$alignbytes"
11284 rp="Doubles must be aligned on a how-many-byte boundary?"
11292 : check for ordering of bytes in a long
11294 case "$crosscompile$multiarch" in
11297 You seem to be either cross-compiling or doing a multiarchitecture build,
11298 skipping the byteorder check.
11304 case "$byteorder" in
11307 In the following, larger digits indicate more significance. A big-endian
11308 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11309 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11310 machines may have weird orders like 3412. A Cray will report 87654321,
11311 an Alpha will report 12345678. If the test program works the default is
11313 I'm now running the test program...
11315 $cat >try.c <<'EOCP'
11322 char c[sizeof(long)];
11325 if (sizeof(long) > 4)
11326 u.l = (0x08070605L << 32) | 0x04030201L;
11329 for (i = 0; i < sizeof(long); i++)
11330 printf("%c", u.c[i]+'0');
11337 if eval $compile && ./try > /dev/null; then
11340 [1-4][1-4][1-4][1-4]|12345678|87654321)
11341 echo "(The test program ran ok.)"
11342 echo "byteorder=$dflt"
11345 ????|????????) echo "(The test program ran ok.)" ;;
11346 *) echo "(The test program didn't run right for some reason.)" ;;
11351 (I can't seem to compile the test program. Guessing big-endian...)
11354 case "$xxx_prompt" in
11356 rp="What is the order of bytes in a long?"
11370 : how do we catenate cpp tokens here?
11372 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11373 $cat >cpp_stuff.c <<'EOCP'
11374 #define RCAT(a,b)a/**/b
11375 #define ACAT(a,b)a ## b
11379 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11380 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11381 echo "Oh! Smells like ANSI's been here." >&4
11382 echo "We can catify or stringify, separately or together!"
11384 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11385 echo "Ah, yes! The good old days!" >&4
11386 echo "However, in the good old days we don't know how to stringify and"
11387 echo "catify at the same time."
11391 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11392 to have to edit the values of CAT[2-5] in config.h...
11394 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11398 : see if this is a db.h system
11404 : Check db version.
11406 echo "Checking Berkeley DB version ..." >&4
11412 #include <sys/types.h>
11417 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11418 int Major, Minor, Patch ;
11419 unsigned long Version ;
11420 (void)db_version(&Major, &Minor, &Patch) ;
11421 printf("You have Berkeley DB Version 2 or greater\n");
11423 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11424 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11425 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11426 Major, Minor, Patch) ;
11428 /* check that db.h & libdb are compatible */
11429 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11430 printf("db.h and libdb are incompatible\n") ;
11434 printf("db.h and libdb are compatible\n") ;
11436 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11437 + DB_VERSION_PATCH ;
11439 /* needs to be >= 2.3.4 */
11440 if (Version < 2003004) {
11441 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11442 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11448 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11449 printf("You have Berkeley DB Version 1\n");
11450 exit(0); /* DB version < 2: the coast is clear. */
11452 exit(1); /* <db.h> not Berkeley DB? */
11458 if eval $compile_ok && ./try; then
11459 echo 'Looks OK.' >&4
11461 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11465 : Remove db from list of libraries to use
11466 echo "Removing unusable -ldb from library list" >&4
11467 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11470 echo "libs = $libs" >&4
11480 : Check the return type needed for hash
11482 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11488 #include <sys/types.h>
11491 #ifndef DB_VERSION_MAJOR
11492 u_int32_t hash_cb (ptr, size)
11500 info.hash = hash_cb;
11504 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11505 if $contains warning try.out >>/dev/null 2>&1 ; then
11508 db_hashtype='u_int32_t'
11511 : XXX Maybe we should just give up here.
11512 db_hashtype=u_int32_t
11514 echo "Help: I can't seem to compile the db test program." >&4
11515 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11518 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11520 *) db_hashtype=u_int32_t
11525 : Check the return type needed for prefix
11527 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11533 #include <sys/types.h>
11536 #ifndef DB_VERSION_MAJOR
11537 size_t prefix_cb (key1, key2)
11545 info.prefix = prefix_cb;
11549 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11550 if $contains warning try.out >>/dev/null 2>&1 ; then
11551 db_prefixtype='int'
11553 db_prefixtype='size_t'
11556 db_prefixtype='size_t'
11557 : XXX Maybe we should just give up here.
11559 echo "Help: I can't seem to compile the db test program." >&4
11560 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11563 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11565 *) db_prefixtype='size_t'
11569 : check for void type
11571 echo "Checking to see how well your C compiler groks the void type..." >&4
11572 case "$voidflags" in
11574 $cat >try.c <<'EOCP'
11580 extern void moo(); /* function returning void */
11581 void (*goo)(); /* ptr to func returning void */
11583 void *hue; /* generic ptr */
11596 int main() { sub(); }
11598 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11599 voidflags=$defvoidused
11600 echo "Good. It appears to support void to the level $package wants.">&4
11601 if $contains warning .out >/dev/null 2>&1; then
11602 echo "However, you might get some warnings that look like this:"
11606 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11607 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11608 echo "It supports 1..."
11609 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11610 echo "It also supports 2..."
11611 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11613 echo "And it supports 4 but not 8 definitely."
11615 echo "It doesn't support 4..."
11616 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11618 echo "But it supports 8."
11621 echo "Neither does it support 8."
11625 echo "It does not support 2..."
11626 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11628 echo "But it supports 4 and 8."
11630 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11632 echo "And it supports 4 but has not heard about 8."
11634 echo "However it supports 8 but not 4."
11639 echo "There is no support at all for void."
11644 case "$voidflags" in
11646 *) $cat >&4 <<'EOM'
11647 Support flag bits are:
11648 1: basic void declarations.
11649 2: arrays of pointers to functions returning void.
11650 4: operations between pointers to and addresses of void functions.
11651 8: generic void pointers.
11654 rp="Your void support flags add up to what?"
11662 : How can we generate normalized random numbers ?
11664 echo "Looking for a random number function..." >&4
11665 case "$randfunc" in
11667 if set drand48 val -f; eval $csym; $val; then
11669 echo "Good, found drand48()." >&4
11670 elif set random val -f; eval $csym; $val; then
11672 echo "OK, found random()." >&4
11675 echo "Yick, looks like I have to use rand()." >&4
11686 *-Dmy_rand=*|*-Dmy_srand=*)
11687 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11688 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11689 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11690 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11694 while $test "$cont"; do
11695 rp="Use which function to generate random numbers?"
11697 if $test "$ans" = "$dflt"; then
11703 if set $ans val -f; eval $csym; $val; then
11707 rp="I cannot find function $ans. Use that name anyway?"
11716 case "$randfunc" in
11718 drand01="drand48()"
11724 case "$randbits" in
11726 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11728 #$i_unistd I_UNISTD
11729 #$i_stdlib I_STDLIB
11732 # include <unistd.h>
11735 # include <stdlib.h>
11740 register unsigned long tmp;
11741 register unsigned long max = 0L;
11743 for (i = 1000; i; i--) {
11744 tmp = (unsigned long) $randfunc();
11745 if (tmp > max) max = tmp;
11747 for (i = 0; max; i++)
11753 if eval $compile_ok; then
11757 echo "(I can't seem to compile the test program...)"
11764 rp="How many bits does your $randfunc() function produce?"
11768 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11769 seedfunc="s$randfunc"
11770 randseedtype=unsigned
11774 rp="How many bits does your $randfunc() function produce?"
11777 seedfunc="s$randfunc"
11778 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11779 if set $seedfunc val -f; eval $csym; $val; then
11780 echo "(Using $seedfunc() to seed random generator)"
11782 echo "(Warning: no $seedfunc() to seed random generator)"
11785 randseedtype=unsigned
11793 echo "Determining whether or not we are on an EBCDIC system..." >&4
11794 $cat >tebcdic.c <<'EOM'
11797 if ('M'==0xd4) return 0;
11804 if eval $compile_ok; then
11806 echo "You have EBCDIC." >&4
11809 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11812 echo "I'm unable to compile the test program." >&4
11813 echo "I'll assume ASCII or some ISO Latin." >&4
11815 $rm -f tebcdic.c tebcdic
11821 Checking how to flush all pending stdio output...
11823 # I only know how to find the first 32 possibly open files on SunOS.
11824 # See also hints/sunos_4_1.sh and util.c --AD
11826 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
11828 $cat >>try.c <<EOCP
11830 #$i_unistd I_UNISTD
11832 # include <unistd.h>
11834 #$d_sysconf HAS_SYSCONF
11835 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
11836 #ifdef HAS_STDIO_STREAM_ARRAY
11837 # define STDIO_STREAM_ARRAY $stdio_stream_array
11840 FILE* p = fopen("try.out", "w");
11844 # ifdef TRY_FPRINTF
11848 #ifdef TRY_FFLUSH_NULL
11851 #ifdef TRY_FFLUSH_ALL
11853 long open_max = -1;
11854 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
11855 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
11857 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
11858 open_max = sysconf(_SC_OPEN_MAX);
11861 open_max = FOPEN_MAX;
11864 open_max = OPEN_MAX;
11873 # ifdef HAS_STDIO_STREAM_ARRAY
11874 if (open_max > 0) {
11876 for (i = 0; i < open_max; i++)
11877 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
11878 STDIO_STREAM_ARRAY[i]._file < open_max &&
11879 STDIO_STREAM_ARRAY[i]._flag)
11880 fflush(&STDIO_STREAM_ARRAY[i]);
11888 : first we have to find out how _not_ to flush
11889 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
11891 set try -DTRY_FPUTC
11892 if eval $compile; then
11894 ./try$exe_ext 2>/dev/null
11895 if $test ! -s try.out -a "X$?" = X42; then
11901 set try -DTRY_FPRINTF
11903 if eval $compile; then
11905 ./try$exe_ext 2>/dev/null
11906 if $test ! -s try.out -a "X$?" = X42; then
11907 output=-DTRY_FPRINTF
11913 : check for fflush NULL behaviour
11914 case "$fflushNULL" in
11915 '') set try -DTRY_FFLUSH_NULL $output
11916 if eval $compile; then
11918 ./try$exe_ext 2>/dev/null
11920 if $test -s try.out -a "X$code" = X42; then
11921 fflushNULL="`$cat try.out`"
11923 if $test "X$code" != X42; then
11925 (If this test failed, don't worry, we'll try another method shortly.)
11930 $rm -f core try.core core.try.*
11931 case "$fflushNULL" in
11933 Your fflush(NULL) works okay.
11935 fflushNULL="$define"
11938 Your fflush(NULL) isn't working (contrary to ANSI C).
11940 fflushNULL="$undef"
11943 Cannot figure out whether your fflush(NULL) works or not.
11944 I'm assuming it doesn't (contrary to ANSI C).
11946 fflushNULL="$undef"
11950 $define|true|[yY]*)
11951 fflushNULL="$define"
11954 fflushNULL="$undef"
11957 : check explicit looping only if NULL did not work
11958 case "$fflushNULL" in
11960 : check for fflush all behaviour
11961 case "$fflushall" in
11962 '') set try -DTRY_FFLUSH_ALL $output
11963 if eval $compile; then
11965 (Now testing the other method--but note that also this may fail.)
11968 ./try$exe_ext 2>/dev/null
11969 if $test -s try.out -a "X$?" = X42; then
11970 fflushall="`$cat try.out`"
11973 $rm -f core try.core core.try.*
11974 case "$fflushall" in
11976 Whew. Flushing explicitly all the stdio streams works.
11978 fflushall="$define"
11981 Sigh. Flushing explicitly all the stdio streams doesn't work.
11986 Cannot figure out whether flushing stdio streams explicitly works or not.
11987 I'm assuming it doesn't.
11993 "$define"|true|[yY]*)
11994 fflushall="$define"
12001 *) fflushall="$undef"
12004 case "$fflushNULL$fflushall" in
12007 I cannot figure out how to flush pending stdio output.
12011 $rm -f try.* try$exe_ext
12013 : Store the full pathname to the ar program for use in the C program
12014 : Respect a hint or command line value for full_ar.
12019 : Store the full pathname to the sed program for use in the C program
12022 : see what type gids are declared as in the kernel
12024 echo "Looking for the type for group ids returned by getgid()."
12025 set gid_t gidtype xxx stdio.h sys/types.h
12029 xxx=`./findhdr sys/user.h`
12030 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12032 unsigned) dflt="$1 $2" ;;
12036 *) dflt="$gidtype";;
12039 gid_t) echo "gid_t found." ;;
12040 *) rp="What is the type for group ids returned by getgid()?"
12048 *_t) zzz="$gidtype" ;;
12051 echo "Checking the size of $zzz..." >&4
12053 #include <sys/types.h>
12056 printf("%d\n", (int)sizeof($gidtype));
12061 if eval $compile_ok; then
12065 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12068 echo "Your $zzz size is $gidsize bytes."
12073 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12079 *_t) zzz="$gidtype" ;;
12082 echo "Checking the sign of $zzz..." >&4
12084 #include <sys/types.h>
12095 if eval $compile; then
12099 echo "(I can't execute the test program--guessing unsigned.)" >&4
12103 1) echo "Your $zzz is unsigned." ;;
12104 -1) echo "Your $zzz is signed." ;;
12110 echo "(I can't compile the test program--guessing unsigned.)" >&4
12114 : check for length of character
12116 case "$charsize" in
12118 echo "Checking to see how big your characters are (hey, you never know)..." >&4
12119 $cat >try.c <<'EOCP'
12123 printf("%d\n", (int)sizeof(char));
12128 if eval $compile_ok; then
12132 echo "(I can't seem to compile the test program. Guessing...)"
12139 rp="What is the size of a character (in bytes)?"
12146 $echo "Choosing the C types to be used for Perl's internal types..." >&4
12148 case "$use64bits:$d_quad:$quadtype" in
12151 uvtype="$uquadtype"
12156 uvtype="unsigned long"
12162 case "$uselongdouble:$d_longdbl" in
12164 nvtype="long double"
12165 nvsize=$longdblsize
12172 echo "(IV will be "$ivtype", $ivsize bytes)"
12173 echo "(UV will be "$uvtype", $uvsize bytes)"
12174 echo "(NV will be "$nvtype", $nvsize bytes)"
12177 #$i_inttypes I_INTTYPES
12179 #include <inttypes.h>
12184 int8_t i = INT8_MAX;
12185 uint8_t u = UINT8_MAX;
12186 printf("int8_t\n");
12189 int16_t i = INT16_MAX;
12190 uint16_t i = UINT16_MAX;
12191 printf("int16_t\n");
12194 int32_t i = INT32_MAX;
12195 uint32_t u = UINT32_MAX;
12196 printf("int32_t\n");
12202 '') case "$charsize" in
12204 u8type="unsigned char"
12213 if eval $compile; then
12214 case "`./try$exe_ext`" in
12215 int8_t) i8type=int8_t
12225 '') if $test $charsize -ge 1; then
12227 u8type="unsigned char"
12235 '') case "$shortsize" in
12237 u16type="unsigned short"
12245 '') set try -DINT16
12246 if eval $compile; then
12247 case "`./try$exe_ext`" in
12259 '') if $test $shortsize -ge 2; then
12261 u16type="unsigned short"
12269 '') case "$longsize" in
12271 u32type="unsigned long"
12275 *) case "$intsize" in
12277 u32type="unsigned int"
12287 '') set try -DINT32
12288 if eval $compile; then
12289 case "`./try$exe_ext`" in
12301 '') if $test $intsize -ge 4; then
12303 u32type="unsigned int"
12311 '') case "$d_quad:$quadtype" in
12313 i64type="$quadtype"
12314 u64type="$uquadtype"
12326 if $test X"$quadtype" != X; then
12328 echo "Checking how to print 64-bit integers..." >&4
12330 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12331 $cat >try.c <<'EOCP'
12332 #include <sys/types.h>
12335 int q = 12345678901;
12336 printf("%ld\n", q);
12340 if eval $compile; then
12341 yyy=`./try$exe_ext`
12344 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12345 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12346 echo "We will use %d."
12352 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12353 $cat >try.c <<'EOCP'
12354 #include <sys/types.h>
12357 long q = 12345678901;
12358 printf("%ld\n", q);
12362 if eval $compile; then
12363 yyy=`./try$exe_ext`
12366 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12367 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12368 echo "We will use %ld."
12374 if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
12375 $cat >try.c <<'EOCP'
12376 #include <sys/types.h>
12377 #include <inttypes.h>
12380 int64_t q = 12345678901;
12381 printf("%" PRId64 "\n", q);
12385 if eval $compile; then
12386 yyy=`./try$exe_ext`
12389 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12390 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12391 echo "We will use the C9X style."
12397 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12398 $cat >try.c <<'EOCP'
12399 #include <sys/types.h>
12402 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12403 printf("%lld\n", q);
12407 if eval $compile; then
12408 yyy=`./try$exe_ext`
12411 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12412 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12413 echo "We will use the %lld style."
12419 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12421 #include <sys/types.h>
12424 $quadtype q = 12345678901;
12425 printf("%Ld\n", q);
12429 if eval $compile; then
12430 yyy=`./try$exe_ext`
12433 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12434 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12435 echo "We will use %Ld."
12441 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12443 #include <sys/types.h>
12446 $quadtype q = 12345678901;
12447 printf("%qd\n", q);
12451 if eval $compile; then
12452 yyy=`./try$exe_ext`
12455 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12456 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12457 echo "We will use %qd."
12463 if $test X"$sPRId64" = X; then
12464 echo "Cannot figure out how to print 64-bit integers." >&4
12472 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12473 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12475 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12476 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12482 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12484 if $test X"$ivsize" = X8; then
12485 ivdformat="$sPRId64"
12486 uvuformat="$sPRIu64"
12487 uvoformat="$sPRIo64"
12488 uvxformat="$sPRIx64"
12490 if $test X"$ivsize" = X"$longsize"; then
12496 if $test X"$ivsize" = X"$intsize"; then
12503 if $test X"$ivsize" = X"$shortsize"; then
12513 case "$ivdformat" in
12514 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12521 $echo "Checking the format string to be used for gids..." >&4
12524 -1) if $test X"$gidsize" = X"$ivsize"; then
12525 gidformat="$ivdformat"
12527 if $test X"$gidsize" = X"$longsize"; then
12530 if $test X"$gidsize" = X"$intsize"; then
12533 if $test X"$gidsize" = X"$shortsize"; then
12540 *) if $test X"$gidsize" = X"$uvsize"; then
12541 gidformat="$uvuformat"
12543 if $test X"$gidsize" = X"$longsize"; then
12546 if $test X"$gidsize" = X"$intsize"; then
12549 if $test X"$gidsize" = X"$shortsize"; then
12558 : see if getgroups exists
12559 set getgroups d_getgrps
12562 : see if setgroups exists
12563 set setgroups d_setgrps
12567 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12569 case "$d_getgrps$d_setgrps" in
12571 case "$groupstype" in
12572 '') dflt="$gidtype" ;;
12573 *) dflt="$groupstype" ;;
12576 What type of pointer is the second argument to getgroups() and setgroups()?
12577 Usually this is the same as group ids, $gidtype, but not always.
12580 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12584 *) groupstype="$gidtype";;
12588 echo "Checking if your $make program sets \$(MAKE)..." >&4
12589 case "$make_set_make" in
12591 $sed 's/^X //' > testmake.mak << 'EOF'
12593 X @echo 'maketemp="$(MAKE)"'
12595 case "`$make -f testmake.mak 2>/dev/null`" in
12596 *maketemp=*) make_set_make='#' ;;
12597 *) make_set_make="MAKE=$make" ;;
12599 $rm -f testmake.mak
12602 case "$make_set_make" in
12603 '#') echo "Yup, it does.";;
12604 *) echo "Nope, it doesn't.";;
12607 : see what type is used for mode_t
12608 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12609 set mode_t modetype int stdio.h sys/types.h
12612 : define a fucntion to check prototypes
12613 $cat > protochk <<EOSH
12616 optimize="$optimize"
12618 prototype="$prototype"
12623 $cat >> protochk <<'EOSH'
12628 while test $# -ge 2; do
12630 $define) echo "#include <$2>" >> try.c ;;
12631 literal) echo "$2" >> try.c ;;
12635 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12636 cat >> try.c <<'EOCP'
12637 #ifdef CAN_PROTOTYPE
12638 #define _(args) args
12643 echo "$foo" >> try.c
12644 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12645 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12651 $eunicefix protochk
12653 : see what type is used for size_t
12654 rp="What is the type used for the length parameter for string functions?"
12655 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12658 : check for type of arguments to gethostbyaddr.
12659 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12660 case "$d_gethbyaddr" in
12664 Checking to see what type of arguments are accepted by gethostbyaddr().
12666 hdrs="$define sys/types.h
12667 $d_socket sys/socket.h
12668 $i_niin netinet/in.h
12670 $i_unistd unistd.h"
12671 : The first arg can 'char *' or 'void *'
12672 : The second arg is some of integral type
12673 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12674 for yyy in size_t long int; do
12675 case "$netdb_host_type" in
12676 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12677 if ./protochk "$try" $hdrs; then
12678 echo "Your system accepts $xxx for the first arg."
12679 echo "...and $yyy for the second arg."
12680 netdb_host_type="$xxx"
12681 netdb_hlen_type="$yyy"
12687 : In case none of those worked, prompt the user.
12688 case "$netdb_host_type" in
12689 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12692 netdb_host_type=$ans
12693 rp='What is the type for the 2nd argument to gethostbyaddr?'
12696 netdb_hlen_type=$ans
12700 *) : no gethostbyaddr, so pick harmless defaults
12701 netdb_host_type='char *'
12702 netdb_hlen_type="$sizetype"
12705 # Remove the "const" if needed. -- but then we'll have a
12707 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12710 : check for type of argument to gethostbyname.
12711 if test "X$netdb_name_type" = X ; then
12712 case "$d_gethbyname" in
12716 Checking to see what type of argument is accepted by gethostbyname().
12718 hdrs="$define sys/types.h
12719 $d_socket sys/socket.h
12720 $i_niin netinet/in.h
12722 $i_unistd unistd.h"
12723 for xxx in "const char *" "char *"; do
12724 case "$netdb_name_type" in
12725 '') try="extern struct hostent *gethostbyname($xxx);"
12726 if ./protochk "$try" $hdrs; then
12727 echo "Your system accepts $xxx."
12728 netdb_name_type="$xxx"
12733 : In case none of those worked, prompt the user.
12734 case "$netdb_name_type" in
12735 '') rp='What is the type for the 1st argument to gethostbyname?'
12738 netdb_name_type=$ans
12742 *) : no gethostbyname, so pick harmless default
12743 netdb_name_type='char *'
12748 : check for type of 1st argument to getnetbyaddr.
12749 if test "X$netdb_net_type" = X ; then
12750 case "$d_getnbyaddr" in
12754 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12756 hdrs="$define sys/types.h
12757 $d_socket sys/socket.h
12758 $i_niin netinet/in.h
12760 $i_unistd unistd.h"
12761 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12762 case "$netdb_net_type" in
12763 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12764 if ./protochk "$try" $hdrs; then
12765 echo "Your system accepts $xxx."
12766 netdb_net_type="$xxx"
12771 : In case none of those worked, prompt the user.
12772 case "$netdb_net_type" in
12773 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12776 netdb_net_type=$ans
12780 *) : no getnetbyaddr, so pick harmless default
12781 netdb_net_type='long'
12785 : locate the preferred pager for this system
12799 '') dflt=/usr/ucb/more;;
12806 rp='What pager is used on your system?'
12810 : see what type pids are declared as in the kernel
12811 rp="What is the type of process ids on this system?"
12812 set pid_t pidtype int stdio.h sys/types.h
12815 : check for length of pointer
12819 $echo $n "Checking to see how big your pointers are...$c" >&4
12820 if test "$voidflags" -gt 7; then
12821 echo '#define VOID_PTR char *' > try.c
12823 echo '#define VOID_PTR void *' > try.c
12825 $cat >>try.c <<'EOCP'
12829 printf("%d\n", (int)sizeof(VOID_PTR));
12834 if eval $compile_ok; then
12836 $echo " $ptrsize bytes." >&4
12839 echo "(I can't seem to compile the test program. Guessing...)" >&4
12840 rp="What is the size of a pointer (in bytes)?"
12848 : see if ar generates random libraries by itself
12850 echo "Checking how to generate random libraries on your machine..." >&4
12851 echo 'int bar1() { return bar2(); }' > bar1.c
12852 echo 'int bar2() { return 2; }' > bar2.c
12853 $cat > foo.c <<'EOP'
12854 int main() { printf("%d\n", bar1()); exit(0); }
12856 $cc $ccflags -c bar1.c >/dev/null 2>&1
12857 $cc $ccflags -c bar2.c >/dev/null 2>&1
12858 $cc $ccflags -c foo.c >/dev/null 2>&1
12859 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12860 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12861 ./foobar >/dev/null 2>&1; then
12862 echo "$ar appears to generate random libraries itself."
12865 elif $ar ts bar$_a >/dev/null 2>&1 &&
12866 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12867 ./foobar >/dev/null 2>&1; then
12868 echo "a table of contents needs to be added with '$ar ts'."
12875 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12876 $test -f $ranlib || ranlib=''
12879 if $test -n "$ranlib"; then
12880 echo "your system has '$ranlib'; we'll use that."
12883 echo "your system doesn't seem to support random libraries"
12884 echo "so we'll use lorder and tsort to order the libraries."
12891 : check for type of arguments to select.
12892 case "$selecttype" in
12893 '') case "$d_select" in
12896 Checking to see what type of arguments are accepted by select().
12898 hdrs="$define sys/types.h
12899 $i_systime sys/time.h
12900 $i_sysselct sys/select.h
12901 $d_socket sys/socket.h"
12902 : The first arg can be int, unsigned, or size_t
12903 : The last arg may or may not be 'const'
12905 : void pointer has been seen but using that
12906 : breaks the selectminbits test
12907 for xxx in 'fd_set *' 'int *'; do
12908 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12909 for tmo in 'struct timeval *' 'const struct timeval *'; do
12911 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12912 if ./protochk "$try" $hdrs; then
12913 echo "Your system accepts $xxx."
12922 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12923 case "$d_fd_set" in
12924 $define) dflt="fd_set *" ;;
12933 *) : no select, so pick a harmless default
12940 : check for the select 'width'
12941 case "$selectminbits" in
12942 '') case "$d_select" in
12946 Checking to see on how many bits at a time your select() operates...
12949 #include <sys/types.h>
12951 #$i_systime I_SYS_TIME
12952 #$i_systimek I_SYS_TIME_KERNEL
12957 # ifdef I_SYS_TIME_KERNEL
12960 # include <sys/time.h>
12961 # ifdef I_SYS_TIME_KERNEL
12965 #$i_sysselct I_SYS_SELECT
12966 #ifdef I_SYS_SELECT
12967 #include <sys/select.h>
12969 #$d_socket HAS_SOCKET
12971 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12975 #define S sizeof(*(b))
12977 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12978 #define NBITS (NBYTES * 8)
12987 fp = fopen("try.c", "r");
12993 b = ($selecttype)s;
12994 for (i = 0; i < NBITS; i++)
12998 select(fd + 1, b, 0, 0, &t);
12999 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13000 printf("%d\n", i + 1);
13005 if eval $compile_ok; then
13006 selectminbits=`./try`
13007 case "$selectminbits" in
13009 Cannot figure out on how many bits at a time your select() operates.
13010 I'll play safe and guess it is 32 bits.
13016 *) bits="$selectminbits bits" ;;
13018 echo "Your select() operates on $bits at a time." >&4
13020 rp='What is the minimum number of bits your select() operates on?'
13021 case "$byteorder" in
13022 1234|12345678) dflt=32 ;;
13027 selectminbits="$val"
13031 *) : no select, so pick a harmless default
13038 : Trace out the files included by signal.h, then look for SIGxxx names.
13039 : Remove SIGARRAYSIZE used by HPUX.
13040 : Remove SIGSTKSIZE used by Linux.
13041 : Remove SIGSTKSZ used by Posix.
13042 : Remove SIGTYP void lines used by OS2.
13043 : Some cpps, like os390, dont give the file name anywhere
13044 if [ "X$fieldn" = X ]; then
13045 : Just make some guesses. We check them later.
13046 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13048 xxx=`echo '#include <signal.h>' |
13049 $cppstdin $cppminus $cppflags 2>/dev/null |
13050 $grep '^[ ]*#.*include' |
13051 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13053 : Check this list of files to be sure we have parsed the cpp output ok.
13054 : This will also avoid potentially non-existent files, such
13057 for xx in $xxx /dev/null ; do
13058 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13060 : If we have found no files, at least try signal.h
13061 case "$xxxfiles" in
13062 '') xxxfiles=`./findhdr signal.h` ;;
13065 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13066 print substr($2, 4, 20)
13068 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13069 print substr($3, 4, 20)
13071 : Append some common names just in case the awk scan failed.
13072 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13073 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13074 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13075 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13076 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13078 : generate a few handy files for later
13079 $cat > signal.c <<'EOCP'
13080 #include <sys/types.h>
13081 #include <signal.h>
13085 /* Strange style to avoid deeply-nested #if/#else/#endif */
13088 # define NSIG (_NSIG)
13094 # define NSIG (SIGMAX+1)
13100 # define NSIG (SIG_MAX+1)
13106 # define NSIG (MAXSIG+1)
13112 # define NSIG (MAX_SIG+1)
13117 # ifdef SIGARRAYSIZE
13118 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13124 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13128 /* Default to some arbitrary number that's big enough to get most
13129 of the common signals.
13135 printf("NSIG %d\n", NSIG);
13141 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13143 printf "#ifdef SIG"; printf $1; printf "\n"
13144 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13145 printf $1; printf ");\n"
13149 printf "#endif /* JUST_NSIG */\n";
13150 printf "exit(0);\n}\n";
13153 $cat >signal.awk <<'EOP'
13154 BEGIN { ndups = 0 }
13155 $1 ~ /^NSIG$/ { nsig = $2 }
13156 ($1 !~ /^NSIG$/) && (NF == 2) {
13157 if ($2 > maxsig) { maxsig = $2 }
13158 if (sig_name[$2]) {
13159 dup_name[ndups] = $1
13160 dup_num[ndups] = $2
13172 printf("NSIG %d\n", nsig);
13173 for (n = 1; n < nsig; n++) {
13175 printf("%s %d\n", sig_name[n], sig_num[n])
13178 printf("NUM%d %d\n", n, n)
13181 for (n = 0; n < ndups; n++) {
13182 printf("%s %d\n", dup_name[n], dup_num[n])
13186 $cat >signal_cmd <<EOS
13188 if $test -s signal.lst; then
13189 echo "Using your existing signal.lst file"
13194 $cat >>signal_cmd <<'EOS'
13197 if eval $compile_ok; then
13198 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13200 echo "(I can't seem be able to compile the whole test program)" >&4
13201 echo "(I'll try it in little pieces.)" >&4
13202 set signal -DJUST_NSIG
13203 if eval $compile_ok; then
13204 ./signal$_exe > signal.nsg
13207 echo "I can't seem to figure out how many signals you have." >&4
13208 echo "Guessing 50." >&4
13209 echo 'NSIG 50' > signal.nsg
13211 : Now look at all the signal names, one at a time.
13212 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13213 $cat > signal.c <<EOCP
13214 #include <sys/types.h>
13215 #include <signal.h>
13218 printf("$xx %d\n", SIG${xx});
13223 if eval $compile; then
13224 echo "SIG${xx} found."
13225 ./signal$_exe >> signal.ls1
13227 echo "SIG${xx} NOT found."
13230 if $test -s signal.ls1; then
13231 $cat signal.nsg signal.ls1 |
13232 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13236 if $test -s signal.lst; then
13239 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13240 echo 'kill -l' >signal
13241 set X `csh -f <signal`
13245 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13247 echo $@ | $tr ' ' $trnl | \
13248 $awk '{ printf "%s %d\n", $1, ++s; }
13249 END { printf "NSIG %d\n", ++s }' >signal.lst
13251 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13253 chmod a+x signal_cmd
13254 $eunicefix signal_cmd
13256 : generate list of signal names
13258 case "$sig_name_init" in
13260 *) case "$sig_num_init" in
13261 ''|*,*) doinit=yes ;;
13266 echo "Generating a list of signal names and numbers..." >&4
13268 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13269 sig_name=`$awk 'BEGIN { printf "ZERO " }
13270 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13271 sig_num=`$awk 'BEGIN { printf "0 " }
13272 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13273 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13274 !/^NSIG/ { printf "\"%s\", ", $1 }
13275 END { printf "0\n" }' signal.lst`
13276 sig_num_init=`$awk 'BEGIN { printf "0, " }
13277 !/^NSIG/ { printf "%d, ", $2}
13278 END { printf "0\n"}' signal.lst`
13281 echo "The following $sig_count signals are available:"
13283 echo $sig_name | $awk \
13284 'BEGIN { linelen = 0 }
13286 for (i = 1; i <= NF; i++) {
13287 name = "SIG" $i " "
13288 linelen = linelen + length(name)
13289 if (linelen > 70) {
13291 linelen = length(name)
13297 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13299 : see what type is used for signed size_t
13300 set ssize_t ssizetype int stdio.h sys/types.h
13303 $cat > ssize.c <<EOM
13305 #include <sys/types.h>
13306 #define Size_t $sizetype
13307 #define SSize_t $dflt
13310 if (sizeof(Size_t) == sizeof(SSize_t))
13312 else if (sizeof(Size_t) == sizeof(int))
13321 if eval $compile_ok && ./ssize > /dev/null; then
13322 ssizetype=`./ssize`
13323 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13326 Help! I can't compile and run the ssize_t test program: please enlighten me!
13327 (This is probably a misconfiguration in your system or libraries, and
13328 you really ought to fix it. Still, I'll try anyway.)
13330 I need a type that is the same size as $sizetype, but is guaranteed to
13331 be signed. Common values are ssize_t, int and long.
13334 rp="What signed type is the same size as $sizetype?"
13338 $rm -f ssize ssize.*
13340 : see what type of char stdio uses.
13342 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13343 echo "Your stdio uses unsigned chars." >&4
13344 stdchar="unsigned char"
13346 echo "Your stdio uses signed chars." >&4
13350 : see if time exists
13352 if test "X$d_time" = X -o X"$timetype" = X; then
13353 if set time val -f d_time; eval $csym; $val; then
13354 echo 'time() found.' >&4
13356 rp="What is the type returned by time() on this system?"
13357 set time_t timetype long stdio.h sys/types.h
13360 echo 'time() not found, hope that will do.' >&4
13368 : see what type uids are declared as in the kernel
13370 echo "Looking for the type for user ids returned by getuid()."
13371 set uid_t uidtype xxx stdio.h sys/types.h
13375 xxx=`./findhdr sys/user.h`
13376 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13378 unsigned) dflt="$1 $2" ;;
13382 *) dflt="$uidtype";;
13385 uid_t) echo "uid_t found." ;;
13386 *) rp="What is the type for user ids returned by getuid()?"
13394 *_t) zzz="$uidtype" ;;
13397 echo "Checking the size of $zzz..." >&4
13399 #include <sys/types.h>
13402 printf("%d\n", (int)sizeof($uidtype));
13407 if eval $compile_ok; then
13411 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13414 echo "Your $zzz size is $uidsize bytes."
13419 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13424 *_t) zzz="$uidtype" ;;
13427 echo "Checking the sign of $zzz..." >&4
13429 #include <sys/types.h>
13440 if eval $compile; then
13444 echo "(I can't execute the test program--guessing unsigned.)" >&4
13448 1) echo "Your $zzz is unsigned." ;;
13449 -1) echo "Your $zzz is signed." ;;
13455 echo "(I can't compile the test program--guessing unsigned.)" >&4
13461 $echo "Checking the format string to be used for uids..." >&4
13464 -1) if $test X"$uidsize" = X"$ivsize"; then
13465 uidformat="$ivdformat"
13467 if $test X"$uidsize" = X"$longsize"; then
13470 if $test X"$uidsize" = X"$intsize"; then
13473 if $test X"$uidsize" = X"$shortsize"; then
13480 *) if $test X"$uidsize" = X"$uvsize"; then
13481 uidformat="$uvuformat"
13483 if $test X"$uidsize" = X"$longsize"; then
13486 if $test X"$uidsize" = X"$intsize"; then
13489 if $test X"$uidsize" = X"$shortsize"; then
13498 : see if dbm.h is available
13499 : see if dbmclose exists
13500 set dbmclose d_dbmclose
13503 case "$d_dbmclose" in
13513 *) set rpcsvc/dbm.h i_rpcsvcdbm
13518 *) echo "We won't be including <dbm.h>"
13528 : see if this is a sys/file.h system
13533 : do we need to include sys/file.h ?
13537 if $h_sysfile; then
13539 echo "We'll be including <sys/file.h>." >&4
13542 echo "We won't be including <sys/file.h>." >&4
13552 : see if fcntl.h is there
13557 : see if we can include fcntl.h
13563 echo "We'll be including <fcntl.h>." >&4
13566 if $h_sysfile; then
13567 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13569 echo "We won't be including <fcntl.h>." >&4
13581 : see if locale.h is available
13582 set locale.h i_locale
13585 : see if mach cthreads are available
13586 if test "X$usethreads" = "X$define"; then
13587 set mach/cthreads.h i_machcthr
13590 i_machcthr="$undef"
13595 : see if this is a math.h system
13599 : see if this is a mntent.h system
13600 set mntent.h i_mntent
13603 : see if ndbm.h is available
13608 : see if dbm_open exists
13609 set dbm_open d_dbm_open
13611 case "$d_dbm_open" in
13614 echo "We won't be including <ndbm.h>"
13623 : see if net/errno.h is available
13625 set net/errno.h val
13628 : Unfortunately, it causes problems on some systems. Arrgh.
13631 cat > try.c <<'EOM'
13634 #include <net/errno.h>
13640 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13641 echo "We'll be including <net/errno.h>." >&4
13643 echo "We won't be including <net/errno.h>." >&4
13652 : see if netinet/tcp.h is available
13653 set netinet/tcp.h i_netinettcp
13656 : see if this is a poll.h system
13660 : get C preprocessor symbols handy
13662 $echo $n "Hmm... $c"
13663 echo $al | $tr ' ' $trnl >Cppsym.know
13664 $cat <<EOSS >Cppsym
13672 case "\$list\$#" in
13675 if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
13677 elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
13680 unknown="\$unknown \$sym"
13690 echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
13692 exit 0; _ _ _ _\1\\ \1\\
13695 echo "exit 1; _ _ _" >>Cppsym\$\$
13696 $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$
13698 true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;;
13704 $rm -f Cppsym\$\$ Cppsym2\$\$
13709 ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true
13711 : now check the C compiler for additional symbols
13712 postprocess_cc_v=''
13714 aix) postprocess_cc_v="|$tr , ' '" ;;
13721 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13724 -D*) echo "\$i" | $sed 's/^-D//';;
13725 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13730 postprocess_cc_v=''
13733 ./ccsym > ccsym1.raw
13734 if $test -s ccsym1.raw; then
13735 $sort ccsym1.raw | $uniq >ccsym.raw
13737 mv ccsym1.raw ccsym.raw
13740 $awk '/\=/ { print $0; next }
13741 { print $0"=1" }' ccsym.raw >ccsym.list
13742 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
13743 $comm -13 ccsym.true ccsym.list >ccsym.own
13744 $comm -12 ccsym.true ccsym.list >ccsym.com
13745 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13747 if $test -z ccsym.raw; then
13748 echo "Your C compiler doesn't seem to define any symbols!" >&4
13750 echo "However, your C preprocessor defines the following symbols:"
13753 cppsymbols=`$cat Cppsym.true`
13754 cppsymbols=`echo $cppsymbols`
13755 cppccsymbols="$cppsymbols"
13757 if $test -s ccsym.com; then
13758 echo "Your C compiler and pre-processor define these symbols:"
13759 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13762 cppccsymbols=`$cat ccsym.com`
13763 cppccsymbols=`echo $cppccsymbols`
13764 $test "$silent" || sleep 1
13766 if $test -s ccsym.cpp; then
13767 $test "$also" && echo " "
13768 echo "Your C pre-processor ${also}defines the following symbols:"
13769 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13771 cppsymbols=`$cat ccsym.cpp`
13772 cppsymbols=`echo $cppsymbols`
13773 $test "$silent" || sleep 1
13775 if $test -s ccsym.own; then
13776 $test "$also" && echo " "
13777 echo "Your C compiler ${also}defines the following cpp symbols:"
13778 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13779 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13780 ccsymbols=`$cat ccsym.own`
13781 ccsymbols=`echo $ccsymbols`
13782 $test "$silent" || sleep 1
13787 : see if this is a termio system
13791 if $test `./findhdr termios.h`; then
13792 set tcsetattr i_termios
13798 "$define") echo "You have POSIX termios.h... good!" >&4;;
13799 *) if ./Cppsym pyr; then
13800 case "`/bin/universe`" in
13801 ucb) if $test `./findhdr sgtty.h`; then
13803 echo "<sgtty.h> found." >&4
13805 echo "System is pyramid with BSD universe."
13806 echo "<sgtty.h> not found--you could have problems." >&4
13808 *) if $test `./findhdr termio.h`; then
13810 echo "<termio.h> found." >&4
13812 echo "System is pyramid with USG universe."
13813 echo "<termio.h> not found--you could have problems." >&4
13817 if $test `./findhdr termio.h`; then
13818 echo "<termio.h> found." >&4
13820 elif $test `./findhdr sgtty.h`; then
13821 echo "<sgtty.h> found." >&4
13824 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13827 if $test `./findhdr sgtty.h`; then
13828 echo "<sgtty.h> found." >&4
13830 elif $test `./findhdr termio.h`; then
13831 echo "<termio.h> found." >&4
13834 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13838 set i_termio; eval $setvar
13839 val=$val2; set i_sgtty; eval $setvar
13840 val=$val3; set i_termios; eval $setvar
13842 : see if this is a shadow.h system
13843 set shadow.h i_shadow
13846 : see if this is a socks.h system
13847 set socks.h i_socks
13850 : see if stdarg is available
13852 if $test `./findhdr stdarg.h`; then
13853 echo "<stdarg.h> found." >&4
13856 echo "<stdarg.h> NOT found." >&4
13860 : see if varags is available
13862 if $test `./findhdr varargs.h`; then
13863 echo "<varargs.h> found." >&4
13865 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13868 : set up the varargs testing programs
13869 $cat > varargs.c <<EOP
13871 #include <stdarg.h>
13874 #include <varargs.h>
13878 int f(char *p, ...)
13892 p = va_arg(ap, char *);
13897 $cat > varargs <<EOP
13899 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13908 : now check which varargs header should be included
13913 if `./varargs I_STDARG`; then
13915 elif `./varargs I_VARARGS`; then
13920 if `./varargs I_VARARGS`; then
13927 echo "I could not find the definition for va_dcl... You have problems..." >&4
13928 val="$undef"; set i_stdarg; eval $setvar
13929 val="$undef"; set i_varargs; eval $setvar
13934 case "$i_varhdr" in
13936 val="$define"; set i_stdarg; eval $setvar
13937 val="$undef"; set i_varargs; eval $setvar
13940 val="$undef"; set i_stdarg; eval $setvar
13941 val="$define"; set i_varargs; eval $setvar
13944 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13948 : see if stddef is available
13949 set stddef.h i_stddef
13952 : see if sys/access.h is available
13953 set sys/access.h i_sysaccess
13956 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13957 set sys/filio.h i_sysfilio
13960 if $test `./findhdr sys/ioctl.h`; then
13962 echo '<sys/ioctl.h> found.' >&4
13965 if $test $i_sysfilio = "$define"; then
13966 echo '<sys/ioctl.h> NOT found.' >&4
13968 $test $i_sgtty = "$define" && xxx="sgtty.h"
13969 $test $i_termio = "$define" && xxx="termio.h"
13970 $test $i_termios = "$define" && xxx="termios.h"
13971 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
13977 : see if sys/resource.h has to be included
13978 set sys/resource.h i_sysresrc
13981 : see if sys/security.h is available
13982 set sys/security.h i_syssecrt
13985 : see if this is a sys/statvfs.h system
13986 set sys/statvfs.h i_sysstatvfs
13989 : see if this is a sys/uio.h system
13990 set sys/uio.h i_sysuio
13993 : see if this is a sys/un.h system
13994 set sys/un.h i_sysun
13997 : see if this is a syswait system
13998 set sys/wait.h i_syswait
14001 : see if this is a ustat.h system
14002 set ustat.h i_ustat
14005 : see if this is an utime system
14006 set utime.h i_utime
14009 : see if this is a values.h system
14010 set values.h i_values
14013 : see if this is a vfork system
14016 set vfork.h i_vfork
14024 : see if gdbm.h is available
14029 : see if gdbm_open exists
14030 set gdbm_open d_gdbm_open
14032 case "$d_gdbm_open" in
14035 echo "We won't be including <gdbm.h>"
14045 echo "Looking for extensions..." >&4
14046 : If we are using the old config.sh, known_extensions may contain
14047 : old or inaccurate or duplicate values.
14048 known_extensions=''
14049 nonxs_extensions=''
14050 : We do not use find because it might not be available.
14051 : We do not just use MANIFEST because the user may have dropped
14052 : some additional extensions into the source tree and expect them
14055 : Function to recursively find available extensions, ignoring DynaLoader
14056 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14060 DynaLoader|dynaload) ;;
14062 if $test -f $xxx/$xxx.xs; then
14063 known_extensions="$known_extensions $1$xxx";
14064 elif $test -f $xxx/Makefile.PL; then
14065 nonxs_extensions="$nonxs_extensions $1$xxx";
14067 if $test -d $xxx -a $# -lt 10; then
14070 eval $find_extensions;
14082 eval $find_extensions
14083 set X $nonxs_extensions
14085 nonxs_extensions="$*"
14086 set X $known_extensions
14088 known_extensions="$*"
14091 : Now see which are supported on this system.
14093 for xxx in $known_extensions ; do
14097 $define) avail_ext="$avail_ext $xxx" ;;
14100 GDBM_File|gdbm_fil)
14102 $define) avail_ext="$avail_ext $xxx" ;;
14105 NDBM_File|ndbm_fil)
14107 $define) avail_ext="$avail_ext $xxx" ;;
14110 ODBM_File|odbm_fil)
14111 case "${i_dbm}${i_rpcsvcdbm}" in
14112 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14116 case "$useposix" in
14117 true|define|y) avail_ext="$avail_ext $xxx" ;;
14121 case "$useopcode" in
14122 true|define|y) avail_ext="$avail_ext $xxx" ;;
14126 case "$d_socket" in
14127 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14131 case "$usethreads" in
14132 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14136 : XXX Do we need a useipcsysv variable here
14137 case "${d_msg}${d_sem}${d_shm}" in
14138 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14141 *) avail_ext="$avail_ext $xxx"
14150 : Now see which nonxs extensions are supported on this system.
14151 : For now assume all are.
14153 for xxx in $nonxs_extensions ; do
14155 *) nonxs_ext="$nonxs_ext $xxx"
14167 A number of extensions are supplied with $package. You may choose to
14168 compile these extensions for dynamic loading (the default), compile
14169 them into the $package executable (static loading), or not include
14170 them at all. Answer "none" to include no extensions.
14171 Note that DynaLoader is always built and need not be mentioned here.
14174 case "$dynamic_ext" in
14175 '') dflt="$avail_ext" ;;
14176 *) dflt="$dynamic_ext"
14177 # Perhaps we are reusing an old out-of-date config.sh.
14180 if test X"$dynamic_ext" != X"$avail_ext"; then
14182 NOTICE: Your previous config.sh list may be incorrect.
14183 The extensions now available to you are
14185 but the default list from your previous config.sh is
14197 rp="What extensions do you wish to load dynamically?"
14200 none) dynamic_ext=' ' ;;
14201 *) dynamic_ext="$ans" ;;
14204 case "$static_ext" in
14206 : Exclude those already listed in dynamic linking
14208 for xxx in $avail_ext; do
14209 case " $dynamic_ext " in
14211 *) dflt="$dflt $xxx" ;;
14218 *) dflt="$static_ext"
14225 rp="What extensions do you wish to load statically?"
14228 none) static_ext=' ' ;;
14229 *) static_ext="$ans" ;;
14234 A number of extensions are supplied with $package. Answer "none"
14235 to include no extensions.
14236 Note that DynaLoader is always built and need not be mentioned here.
14239 case "$static_ext" in
14240 '') dflt="$avail_ext" ;;
14241 *) dflt="$static_ext"
14242 # Perhaps we are reusing an old out-of-date config.sh.
14245 if test X"$static_ext" != X"$avail_ext"; then
14247 NOTICE: Your previous config.sh list may be incorrect.
14248 The extensions now available to you are
14250 but the default list from your previous config.sh is
14259 : Exclude those that are not xs extensions
14263 rp="What extensions do you wish to include?"
14266 none) static_ext=' ' ;;
14267 *) static_ext="$ans" ;;
14272 set X $dynamic_ext $static_ext $nonxs_ext
14276 : Remove build directory name from cppstdin so it can be used from
14277 : either the present location or the final installed location.
14279 : Get out of the UU directory to get correct path name.
14281 case "$cppstdin" in
14283 echo "Stripping down cppstdin path name"
14289 : end of configuration questions
14291 echo "End of configuration questions."
14294 : back to where it started
14295 if test -d ../UU; then
14299 : configuration may be patched via a 'config.over' file
14300 if $test -f config.over; then
14303 rp='I see a config.over file. Do you wish to load it?'
14306 n*) echo "OK, I'll ignore it.";;
14308 echo "Configuration override changes have been loaded."
14313 : in case they want portability, strip down executable paths
14314 case "$d_portable" in
14317 echo "Stripping down executable paths..." >&4
14318 for file in $loclist $trylist; do
14320 eval $file=`basename $temp`
14325 : create config.sh file
14327 echo "Creating config.sh..." >&4
14328 $spitshell <<EOT >config.sh
14331 # This file was produced by running the Configure script. It holds all the
14332 # definitions figured out by Configure. Should you modify one of these values,
14333 # do not forget to propagate your changes by running "Configure -der". You may
14334 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14337 # Package name : $package
14338 # Source directory : $src
14339 # Configuration time: $cf_time
14340 # Configured by : $cf_by
14341 # Target system : $myuname
14351 Revision='$Revision'
14358 alignbytes='$alignbytes'
14359 ansi2knr='$ansi2knr'
14360 aphostname='$aphostname'
14361 api_revision='$api_revision'
14362 api_subversion='$api_subversion'
14363 api_version='$api_version'
14364 api_versionstring='$api_versionstring'
14367 archlibexp='$archlibexp'
14368 archname64='$archname64'
14369 archname='$archname'
14370 archobjs='$archobjs'
14375 bincompat5005='$bincompat5005'
14379 byteorder='$byteorder'
14381 castflags='$castflags'
14384 cccdlflags='$cccdlflags'
14385 ccdlflags='$ccdlflags'
14387 ccsymbols='$ccsymbols'
14389 cf_email='$cf_email'
14391 charsize='$charsize'
14395 clocktype='$clocktype'
14397 compress='$compress'
14398 contains='$contains'
14402 cpp_stuff='$cpp_stuff'
14403 cppccsymbols='$cppccsymbols'
14404 cppflags='$cppflags'
14406 cppminus='$cppminus'
14408 cppstdin='$cppstdin'
14409 cppsymbols='$cppsymbols'
14410 crosscompile='$crosscompile'
14411 cryptlib='$cryptlib'
14413 d_Gconvert='$d_Gconvert'
14414 d_PRIEldbl='$d_PRIEldbl'
14415 d_PRIFldbl='$d_PRIFldbl'
14416 d_PRIGldbl='$d_PRIGldbl'
14417 d_PRIX64='$d_PRIX64'
14418 d_PRId64='$d_PRId64'
14419 d_PRIeldbl='$d_PRIeldbl'
14420 d_PRIfldbl='$d_PRIfldbl'
14421 d_PRIgldbl='$d_PRIgldbl'
14422 d_PRIi64='$d_PRIi64'
14423 d_PRIo64='$d_PRIo64'
14424 d_PRIu64='$d_PRIu64'
14425 d_PRIx64='$d_PRIx64'
14426 d_access='$d_access'
14427 d_accessx='$d_accessx'
14429 d_archlib='$d_archlib'
14432 d_attribut='$d_attribut'
14435 d_bincompat5005='$d_bincompat5005'
14437 d_bsdgetpgrp='$d_bsdgetpgrp'
14438 d_bsdsetpgrp='$d_bsdsetpgrp'
14440 d_casti32='$d_casti32'
14441 d_castneg='$d_castneg'
14442 d_charvspr='$d_charvspr'
14444 d_chroot='$d_chroot'
14445 d_chsize='$d_chsize'
14446 d_closedir='$d_closedir'
14450 d_cuserid='$d_cuserid'
14451 d_dbl_dig='$d_dbl_dig'
14452 d_difftime='$d_difftime'
14453 d_dirnamlen='$d_dirnamlen'
14454 d_dlerror='$d_dlerror'
14455 d_dlopen='$d_dlopen'
14456 d_dlsymun='$d_dlsymun'
14457 d_dosuid='$d_dosuid'
14458 d_drand48proto='$d_drand48proto'
14460 d_eaccess='$d_eaccess'
14461 d_endgrent='$d_endgrent'
14462 d_endhent='$d_endhent'
14463 d_endnent='$d_endnent'
14464 d_endpent='$d_endpent'
14465 d_endpwent='$d_endpwent'
14466 d_endsent='$d_endsent'
14467 d_endspent='$d_endspent'
14468 d_eofnblk='$d_eofnblk'
14469 d_eunice='$d_eunice'
14470 d_fchmod='$d_fchmod'
14471 d_fchown='$d_fchown'
14473 d_fd_macros='$d_fd_macros'
14474 d_fd_set='$d_fd_set'
14475 d_fds_bits='$d_fds_bits'
14476 d_fgetpos='$d_fgetpos'
14477 d_flexfnam='$d_flexfnam'
14480 d_fpathconf='$d_fpathconf'
14481 d_fpos64_t='$d_fpos64_t'
14482 d_fs_data_s='$d_fs_data_s'
14483 d_fseeko='$d_fseeko'
14484 d_fsetpos='$d_fsetpos'
14485 d_fstatfs='$d_fstatfs'
14486 d_fstatvfs='$d_fstatvfs'
14487 d_ftello='$d_ftello'
14489 d_getgrent='$d_getgrent'
14490 d_getgrps='$d_getgrps'
14491 d_gethbyaddr='$d_gethbyaddr'
14492 d_gethbyname='$d_gethbyname'
14493 d_gethent='$d_gethent'
14494 d_gethname='$d_gethname'
14495 d_gethostprotos='$d_gethostprotos'
14496 d_getlogin='$d_getlogin'
14497 d_getmnt='$d_getmnt'
14498 d_getmntent='$d_getmntent'
14499 d_getnbyaddr='$d_getnbyaddr'
14500 d_getnbyname='$d_getnbyname'
14501 d_getnent='$d_getnent'
14502 d_getnetprotos='$d_getnetprotos'
14503 d_getpbyname='$d_getpbyname'
14504 d_getpbynumber='$d_getpbynumber'
14505 d_getpent='$d_getpent'
14506 d_getpgid='$d_getpgid'
14507 d_getpgrp2='$d_getpgrp2'
14508 d_getpgrp='$d_getpgrp'
14509 d_getppid='$d_getppid'
14510 d_getprior='$d_getprior'
14511 d_getprotoprotos='$d_getprotoprotos'
14512 d_getpwent='$d_getpwent'
14513 d_getsbyname='$d_getsbyname'
14514 d_getsbyport='$d_getsbyport'
14515 d_getsent='$d_getsent'
14516 d_getservprotos='$d_getservprotos'
14517 d_getspent='$d_getspent'
14518 d_getspnam='$d_getspnam'
14519 d_gettimeod='$d_gettimeod'
14520 d_gnulibc='$d_gnulibc'
14521 d_grpasswd='$d_grpasswd'
14522 d_hasmntopt='$d_hasmntopt'
14525 d_inetaton='$d_inetaton'
14526 d_int64t='$d_int64t'
14527 d_isascii='$d_isascii'
14528 d_killpg='$d_killpg'
14529 d_lchown='$d_lchown'
14530 d_ldbl_dig='$d_ldbl_dig'
14532 d_locconv='$d_locconv'
14534 d_longdbl='$d_longdbl'
14535 d_longlong='$d_longlong'
14538 d_mbstowcs='$d_mbstowcs'
14539 d_mbtowc='$d_mbtowc'
14540 d_memchr='$d_memchr'
14541 d_memcmp='$d_memcmp'
14542 d_memcpy='$d_memcpy'
14543 d_memmove='$d_memmove'
14544 d_memset='$d_memset'
14546 d_mkfifo='$d_mkfifo'
14547 d_mktime='$d_mktime'
14549 d_msg_ctrunc='$d_msg_ctrunc'
14550 d_msg_dontroute='$d_msg_dontroute'
14551 d_msg_oob='$d_msg_oob'
14552 d_msg_peek='$d_msg_peek'
14553 d_msg_proxy='$d_msg_proxy'
14554 d_msgctl='$d_msgctl'
14555 d_msgget='$d_msgget'
14556 d_msgrcv='$d_msgrcv'
14557 d_msgsnd='$d_msgsnd'
14558 d_mymalloc='$d_mymalloc'
14560 d_off64_t='$d_off64_t'
14561 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14562 d_oldpthreads='$d_oldpthreads'
14563 d_oldsock='$d_oldsock'
14565 d_pathconf='$d_pathconf'
14567 d_phostname='$d_phostname'
14570 d_portable='$d_portable'
14571 d_pthread_yield='$d_pthread_yield'
14573 d_pwchange='$d_pwchange'
14574 d_pwclass='$d_pwclass'
14575 d_pwcomment='$d_pwcomment'
14576 d_pwexpire='$d_pwexpire'
14577 d_pwgecos='$d_pwgecos'
14578 d_pwpasswd='$d_pwpasswd'
14579 d_pwquota='$d_pwquota'
14581 d_readdir='$d_readdir'
14582 d_readlink='$d_readlink'
14583 d_rename='$d_rename'
14584 d_rewinddir='$d_rewinddir'
14586 d_safebcpy='$d_safebcpy'
14587 d_safemcpy='$d_safemcpy'
14588 d_sanemcmp='$d_sanemcmp'
14589 d_sched_yield='$d_sched_yield'
14590 d_scm_rights='$d_scm_rights'
14591 d_seekdir='$d_seekdir'
14592 d_select='$d_select'
14594 d_semctl='$d_semctl'
14595 d_semctl_semid_ds='$d_semctl_semid_ds'
14596 d_semctl_semun='$d_semctl_semun'
14597 d_semget='$d_semget'
14599 d_setegid='$d_setegid'
14600 d_seteuid='$d_seteuid'
14601 d_setgrent='$d_setgrent'
14602 d_setgrps='$d_setgrps'
14603 d_sethent='$d_sethent'
14604 d_setlinebuf='$d_setlinebuf'
14605 d_setlocale='$d_setlocale'
14606 d_setnent='$d_setnent'
14607 d_setpent='$d_setpent'
14608 d_setpgid='$d_setpgid'
14609 d_setpgrp2='$d_setpgrp2'
14610 d_setpgrp='$d_setpgrp'
14611 d_setprior='$d_setprior'
14612 d_setpwent='$d_setpwent'
14613 d_setregid='$d_setregid'
14614 d_setresgid='$d_setresgid'
14615 d_setresuid='$d_setresuid'
14616 d_setreuid='$d_setreuid'
14617 d_setrgid='$d_setrgid'
14618 d_setruid='$d_setruid'
14619 d_setsent='$d_setsent'
14620 d_setsid='$d_setsid'
14621 d_setspent='$d_setspent'
14622 d_setvbuf='$d_setvbuf'
14626 d_shmatprototype='$d_shmatprototype'
14627 d_shmctl='$d_shmctl'
14629 d_shmget='$d_shmget'
14630 d_sigaction='$d_sigaction'
14631 d_sigsetjmp='$d_sigsetjmp'
14632 d_socket='$d_socket'
14633 d_sockpair='$d_sockpair'
14635 d_statblks='$d_statblks'
14636 d_statfs_f_flags='$d_statfs_f_flags'
14637 d_statfs_s='$d_statfs_s'
14638 d_statvfs='$d_statvfs'
14639 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14640 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14641 d_stdio_stream_array='$d_stdio_stream_array'
14642 d_stdiobase='$d_stdiobase'
14643 d_stdstdio='$d_stdstdio'
14644 d_strchr='$d_strchr'
14645 d_strcoll='$d_strcoll'
14646 d_strctcpy='$d_strctcpy'
14647 d_strerrm='$d_strerrm'
14648 d_strerror='$d_strerror'
14649 d_strtod='$d_strtod'
14650 d_strtol='$d_strtol'
14651 d_strtold='$d_strtold'
14652 d_strtoll='$d_strtoll'
14653 d_strtoul='$d_strtoul'
14654 d_strtoull='$d_strtoull'
14655 d_strtouq='$d_strtouq'
14656 d_strxfrm='$d_strxfrm'
14657 d_suidsafe='$d_suidsafe'
14658 d_symlink='$d_symlink'
14659 d_syscall='$d_syscall'
14660 d_sysconf='$d_sysconf'
14661 d_sysernlst='$d_sysernlst'
14662 d_syserrlst='$d_syserrlst'
14663 d_system='$d_system'
14664 d_tcgetpgrp='$d_tcgetpgrp'
14665 d_tcsetpgrp='$d_tcsetpgrp'
14666 d_telldir='$d_telldir'
14667 d_telldirproto='$d_telldirproto'
14670 d_truncate='$d_truncate'
14671 d_tzname='$d_tzname'
14674 d_union_semun='$d_union_semun'
14676 d_vendorbin='$d_vendorbin'
14677 d_vendorlib='$d_vendorlib'
14679 d_void_closedir='$d_void_closedir'
14680 d_voidsig='$d_voidsig'
14681 d_voidtty='$d_voidtty'
14682 d_volatile='$d_volatile'
14683 d_vprintf='$d_vprintf'
14685 d_waitpid='$d_waitpid'
14686 d_wcstombs='$d_wcstombs'
14687 d_wctomb='$d_wctomb'
14690 db_hashtype='$db_hashtype'
14691 db_prefixtype='$db_prefixtype'
14692 defvoidused='$defvoidused'
14693 direntrytype='$direntrytype'
14696 doublesize='$doublesize'
14698 dynamic_ext='$dynamic_ext'
14704 eunicefix='$eunicefix'
14707 extensions='$extensions'
14708 fflushNULL='$fflushNULL'
14709 fflushall='$fflushall'
14711 firstmakefile='$firstmakefile'
14713 fpossize='$fpossize'
14714 fpostype='$fpostype'
14715 freetype='$freetype'
14717 full_csh='$full_csh'
14718 full_sed='$full_sed'
14719 gccversion='$gccversion'
14720 gidformat='$gidformat'
14726 groupcat='$groupcat'
14727 groupstype='$groupstype'
14730 h_sysfile='$h_sysfile'
14742 i_arpainet='$i_arpainet'
14743 i_bsdioctl='$i_bsdioctl'
14746 i_dirent='$i_dirent'
14753 i_inttypes='$i_inttypes'
14754 i_limits='$i_limits'
14755 i_locale='$i_locale'
14756 i_machcthr='$i_machcthr'
14757 i_malloc='$i_malloc'
14759 i_memory='$i_memory'
14760 i_mntent='$i_mntent'
14763 i_neterrno='$i_neterrno'
14764 i_netinettcp='$i_netinettcp'
14767 i_pthread='$i_pthread'
14769 i_rpcsvcdbm='$i_rpcsvcdbm'
14772 i_shadow='$i_shadow'
14774 i_stdarg='$i_stdarg'
14775 i_stddef='$i_stddef'
14776 i_stdlib='$i_stdlib'
14777 i_string='$i_string'
14778 i_sysaccess='$i_sysaccess'
14779 i_sysdir='$i_sysdir'
14780 i_sysfile='$i_sysfile'
14781 i_sysfilio='$i_sysfilio'
14783 i_sysioctl='$i_sysioctl'
14784 i_sysmount='$i_sysmount'
14785 i_sysndir='$i_sysndir'
14786 i_sysparam='$i_sysparam'
14787 i_sysresrc='$i_sysresrc'
14788 i_syssecrt='$i_syssecrt'
14789 i_sysselct='$i_sysselct'
14790 i_syssockio='$i_syssockio'
14791 i_sysstat='$i_sysstat'
14792 i_sysstatfs='$i_sysstatfs'
14793 i_sysstatvfs='$i_sysstatvfs'
14794 i_systime='$i_systime'
14795 i_systimek='$i_systimek'
14796 i_systimes='$i_systimes'
14797 i_systypes='$i_systypes'
14798 i_sysuio='$i_sysuio'
14800 i_sysvfs='$i_sysvfs'
14801 i_syswait='$i_syswait'
14802 i_termio='$i_termio'
14803 i_termios='$i_termios'
14805 i_unistd='$i_unistd'
14808 i_values='$i_values'
14809 i_varargs='$i_varargs'
14810 i_varhdr='$i_varhdr'
14812 ignore_versioned_solibs='$ignore_versioned_solibs'
14813 inc_version_list='$inc_version_list'
14816 installarchlib='$installarchlib'
14817 installbin='$installbin'
14818 installman1dir='$installman1dir'
14819 installman3dir='$installman3dir'
14820 installprefix='$installprefix'
14821 installprefixexp='$installprefixexp'
14822 installprivlib='$installprivlib'
14823 installscript='$installscript'
14824 installsitearch='$installsitearch'
14825 installsitebin='$installsitebin'
14826 installsitelib='$installsitelib'
14827 installstyle='$installstyle'
14828 installusrbinperl='$installusrbinperl'
14829 installvendorbin='$installvendorbin'
14830 installvendorlib='$installvendorlib'
14832 ivdformat='$ivdformat'
14835 known_extensions='$known_extensions'
14839 lddlflags='$lddlflags'
14841 ldlibpthname='$ldlibpthname'
14848 libswanted='$libswanted'
14854 locincpth='$locincpth'
14855 loclibpth='$loclibpth'
14856 longdblsize='$longdblsize'
14857 longlongsize='$longlongsize'
14858 longsize='$longsize'
14862 lseeksize='$lseeksize'
14863 lseektype='$lseektype'
14867 make_set_make='$make_set_make'
14868 mallocobj='$mallocobj'
14869 mallocsrc='$mallocsrc'
14870 malloctype='$malloctype'
14872 man1direxp='$man1direxp'
14875 man3direxp='$man3direxp'
14878 mips_type='$mips_type'
14881 modetype='$modetype'
14883 multiarch='$multiarch'
14885 myarchname='$myarchname'
14886 mydomain='$mydomain'
14887 myhostname='$myhostname'
14890 netdb_hlen_type='$netdb_hlen_type'
14891 netdb_host_type='$netdb_host_type'
14892 netdb_name_type='$netdb_name_type'
14893 netdb_net_type='$netdb_net_type'
14896 nm_so_opt='$nm_so_opt'
14897 nonxs_ext='$nonxs_ext'
14901 o_nonblock='$o_nonblock'
14903 old_pthread_create_joinable='$old_pthread_create_joinable'
14904 optimize='$optimize'
14905 orderlib='$orderlib'
14911 patchlevel='$patchlevel'
14912 path_sep='$path_sep'
14914 perladmin='$perladmin'
14915 perlpath='$perlpath'
14917 phostname='$phostname'
14923 prefixexp='$prefixexp'
14925 privlibexp='$privlibexp'
14926 prototype='$prototype'
14928 quadkind='$quadkind'
14929 quadtype='$quadtype'
14930 randbits='$randbits'
14931 randfunc='$randfunc'
14932 randseedtype='$randseedtype'
14934 rd_nodata='$rd_nodata'
14938 sPRIEldbl='$sPRIEldbl'
14939 sPRIFldbl='$sPRIFldbl'
14940 sPRIGldbl='$sPRIGldbl'
14943 sPRIeldbl='$sPRIeldbl'
14944 sPRIfldbl='$sPRIfldbl'
14945 sPRIgldbl='$sPRIgldbl'
14950 sched_yield='$sched_yield'
14951 scriptdir='$scriptdir'
14952 scriptdirexp='$scriptdirexp'
14954 seedfunc='$seedfunc'
14955 selectminbits='$selectminbits'
14956 selecttype='$selecttype'
14957 sendmail='$sendmail'
14960 sharpbang='$sharpbang'
14961 shmattype='$shmattype'
14962 shortsize='$shortsize'
14965 sig_count='$sig_count'
14966 sig_name='$sig_name'
14967 sig_name_init='$sig_name_init'
14969 sig_num_init='$sig_num_init'
14970 signal_t='$signal_t'
14971 sitearch='$sitearch'
14972 sitearchexp='$sitearchexp'
14974 sitebinexp='$sitebinexp'
14976 sitelibexp='$sitelibexp'
14977 siteprefix='$siteprefix'
14978 siteprefixexp='$siteprefixexp'
14979 sizetype='$sizetype'
14984 sockethdr='$sockethdr'
14985 socketlib='$socketlib'
14987 spackage='$spackage'
14988 spitshell='$spitshell'
14991 ssizetype='$ssizetype'
14992 startperl='$startperl'
14994 static_ext='$static_ext'
14996 stdio_base='$stdio_base'
14997 stdio_bufsiz='$stdio_bufsiz'
14998 stdio_cnt='$stdio_cnt'
14999 stdio_filbuf='$stdio_filbuf'
15000 stdio_ptr='$stdio_ptr'
15001 stdio_stream_array='$stdio_stream_array'
15004 subversion='$subversion'
15011 timeincl='$timeincl'
15012 timetype='$timetype'
15025 uidformat='$uidformat'
15031 uquadtype='$uquadtype'
15032 use5005threads='$use5005threads'
15033 use64bits='$use64bits'
15035 useithreads='$useithreads'
15036 uselargefiles='$uselargefiles'
15037 uselongdouble='$uselongdouble'
15038 uselonglong='$uselonglong'
15039 usemorebits='$usemorebits'
15040 usemultiplicity='$usemultiplicity'
15041 usemymalloc='$usemymalloc'
15043 useopcode='$useopcode'
15044 useperlio='$useperlio'
15045 useposix='$useposix'
15047 useshrplib='$useshrplib'
15048 usesocks='$usesocks'
15049 usethreads='$usethreads'
15050 usevendorprefix='$usevendorprefix'
15051 usevfork='$usevfork'
15054 uvoformat='$uvoformat'
15057 uvuformat='$uvuformat'
15058 uvxformat='$uvxformat'
15059 vendorbin='$vendorbin'
15060 vendorbinexp='$vendorbinexp'
15061 vendorlib='$vendorlib'
15062 vendorlibexp='$vendorlibexp'
15063 vendorprefix='$vendorprefix'
15064 vendorprefixexp='$vendorprefixexp'
15067 voidflags='$voidflags'
15073 : Add in command line options if available
15074 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15076 : add special variables
15077 $test -f $src/patchlevel.h && \
15078 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15079 echo "CONFIGDOTSH=true" >>config.sh
15081 : propagate old symbols
15082 if $test -f UU/config.sh; then
15083 <UU/config.sh sort | uniq >UU/oldconfig.sh
15084 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
15085 sort | uniq -u >UU/oldsyms
15086 set X `cat UU/oldsyms`
15092 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
15094 echo "# Variables propagated from previous config.sh file." >>config.sh
15095 for sym in `cat UU/oldsyms`; do
15096 echo " Propagating $hint variable "'$'"$sym..."
15097 eval 'tmp="$'"${sym}"'"'
15099 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
15105 : Finish up by extracting the .SH files
15119 If you'd like to make any changes to the config.sh file before I begin
15120 to configure things, do it as a shell escape now (e.g. !vi config.sh).
15123 rp="Press return or use a shell escape to edit config.sh:"
15128 *) : in case they cannot read
15129 sh 1>&4 -c "$ans";;
15134 : if this fails, just run all the .SH files by hand
15141 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15148 Now you need to generate make dependencies by running "$make depend".
15149 You might prefer to run it in background: "$make depend > makedepend.out &"
15150 It can take a while, so you might not want to run it right now.
15155 rp="Run $make depend now?"
15159 $make depend && echo "Now you must run a $make."
15162 echo "You must run '$make depend' then '$make'."
15165 elif test -f [Mm]akefile; then
15167 echo "Now you must run a $make."
15172 if $test -f Policy.sh; then
15175 If you compile $package on a different machine or from a different object
15176 directory, copy the Policy.sh file from this object directory to the
15177 new one before you run Configure -- this will help you with most of
15178 the policy defaults.
15182 if $test -f config.msg; then
15183 echo "Hmm. I also noted the following information while running:"
15185 $cat config.msg >&4
15188 $rm -f kit*isdone ark*isdone