# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Fri Mar 3 16:54:03 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
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=''
set use64bitint
eval $setvar
+case "$use64bitall" in
+"$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
If this doesn't make any sense to you, just accept the default '$dflt'.
EOM
rp='Try to use maximal 64-bit support, if available?'
-case "$use64bitall" in
-"$define"|true|[yY]*) dflt='y' ;;
-*) case "$longsize" in
- 8) dflt='y' ;;
- *) dflt='n' ;;
- esac
- ;;
-esac
. ./myread
case "$ans" in
[yY]*) val="$define" ;;
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
#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 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
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'
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'