From dc45a647708b6c5442e1362e6b6e7a2583c30346 Mon Sep 17 00:00:00 2001 From: Malcolm Beattie Date: Thu, 2 Apr 1998 15:25:18 +0000 Subject: Andy Dougherty's configuration patches (Config_63-01 up to 04). p4raw-id: //depot/perl@845 --- Configure | 1766 ++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 982 insertions(+), 784 deletions(-) (limited to 'Configure') diff --git a/Configure b/Configure index af22c1b77f..461670a5cb 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Mon Mar 9 14:02:25 EST 1998 [metaconfig 3.0 PL70] +# Generated on Tue Mar 31 15:49:57 EST 1998 [metaconfig 3.0 PL70] cat >/tmp/c1$$ <&4 fi -: determine where manual pages go -set man1dir man1dir none -eval $prefixit +: see what memory models we can support +case "$models" in +'') + $cat >pdp11.c <<'EOP' +main() { +#ifdef pdp11 + exit(0); +#else + exit(1); +#endif +} +EOP + ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1 + if $test -f pdp11 && ./pdp11 2>/dev/null; then + dflt='unsplit split' + else + tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge` + case "$tans" in + X) dflt='none';; + *) if $test -d /lib/small || $test -d /usr/lib/small; then + dflt='small' + else + dflt='' + fi + if $test -d /lib/medium || $test -d /usr/lib/medium; then + dflt="$dflt medium" + fi + if $test -d /lib/large || $test -d /usr/lib/large; then + dflt="$dflt large" + fi + if $test -d /lib/huge || $test -d /usr/lib/huge; then + dflt="$dflt huge" + fi + esac + fi;; +*) dflt="$models";; +esac $cat </dev/null 2>&1 || \ + $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then + dflt='-i' + else + dflt='none' + fi;; + *) dflt="$split";; + esac + rp="What flag indicates separate I and D space?" + . ./myread + tans="$ans" + case "$tans" in + none) tans='';; + esac + split="$tans" + unsplit='';; +*large*|*small*|*medium*|*huge*) + case "$models" in + *large*) + case "$large" in + '') dflt='-Ml';; + *) dflt="$large";; + esac + rp="What flag indicates large model?" + . ./myread + tans="$ans" + case "$tans" in + none) tans=''; + esac + large="$tans";; + *) large='';; + esac + case "$models" in + *huge*) case "$huge" in + '') dflt='-Mh';; + *) dflt="$huge";; + esac + rp="What flag indicates huge model?" + . ./myread + tans="$ans" + case "$tans" in + none) tans=''; + esac + huge="$tans";; + *) huge="$large";; + esac + case "$models" in + *medium*) case "$medium" in + '') dflt='-Mm';; + *) dflt="$medium";; + esac + rp="What flag indicates medium model?" + . ./myread + tans="$ans" + case "$tans" in + none) tans=''; + esac + medium="$tans";; + *) medium="$large";; + esac + case "$models" in + *small*) case "$small" in + '') dflt='none';; + *) dflt="$small";; + esac + rp="What flag indicates small model?" + . ./myread + tans="$ans" + case "$tans" in + none) tans=''; + esac + small="$tans";; + *) small='';; esac - set dflt - eval $prefixup ;; -*) dflt="$man1dir" +*) + echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4 ;; esac -echo " " -fn=dn+~ -rp="Where do the main $spackage manual pages (source) go?" -. ./getfile -if $test "X$man1direxp" != "X$ansexp"; then - installman1dir='' -fi -man1dir="$ans" -man1direxp="$ansexp" -case "$man1dir" in -'') man1dir=' ' - installman1dir='';; -esac -if $afs; then - $cat </dev/null 2>&1 ; then + if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then + dflt='cc' + else + dflt='cc -M' + fi + else + dflt='cc' + fi;; + esac;; + esac;; + *) dflt="$cc";; + esac + case "$dflt" in + *M*) $cat <<'EOM' +On some older systems the default C compiler will not resolve multiple global +references that happen to have the same name. On some such systems the "Mcc" +command may be used to force these to be resolved. On other systems a "cc -M" +command is required. (Note that the -M flag on other systems indicates a +memory model to use!) If you have the Gnu C compiler, you might wish to use +that instead. EOM - case "$installman1dir" in - '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;; - *) dflt="$installman1dir";; + ;; esac - fn=de~ - rp='Where will man pages be installed?' - . ./getfile - installman1dir="$ans" + rp="Use which C compiler?" + . ./myread + cc="$ans" else - installman1dir="$man1direxp" -fi - -: What suffix to use on installed man pages - -case "$man1dir" in -' ') - man1ext='0' - ;; -*) - rp="What suffix should be used for the main $spackage man pages?" - case "$man1ext" in - '') case "$man1dir" in - *1) dflt=1 ;; - *1p) dflt=1p ;; - *1pm) dflt=1pm ;; - *l) dflt=l;; - *n) dflt=n;; - *o) dflt=o;; - *p) dflt=p;; - *C) dflt=C;; - *L) dflt=L;; - *L1) dflt=L1;; - *) dflt=1;; - esac - ;; - *) dflt="$man1ext";; + case "$cc" in + '') dflt=cc;; + *) dflt="$cc";; esac - . ./myread - man1ext="$ans" - ;; -esac - -: see if we can have long filenames -echo " " -rmlist="$rmlist /tmp/cf$$" -$test -d /tmp/cf$$ || mkdir /tmp/cf$$ -first=123456789abcdef -second=/tmp/cf$$/$first -$rm -f $first $second -if (echo hi >$first) 2>/dev/null; then - if $test -f 123456789abcde; then - echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 - val="$undef" - else - if (echo hi >$second) 2>/dev/null; then - if $test -f /tmp/cf$$/123456789abcde; then - $cat <<'EOM' -That's peculiar... You can have filenames longer than 14 characters, but only -on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems -I shall consider your system cannot support long filenames at all. -EOM - val="$undef" - else - echo 'You can have filenames longer than 14 characters.' >&4 - val="$define" - fi - else - $cat <<'EOM' -How confusing! Some of your filesystems are sane enough to allow filenames -longer than 14 characters but some others like /tmp can't even think about them. -So, for now on, I shall assume your kernel does not allow them at all. -EOM - val="$undef" - fi - fi -else - $cat <<'EOM' -You can't have filenames longer than 14 chars. You can't even think about them! -EOM - val="$undef" -fi -set d_flexfnam -eval $setvar -$rm -rf /tmp/cf$$ 123456789abcde* - -: determine where library module manual pages go -set man3dir man3dir none -eval $prefixit -$cat <pdp11.c <<'EOP' -main() { -#ifdef pdp11 - exit(0); -#else - exit(1); -#endif -} -EOP - ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1 - if $test -f pdp11 && ./pdp11 2>/dev/null; then - dflt='unsplit split' - else - tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge` - case "$tans" in - X) dflt='none';; - *) if $test -d /lib/small || $test -d /usr/lib/small; then - dflt='small' - else - dflt='' - fi - if $test -d /lib/medium || $test -d /usr/lib/medium; then - dflt="$dflt medium" - fi - if $test -d /lib/large || $test -d /usr/lib/large; then - dflt="$dflt large" - fi - if $test -d /lib/huge || $test -d /usr/lib/huge; then - dflt="$dflt huge" - fi - esac - fi;; -*) dflt="$models";; -esac -$cat </dev/null 2>&1 || \ - $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then - dflt='-i' - else - dflt='none' - fi;; - *) dflt="$split";; - esac - rp="What flag indicates separate I and D space?" - . ./myread - tans="$ans" - case "$tans" in - none) tans='';; - esac - split="$tans" - unsplit='';; -*large*|*small*|*medium*|*huge*) - case "$models" in - *large*) - case "$large" in - '') dflt='-Ml';; - *) dflt="$large";; - esac - rp="What flag indicates large model?" - . ./myread - tans="$ans" - case "$tans" in - none) tans=''; - esac - large="$tans";; - *) large='';; - esac - case "$models" in - *huge*) case "$huge" in - '') dflt='-Mh';; - *) dflt="$huge";; - esac - rp="What flag indicates huge model?" - . ./myread - tans="$ans" - case "$tans" in - none) tans=''; - esac - huge="$tans";; - *) huge="$large";; - esac - case "$models" in - *medium*) case "$medium" in - '') dflt='-Mm';; - *) dflt="$medium";; - esac - rp="What flag indicates medium model?" - . ./myread - tans="$ans" - case "$tans" in - none) tans=''; - esac - medium="$tans";; - *) medium="$large";; - esac - case "$models" in - *small*) case "$small" in - '') dflt='none';; - *) dflt="$small";; - esac - rp="What flag indicates small model?" - . ./myread - tans="$ans" - case "$tans" in - none) tans=''; - esac - small="$tans";; - *) small='';; - esac - ;; -*) - echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4 - ;; -esac -$rm -f pdp11.* pdp11 - -: see if we need a special compiler -echo " " -if ./usg; then - case "$cc" in - '') case "$Mcc" in - /*) dflt='Mcc';; - *) case "$large" in - -M*) dflt='cc';; - *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then - if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then - dflt='cc' - else - dflt='cc -M' - fi - else - dflt='cc' - fi;; - esac;; - esac;; - *) dflt="$cc";; - esac - case "$dflt" in - *M*) $cat <<'EOM' -On some older systems the default C compiler will not resolve multiple global -references that happen to have the same name. On some such systems the "Mcc" -command may be used to force these to be resolved. On other systems a "cc -M" -command is required. (Note that the -M flag on other systems indicates a -memory model to use!) If you have the Gnu C compiler, you might wish to use -that instead. - -EOM - ;; - esac - rp="Use which C compiler?" - . ./myread - cc="$ans" -else - case "$cc" in - '') dflt=cc;; - *) dflt="$cc";; - esac - rp="Use which C compiler?" + rp="Use which C compiler?" . ./myread cc="$ans" fi @@ -4341,7 +3961,12 @@ $rm -f try try.* core compile=' mc_file=$1; shift; -$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;' +$cc $optimize $ccflags $ldflags -o ${mc_file}$_exe $* ${mc_file}.c $libs > /dev/null 2>&1;' +: define a shorthand compile call for compilations that should be ok. +compile_ok=' +mc_file=$1; +shift; +$cc $optimize $ccflags $ldflags -o ${mc_file}$_exe $* ${mc_file}.c $libs;' echo " " echo "Checking for GNU C Library..." >&4 @@ -4354,7 +3979,7 @@ main() EOM set gnulibc if eval $compile && \ - ./gnulibc | $contains '^GNU C Library' >/dev/null 2>&1; then + ./gnulibc | $contains '^GNU C Library'; then val="$define" echo "You are using the GNU C Library" else @@ -4368,12 +3993,26 @@ eval $setvar : see if nm is to be used to determine whether a symbol is defined or not case "$usenm" in '') + dflt='' case "$d_gnulibc" in - $define) + "$define") + echo " " + echo "nm probably won't work on the GNU C Library." >&4 dflt=n ;; - *) - dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null` + esac + case "$dflt" in + '') + if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then + echo " " + echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4 + echo "'nm' won't be sufficient on this sytem." >&4 + dflt=n + fi + ;; + esac + case "$dflt" in + '') dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null` if $test $dflt -gt 20; then dflt=y else @@ -4384,26 +4023,28 @@ case "$usenm" in ;; *) case "$usenm" in - true) dflt=y;; + true|$define) dflt=y;; *) dflt=n;; esac ;; esac $cat <&4 com='' - if $ar t $libc > libc.tmp; then - for thisname in $libnames; do + if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then + for thisname in $libnames $libc; do $ar t $thisname >>libc.tmp done $sed -e "s/\\$_o\$//" < libc.tmp > libc.list echo "Ok." >&4 + elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then + # Repeat libc to extract forwarders to DLL entries too + for thisname in $libnames $libc; do + $ar tv $thisname >>libc.tmp + # Revision 50 of EMX has bug in $ar. + # it will not extract forwarders to DLL entries + # Use emximp which will extract exactly them. + emximp -o tmp.imp $thisname \ + 2>/dev/null && \ + $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \ + < tmp.imp >>libc.tmp + $rm tmp.imp + done + $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list + echo "Ok." >&4 else echo "$ar didn't seem to work right." >&4 echo "Maybe this is a Cray...trying bld instead..." >&4 @@ -4885,7 +4541,7 @@ $undef|n|false) $define) dflt='y' ;; esac : Does a dl_xxx.xs file exist for this operating system - $test -f ../$dldir/dl_${osname}.xs && dflt='y' + $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y' ;; esac rp="Do you wish to use dynamic loading?" @@ -4895,7 +4551,7 @@ case "$ans" in y*) usedl="$define" case "$dlsrc" in '') - if $test -f ../$dldir/dl_${osname}.xs ; then + if $test -f $rsrc/$dldir/dl_${osname}.xs ; then dflt="$dldir/dl_${osname}.xs" elif $test "$d_dlopen" = "$define" ; then dflt="$dldir/dl_dlopen.xs" @@ -4910,15 +4566,17 @@ y*) usedl="$define" esac echo "The following dynamic loading files are available:" : Can not go over to $dldir because getfile has path hard-coded in. - cd ..; ls -C $dldir/dl*.xs; cd UU - rp="Source file to use for dynamic loading" - fn="fne" - . ./getfile + tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir + rp="Source file to use for dynamic loading" + fn="fne" + # XXX This getfile call will fail the existence check if you try + # building away from $src (this is not supported yet). + . ./getfile usedl="$define" : emulate basename dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'` - $cat << EOM + $cat << EOM Some systems may require passing special flags to $cc -c to compile modules that will be used to create a shared library. @@ -5135,11 +4793,11 @@ EOM # Why does next4 have to be so different? case "${osname}${osvers}" in next4*) xxx='DYLD_LIBRARY_PATH' ;; + os2*) xxx='' ;; # Nothing special needed. *) xxx='LD_LIBRARY_PATH' ;; esac - case "$osname" in - os2) ;; - *) $cat <&4 + if test X"$xxx" != "X"; then + $cat <&4 To build perl, you must add the current working directory to your $xxx environment variable before running make. You can do @@ -5150,7 +4808,7 @@ for Bourne-style shells, or for Csh-style shells. You *MUST* do this before running make. EOM - esac + fi ;; *) useshrplib='false' ;; esac @@ -5239,61 +4897,305 @@ Further, your current attempted setting of $shrpdir conflicts with the value of $archlibexp/CORE that installperl will use. EOM - ;; + ;; + esac + ;; +esac + +# How will the perl executable find the installed shared $libperl? +# Add $xxx to ccdlflags. +# If we can't figure out a command-line option, use $shrpenv to +# set env LD_RUN_PATH. The main perl makefile uses this. +shrpdir=$archlibexp/CORE +xxx='' +tmp_shrpenv='' +if "$useshrplib"; then + case "$osname" in + aix) + # We'll set it in Makefile.SH... + ;; + solaris|netbsd) + xxx="-R $shrpdir" + ;; + freebsd) + xxx="-Wl,-R$shrpdir" + ;; + linux|irix*|dec_osf) + xxx="-Wl,-rpath,$shrpdir" + ;; + next) + # next doesn't like the default... + ;; + *) + tmp_shrpenv="env LD_RUN_PATH=$shrpdir" + ;; + esac + case "$xxx" in + '') ;; + *) + # Only add $xxx if it isn't already in ccdlflags. + case " $ccdlflags " in + *" $xxx "*) ;; + *) ccdlflags="$ccdlflags $xxx" + cat <&4 + +Adding $xxx to the flags +passed to $ld so that the perl executable will find the +installed shared $libperl. + +EOM + ;; + esac + ;; + esac +fi +# Respect a hint or command-line value. +case "$shrpenv" in +'') shrpenv="$tmp_shrpenv" ;; +esac + +: determine where manual pages go +set man1dir man1dir none +eval $prefixit +$cat <$first) 2>/dev/null; then + if $test -f 123456789abcde; then + echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 + val="$undef" + else + if (echo hi >$second) 2>/dev/null; then + if $test -f /tmp/cf$$/123456789abcde; then + $cat <<'EOM' +That's peculiar... You can have filenames longer than 14 characters, but only +on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems +I shall consider your system cannot support long filenames at all. +EOM + val="$undef" + else + echo 'You can have filenames longer than 14 characters.' >&4 + val="$define" + fi + else + $cat <<'EOM' +How confusing! Some of your filesystems are sane enough to allow filenames +longer than 14 characters but some others like /tmp can't even think about them. +So, for now on, I shall assume your kernel does not allow them at all. +EOM + val="$undef" + fi + fi +else + $cat <<'EOM' +You can't have filenames longer than 14 chars. You can't even think about them! +EOM + val="$undef" +fi +set d_flexfnam +eval $setvar +$rm -rf /tmp/cf$$ 123456789abcde* + +: determine where library module manual pages go +set man3dir man3dir none +eval $prefixit +$cat <&4 +fn=dn+~ +rp="Where do the $package library man pages (source) go?" +. ./getfile +if test "X$man3direxp" != "X$ansexp"; then + installman3dir='' +fi -Adding $xxx to the flags -passed to $ld so that the perl executable will find the -installed shared $libperl. +man3dir="$ans" +man3direxp="$ansexp" +case "$man3dir" in +'') man3dir=' ' + installman3dir='';; +esac +if $afs; then + $cat < /dev/null; then + if eval $compile_ok && ./intsize > /dev/null; then eval `./intsize` echo "Your integers are $intsize bytes long." echo "Your long integers are $longsize bytes long." @@ -6120,7 +6165,7 @@ main() } EOCP set try -if eval $compile; then +if eval $compile_ok; then ./try yyy=$? else @@ -6208,7 +6253,7 @@ main() } EOCP set try -if eval $compile; then +if eval $compile_ok; then ./try castflags=$? else @@ -6662,7 +6707,7 @@ main() { } EOCP set try - if eval $compile; then + if eval $compile_ok; then o_nonblock=`./try` case "$o_nonblock" in '') echo "I can't figure it out, assuming O_NONBLOCK will do.";; @@ -6686,7 +6731,9 @@ case "$eagain" in #include #include #define MY_O_NONBLOCK $o_nonblock +#ifndef errno /* XXX need better Configure test */ extern int errno; +#endif $signal_t blech(x) int x; { exit(3); } EOCP $cat >> try.c <<'EOCP' @@ -6741,7 +6788,7 @@ main() } EOCP set try - if eval $compile; then + if eval $compile_ok; then echo "$startsh" >mtry echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry chmod +x mtry @@ -6852,6 +6899,34 @@ eval $inlibc set gethostent d_gethent eval $inlibc +hasproto='varname=$1; func=$2; shift; shift; +while $test $# -ge 2; do + case "$1" in + $define) echo "#include <$2>";; + esac ; + shift 2; +done > try.c; +$cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null; +if $contains "$func.*(" tryout.c >/dev/null 2>&1; then + echo "$func() prototype found."; + val="$define"; +else + echo "$func() prototype NOT found."; + val="$undef"; +fi; +set $varname; +eval $setvar; +$rm -f try.c tryout.c' + +: see if this is a netdb.h system +set netdb.h i_netdb +eval $inhdr + +: see if prototypes for various gethostxxx netdb.h functions are available +echo " " +set d_gethostprotos gethostent $i_netdb netdb.h +eval $hasproto + : see if getlogin exists set getlogin d_getlogin eval $inlibc @@ -6868,6 +6943,11 @@ eval $inlibc set getnetent d_getnent eval $inlibc +: see if prototypes for various getnetxxx netdb.h functions are available +echo " " +set d_getnetprotos getnetent $i_netdb netdb.h +eval $hasproto + : see if getprotobyname exists set getprotobyname d_getpbyname @@ -6897,6 +6977,11 @@ eval $inlibc set getpriority d_getprior eval $inlibc +: see if prototypes for various getprotoxxx netdb.h functions are available +echo " " +set d_getprotoprotos getprotoent $i_netdb netdb.h +eval $hasproto + : see if getservbyname exists set getservbyname d_getsbyname @@ -6910,6 +6995,11 @@ eval $inlibc set getservent d_getsent eval $inlibc +: see if prototypes for various getservxxx netdb.h functions are available +echo " " +set d_getservprotos getservent $i_netdb netdb.h +eval $hasproto + : see if gettimeofday or ftime exists set gettimeofday d_gettimeod eval $inlibc @@ -7071,7 +7161,7 @@ eval $inlibc echo " " echo $n "Checking to see if your system supports long doubles...$c" >&4 echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c -if $cc $optimize $ccflags -c try.c; then +if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then val="$define" echo " Yup, it does." >&4 else @@ -7083,10 +7173,9 @@ set d_longdbl eval $setvar : check for length of long double -echo " " - case "${d_longdbl}${longdblsize}" in $define) + echo " " $echo $n "Checking to see how big your long doubles are...$c" >&4 $cat >try.c <<'EOCP' #include @@ -7096,16 +7185,60 @@ main() } EOCP set try - if eval $compile; then + if eval $compile_ok; then longdblsize=`./try` + $echo " $longdblsize bytes." >&4 else dflt='8' + echo " " echo "(I can't seem to compile the test program. Guessing...)" rp="What is the size of a long double (in bytes)?" . ./myread longdblsize="$ans" fi - $echo " $longdblsize bytes." + ;; +esac +$rm -f try.c try + +: check for long long +echo " " +echo $n "Checking to see if your system supports long long...$c" >&4 +echo 'long long foo() { long long x; x = 7; return x; }' > try.c +if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then + val="$define" + echo " Yup, it does." >&4 +else + val="$undef" + echo " Nope, it doesn't." >&4 +fi +$rm try.* +set d_longlong +eval $setvar + +: check for length of long long +case "${d_longlong}${longlongsize}" in +$define) + echo " " + $echo $n "Checking to see how big your long longs are...$c" >&4 + $cat >try.c <<'EOCP' +#include +main() +{ + printf("%d\n", sizeof(long long)); +} +EOCP + set try + if eval $compile_ok; then + longlongsize=`./try` + $echo " $longlongsize bytes." >&4 + else + dflt='8' + echo " " + echo "(I can't seem to compile the test program. Guessing...)" + rp="What is the size of a long long (in bytes)?" + . ./myread + longlongsize="$ans" + fi ;; esac $rm -f try.c try @@ -7538,7 +7671,7 @@ exit(0); } EOCP set try - if eval $compile; then + if eval $compile_ok; then if ./try 2>/dev/null; then echo "Yes, it can." val="$define" @@ -7616,7 +7749,7 @@ exit(0); } EOCP set try - if eval $compile; then + if eval $compile_ok; then if ./try 2>/dev/null; then echo "Yes, it can." val="$define" @@ -7676,7 +7809,7 @@ exit(0); } EOCP set try - if eval $compile; then + if eval $compile_ok; then if ./try 2>/dev/null; then echo "Yes, it can." val="$define" @@ -7916,12 +8049,7 @@ echo " " : see if we have sigaction if set sigaction val -f d_sigaction; eval $csym; $val; then echo 'sigaction() found.' >&4 - val="$define" -else - echo 'sigaction NOT found.' >&4 - val="$undef" -fi -$cat > try.c <<'EOP' + $cat > try.c <<'EOP' #include #include #include @@ -7930,11 +8058,15 @@ main() struct sigaction act, oact; } EOP -set try -if eval $compile; then - : + set try + if eval $compile_ok; then + val="$define" + else + echo "But you don't seem to have a useable struct sigaction." >&4 + val="$undef" + fi else - echo "But you don't seem to have a useable struct sigaction." >&4 + echo 'sigaction NOT found.' >&4 val="$undef" fi set d_sigaction; eval $setvar @@ -8008,7 +8140,7 @@ else else echo "You don't have Berkeley networking in libc$_a..." >&4 if test -f /usr/lib/libnet$_a; then - ( (nm $nm_opt /usr/lib/libnet$_a | eval $nm_extract) || \ + ( ($nm $nm_opt /usr/lib/libnet$_a | eval $nm_extract) || \ $ar t /usr/lib/libnet$_a) 2>/dev/null >> libc.list if $contains socket libc.list >/dev/null 2>&1; then echo "...but the Wollongong group seems to have hacked it in." >&4 @@ -8310,6 +8442,34 @@ case "$varval" in *) eval "$var=\$varval";; esac' +: define an is-a-typedef? function that prompts if the type is not available. +typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; +case "$inclist" in +"") inclist="sys/types.h";; +esac; +eval "varval=\$$var"; +case "$varval" in +"") + $rm -f temp.c; + for inc in $inclist; do + echo "#include <$inc>" >>temp.c; + done; + $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; + echo " " ; + echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./"; + if $contains $type temp.E >/dev/null 2>&1; then + echo "$type found." >&4; + eval "$var=\$type"; + else + echo "$type NOT found." >&4; + dflt="$def"; + . ./myread ; + eval "$var=\$ans"; + fi; + $rm -f temp.?;; +*) eval "$var=\$varval";; +esac' + : see if this is a sys/times.h system set sys/times.h i_systimes eval $inhdr @@ -8323,13 +8483,9 @@ if set times val -f d_times; eval $csym; $val; then case "$i_systimes" in "$define") inc='sys/times.h';; esac + rp="What is the type returned by times() on this system?" set clock_t clocktype long stdio.h sys/types.h $inc - eval $typedef - dflt="$clocktype" - echo " " - rp="What type is returned by times() on this system?" - . ./myread - clocktype="$ans" + eval $typedef_ask else echo 'times() NOT found, hope that will do.' >&4 d_times="$undef" @@ -8472,7 +8628,7 @@ case "$d_closedir" in int main() { return closedir(opendir(".")); } EOM set closedir - if eval $compile; then + if eval $compile_ok; then if ./closedir > /dev/null 2>&1 ; then echo "Yes, it does." val="$undef" @@ -8561,7 +8717,7 @@ main() } EOCP set try - if eval $compile; then + if eval $compile_ok; then dflt=`./try` else dflt='8' @@ -8672,51 +8828,6 @@ $rm -f cpp_stuff.* set db.h i_db eval $inhdr -case "$i_db" in -define) - : Check the return type needed for hash - echo " " - echo "Checking return type needed for hash for Berkeley DB ..." >&4 - $cat >try.c < -#include - -#ifndef DB_VERSION_MAJOR -u_int32_t hash_cb (ptr, size) -const void *ptr; -size_t size; -{ -} -HASHINFO info; -main() -{ - info.hash = hash_cb; -} -#endif -EOCP - if $cc $ccflags -c try.c >try.out 2>&1 ; then - if $contains warning try.out >>/dev/null 2>&1 ; then - db_hashtype='int' - else - db_hashtype='u_int32_t' - fi - else - : XXX Maybe we should just give up here. - db_hashtype=u_int32_t - echo "Help: I can't seem to compile the db test program." >&4 - echo "Something's wrong, but I'll assume you use $db_hashtype." >&4 - fi - $rm -f try.* - echo "Your version of Berkeley DB uses $db_hashtype for hash." - ;; -*) db_hashtype=u_int32_t - ;; -esac - case "$i_db" in $define) : Check db version. @@ -8793,6 +8904,51 @@ EOCP ;; esac +case "$i_db" in +define) + : Check the return type needed for hash + echo " " + echo "Checking return type needed for hash for Berkeley DB ..." >&4 + $cat >try.c < +#include + +#ifndef DB_VERSION_MAJOR +u_int32_t hash_cb (ptr, size) +const void *ptr; +size_t size; +{ +} +HASHINFO info; +main() +{ + info.hash = hash_cb; +} +#endif +EOCP + if $cc $ccflags -c try.c >try.out 2>&1 ; then + if $contains warning try.out >>/dev/null 2>&1 ; then + db_hashtype='int' + else + db_hashtype='u_int32_t' + fi + else + : XXX Maybe we should just give up here. + db_hashtype=u_int32_t + $cat try.out >&4 + echo "Help: I can't seem to compile the db test program." >&4 + echo "Something's wrong, but I'll assume you use $db_hashtype." >&4 + fi + $rm -f try.* + echo "Your version of Berkeley DB uses $db_hashtype for hash." + ;; +*) db_hashtype=u_int32_t + ;; +esac case "$i_db" in define) : Check the return type needed for prefix @@ -8828,6 +8984,7 @@ EOCP else db_prefixtype='size_t' : XXX Maybe we should just give up here. + $cat try.out >&4 echo "Help: I can't seem to compile the db test program." >&4 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4 fi @@ -8946,7 +9103,7 @@ main() } EOCP set try - if eval $compile; then + if eval $compile_ok; then doublesize=`./try` $echo $doublesize >&4 else @@ -8961,13 +9118,9 @@ esac $rm -f try.c try : see what type file positions are declared as in the library -set fpos_t fpostype long stdio.h sys/types.h -eval $typedef -echo " " -dflt="$fpostype" rp="What is the type for file position used by fsetpos()?" -. ./myread -fpostype="$ans" +set fpos_t fpostype long stdio.h sys/types.h +eval $typedef_ask : get csh whereabouts case "$csh" in @@ -8985,6 +9138,8 @@ esac full_sed=$sed : see what type gids are declared as in the kernel +echo " " +echo "Looking for the type for group ids returned by getgid()." set gid_t gidtype xxx stdio.h sys/types.h eval $typedef case "$gidtype" in @@ -8998,10 +9153,13 @@ xxx) ;; *) dflt="$gidtype";; esac -echo " " -rp="What is the type for group ids returned by getgid()?" -. ./myread -gidtype="$ans" +case "$gidtype" in +gid_t) echo "gid_t found." ;; +*) rp="What is the type for group ids returned by getgid()?" + . ./myread + gidtype="$ans" + ;; +esac : see if getgroups exists set getgroups d_getgrps @@ -9021,11 +9179,11 @@ case "$d_getgrps$d_setgrps" in *) dflt="$groupstype" ;; esac $cat <&4 @@ -9062,13 +9216,9 @@ case "$make_set_make" in esac : see what type is used for mode_t +rp="What is the type used for file modes for system calls (e.g. fchmod())?" set mode_t modetype int stdio.h sys/types.h -eval $typedef -dflt="$modetype" -echo " " -rp="What type is used for file modes?" -. ./myread -modetype="$ans" +eval $typedef_ask : Cruising for prototypes echo " " @@ -9129,18 +9279,10 @@ EOSH chmod +x protochk $eunicefix protochk -: see if this is a netdb.h system -set netdb.h i_netdb -eval $inhdr - : see what type is used for size_t +rp="What is the type used for the length parameter for string functions?" set size_t sizetype 'unsigned int' stdio.h sys/types.h -eval $typedef -dflt="$sizetype" -echo " " -rp="What type is used for the length parameter for string functions?" -. ./myread -sizetype="$ans" +eval $typedef_ask : check for type of arguments to gethostbyaddr. if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then @@ -9295,19 +9437,15 @@ rp='What pager is used on your system?' pager="$ans" : see what type pids are declared as in the kernel +rp="What is the type of process ids on this system?" set pid_t pidtype int stdio.h sys/types.h -eval $typedef -dflt="$pidtype" -echo " " -rp="What type are process ids on this system declared as?" -. ./myread -pidtype="$ans" +eval $typedef_ask : check for length of pointer echo " " case "$ptrsize" in '') - echo "Checking to see how big your pointers are..." >&4 + $echo $n "Checking to see how big your pointers are...$c" >&4 if test "$voidflags" -gt 7; then echo '#define VOID_PTR char *' > try.c else @@ -9322,8 +9460,9 @@ main() } EOCP set try - if eval $compile; then + if eval $compile_ok; then ptrsize=`./try` + $echo " $ptrsize bytes." >&4 else dflt='4' echo "(I can't seem to compile the test program. Guessing...)" >&4 @@ -9368,7 +9507,7 @@ main() } EOCP set try - if eval $compile; then + if eval $compile_ok; then dflt=`./try$_exe` else dflt='?' @@ -9665,9 +9804,10 @@ xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP" xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM" xxx="$xxx WINCH WIND WINDOW XCPU XFSZ" : generate a few handy files for later -$cat > signal.c <<'EOP' +$cat > signal.c <<'EOCP' #include #include +#include int main() { /* Strange style to avoid deeply-nested #if/#else/#endif */ @@ -9722,7 +9862,10 @@ int main() { printf("NSIG %d\n", NSIG); -EOP +#ifndef JUST_NSIG + +EOCP + echo $xxx | $tr ' ' '\012' | $sort | $uniq | $awk ' { printf "#ifdef SIG"; printf $1; printf "\n" @@ -9731,6 +9874,7 @@ echo $xxx | $tr ' ' '\012' | $sort | $uniq | $awk ' printf "#endif\n" } END { + printf "#endif /* JUST_NSIG */\n"; printf "}\n"; } ' >>signal.c @@ -9767,22 +9911,69 @@ END { EOP $cat >signal_cmd </dev/null 2>&1; then +if $test -s signal.lst; then + echo "Using your existing signal.lst file" + exit 0 +fi +xxx="$xxx" +EOS +$cat >>signal_cmd <<'EOS' + +set signal +if eval $compile_ok; then ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst else - echo "(I can't seem be able to compile the test program -- Guessing)" + echo "(I can't seem be able to compile the whole test program)" >&4 + echo "(I'll try it in little pieces.)" >&4 + set signal -DJUST_NSIG + if eval $compile_ok; then + ./signal$_exe > signal.nsg + $cat signal.nsg + else + echo "I can't seem to figure out how many signals you have." >&4 + echo "Guessing 50." >&4 + echo 'NSIG 50' > signal.nsg + fi + : Now look at all the signal names, one at a time. + for xx in `echo $xxx | $tr ' ' '\012' | $sort | $uniq`; do + $cat > signal.c < +#include +#include +int main() { +printf("$xx %d\n", SIG${xx}); +return 0; +} +EOCP + set signal + if eval $compile; then + echo "SIG${xx} found." + ./signal$_exe >> signal.ls1 + else + echo "SIG${xx} NOT found." + fi + done + if $test -s signal.ls1; then + $cat signal.nsg signal.ls1 | + $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst + fi + +fi +if $test -s signal.lst; then + : +else + echo "(AAK! I can't compile the test programs -- Guessing)" >&4 echo 'kill -l' >signal - set X \`csh -f signal.lst + echo $@ | $tr ' ' '\012' | \ + $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst fi -$rm -f signal.c signal signal$_o +$rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1 EOS chmod a+x signal_cmd $eunicefix signal_cmd @@ -9792,7 +9983,7 @@ echo " " case "$sig_name_init" in '') echo "Generating a list of signal names and numbers..." >&4 - ./signal_cmd + . ./signal_cmd sig_name=`$awk '{printf "%s ", $1}' signal.lst` sig_name="ZERO $sig_name" sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " } @@ -9843,7 +10034,7 @@ main() EOM echo " " set ssize -if eval $compile && ./ssize > /dev/null; then +if eval $compile_ok && ./ssize > /dev/null; then ssizetype=`./ssize` echo "I'll be using $ssizetype for functions returning a byte count." >&4 else @@ -9877,13 +10068,9 @@ echo " " if set time val -f d_time; eval $csym; $val; then echo 'time() found.' >&4 val="$define" + rp="What is the type returned by time() on this system?" set time_t timetype long stdio.h sys/types.h - eval $typedef - dflt="$timetype" - echo " " - rp="What type is returned by time() on this system?" - . ./myread - timetype="$ans" + eval $typedef_ask else echo 'time() not found, hope that will do.' >&4 val="$undef" @@ -9893,6 +10080,8 @@ set d_time eval $setvar : see what type uids are declared as in the kernel +echo " " +echo "Looking for the type for user ids returned by getuid()." set uid_t uidtype xxx stdio.h sys/types.h eval $typedef case "$uidtype" in @@ -9906,10 +10095,13 @@ xxx) ;; *) dflt="$uidtype";; esac -echo " " -rp="What is the type for user ids returned by getuid()?" -. ./myread -uidtype="$ans" +case "$uidtype" in +uid_t) echo "uid_t found." ;; +*) rp="What is the type for user ids returned by getuid()?" + . ./myread + uidtype="$ans" + ;; +esac : see if dbm.h is available : see if dbmclose exists @@ -10405,7 +10597,8 @@ eval $setvar echo " " echo "Looking for extensions..." >&4 -cd ../ext +tdir=`pwd` +cd $rsrc/ext : If we are using the old config.sh, known_extensions may contain : old or inaccurate or duplicate values. known_extensions='' @@ -10426,7 +10619,7 @@ for xxx in * ; do known_extensions="$known_extensions $xxx/$yyy" fi done - cd .. + cd .. fi fi ;; @@ -10435,7 +10628,7 @@ done set X $known_extensions shift known_extensions="$*" -cd ../UU +cd $tdir : Now see which are supported on this system. avail_ext='' @@ -10779,10 +10972,12 @@ d_gethbyaddr='$d_gethbyaddr' d_gethbyname='$d_gethbyname' d_gethent='$d_gethent' d_gethname='$d_gethname' +d_gethostprotos='$d_gethostprotos' d_getlogin='$d_getlogin' d_getnbyaddr='$d_getnbyaddr' d_getnbyname='$d_getnbyname' d_getnent='$d_getnent' +d_getnetprotos='$d_getnetprotos' d_getpbyname='$d_getpbyname' d_getpbynumber='$d_getpbynumber' d_getpent='$d_getpent' @@ -10791,9 +10986,11 @@ d_getpgrp2='$d_getpgrp2' d_getpgrp='$d_getpgrp' d_getppid='$d_getppid' d_getprior='$d_getprior' +d_getprotoprotos='$d_getprotoprotos' d_getsbyname='$d_getsbyname' d_getsbyport='$d_getsbyport' d_getsent='$d_getsent' +d_getservprotos='$d_getservprotos' d_gettimeod='$d_gettimeod' d_gnulibc='$d_gnulibc' d_htonl='$d_htonl' @@ -10805,6 +11002,7 @@ d_link='$d_link' d_locconv='$d_locconv' d_lockf='$d_lockf' d_longdbl='$d_longdbl' +d_longlong='$d_longlong' d_lstat='$d_lstat' d_mblen='$d_mblen' d_mbstowcs='$d_mbstowcs' @@ -10953,7 +11151,6 @@ fpostype='$fpostype' freetype='$freetype' full_csh='$full_csh' full_sed='$full_sed' -gcc='$gcc' gccversion='$gccversion' gidtype='$gidtype' glibpth='$glibpth' @@ -11051,6 +11248,7 @@ lns='$lns' locincpth='$locincpth' loclibpth='$loclibpth' longdblsize='$longdblsize' +longlongsize='$longlongsize' longsize='$longsize' lp='$lp' lpr='$lpr' -- cgit v1.2.1