# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Sat Feb 26 05:10:12 EET 2000 [metaconfig 3.0 PL70]
+# Generated on Sat Mar 11 20:26:09 EET 2000 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
longlongsize=''
d_lseekproto=''
d_lstat=''
+d_madvise=''
d_mblen=''
d_mbstowcs=''
d_mbtowc=''
d_pthread_yield=''
d_sched_yield=''
sched_yield=''
+d_qgcvt=''
d_readdir=''
d_rewinddir=''
d_seekdir=''
d_grpasswd=''
i_grp=''
i_iconv=''
+i_ieeefp=''
i_inttypes=''
i_limits=''
i_locale=''
i_stdlib=''
i_string=''
strings=''
+i_sunmath=''
i_sysaccess=''
i_sysdir=''
i_sysfile=''
sitebinexp=''
installsitelib=''
sitelib=''
+sitelib_stem=''
sitelibexp=''
siteprefix=''
siteprefixexp=''
incpath=''
mips_type=''
usrinc=''
+d_vendorarch=''
+installvendorarch=''
+vendorarch=''
+vendorarchexp=''
d_vendorbin=''
installvendorbin=''
vendorbin=''
d_vendorlib=''
installvendorlib=''
vendorlib=''
+vendorlib_stem=''
vendorlibexp=''
usevendorprefix=''
vendorprefix=''
: List of libraries we want.
: If anyone needs -lnet, put it in a hint file.
-libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
+libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
libswanted="$libswanted dld ld sun m c cposix posix"
libswanted="$libswanted ndir dir crypt sec"
-libswanted="$libswanted ucb bsd BSD PW x"
+libswanted="$libswanted ucb bsd BSD PW x iconv"
: We probably want to search /usr/shlib before most other libraries.
: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
'') libswanted='c_s';;
esac
case "$usesocks" in
-$define)
- libswanted="$libswanted socks5 socks5_sh"
- ;;
+"$define") libswanted="$libswanted socks5 socks5_sh" ;;
esac
libsfound=''
libsfiles=''
xxx=$thisdir/lib${thislib}_s$_a
$test -f "$xxx" && eval $libscheck
$test -f "$xxx" && libstyle=static
+ $test -f "$xxx" && thislib=${thislib}_s
fi
if test ! -f "$xxx"; then
xxx=$thisdir/Slib$thislib$_a
cat <<EOM >&4
*** Configure -Duselfs is deprecated, using -Duselargefiles instead.
-
EOM
uselargefiles="$define"
;;
: Look for a hint-file generated 'call-back-unit'. If the
: user has specified that a large files perl is to be built,
: we may need to set or change some other defaults.
- if $test -f uselfs.cbu; then
+ if $test -f uselargefiles.cbu; then
echo "Your platform has some specific hints for large file builds, using them..."
- . ./uselfs.cbu
+ . ./uselargefiles.cbu
echo " "
echo "Rechecking to see how big your file offsets are..." >&4
$cat >try.c <<EOCP
esac
-# Backward compatibility (uselonglong is deprecated).
case "$uselonglong" in
"$define"|true|[yY]*)
cat <<EOM >&4
*** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
-
EOM
use64bitint="$define"
;;
esac
-# Backward compatibility (use64bits is deprecated).
case "$use64bits" in
"$define"|true|[yY]*)
cat <<EOM >&4
*** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
-
EOM
use64bitint="$define"
;;
esac
-# Thinko compatibility
case "$use64bitints" in
"$define"|true|[yY]*)
cat <<EOM >&4
*** There is no Configure -Duse64bitints, using -Duse64bitint instead.
+EOM
+ use64bitint="$define"
+ ;;
+esac
+case "$use64bitsint" in
+"$define"|true|[yY]*)
+ cat <<EOM >&4
+*** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
EOM
use64bitint="$define"
;;
esac
+case "$uselonglongs" in
+"$define"|true|[yY]*)
+ cat <<EOM >&4
+
+*** There is no Configure -Duselonglongs, using -Duse64bitint instead.
+EOM
+ use64bitint="$define"
+ ;;
+esac
+case "$use64bitsall" in
+"$define"|true|[yY]*)
+ cat <<EOM >&4
+
+*** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
+EOM
+ use64bitall="$define"
+ ;;
+esac
case "$ccflags" in
*-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
eval $setvar
case "$use64bitall" in
-"$define"|true|[yY]*) val="$define" ;;
-*) case "$use64bitint" in
- "$define") case "$longsize" in
- 4) dflt='n'
- cat <<EOM
-
-Since you chose 64-bitness you may want to try maximal 64-bitness.
-What you have chosen is minimal 64-bitness which means just enough
-to get 64-bit integers. The maximal means using as much 64-bitness
-as is possible on the platform. This in turn means even more binary
-incompatibilities. On the other hand, your platform may not have
-any more maximal 64-bitness than what you already have chosen.
+"$define"|true|[yY]*) dflt='y' ;;
+*) case "$longsize" in
+ 8) dflt='y' ;;
+ *) dflt='n' ;;
+ esac
+ ;;
+esac
+cat <<EOM
+
+You may also choose to try maximal 64-bitness. It means using as much
+64-bitness as possible on the platform. This in turn means even more
+binary incompatibilities. On the other hand, your platform may not
+have any more 64-bitness available than what you already have chosen.
If this doesn't make any sense to you, just accept the default '$dflt'.
EOM
- rp='Try to use full 64-bit support, if available?'
- . ./myread
- case "$ans" in
- [yY]*) val="$define" ;;
- *) val="$undef" ;;
- esac
- ;;
- 8) val="$define" ;;
- *) val="$undef" ;;
- esac
- ;;
- *) val="$undef" ;;
- esac
- ;;
-esac
+rp='Try to use maximal 64-bit support, if available?'
+. ./myread
+case "$ans" in
+[yY]*) val="$define" ;;
+*) val="$undef" ;;
+esac
set use64bitall
eval $setvar
+case "$use64bitall" in
+"$define")
+ case "$use64bitint" in
+ "$undef")
+ cat <<EOM
+
+Since you have chosen a maximally 64-bit build, I'm also turning on
+the use of 64-bit integers.
+EOM
+ use64bitint="$define" ;;
+ esac
+ ;;
+esac
case "$use64bitint" in
"$define"|true|[yY]*)
: user has specified that a 64-bit perl is to be built,
: we may need to set or change some other defaults.
if $test -f use64bitint.cbu; then
- echo "Your platform has some specific hints for 64-bit builds, using them..."
+ echo "Your platform has some specific hints for 64-bit integers, using them..."
. ./use64bitint.cbu
fi
case "$longsize" in
- 4) case "$ccflags" in
- *-DUSE_64_BIT_INT*) ;;
- *) ccflags="$ccflags -DUSE_64_BIT_INT";;
- esac
- case "$archname64" in
+ 4) case "$archname64" in
'') archname64=64int ;;
esac
;;
case "$use64bitall" in
"$define"|true|[yY]*)
: Look for a hint-file generated 'call-back-unit'. If the
-: user has specified that a full 64-bit perl is to be built,
+: user has specified that a maximally 64-bit perl is to be built,
: we may need to set or change some other defaults.
if $test -f use64bitall.cbu; then
- echo "Your platform has some specific hints for full 64-bit builds, using them..."
+ echo "Your platform has some specific hints for 64-bit builds, using them..."
. ./use64bitall.cbu
fi
case "$longsize" in
- 4) case "$ccflags" in
- *-DUSE_64_BIT_ALL*) ;;
- *) ccflags="$ccflags -DUSE_64_BIT_ALL";;
- esac
- case "$archname64" in
- ''|64) archname64=64all ;;
+ 4) case "$archname64" in
+ ''|64int) archname64=64all ;;
esac
;;
esac
*) dflt='lib/perl5' ;;
esac
;;
-*) dflt='lib/perl5' ;;
+*) dflt="$installstyle" ;;
esac
: Probably not worth prompting for this since we prompt for all
: the directories individually, and the prompt would be too long and
vendorlibexp="$ansexp"
;;
esac
+vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
: Change installation prefix, if necessary.
if $test X"$prefix" != X"$installprefix"; then
installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
installvendorlib="$vendorlibexp"
fi
+case "$vendorprefix" in
+'') d_vendorarch="$undef"
+ vendorarch=''
+ vendorarchexp=''
+ ;;
+*) d_vendorarch="$define"
+ : determine where vendor-supplied architecture-dependent libraries go.
+ : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
+ : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
+ : vendorlib may have an optional trailing /share.
+ case "$vendorarch" in
+ '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
+ dflt="$dflt/$archname"
+ ;;
+ *) dflt="$vendorarch" ;;
+ esac
+ fn=d~+
+ rp='Pathname for vendor-supplied architecture-dependent files?'
+ . ./getfile
+ vendorarch="$ans"
+ vendorarchexp="$ansexp"
+ ;;
+esac
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+ installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
+else
+ installvendorarch="$vendorarchexp"
+fi
+
: Cruising for prototypes
echo " "
echo "Checking out function prototypes..." >&4
. ./getfile
sitelib="$ans"
sitelibexp="$ansexp"
+sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
: Change installation prefix, if necessary.
if $test X"$prefix" != X"$installprefix"; then
installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
echo " "
if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
$cat <<EOM
-Many scripts expect to perl to be installed as /usr/bin/perl.
+Many scripts expect perl to be installed as /usr/bin/perl.
I can install the perl you are about to compile also as /usr/bin/perl
(in addition to $installbin/perl).
EOM
case "$lddlflags" in
'') case "$osname" in
beos) dflt='-nostart' ;;
- hpux) dflt='-b +vnocompatwarnings' ;;
+ hpux) dflt='-b';
+ case "$gccversion" in
+ '') dflt="$dflt +vnocompatwarnings" ;;
+ esac
+ ;;
linux|irix*) dflt='-shared' ;;
next) dflt='none' ;;
solaris) dflt='-G' ;;
$define:$undef)
$cat <<EOM >&4
-You requested the use of long doubles but you do not seem to have
-the mathematic functions for long doubles. I'm disabling the use
-of long doubles.
+*** You requested the use of long doubles but you do not seem to have
+*** the mathematic functions for long doubles. I'm disabling the use
+*** of long doubles.
+
EOM
uselongdouble=$undef
;;
installvendorbin="$vendorbinexp"
fi
+: see if qgcvt exists
+set qgcvt d_qgcvt
+eval $inlibc
+
: check for length of double
echo " "
case "$doublesize" in
esac
$rm -f try.* try
-: Check how to convert floats to strings.
-if test "X$d_Gconvert" = X; then
- echo " "
- echo "Checking for an efficient way to convert floats to strings."
- $cat >try.c <<EOP
-#ifdef TRY_gconvert
-#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
-char *myname = "gconvert";
-#endif
-#ifdef TRY_gcvt
-#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
-char *myname = "gcvt";
-#endif
-#ifdef TRY_qgcvt
-#define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
-char *myname = "qgcvt";
-#define DOUBLETYPE long double
-#endif
-#ifdef TRY_sprintf
-#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
-char *myname = "sprintf";
-#endif
-
-#ifndef DOUBLETYPE
-#define DOUBLETYPE double
-#endif
-
-#include <stdio.h>
-
-#define I_STDLIB $i_stdlib
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-
-int
-checkit(expect, got)
-char *expect;
-char *got;
-{
- if (strcmp(expect, got)) {
- printf("%s oddity: Expected %s, got %s\n",
- myname, expect, got);
- exit(1);
- }
-}
-
-int main()
-{
- char buf[64];
- buf[63] = '\0';
-
- /* This must be 1st test on (which?) platform */
- /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
- Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
- checkit("0.1", buf);
-
- Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
- checkit("1", buf);
-
- Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
- checkit("0", buf);
-
- Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
- checkit("-1", buf);
-
- /* Some Linux gcvt's give 1.e+5 here. */
- Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
- checkit("100000", buf);
-
- /* Some Linux gcvt's give -1.e+5 here. */
- Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
- checkit("-100000", buf);
-
- exit(0);
-}
-EOP
- case "$d_Gconvert" in
- gconvert*) xxx_list='gconvert gcvt sprintf' ;;
- gcvt*) xxx_list='gcvt gconvert sprintf' ;;
- sprintf*) xxx_list='sprintf gconvert gcvt' ;;
- *) xxx_list='gconvert gcvt sprintf' ;;
- esac
-
- case "$d_longdbl$uselongdouble" in
- definedefine) xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
- esac
-
- for xxx_convert in $xxx_list; do
- echo "Trying $xxx_convert..."
- $rm -f try try$_o
- set try -DTRY_$xxx_convert
- if eval $compile; then
- echo "$xxx_convert() found." >&4
- if ./try; then
- echo "I'll use $xxx_convert to convert floats into a string." >&4
- break;
- else
- echo "...But $xxx_convert didn't work as I expected."
- fi
- else
- echo "$xxx_convert NOT found." >&4
- fi
- done
-
- case "$xxx_convert" in
- gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
- gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
- qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
- *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
- esac
-fi
-
echo " "
if $test X"$d_longdbl" = X"$define"; then
;;
esac
+: Check how to convert floats to strings.
+if test "X$d_Gconvert" = X; then
+ echo " "
+ echo "Checking for an efficient way to convert floats to strings."
+ echo " " > try.c
+ case "$uselongdouble" in
+ "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
+ esac
+ case "$d_longdbl" in
+ "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
+ esac
+ case "$d_PRIgldbl" in
+ "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
+ esac
+ $cat >>try.c <<EOP
+#ifdef TRY_gconvert
+#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
+char *myname = "gconvert";
+#endif
+#ifdef TRY_gcvt
+#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
+char *myname = "gcvt";
+#endif
+#ifdef TRY_qgcvt
+#define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
+char *myname = "qgcvt";
+#define DOUBLETYPE long double
+#endif
+#ifdef TRY_sprintf
+#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
+#define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
+#else
+#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
+#endif
+char *myname = "sprintf";
+#endif
+
+#ifndef DOUBLETYPE
+#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
+#define DOUBLETYPE long double
+#else
+#define DOUBLETYPE double
+#endif
+#endif
+
+#include <stdio.h>
+
+#define I_STDLIB $i_stdlib
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+
+int
+checkit(expect, got)
+char *expect;
+char *got;
+{
+ if (strcmp(expect, got)) {
+ printf("%s oddity: Expected %s, got %s\n",
+ myname, expect, got);
+ exit(1);
+ }
+}
+
+int main()
+{
+ char buf[64];
+ buf[63] = '\0';
+
+ /* This must be 1st test on (which?) platform */
+ /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
+ Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
+ checkit("0.1", buf);
+
+ Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
+ checkit("1", buf);
+
+ Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
+ checkit("1.1", buf);
+
+ Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
+ checkit("1.01", buf);
+
+ Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
+ checkit("1.001", buf);
+
+ Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
+ checkit("1.0001", buf);
+
+ Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
+ checkit("1.00001", buf);
+
+ Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
+ checkit("1.000001", buf);
+
+ Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
+ checkit("0", buf);
+
+ Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
+ checkit("-1", buf);
+
+ /* Some Linux gcvt's give 1.e+5 here. */
+ Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
+ checkit("100000", buf);
+
+ /* Some Linux gcvt's give -1.e+5 here. */
+ Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
+ checkit("-100000", buf);
+
+ exit(0);
+}
+EOP
+ case "$d_Gconvert" in
+ gconvert*) xxx_list='gconvert gcvt sprintf' ;;
+ gcvt*) xxx_list='gcvt gconvert sprintf' ;;
+ sprintf*) xxx_list='sprintf gconvert gcvt' ;;
+ *) xxx_list='gconvert gcvt sprintf' ;;
+ esac
+
+ case "$d_longdbl$uselongdouble$d_qgcvt" in
+ "$define$define$define") xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
+ esac
+
+ for xxx_convert in $xxx_list; do
+ echo "Trying $xxx_convert..."
+ $rm -f try try$_o
+ set try -DTRY_$xxx_convert
+ if eval $compile; then
+ echo "$xxx_convert() found." >&4
+ if ./try; then
+ echo "I'll use $xxx_convert to convert floats into a string." >&4
+ break;
+ else
+ echo "...But $xxx_convert didn't work as I expected."
+ fi
+ else
+ echo "$xxx_convert NOT found." >&4
+ fi
+ done
+
+ case "$xxx_convert" in
+ gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
+ gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
+ qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
+ *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
+ "$define$define$define")
+ d_Gconvert="sprintf((b),\"%.*$sPRIgldbl\",(n),(x))" ;;
+ *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
+ esac
+ ;;
+ esac
+fi
+
: Initialize h_fcntl
h_fcntl=false
#ifdef I_UNISTD
#include <unistd.h>
#endif
-#ifdef $i_string
+#$i_string I_STRING
+#ifdef I_STRING
#include <string.h>
#else
#include <strings.h>
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
set strtoll d_strtoll
eval $inlibc
+case "$d_longlong-$d_strtoll" in
+"$define-$define")
+ $cat <<EOM
+Checking whether your strtoll() works okay...
+EOM
+ $cat >try.c <<'EOCP'
+#include <errno.h>
+#ifdef __hpux
+#define strtoll __strtoll
+#endif
+#include <stdio.h>
+extern long long int strtoll(char *s, char **, int);
+static int bad = 0;
+int check(char *s, long long ell, int een) {
+ long long gll;
+ errno = 0;
+ gll = strtoll(s, 0, 10);
+ if (!((gll == ell) && (errno == een)))
+ bad++;
+}
+int main() {
+ check(" 1", 1LL, 0);
+ check(" 0", 0LL, 0);
+ check("-1", -1LL, 0);
+ check("-9223372036854775808", -9223372036854775808LL, 0);
+ check("-9223372036854775808", -9223372036854775808LL, 0);
+ check(" 9223372036854775807", 9223372036854775807LL, 0);
+ check("-9223372036854775808", -9223372036854775808LL, 0);
+ check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
+ check("-9223372036854775809", -9223372036854775808LL, ERANGE);
+ if (!bad)
+ printf("ok\n");
+}
+EOCP
+ set try
+ if eval $compile; then
+ case "`./try`" in
+ ok) echo "Your strtoll() seems to be working okay." ;;
+ *) cat <<EOM >&4
+Your strtoll() doesn't seem to be working okay.
+EOM
+ d_strtoll="$undef"
+ ;;
+ esac
+ fi
+ ;;
+esac
+
: see if strtoul exists
set strtoul d_strtoul
eval $inlibc
set strtoull d_strtoull
eval $inlibc
+case "$d_longlong-$d_strtoull" in
+"$define-$define")
+ $cat <<EOM
+Checking whether your strtoull() works okay...
+EOM
+ $cat >try.c <<'EOCP'
+#include <errno.h>
+#ifdef __hpux
+#define strtoull __strtoull
+#endif
+#include <stdio.h>
+extern unsigned long long int strtoull(char *s, char **, int);
+static int bad = 0;
+int check(char *s, long long eull, int een) {
+ long long gull;
+ errno = 0;
+ gull = strtoull(s, 0, 10);
+ if (!((gull == eull) && (errno == een)))
+ bad++;
+}
+int main() {
+ check(" 1", 1LL, 0);
+ check(" 0", 0LL, 0);
+ check("18446744073709551615", 18446744073709551615ULL, 0);
+ check("18446744073709551616", 18446744073709551615ULL, ERANGE);
+ if (!bad)
+ printf("ok\n");
+}
+EOCP
+ set try
+ if eval $compile; then
+ case "`./try`" in
+ ok) echo "Your strtoull() seems to be working okay." ;;
+ *) cat <<EOM >&4
+Your strtoull() doesn't seem to be working okay.
+EOM
+ d_strtoull="$undef"
+ ;;
+ esac
+ fi
+ ;;
+esac
+
: see if strtouq exists
set strtouq d_strtouq
eval $inlibc
$rm -f core try.core core.try.*
case "$fflushNULL" in
x) $cat >&4 <<EOM
-Your fflush(NULL) works okay.
+Your fflush(NULL) works okay for output streams.
+Let's see if it clobbers input pipes...
EOM
- fflushNULL="$define"
+# As of mid-March 2000 all versions of Solaris appear to have a stdio
+# bug that improperly flushes the input end of pipes. So we avoid the
+# autoflush on fork/system/exec support for now. :-(
+$cat >tryp.c <<EOCP
+#include <stdio.h>
+int
+main(int argc, char **argv)
+{
+ char buf[1024];
+ int i;
+ char *bp = buf;
+ while (1) {
+ while ((i = getc(stdin)) != -1
+ && (*bp++ = i) != '\n'
+ && bp < &buf[1024])
+ /* DO NOTHING */ ;
+ *bp = '\0';
+ fprintf(stdout, "%s", buf);
+ fflush(NULL);
+ if (i == -1)
+ return 0;
+ bp = buf;
+ }
+}
+EOCP
+ fflushNULL="$define"
+ set tryp
+ if eval $compile; then
+ $rm -f tryp.out
+ $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
+ if cmp tryp.c tryp.out >/dev/null 2>&1; then
+ $cat >&4 <<EOM
+fflush(NULL) seems to behave okay with input streams.
+EOM
+ fflushNULL="$define"
+ else
+ $cat >&4 <<EOM
+Ouch, fflush(NULL) clobbers input pipes! We will not use it.
+EOM
+ fflushNULL="$undef"
+ fi
+ fi
+ $rm -f core tryp.c tryp.core core.tryp.*
;;
'') $cat >&4 <<EOM
Your fflush(NULL) isn't working (contrary to ANSI C).
fflushNULL="$undef"
;;
esac
-: check explicit looping only if NULL did not work
+: check explicit looping only if NULL did not work, and if the pipe
+: bug does not show up on an explicit flush too
case "$fflushNULL" in
"$undef")
- : check for fflush all behaviour
- case "$fflushall" in
- '') set try -DTRY_FFLUSH_ALL $output
- if eval $compile; then
- $cat >&4 <<EOM
-(Now testing the other method--but note that also this may fail.)
+ $cat >tryp.c <<EOCP
+#include <stdio.h>
+int
+main(int argc, char **argv)
+{
+ char buf[1024];
+ int i;
+ char *bp = buf;
+ while (1) {
+ while ((i = getc(stdin)) != -1
+ && (*bp++ = i) != '\n'
+ && bp < &buf[1024])
+ /* DO NOTHING */ ;
+ *bp = '\0';
+ fprintf(stdout, "%s", buf);
+ fflush(stdin);
+ if (i == -1)
+ return 0;
+ bp = buf;
+ }
+}
+EOCP
+ set tryp
+ if eval $compile; then
+ $rm -f tryp.out
+ $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
+ if cmp tryp.c tryp.out >/dev/null 2>&1; then
+ $cat >&4 <<EOM
+Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
EOM
- $rm -f try.out
- ./try$exe_ext 2>/dev/null
- if $test -s try.out -a "X$?" = X42; then
- fflushall="`$cat try.out`"
- fi
- fi
- $rm -f core try.core core.try.*
+ : now check for fflushall behaviour
case "$fflushall" in
- x) $cat >&4 <<EOM
+ '') set try -DTRY_FFLUSH_ALL $output
+ if eval $compile; then
+ $cat >&4 <<EOM
+(Now testing the other method--but note that this also may fail.)
+EOM
+ $rm -f try.out
+ ./try$exe_ext 2>/dev/null
+ if $test -s try.out -a "X$?" = X42; then
+ fflushall="`$cat try.out`"
+ fi
+ fi
+ $rm -f core try.core core.try.*
+ case "$fflushall" in
+ x) $cat >&4 <<EOM
Whew. Flushing explicitly all the stdio streams works.
EOM
- fflushall="$define"
- ;;
- '') $cat >&4 <<EOM
+ fflushall="$define"
+ ;;
+ '') $cat >&4 <<EOM
Sigh. Flushing explicitly all the stdio streams doesn't work.
EOM
- fflushall="$undef"
- ;;
- *) $cat >&4 <<EOM
+ fflushall="$undef"
+ ;;
+ *) $cat >&4 <<EOM
Cannot figure out whether flushing stdio streams explicitly works or not.
I'm assuming it doesn't.
EOM
+ fflushall="$undef"
+ ;;
+ esac
+ ;;
+ "$define"|true|[yY]*)
+ fflushall="$define"
+ ;;
+ *)
fflushall="$undef"
;;
esac
- ;;
- "$define"|true|[yY]*)
- fflushall="$define"
- ;;
- *)
+ else
+ $cat >&4 <<EOM
+All is futile. Even fflush(stdin) clobbers input pipes!
+EOM
fflushall="$undef"
- ;;
- esac
+ fi
+ else
+ fflushall="$undef"
+ fi
+ $rm -f core tryp.c tryp.core core.tryp.*
;;
-*) fflushall="$undef"
+*) fflushall="$undef"
;;
esac
+
case "$fflushNULL$fflushall" in
undefundef)
$cat <<EOM
-I cannot figure out how to flush pending stdio output.
+OK, I give up. I cannot figure out how to flush pending stdio output.
+We won't be flushing handles at all before fork/exec/popen.
EOM
;;
esac
done
: In case none of those worked, prompt the user.
case "$socksizetype" in
- '') rp='What is the type for the last argument to accept()?'
+ '') rp='What is the type for socket address structure sizes?'
dflt='int'
. ./myread
socksizetype=$ans
set iconv.h i_iconv
eval $inhdr
+: see if this is a ieeefp.h system
+set ieeefp.h i_ieeefp
+eval $inhdr
+
: see if locale.h is available
set locale.h i_locale
eval $inhdr
echo '}' >> try.c
EOSH
cat <<EOSH >> Cppsym.try
-cc="$cc"
-optimize="$optimize"
ccflags="$ccflags"
-ldflags="$ldflags"
-libs="$libs"
-exe_ext="$exe_ext"
-$cc $optimize $ccflags $ldflags -o try try.c $libs && ./try$exe_ext
+case "$osname-$gccversion" in
+irix-) ccflags="\$ccflags -woff 1178" ;;
+esac
+$cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext
EOSH
chmod +x Cppsym.try
$eunicefix Cppsym.try
set stddef.h i_stddef
eval $inhdr
+: see if this is a sunmath.h system
+set sunmath.h i_sunmath
+eval $inhdr
+
: see if sys/access.h is available
set sys/access.h i_sysaccess
eval $inhdr
d_longlong='$d_longlong'
d_lseekproto='$d_lseekproto'
d_lstat='$d_lstat'
+d_madvise='$d_madvise'
d_mblen='$d_mblen'
d_mbstowcs='$d_mbstowcs'
d_mbtowc='$d_mbtowc'
d_pwgecos='$d_pwgecos'
d_pwpasswd='$d_pwpasswd'
d_pwquota='$d_pwquota'
+d_qgcvt='$d_qgcvt'
d_quad='$d_quad'
d_readdir='$d_readdir'
d_readlink='$d_readlink'
d_uname='$d_uname'
d_union_semun='$d_union_semun'
d_ustat='$d_ustat'
+d_vendorarch='$d_vendorarch'
d_vendorbin='$d_vendorbin'
d_vendorlib='$d_vendorlib'
d_vfork='$d_vfork'
i_gdbm='$i_gdbm'
i_grp='$i_grp'
i_iconv='$i_iconv'
+i_ieeefp='$i_ieeefp'
i_inttypes='$i_inttypes'
i_limits='$i_limits'
i_locale='$i_locale'
i_stddef='$i_stddef'
i_stdlib='$i_stdlib'
i_string='$i_string'
+i_sunmath='$i_sunmath'
i_sysaccess='$i_sysaccess'
i_sysdir='$i_sysdir'
i_sysfile='$i_sysfile'
installsitelib='$installsitelib'
installstyle='$installstyle'
installusrbinperl='$installusrbinperl'
+installvendorarch='$installvendorarch'
installvendorbin='$installvendorbin'
installvendorlib='$installvendorlib'
intsize='$intsize'
sitebin='$sitebin'
sitebinexp='$sitebinexp'
sitelib='$sitelib'
+sitelib_stem='$sitelib_stem'
sitelibexp='$sitelibexp'
siteprefix='$siteprefix'
siteprefixexp='$siteprefixexp'
uvtype='$uvtype'
uvuformat='$uvuformat'
uvxformat='$uvxformat'
+vendorarch='$vendorarch'
+vendorarchexp='$vendorarchexp'
vendorbin='$vendorbin'
vendorbinexp='$vendorbinexp'
vendorlib='$vendorlib'
+vendorlib_stem='$vendorlib_stem'
vendorlibexp='$vendorlibexp'
vendorprefix='$vendorprefix'
vendorprefixexp='$vendorprefixexp'