X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Configure;h=559eb24df1b7619cb730a73544d5f16bb805703d;hb=a22e52b96b9903703a79e4a00983091457f7aff2;hp=9351a5780db974d9bbf42fd8406cd07acc6769b0;hpb=57def98fcb6c98601beaf31e3c48ad681bfdc2a3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Configure b/Configure index 9351a57..559eb24 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 Sat Oct 2 15:53:32 EET DST 1999 [metaconfig 3.0 PL70] +# Generated on Sat Oct 30 02:37:12 EET DST 1999 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <. Versions 5.003_02 and later of perl allow alternate IO mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still @@ -6603,6 +6708,28 @@ esac set useperlio eval $setvar +case "$vendorprefix" in +'') d_vendorbin="$undef" + vendorbin='' + vendorbinexp='' + ;; +*) d_vendorbin="$define" + : determine where vendor-supplied executables go. + dflt=$vendorprefix/bin + fn=d~+ + rp='Pathname for the vendor-supplied executables directory?' + . ./getfile + vendorbin="$ans" + vendorbinexp="$ansexp" + : Change installation prefix, if necessary. + if $test X"$prefix" != X"$installprefix"; then + installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"` + else + installvendorbin="$vendorbinexp" + fi + ;; +esac + : Check how to convert floats to strings. if test "X$d_Gconvert" = X; then echo " " @@ -6696,471 +6823,170 @@ EOP esac fi -: see if inttypes.h is available -: we want a real compile instead of Inhdr because some systems -: have an inttypes.h which includes non-existent headers -echo " " -$cat >try.c < -int main() { - static int32_t foo32 = 0x12345678; -} -EOCP -set try -if eval $compile; then - echo " found." >&4 - val="$define" -else - echo " NOT found." >&4 - val="$undef" -fi -$rm -f try.c try -set i_inttypes -eval $setvar - -: check for int64_t -case "$use64bits" in -"$define" ) - echo " " - echo $n "Checking to see if your system supports int64_t...$c" >&4 - $cat >try.c < -#$i_inttypes I_INTTYPES -#ifdef I_INTTYPES -#include -#endif -int64_t foo() { int64_t x; x = 7; return x; } -EOCP - 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 -f try.* - ;; -*) val="$undef" - ;; -esac -set d_int64t -eval $setvar - - -: check for lengths of integral types +: check for length of double echo " " -case "$intsize" in +case "$doublesize" in '') - echo "Checking to see how big your integers are..." >&4 - $cat >intsize.c <<'EOCP' + $echo $n "Checking to see how big your double precision numbers are...$c" >&4 + $cat >try.c <<'EOCP' #include int main() { - printf("intsize=%d;\n", sizeof(int)); - printf("longsize=%d;\n", sizeof(long)); - printf("shortsize=%d;\n", sizeof(short)); - exit(0); + printf("%d\n", sizeof(double)); } EOCP - set intsize - 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." - echo "Your short integers are $shortsize bytes long." + set try + if eval $compile_ok; then + doublesize=`./try` + $echo " $doublesize bytes." >&4 else - $cat >&4 <&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 +$echo $n "Checking to see if your system supports long double..." $c >&4 +echo 'int main() { long double x = 7.0; }' > try.c +set try +if eval $compile; then val="$define" - echo " Yup, it does." >&4 + echo " Yes, it does." >&4 else val="$undef" - echo " Nope, it doesn't." >&4 + echo " No, it doesn't." >&4 fi $rm try.* -set d_longlong +set d_longdbl eval $setvar -: check for length of long long -case "${d_longlong}${longlongsize}" in +: check for length of long double +case "${d_longdbl}${longdblsize}" in $define) echo " " - $echo $n "Checking to see how big your long longs are...$c" >&4 + $echo $n "Checking to see how big your long doubles are..." $c >&4 $cat >try.c <<'EOCP' #include int main() { - printf("%d\n", sizeof(long long)); + printf("%d\n", sizeof(long double)); } EOCP set try - if eval $compile_ok; then - longlongsize=`./try` - $echo " $longlongsize bytes." >&4 + set try + if eval $compile; then + longdblsize=`./try$exe_ext` + $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 long (in bytes)?" + echo "(I can't seem to compile the test program. Guessing...)" >&4 + rp="What is the size of a long double (in bytes)?" . ./myread - longlongsize="$ans" + longdblsize="$ans" fi - if $test "X$longsize" = "X$longlongsize"; then - echo "(That isn't any different from an ordinary long.)" + if $test "X$doublesize" = "X$longdblsize"; then + echo "(That isn't any different from an ordinary double.)" fi ;; esac -$rm -f try.c try +$rm -f try.* try echo " " -if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then +if $test X"$d_longdbl" = X"$define"; then -echo "Checking how to print 64-bit integers..." >&4 +echo "Checking how to print long doubles..." >&4 -if $test X"$sPRId64" = X -a X"$intsize" = X8; then - quad=int +if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then $cat >try.c <<'EOCP' #include #include int main() { - int q = 12345678901; - printf("%ld\n", q); + double d = 123.456; + printf("%.3f\n", d); } EOCP set try if eval $compile; then yyy=`./try$exe_ext` case "$yyy" in - 12345678901) - sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"'; - sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"'; - echo "We will use %d." + 123.456) + sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"'; + sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"'; + echo "We will use %f." ;; esac fi fi -if $test X"$sPRId64" = X -a X"$longsize" = X8; then - quad=long +if $test X"$sPRIfldbl" = X; then $cat >try.c <<'EOCP' #include #include int main() { - long q = 12345678901; - printf("%ld\n", q); + long double d = 123.456; + printf("%.3llf\n", d); } EOCP set try if eval $compile; then yyy=`./try$exe_ext` case "$yyy" in - 12345678901) - sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"'; - sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"'; - echo "We will use %ld." + 123.456) + sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"'; + sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"'; + echo "We will use %llf." ;; esac fi fi -if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then - quad=int64_t +if $test X"$sPRIfldbl" = X; then $cat >try.c <<'EOCP' #include -#include #include int main() { - int64_t q = 12345678901; - printf("%" PRId64 "\n", q); + long double d = 123.456; + printf("%.3Lf\n", d); } EOCP set try if eval $compile; then yyy=`./try$exe_ext` case "$yyy" in - 12345678901) - sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64; - sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64; - echo "We will use the C9X style." + 123.456) + sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"'; + sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"'; + echo "We will use %Lf." ;; esac fi fi -if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then - quad="long long" +if $test X"$sPRIfldbl" = X; then $cat >try.c <<'EOCP' #include #include int main() { - long long q = 12345678901LL; /* AIX cc requires the LL prefix. */ - printf("%lld\n", q); + long double d = 123.456; + printf("%.3lf\n", d); } EOCP set try if eval $compile; then yyy=`./try$exe_ext` case "$yyy" in - 12345678901) - sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"'; - sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"'; - echo "We will use the %lld style." - ;; - esac - fi -fi - -if $test X"$sPRId64" = X -a X"$quad" != X; then - $cat >try.c < -#include -int main() { - $quad q = 12345678901; - printf("%Ld\n", q); -} -EOCP - set try - if eval $compile; then - yyy=`./try$exe_ext` - case "$yyy" in - 12345678901) - sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"'; - sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"'; - echo "We will use %lld." - ;; - esac - fi -fi - -if $test X"$sPRId64" = X -a X"$quad" != X; then - $cat >try.c < -#include -int main() { - $quad q = 12345678901; - printf("%qd\n", q); -} -EOCP - set try - if eval $compile; then - yyy=`./try$exe_ext` - case "$yyy" in - 12345678901) - sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"'; - sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"'; - echo "We will use %qd." - ;; - esac - fi -fi - -if $test X"$sPRId64" = X; then - echo "Cannot figure out how to print 64-bit integers." >&4 -fi - -$rm -f try try.* - -fi # intsize -o longsize -o d_int64t -o d_longlong - -case "$sPRId64" in -'') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef"; - d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef"; - ;; -*) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define"; - d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define"; - ;; -esac - -: check for length of double -echo " " -case "$doublesize" in -'') - $echo $n "Checking to see how big your double precision numbers are...$c" >&4 - $cat >try.c <<'EOCP' -#include -int main() -{ - printf("%d\n", sizeof(double)); -} -EOCP - set try - if eval $compile_ok; then - doublesize=`./try` - $echo " $doublesize bytes." >&4 - else - dflt='8' - echo "(I can't seem to compile the test program. Guessing...)" - rp="What is the size of a double precision number (in bytes)?" - . ./myread - doublesize="$ans" - fi - ;; -esac -$rm -f try.c try - -: check for long doubles -echo " " -echo $n "Checking to see if your system supports long double...$c" >&4 -echo 'long double foo() { long double x; x = 7.0; 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_longdbl -eval $setvar - -: check for length of long double -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 -int main() -{ - printf("%d\n", sizeof(long double)); -} -EOCP - set try - if eval $compile; then - longdblsize=`./try` - $echo " $longdblsize bytes." >&4 - else - dflt='8' - echo " " - echo "(I can't seem to compile the test program. Guessing...)" >&4 - rp="What is the size of a long double (in bytes)?" - . ./myread - longdblsize="$ans" - fi - if $test "X$doublesize" = "X$longdblsize"; then - echo "(That isn't any different from an ordinary double.)" - fi - ;; -esac -$rm -f try.c try - -echo " " - -if $test X"$d_longdbl" = X"$define"; then - -echo "Checking how to print long doubles..." >&4 - -if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then - $cat >try.c <<'EOCP' -#include -#include -int main() { - double d = 123.456; - printf("%.3f\n", d); -} -EOCP - set try - if eval $compile; then - yyy=`./try$exe_ext` - case "$yyy" in - 123.456) - sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"'; - sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"'; - echo "We will use %f." - ;; - esac - fi -fi - -if $test X"$sPRIfldbl" = X; then - $cat >try.c <<'EOCP' -#include -#include -int main() { - long double d = 123.456; - printf("%.3llf\n", d); -} -EOCP - set try - if eval $compile; then - yyy=`./try$exe_ext` - case "$yyy" in - 123.456) - sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"'; - sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"'; - echo "We will use %llf." - ;; - esac - fi -fi - -if $test X"$sPRIfldbl" = X; then - $cat >try.c <<'EOCP' -#include -#include -int main() { - long double d = 123.456; - printf("%.3Lf\n", d); -} -EOCP - set try - if eval $compile; then - yyy=`./try$exe_ext` - case "$yyy" in - 123.456) - sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"'; - sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"'; - echo "We will use %Lf." - ;; - esac - fi -fi - -if $test X"$sPRIfldbl" = X; then - $cat >try.c <<'EOCP' -#include -#include -int main() { - long double d = 123.456; - printf("%.3lf\n", d); -} -EOCP - set try - if eval $compile; then - yyy=`./try$exe_ext` - case "$yyy" in - 123.456) - sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"'; - sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"'; - echo "We will use %lf." + 123.456) + sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"'; + sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"'; + echo "We will use %lf." ;; esac fi @@ -7409,6 +7235,52 @@ $rm -f set set.c set bzero d_bzero eval $inlibc +: check for lengths of integral types +echo " " +case "$intsize" in +'') + echo "Checking to see how big your integers are..." >&4 + $cat >intsize.c <<'EOCP' +#include +int main() +{ + printf("intsize=%d;\n", sizeof(int)); + printf("longsize=%d;\n", sizeof(long)); + printf("shortsize=%d;\n", sizeof(short)); + exit(0); +} +EOCP + set intsize + 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." + echo "Your short integers are $shortsize bytes long." + else + $cat >&4 <&4 -set d_iovec_s iovec iov_base $i_sysuio sys/uio.h -eval $hasfield -case "$d_iovec_s" in -"$define") echo "Yup, it does." >&4 - ;; -*) echo "Nope, it doesn't." >&4 - ;; -esac - -socketlib='' -sockethdr='' -: see whether socket exists -echo " " -$echo $n "Hmm... $c" >&4 -if set socket val -f d_socket; eval $csym; $val; then - echo "Looks like you have Berkeley networking support." >&4 - d_socket="$define" - if set setsockopt val -f; eval $csym; $val; then - d_oldsock="$undef" - else - echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4 - d_oldsock="$define" - fi -else - if $contains socklib libc.list >/dev/null 2>&1; then - echo "Looks like you have Berkeley networking support." >&4 - d_socket="$define" - : we will have to assume that it supports the 4.2 BSD interface - d_oldsock="$undef" - else - echo "You don't have Berkeley networking in libc$_a..." >&4 - if test "X$d_socket" = "X$define"; then - echo "...but you seem to believe that you have sockets." >&4 - else - for net in net socket - do - if test -f /usr/lib/lib$net$_a; then - ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \ - $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list - if $contains socket libc.list >/dev/null 2>&1; then - d_socket="$define" - socketlib="-l$net" - case "$net" in - net) - echo "...but the Wollongong group seems to have hacked it in." >&4 - sockethdr="-I/usr/netinclude" - ;; - esac - echo "Found Berkeley sockets interface in lib$net." >& 4 - if $contains setsockopt libc.list >/dev/null 2>&1; then - d_oldsock="$undef" - else - echo "...using the old BSD 4.1c interface, rather than 4.2." >&4 - d_oldsock="$define" - fi - break - fi - fi - done - if test "X$d_socket" != "X$define"; then - echo "or anywhere else I see." >&4 - d_socket="$undef" - d_oldsock="$undef" - fi - fi - fi -fi - -: see if socketpair exists -set socketpair d_sockpair -eval $inlibc - - -echo " " -echo "Checking the availability of certain socket constants..." >& 4 -for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do - enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'` - $cat >try.c < -#include -int main() { - int i = $ENUM; -} -EOF - val="$undef" - set try; if eval $compile; then - val="$define" - fi - set d_${enum}; eval $setvar - $rm -f try.c try -done - -set sendmsg d_sendmsg -eval $inlibc - -set recvmsg d_recvmsg -eval $inlibc - -echo " " -$echo $n "Checking to see if your system supports struct msghdr...$c" >&4 -set d_msghdr_s msghdr msg_name define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h -eval $hasfield -case "$d_msghdr_s" in -"$define") echo "Yup, it does." >&4 - ;; -*) echo "Nope, it doesn't." >&4 - ;; -esac - -$echo $n "Checking to see if your system supports struct cmsghdr...$c" >&4 -set d_cmsghdr_s cmsghdr cmsg_len define sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h -eval $hasfield -case "$d_cmsghdr_s" in -"$define") echo "Yup, it does." >&4 - ;; -*) echo "Nope, it doesn't." >&4 - ;; -esac - : check for const keyword echo " " echo 'Checking to see if your C compiler knows about "const"...' >&4 @@ -8393,6 +8124,107 @@ eval $inlibc set fcntl d_fcntl eval $inlibc +hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift; +while $test $# -ge 2; do + case "$1" in + $define) echo "#include <$2>";; + esac ; + shift 2; +done > try.c; +echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c; +set try; +if eval $compile; then + val="$define"; +else + val="$undef"; +fi; +set $varname; +eval $setvar; +$rm -f try.c try.o' + +socketlib='' +sockethdr='' +: see whether socket exists +echo " " +$echo $n "Hmm... $c" >&4 +if set socket val -f d_socket; eval $csym; $val; then + echo "Looks like you have Berkeley networking support." >&4 + d_socket="$define" + if set setsockopt val -f; eval $csym; $val; then + d_oldsock="$undef" + else + echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4 + d_oldsock="$define" + fi +else + if $contains socklib libc.list >/dev/null 2>&1; then + echo "Looks like you have Berkeley networking support." >&4 + d_socket="$define" + : we will have to assume that it supports the 4.2 BSD interface + d_oldsock="$undef" + else + echo "You don't have Berkeley networking in libc$_a..." >&4 + if test "X$d_socket" = "X$define"; then + echo "...but you seem to believe that you have sockets." >&4 + else + for net in net socket + do + if test -f /usr/lib/lib$net$_a; then + ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \ + $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list + if $contains socket libc.list >/dev/null 2>&1; then + d_socket="$define" + socketlib="-l$net" + case "$net" in + net) + echo "...but the Wollongong group seems to have hacked it in." >&4 + sockethdr="-I/usr/netinclude" + ;; + esac + echo "Found Berkeley sockets interface in lib$net." >& 4 + if $contains setsockopt libc.list >/dev/null 2>&1; then + d_oldsock="$undef" + else + echo "...using the old BSD 4.1c interface, rather than 4.2." >&4 + d_oldsock="$define" + fi + break + fi + fi + done + if test "X$d_socket" != "X$define"; then + echo "or anywhere else I see." >&4 + d_socket="$undef" + d_oldsock="$undef" + fi + fi + fi +fi + +: see if socketpair exists +set socketpair d_sockpair +eval $inlibc + + +echo " " +echo "Checking the availability of certain socket constants..." >& 4 +for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do + enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'` + $cat >try.c < +#include +int main() { + int i = $ENUM; +} +EOF + val="$undef" + set try; if eval $compile; then + val="$define" + fi + set d_${enum}; eval $setvar + $rm -f try.c try +done + : see if sys/select.h has to be included set sys/select.h i_sysselct eval $inhdr @@ -8575,55 +8407,189 @@ eval $inlibc set fpathconf d_fpathconf eval $inlibc +: define an is-a-typedef? function +typedef='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; + echo "#ifdef $type" >> temp.c; + echo "printf(\"We have $type\");" >> temp.c; + echo "#endif" >> temp.c; + $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; + if $contains $type temp.E >/dev/null 2>&1; then + eval "$var=\$type"; + else + eval "$var=\$def"; + fi; + $rm -f temp.?;; +*) eval "$var=\$varval";; +esac' -: see if llseek exists -set llseek d_llseek -eval $inlibc - -: check for off64_t -echo " " -echo $n "Checking to see if your system supports off64_t...$c" >&4 -$cat >try.c < -#include -off64_t foo() { off64_t x; x = 7; return x; }' -EOCP -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 -f try.* -set d_off64_t -eval $setvar - -: check for fpos64_t -echo " " -echo $n "Checking to see if your system supports fpos64_t...$c" >&4 -$cat >try.c < -fpos64_t foo() { fpos64_t x; x = 7; return x; }' -EOCP -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 +: 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; + echo "#ifdef $type" >> temp.c; + echo "printf(\"We have $type\");" >> temp.c; + echo "#endif" >> temp.c; + $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 what type lseek is declared as in the kernel +rp="What is the type used for lseek's offset on this system?" +set off_t lseektype long stdio.h sys/types.h +eval $typedef_ask + +echo " " +$echo $n "Checking to see how big your file offsets are...$c" >&4 +$cat >try.c < +#include +int main() +{ + printf("%d\n", sizeof($lseektype)); +} +EOCP +set try +if eval $compile_ok; then + lseeksize=`./try` + $echo " $lseeksize bytes." >&4 +else + dflt='4' + echo " " + echo "(I can't seem to compile the test program. Guessing...)" + rp="What is the size of your file offsets (in bytes)?" + . ./myread + lseeksize="$ans" fi -$rm -f try.* -set d_fpos64_t +$rm -f try.c try + +: see what type file positions are declared as in the library +rp="What is the type for file position used by fsetpos()?" +set fpos_t fpostype long stdio.h sys/types.h +eval $typedef_ask + +echo " " +case "$fpostype" in +*_t) zzz="$fpostype" ;; +*) zzz="fpos_t" ;; +esac +echo "Checking the size of $zzz..." >&4 +cat > try.c < +#include +int main() { + printf("%d\n", sizeof($fpostype)); +} +EOCP +set try +if eval $compile_ok; then + yyy=`./try` + case "$yyy" in + '') fpossize=4 + echo "(I can't execute the test program--guessing $fpossize.)" >&4 + ;; + *) fpossize=$yyy + echo "Your $zzz size is $fpossize bytes." + ;; + esac +else + fpossize=4 + echo "(I can't compile the test program--guessing $fpossize.)" >&4 +fi + + + +: check for off64_t +echo " " +echo "Checking to see if your system supports off64_t..." >&4 +$cat >try.c < +#include +int main() { off64_t x = 7; }' +EOCP +set try +if eval $compile; then + val="$define" + echo "Yes, it does." +else + val="$undef" + echo "No, it doesn't." + case "$lseeksize" in + 8) echo "(This is okay because your off_t is 64 bits wide.)" ;; + esac +fi +$rm -f try.* try +set d_off64_t eval $setvar -: see if fseeko exists -set fseeko d_fseeko -eval $inlibc +: check for fpos64_t +echo " " +echo "Checking to see if your system supports fpos64_t..." >&4 +$cat >try.c < +int main() { fpos64_t x x = 7; }' +EOCP +set try +if eval $compile; then + val="$define" + echo "Yes, it does." +else + val="$undef" + echo "No, it doesn't." + case "$fpossize" in + 8) echo "(This is okay because your fpos_t is 64 bits wide.)" ;; + esac +fi +$rm -f try.* try +set d_fpos64_t +eval $setvar -: see if fsetpos exists -set fsetpos d_fsetpos -eval $inlibc +hasstruct='varname=$1; struct=$2; shift; shift; +while $test $# -ge 2; do + case "$1" in + $define) echo "#include <$2>";; + esac ; + shift 2; +done > try.c; +echo "int main () { struct $struct foo; }" >> try.c; +set try; +if eval $compile; then + val="$define"; +else + val="$undef"; +fi; +set $varname; +eval $setvar; +$rm -f try.c try.o' : see if this is a sys/param system set sys/param.h i_sysparam @@ -8633,19 +8599,33 @@ eval $inhdr set sys/mount.h i_sysmount eval $inhdr +: see if sys/types.h has to be included +set sys/types.h i_systypes +eval $inhdr + + +echo " " +echo "Checking to see if your system supports struct fs_data..." >&4 +set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h +eval $hasstruct +case "$d_fs_data_s" in +"$define") echo "Yes, it does." ;; +*) echo "No, it doesn't." ;; +esac + +: see if fseeko exists +set fseeko d_fseeko +eval $inlibc -: see if statfs exists -set statfs d_statfs +: see if fsetpos exists +set fsetpos d_fsetpos eval $inlibc + : see if fstatfs exists set fstatfs d_fstatfs eval $inlibc -: see if statfs knows about mount flags -set d_statfsflags statfs f_flags $i_sysparam sys/param.h $i_sysmount sys/mount.h -eval $hasfield - : see if statvfs exists set statvfs d_statvfs @@ -8774,6 +8754,10 @@ eval $hasproto set getlogin d_getlogin eval $inlibc +: see if getmnt exists +set getmnt d_getmnt +eval $inlibc + : see if getmntent exists set getmntent d_getmntent eval $inlibc @@ -9012,6 +8996,58 @@ set d_index; eval $setvar set inet_aton d_inetaton eval $inlibc +: see if inttypes.h is available +: we want a real compile instead of Inhdr because some systems +: have an inttypes.h which includes non-existent headers +echo " " +$cat >try.c < +int main() { + static int32_t foo32 = 0x12345678; +} +EOCP +set try +if eval $compile; then + echo " found." >&4 + val="$define" +else + echo " NOT found." >&4 + val="$undef" +fi +$rm -f try.c try +set i_inttypes +eval $setvar + +: check for int64_t +case "$use64bits" in +"$define" ) + echo " " + $echo $n "Checking to see if your system supports int64_t...$c" >&4 + $cat >try.c < +#$i_inttypes I_INTTYPES +#ifdef I_INTTYPES +#include +#endif +int main() { int64_t x = 7; } +EOCP + set try + if eval $compile; then + val="$define" + echo " Yes, it does." >&4 + else + val="$undef" + echo " No, it doesn't." >&4 + fi + $rm -f try try.* + ;; +*) val="$undef" + ;; +esac +set d_int64t +eval $setvar + + : Look for isascii echo " " $cat >isascii.c <<'EOCP' @@ -9112,14 +9148,57 @@ eval $inlibc set lockf d_lockf eval $inlibc +: check for long long +echo " " +$echo $n "Checking to see if your system supports long long..." $c >&4 +echo 'int main() { long long x = 7; }' > try.c +set try +if eval $compile; then + val="$define" + echo " Yes, it does." >&4 +else + val="$undef" + echo " No, 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 +int main() +{ + printf("%d\n", sizeof(long long)); +} +EOCP + set try + if eval $compile_ok; then + longlongsize=`./try$exe_ext` + $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 + if $test "X$longsize" = "X$longlongsize"; then + echo "(That isn't any different from an ordinary long.)" + fi + ;; +esac +$rm -f try.* try + : see if lstat exists set lstat d_lstat eval $inlibc -: see if madvise exists -set madvise d_madvise -eval $inlibc - : see if mblen exists set mblen d_mblen eval $inlibc @@ -9164,37 +9243,6 @@ eval $inlibc set mktime d_mktime eval $inlibc -: see if this is a sys/mman.h system -set sys/mman.h i_sysmman -eval $inhdr - -: see if mmap exists -set mmap d_mmap -eval $inlibc -: see what shmat returns -: default to something harmless -mmaptype='void *' -case "$i_sysmman$d_mmap" in -"$define$define") - $cat >mmap.c <<'END' -#include -void *mmap(); -END - if $cc $ccflags -c mmap.c >/dev/null 2>&1; then - mmaptype='void *' - else - mmaptype='caddr_t' - fi - echo "and it returns ($mmaptype)." >&4 - ;; -esac - - - -: see if mprotect exists -set mprotect d_mprotect -eval $inlibc - : see if msgctl exists set msgctl d_msgctl eval $inlibc @@ -9247,14 +9295,6 @@ fi set d_msg eval $setvar -: see if msync exists -set msync d_msync -eval $inlibc - -: see if munmap exists -set munmap d_munmap -eval $inlibc - : see if nice exists set nice d_nice eval $inlibc @@ -9508,10 +9548,6 @@ eval $inlibc set readlink d_readlink eval $inlibc -: see if readv exists -set readv d_readv -eval $inlibc - : see if rename exists set rename d_rename eval $inlibc @@ -10281,15 +10317,61 @@ set d_sigsetjmp eval $setvar $rm -f try.c try +: see if sqrtl exists +set sqrtl d_sqrtl +eval $inlibc + : see if sys/stat.h is available set sys/stat.h i_sysstat eval $inhdr + : see if stat knows about block sizes echo " " +echo "Checking to see if your struct stat has st_blocks field..." >&4 set d_statblks stat st_blocks $i_sysstat sys/stat.h eval $hasfield + +: see if this is a sys/vfs.h system +set sys/vfs.h i_sysvfs +eval $inhdr + + +: see if this is a sys/statfs.h system +set sys/statfs.h i_sysstatfs +eval $inhdr + + +echo " " +echo "Checking to see if your system supports struct statfs..." >&4 +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 +eval $hasstruct +case "$d_statfs_s" in +"$define") echo "Yes, it does." ;; +*) echo "No, it doesn't." ;; +esac + + + +: see if struct statfs knows about f_flags +case "$d_statfs_s" in +define) + echo " " + echo "Checking to see if your struct statfs has f_flags field..." >&4 + 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 + eval $hasfield + ;; +*) val="$undef" + set d_statfs_f_flags + eval $setvar + ;; +esac +case "$d_statfs_f_flags" in +"$define") echo "Yes, it does." ;; +*) echo "No, it doesn't." ;; +esac + : see if _ptr and _cnt from stdio act std echo " " if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then @@ -10563,71 +10645,11 @@ eval $inlibc set tcsetpgrp d_tcsetpgrp eval $inlibc -: see if sys/types.h has to be included -set sys/types.h i_systypes -eval $inhdr - : see if prototype for telldir is available echo " " set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h eval $hasproto -: define an is-a-typedef? function -typedef='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; - echo "#ifdef $type" >> temp.c; - echo "printf(\"We have $type\");" >> temp.c; - echo "#endif" >> temp.c; - $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; - if $contains $type temp.E >/dev/null 2>&1; then - eval "$var=\$type"; - else - eval "$var=\$def"; - fi; - $rm -f temp.?;; -*) 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; - echo "#ifdef $type" >> temp.c; - echo "printf(\"We have $type\");" >> temp.c; - echo "#endif" >> temp.c; - $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 @@ -10670,6 +10692,10 @@ eval $setvar set umask d_umask eval $inlibc +: see if ustat exists +set ustat d_ustat +eval $inlibc + : backward compatibility for d_hvfork if test X$d_hvfork != X; then d_vfork="$d_hvfork" @@ -10829,10 +10855,6 @@ eval $inlibc set wctomb d_wctomb eval $inlibc -: see if writev exists -set writev d_writev -eval $inlibc - : preserve RCS keywords in files with variable substitution, grrr Date='$Date' Id='$Id' @@ -11584,74 +11606,634 @@ Whew. Flushing explicitly all the stdio streams works. EOM fflushall="$define" ;; - '') $cat >&4 <&4 <&4 </dev/null` unsigned short + case $1 in + unsigned) dflt="$1 $2" ;; + *) dflt="$1" ;; + esac + ;; +*) dflt="$gidtype";; +esac +case "$gidtype" in +gid_t) echo "gid_t found." ;; +*) rp="What is the type for group ids returned by getgid()?" + . ./myread + gidtype="$ans" + ;; +esac + +echo " " +case "$gidtype" in +*_t) zzz="$gidtype" ;; +*) zzz="gid" ;; +esac +echo "Checking the size of $zzz..." >&4 +cat > try.c < +#include +int main() { + printf("%d\n", sizeof($gidtype)); +} +EOCP +set try +if eval $compile_ok; then + yyy=`./try` + case "$yyy" in + '') gidsize=4 + echo "(I can't execute the test program--guessing $gidsize.)" >&4 + ;; + *) gidsize=$yyy + echo "Your $zzz size is $gidsize bytes." + ;; + esac +else + gidsize=4 + echo "(I can't compile the test program--guessing $gidsize.)" >&4 +fi + + +echo " " +case "$gidtype" in +*_t) zzz="$gidtype" ;; +*) zzz="gid" ;; +esac +echo "Checking the sign of $zzz..." >&4 +cat > try.c < +#include +int main() { + $gidtype foo = -1; + if (foo < 0) + printf("-1\n"); + else + printf("1\n"); +} +EOCP +set try +if eval $compile; then + yyy=`./try` + case "$yyy" in + '') gidsign=1 + echo "(I can't execute the test program--guessing unsigned.)" >&4 + ;; + *) gidsign=$yyy + case "$gidsign" in + 1) echo "Your $zzz is unsigned." ;; + -1) echo "Your $zzz is signed." ;; + esac + ;; + esac +else + gidsign=1 + echo "(I can't compile the test program--guessing unsigned.)" >&4 +fi + + + +echo " " +echo "Checking which 64-bit integer type to use..." >&4 + +case "$intsize" in +8) val=int + set quadtype + eval $setvar + val='"unsigned int"' + set uquadtype + eval $setvar + quadcase=1 + ;; +*) case "$longsize" in + 8) val=long + set quadtype + eval $setvar + val='"unsigned long"' + set uquadtype + eval $setvar + quadcase=2 + ;; + *) case "$uselonglong:$d_longlong:$longlongsize" in + define:define:8) + val='"long long"' + set quadtype + eval $setvar + val='"unsigned long long"' + set uquadtype + eval $setvar + quadcase=3 + ;; + *) case "$d_int64t" in + define) + val=int64_t + set quadtype + eval $setvar + val=uint64_t + set uquadtype + eval $setvar + quadcase=4 + ;; + esac + ;; + esac + ;; + esac + ;; +esac + +case "$quadtype" in +'') echo "Alas, no 64-bit integer types in sight." >&4 ;; +*) echo "Using '$quadtype' for 64-bit integers." >&4 ;; +esac + +: check for length of character +echo " " +case "$charsize" in +'') + echo "Checking to see how big your characters are..." >&4 + $cat >try.c <<'EOCP' +#include +int main() +{ + printf("%d\n", sizeof(char)); +} +EOCP + set try + if eval $compile_ok; then + dflt=`./try` + else + dflt='1' + echo "(I can't seem to compile the test program. Guessing...)" + fi + ;; +*) + dflt="$charsize" + ;; +esac +rp="What is the size of a character (in bytes)?" +. ./myread +charsize="$ans" +$rm -f try.c try + + +echo " " +$echo "Choosing the C types to be used for Perl's internal types..." >&4 + +case "$use64bits:$quadtype" in +define:?*) + ivtype="$quadtype" + uvtype="$uquadtype" + ivsize=8 + uvsize=8 + ;; +*) ivtype="long" + uvtype="unsigned long" + ivsize=$longsize + uvsize=$longsize + ;; +esac + +case "$uselongdouble:$d_longdbl" in +define:define) + nvtype="long double" + nvsize=$longdblsize + ;; +*) nvtype=double + nvsize=$doublesize + ;; +esac + +echo "(IV will be "$ivtype", $ivsize bytes)" +echo "(UV will be "$uvtype", $uvsize bytes)" +echo "(NV will be "$nvtype", $nvsize bytes)" + +$cat >try.c < +#endif +#include +int main() { +#ifdef INT8 + int8_t i = INT8_MAX; + uint8_t u = UINT8_MAX; + printf("int8_t\n"); +#endif +#ifdef INT16 + int16_t i = INT16_MAX; + uint16_t i = UINT16_MAX; + printf("int16_t\n"); +#endif +#ifdef INT32 + int32_t i = INT32_MAX; + uint32_t u = UINT32_MAX; + printf("int32_t\n"); +#endif +} +EOCP + +case "$i8type" in +'') case "$charsize" in + 1) i8type=char + u8type="unsigned char" + i8size=$charsize + u8size=$charsize + ;; + esac + ;; +esac +case "$i8type" in +'') set try -DINT8 + if eval $compile; then + case "`./try$exe_ext`" in + int8_t) i8type=int8_t + u8type=uint8_t + i8size=1 + u8size=1 + ;; + esac + fi + ;; +esac +case "$i8type" in +'') if $test $charsize -ge 1; then + i8type=char + u8type="unsigned char" + i8size=$charsize + u8size=$charsize + fi + ;; +esac + +case "$i16type" in +'') case "$shortsize" in + 2) i16type=short + u16type="unsigned short" + i16size=$shortsize + u16size=$shortsize + ;; + esac + ;; +esac +case "$i16type" in +'') set try -DINT16 + if eval $compile; then + case "`./try$exe_ext`" in + int16_t) + i16type=int16_t + u16type=uint16_t + i16size=2 + u16size=2 + ;; + esac + fi + ;; +esac +case "$i16type" in +'') if $test $shortsize -ge 2; then + i16type=short + u16type="unsigned short" + i16size=$shortsize + u16size=$shortsize + fi + ;; +esac + +case "$i32type" in +'') case "$longsize" in + 4) i32type=long + u32type="unsigned long" + i32size=$longsize + u32size=$longsize + ;; + *) case "$intsize" in + 4) i32type=int + u32type="unsigned int" + i32size=$intsize + u32size=$intsize + ;; + esac + ;; + esac + ;; +esac +case "$i32type" in +'') set try -DINT32 + if eval $compile; then + case "`./try$exe_ext`" in + int32_t) + i32type=int32_t + u32type=uint32_t + i32size=4 + u32size=4 + ;; + esac + fi + ;; +esac +case "$i32type" in +'') if $test $intsize -ge 4; then + i32type=int + u32type="unsigned int" + i32size=$intsize + u32size=$intsize + fi + ;; +esac + +case "$i64type" in +'') case "$quadtype" in + '') ;; + *) i64type="$quadtype" + u64type="$uquadtype" + i64size=8 + u64size=8 + ;; + esac + ;; +esac + +$rm -f try.* try + +echo " " + +if $test X"$quadtype" != X; then + +echo "Checking how to print 64-bit integers..." >&4 + +if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then + $cat >try.c <<'EOCP' +#include +#include +int main() { + int q = 12345678901; + printf("%ld\n", q); +} +EOCP + set try + if eval $compile; then + yyy=`./try$exe_ext` + case "$yyy" in + 12345678901) + sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"'; + sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"'; + echo "We will use %d." + ;; + esac + fi +fi + +if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then + $cat >try.c <<'EOCP' +#include +#include +int main() { + long q = 12345678901; + printf("%ld\n", q); +} +EOCP + set try + if eval $compile; then + yyy=`./try$exe_ext` + case "$yyy" in + 12345678901) + sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"'; + sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"'; + echo "We will use %ld." + ;; + esac + fi +fi + +if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then + $cat >try.c <<'EOCP' +#include +#include +#include +int main() { + int64_t q = 12345678901; + printf("%" PRId64 "\n", q); +} +EOCP + set try + if eval $compile; then + yyy=`./try$exe_ext` + case "$yyy" in + 12345678901) + sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64; + sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64; + echo "We will use the C9X style." ;; - *) $cat >&4 <try.c <<'EOCP' +#include +#include +int main() { + long long q = 12345678901LL; /* AIX cc requires the LL prefix. */ + printf("%lld\n", q); +} +EOCP + set try + if eval $compile; then + yyy=`./try$exe_ext` + case "$yyy" in + 12345678901) + sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"'; + sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"'; + echo "We will use the %lld style." ;; esac - ;; - "$define"|true|[yY]*) - fflushall="$define" - ;; - *) - fflushall="$undef" - ;; - esac - ;; -*) fflushall="$undef" + fi +fi + +if $test X"$sPRId64" = X -a X"$quadtype" != X; then + $cat >try.c < +#include +int main() { + $quadtype q = 12345678901; + printf("%Ld\n", q); +} +EOCP + set try + if eval $compile; then + yyy=`./try$exe_ext` + case "$yyy" in + 12345678901) + sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"'; + sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"'; + echo "We will use %Ld." + ;; + esac + fi +fi + +if $test X"$sPRId64" = X -a X"$quadtype" != X; then + $cat >try.c < +#include +int main() { + $quadtype q = 12345678901; + printf("%qd\n", q); +} +EOCP + set try + if eval $compile; then + yyy=`./try$exe_ext` + case "$yyy" in + 12345678901) + sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"'; + sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"'; + echo "We will use %qd." + ;; + esac + fi +fi + +if $test X"$sPRId64" = X; then + echo "Cannot figure out how to print 64-bit integers." >&4 +fi + +$rm -f try try.* + +fi + +case "$sPRId64" in +'') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef"; + d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef"; ;; -esac -case "$fflushNULL$fflushall" in -undefundef) - $cat <&4 + +if $test X"$ivsize" = X8; then + ivdformat="$sPRId64" + uvuformat="$sPRIu64" + uvoformat="$sPRIo64" + uvxformat="$sPRIx64" +else + if $test X"$ivsize" = X"$longsize"; then + ivdformat='"ld"' + uvuformat='"lu"' + uvoformat='"lo"' + uvxformat='"lx"' + else + if $test X"$ivsize" = X"$intsize"; then + ivdformat='"d"' + uvuformat='"u"' + uvoformat='"o"' + uvxformat='"x"' + else + : far out + if $test X"$ivsize" = X"$shortsize"; then + ivdformat='"hd"' + uvuformat='"hu"' + uvoformat='"ho"' + uvxformat='"hx"' + fi + fi + fi +fi + +case "$ivdformat" in +'') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4 + exit 1 + ;; esac -: Store the full pathname to the sed program for use in the C program -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 -xxx) - xxx=`./findhdr sys/user.h` - set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short - case $1 in - unsigned) dflt="$1 $2" ;; - *) dflt="$1" ;; - esac +$echo "Checking the format string to be used for gids..." >&4 + +case "$gidsign" in +-1) if $test X"$gidsize" = X"$ivsize"; then + gidformat="$ivdformat" + else + if $test X"$gidsize" = X"$longsize"; then + gidformat='"ld"' + else + if $test X"$gidsize" = X"$intsize"; then + gidformat='"d"' + else + if $test X"$gidsize" = X"$shortsize"; then + gidformat='"hd"' + fi + fi + fi + fi ;; -*) dflt="$gidtype";; -esac -case "$gidtype" in -gid_t) echo "gid_t found." ;; -*) rp="What is the type for group ids returned by getgid()?" - . ./myread - gidtype="$ans" +*) if $test X"$gidsize" = X"$uvsize"; then + gidformat="$uvuformat" + else + if $test X"$gidsize" = X"$longsize"; then + gidformat='"lu"' + else + if $test X"$gidsize" = X"$intsize"; then + gidformat='"u"' + else + if $test X"$gidsize" = X"$shortsize"; then + gidformat='"hu"' + fi + fi + fi + fi ;; esac @@ -11684,35 +12266,6 @@ EOM *) groupstype="$gidtype";; esac -: see what type lseek is declared as in the kernel -rp="What is the type used for lseek's offset on this system?" -set off_t lseektype long stdio.h sys/types.h -eval $typedef_ask - -echo " " -$echo $n "Checking to see how big your file offsets are...$c" >&4 -$cat >try.c < -#include -int main() -{ - printf("%d\n", sizeof($lseektype)); -} -EOCP -set try -if eval $compile_ok; then - lseeksize=`./try` - $echo " $lseeksize bytes." >&4 -else - dflt='4' - echo " " - echo "(I can't seem to compile the test program. Guessing...)" - rp="What is the size of your file offsets (in bytes)?" - . ./myread - lseeksize="$ans" -fi -$rm -f try.c try - echo " " echo "Checking if your $make program sets \$(MAKE)..." >&4 case "$make_set_make" in @@ -12524,6 +13077,35 @@ case "$uidtype" in *_t) zzz="$uidtype" ;; *) zzz="uid" ;; esac +echo "Checking the size of $zzz..." >&4 +cat > try.c < +#include +int main() { + printf("%d\n", sizeof($uidtype)); +} +EOCP +set try +if eval $compile_ok; then + yyy=`./try` + case "$yyy" in + '') uidsize=4 + echo "(I can't execute the test program--guessing $uidsize.)" >&4 + ;; + *) uidsize=$yyy + echo "Your $zzz size is $uidsize bytes." + ;; + esac +else + uidsize=4 + echo "(I can't compile the test program--guessing $uidsize.)" >&4 +fi + +echo " " +case "$uidtype" in +*_t) zzz="$uidtype" ;; +*) zzz="uid" ;; +esac echo "Checking the sign of $zzz..." >&4 cat > try.c < @@ -12536,6 +13118,7 @@ int main() { printf("1\n"); } EOCP +set try if eval $compile; then yyy=`./try` case "$yyy" in @@ -12555,6 +13138,45 @@ else fi + +echo " " +$echo "Checking the format string to be used for uids..." >&4 + +case "$uidsign" in +-1) if $test X"$uidsize" = X"$ivsize"; then + uidformat="$ivdformat" + else + if $test X"$uidsize" = X"$longsize"; then + uidformat='"ld"' + else + if $test X"$uidsize" = X"$intsize"; then + uidformat='"d"' + else + if $test X"$uidsize" = X"$shortsize"; then + uidformat='"hd"' + fi + fi + fi + fi + ;; +*) if $test X"$uidsize" = X"$uvsize"; then + uidformat="$uvuformat" + else + if $test X"$uidsize" = X"$longsize"; then + uidformat='"lu"' + else + if $test X"$uidsize" = X"$intsize"; then + uidformat='"u"' + else + if $test X"$uidsize" = X"$shortsize"; then + uidformat='"hu"' + fi + fi + fi + fi + ;; +esac + : see if dbm.h is available : see if dbmclose exists set dbmclose d_dbmclose @@ -13046,6 +13668,10 @@ eval $inhdr set sys/statvfs.h i_sysstatvfs eval $inhdr +: see if this is a sys/uio.h system +set sys/uio.h i_sysuio +eval $inhdr + : see if this is a sys/un.h system set sys/un.h i_sysun eval $inhdr @@ -13054,6 +13680,10 @@ eval $inhdr set sys/wait.h i_syswait eval $inhdr +: see if this is a ustat.h system +set ustat.h i_ustat +eval $inhdr + : see if this is an utime system set utime.h i_utime eval $inhdr @@ -13437,6 +14067,7 @@ ccsymbols='$ccsymbols' cf_by='$cf_by' cf_email='$cf_email' cf_time='$cf_time' +charsize='$charsize' chgrp='$chgrp' chmod='$chmod' chown='$chown' @@ -13492,7 +14123,6 @@ d_chown='$d_chown' d_chroot='$d_chroot' d_chsize='$d_chsize' d_closedir='$d_closedir' -d_cmsghdr_s='$d_cmsghdr_s' d_const='$d_const' d_crypt='$d_crypt' d_csh='$d_csh' @@ -13528,6 +14158,7 @@ d_flock='$d_flock' d_fork='$d_fork' d_fpathconf='$d_fpathconf' d_fpos64_t='$d_fpos64_t' +d_fs_data_s='$d_fs_data_s' d_fseeko='$d_fseeko' d_fsetpos='$d_fsetpos' d_fstatfs='$d_fstatfs' @@ -13542,6 +14173,7 @@ d_gethent='$d_gethent' d_gethname='$d_gethname' d_gethostprotos='$d_gethostprotos' d_getlogin='$d_getlogin' +d_getmnt='$d_getmnt' d_getmntent='$d_getmntent' d_getnbyaddr='$d_getnbyaddr' d_getnbyname='$d_getnbyname' @@ -13571,19 +14203,16 @@ d_htonl='$d_htonl' d_index='$d_index' d_inetaton='$d_inetaton' d_int64t='$d_int64t' -d_iovec_s='$d_iovec_s' d_isascii='$d_isascii' d_killpg='$d_killpg' d_lchown='$d_lchown' d_ldbl_dig='$d_ldbl_dig' d_link='$d_link' -d_llseek='$d_llseek' d_locconv='$d_locconv' d_lockf='$d_lockf' d_longdbl='$d_longdbl' d_longlong='$d_longlong' d_lstat='$d_lstat' -d_madvise='$d_madvise' d_mblen='$d_mblen' d_mbstowcs='$d_mbstowcs' d_mbtowc='$d_mbtowc' @@ -13595,8 +14224,6 @@ d_memset='$d_memset' d_mkdir='$d_mkdir' d_mkfifo='$d_mkfifo' d_mktime='$d_mktime' -d_mmap='$d_mmap' -d_mprotect='$d_mprotect' d_msg='$d_msg' d_msg_ctrunc='$d_msg_ctrunc' d_msg_dontroute='$d_msg_dontroute' @@ -13605,11 +14232,8 @@ d_msg_peek='$d_msg_peek' d_msg_proxy='$d_msg_proxy' d_msgctl='$d_msgctl' d_msgget='$d_msgget' -d_msghdr_s='$d_msghdr_s' d_msgrcv='$d_msgrcv' d_msgsnd='$d_msgsnd' -d_msync='$d_msync' -d_munmap='$d_munmap' d_mymalloc='$d_mymalloc' d_nice='$d_nice' d_off64_t='$d_off64_t' @@ -13634,8 +14258,6 @@ d_pwpasswd='$d_pwpasswd' d_pwquota='$d_pwquota' d_readdir='$d_readdir' d_readlink='$d_readlink' -d_readv='$d_readv' -d_recvmsg='$d_recvmsg' d_rename='$d_rename' d_rewinddir='$d_rewinddir' d_rmdir='$d_rmdir' @@ -13652,7 +14274,6 @@ d_semctl_semid_ds='$d_semctl_semid_ds' d_semctl_semun='$d_semctl_semun' d_semget='$d_semget' d_semop='$d_semop' -d_sendmsg='$d_sendmsg' d_setegid='$d_setegid' d_seteuid='$d_seteuid' d_setgrent='$d_setgrent' @@ -13688,9 +14309,10 @@ d_sigaction='$d_sigaction' d_sigsetjmp='$d_sigsetjmp' d_socket='$d_socket' d_sockpair='$d_sockpair' +d_sqrtl='$d_sqrtl' d_statblks='$d_statblks' -d_statfs='$d_statfs' -d_statfsflags='$d_statfsflags' +d_statfs_f_flags='$d_statfs_f_flags' +d_statfs_s='$d_statfs_s' d_statvfs='$d_statvfs' d_stdio_cnt_lval='$d_stdio_cnt_lval' d_stdio_ptr_lval='$d_stdio_ptr_lval' @@ -13725,6 +14347,8 @@ d_tzname='$d_tzname' d_umask='$d_umask' d_uname='$d_uname' d_union_semun='$d_union_semun' +d_ustat='$d_ustat' +d_vendorbin='$d_vendorbin' d_vendorlib='$d_vendorlib' d_vfork='$d_vfork' d_void_closedir='$d_void_closedir' @@ -13736,7 +14360,6 @@ d_wait4='$d_wait4' d_waitpid='$d_waitpid' d_wcstombs='$d_wcstombs' d_wctomb='$d_wctomb' -d_writev='$d_writev' d_xenix='$d_xenix' date='$date' db_hashtype='$db_hashtype' @@ -13762,12 +14385,16 @@ fflushall='$fflushall' find='$find' firstmakefile='$firstmakefile' flex='$flex' +fpossize='$fpossize' fpostype='$fpostype' freetype='$freetype' full_ar='$full_ar' full_csh='$full_csh' full_sed='$full_sed' gccversion='$gccversion' +gidformat='$gidformat' +gidsign='$gidsign' +gidsize='$gidsize' gidtype='$gidtype' glibpth='$glibpth' grep='$grep' @@ -13779,6 +14406,14 @@ h_sysfile='$h_sysfile' hint='$hint' hostcat='$hostcat' huge='$huge' +i16size='$i16size' +i16type='$i16type' +i32size='$i32size' +i32type='$i32type' +i64size='$i64size' +i64type='$i64type' +i8size='$i8size' +i8type='$i8type' i_arpainet='$i_arpainet' i_bsdioctl='$i_bsdioctl' i_db='$i_db' @@ -13821,7 +14456,6 @@ i_sysfile='$i_sysfile' i_sysfilio='$i_sysfilio' i_sysin='$i_sysin' i_sysioctl='$i_sysioctl' -i_sysmman='$i_sysmman' i_sysmount='$i_sysmount' i_sysndir='$i_sysndir' i_sysparam='$i_sysparam' @@ -13830,6 +14464,7 @@ i_syssecrt='$i_syssecrt' i_sysselct='$i_sysselct' i_syssockio='$i_syssockio' i_sysstat='$i_sysstat' +i_sysstatfs='$i_sysstatfs' i_sysstatvfs='$i_sysstatvfs' i_systime='$i_systime' i_systimek='$i_systimek' @@ -13837,11 +14472,13 @@ i_systimes='$i_systimes' i_systypes='$i_systypes' i_sysuio='$i_sysuio' i_sysun='$i_sysun' +i_sysvfs='$i_sysvfs' i_syswait='$i_syswait' i_termio='$i_termio' i_termios='$i_termios' i_time='$i_time' i_unistd='$i_unistd' +i_ustat='$i_ustat' i_utime='$i_utime' i_values='$i_values' i_varargs='$i_varargs' @@ -13859,11 +14496,16 @@ installprefixexp='$installprefixexp' installprivlib='$installprivlib' installscript='$installscript' installsitearch='$installsitearch' +installsitebin='$installsitebin' installsitelib='$installsitelib' installstyle='$installstyle' installusrbinperl='$installusrbinperl' +installvendorbin='$installvendorbin' installvendorlib='$installvendorlib' intsize='$intsize' +ivdformat='$ivdformat' +ivsize='$ivsize' +ivtype='$ivtype' known_extensions='$known_extensions' ksh='$ksh' large='$large' @@ -13907,10 +14549,8 @@ man3dir='$man3dir' man3direxp='$man3direxp' man3ext='$man3ext' medium='$medium' -mips='$mips' mips_type='$mips_type' mkdir='$mkdir' -mmaptype='$mmaptype' models='$models' modetype='$modetype' more='$more' @@ -13930,6 +14570,8 @@ nm_opt='$nm_opt' nm_so_opt='$nm_so_opt' nonxs_ext='$nonxs_ext' nroff='$nroff' +nvsize='$nvsize' +nvtype='$nvtype' o_nonblock='$o_nonblock' obj_ext='$obj_ext' old_pthread_create_joinable='$old_pthread_create_joinable' @@ -13958,6 +14600,8 @@ privlib='$privlib' privlibexp='$privlibexp' prototype='$prototype' ptrsize='$ptrsize' +quadcase='$quadcase' +quadtype='$quadtype' randbits='$randbits' randfunc='$randfunc' randseedtype='$randseedtype' @@ -14001,6 +14645,8 @@ sig_num_init='$sig_num_init' signal_t='$signal_t' sitearch='$sitearch' sitearchexp='$sitearchexp' +sitebin='$sitebin' +sitebinexp='$sitebinexp' sitelib='$sitelib' sitelibexp='$sitelibexp' siteprefix='$siteprefix' @@ -14043,14 +14689,26 @@ touch='$touch' tr='$tr' trnl='$trnl' troff='$troff' +u16size='$u16size' +u16type='$u16type' +u32size='$u32size' +u32type='$u32type' +u64size='$u64size' +u64type='$u64type' +u8size='$u8size' +u8type='$u8type' +uidformat='$uidformat' uidsign='$uidsign' +uidsize='$uidsize' uidtype='$uidtype' uname='$uname' uniq='$uniq' +uquadtype='$uquadtype' use64bits='$use64bits' usedl='$usedl' uselargefiles='$uselargefiles' uselongdouble='$uselongdouble' +uselonglong='$uselonglong' usemorebits='$usemorebits' usemultiplicity='$usemultiplicity' usemymalloc='$usemymalloc' @@ -14066,6 +14724,13 @@ usevendorprefix='$usevendorprefix' usevfork='$usevfork' usrinc='$usrinc' uuname='$uuname' +uvoformat='$uvoformat' +uvsize='$uvsize' +uvtype='$uvtype' +uvuformat='$uvuformat' +uvxformat='$uvxformat' +vendorbin='$vendorbin' +vendorbinexp='$vendorbinexp' vendorlib='$vendorlib' vendorlibexp='$vendorlibexp' vendorprefix='$vendorprefix'