# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Thu Nov 9 15:20:17 EET 2000 [metaconfig 3.0 PL70]
+# Generated on Thu Dec 21 18:12:08 EET 2000 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.org)
-cat >/tmp/c1$$ <<EOF
+cat >c1$$ <<EOF
ARGGGHHHH!!!!!
SCO csh still thinks true is false. Write to SCO today and tell them that next
[End of diatribe. We now return you to your regularly scheduled programming...]
EOF
-cat >/tmp/c2$$ <<EOF
+cat >c2$$ <<EOF
OOPS! You naughty creature! You didn't run Configure with sh!
I will attempt to remedy the situation by running sh for you...
EOF
-true || cat /tmp/c1$$ /tmp/c2$$
+true || cat c1$$ c2$$
true || exec sh $0 $argv:q
-(exit $?0) || cat /tmp/c2$$
+(exit $?0) || cat c2$$
(exit $?0) || exec sh $0 $argv:q
-rm -f /tmp/c1$$ /tmp/c2$$
+rm -f c1$$ c2$$
: compute my invocation name
me=$0
cpprun=''
cppstdin=''
crosscompile=''
+d__fwalk=''
d_access=''
d_accessx=''
d_alarm=''
d_fseeko=''
d_fsetpos=''
d_fstatfs=''
+d_fsync=''
d_ftello=''
d_ftime=''
d_gettimeod=''
d_getnbyname=''
d_getnent=''
d_getnetprotos=''
+d_getpagsz=''
d_getpent=''
d_getpgid=''
d_getpgrp2=''
d_safebcpy=''
d_safemcpy=''
d_sanemcmp=''
+d_sbrkproto=''
d_select=''
d_sem=''
d_semctl=''
d_strtol=''
d_strtold=''
d_strtoll=''
+d_strtoq=''
d_strtoul=''
d_strtoull=''
d_strtouq=''
intsize=''
longsize=''
shortsize=''
+issymlink=''
libc=''
ldlibpthname=''
libperl=''
eagain=''
o_nonblock=''
rd_nodata=''
+need_va_copy=''
netdb_hlen_type=''
netdb_host_type=''
netdb_name_type=''
fi
$rm -f blurfl sym
+: determine whether symbolic links are supported
+echo " "
+case "$lns" in
+*"ln -s")
+ echo "Checking how to test for symbolic links..." >&4
+ $lns blurfl sym
+ if $test "X$issymlink" = X; then
+ if $test -h sym 2>/dev/null; then
+ issymlink=-h
+ fi
+ fi
+ if $test "X$issymlink" = X; then
+ if $test -L sym 2>/dev/null; then
+ issymlink=-L
+ fi
+ fi
+ if $test "X$issymlink" != X; then
+ echo "You can test for symbolic links with $issymlink." >&4
+ else
+ echo "I do not know how you can test for symbolic links." >&4
+ fi
+ $rm -f blurfl sym
+ ;;
+*) echo "No symbolic links, so not testing for their testing..." >&4
+ ;;
+esac
+echo " "
+
+
+case "$mksymlinks" in
+$define|true|[yY]*)
+ case "$src" in
+ ''|'.') echo "Cannot create symlinks in the original directory." >&4
+ exit 1
+ ;;
+ *) case "$lns:$issymlink" in
+ *"ln -s:-"?)
+ echo "Creating the symbolic links..." >&4
+ echo "(First creating the subdirectories...)" >&4
+ cd ..
+ awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
+ read directory
+ test -z "$directory" && break
+ mkdir -p $directory
+ done
+ # Sanity check 1.
+ if test ! -d t/base; then
+ echo "Failed to create the subdirectories. Aborting." >&4
+ exit 1
+ fi
+ echo "(Then creating the symlinks...)" >&4
+ awk '{print $1}' $src/MANIFEST | while true; do
+ read filename
+ test -z "$filename" && break
+ if test -f $filename; then
+ if test $issymlink $filename; then
+ rm -f $filename
+ fi
+ fi
+ if test -f $filename; then
+ echo "$filename already exists, not symlinking."
+ else
+ ln -s $src/$filename $filename
+ fi
+ done
+ # Sanity check 2.
+ if test ! -f t/base/commonsense.t; then
+ echo "Failed to create the symlinks. Aborting." >&4
+ exit 1
+ fi
+ cd UU
+ ;;
+ *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+esac
+
: see whether [:lower:] and [:upper:] are supported character classes
echo " "
case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
cat <<EOM
Perl can be built to use the SOCKS proxy protocol library. To do so,
-Configure must be run with -Dusesocks.
+Configure must be run with -Dusesocks. If you use SOCKS you also need
+to use the PerlIO abstraction layer, this will be implicitly selected.
If this doesn't make any sense to you, just accept the default '$dflt'.
EOM
set usesocks
eval $setvar
+case "$usesocks" in
+$define|true|[yY]*) useperlio="$define";;
+esac
+
: Looking for optional libraries
echo " "
echo "Checking for optional libraries..." >&4
esac
cat <<EOM
-Previous version of $package used the standard IO mechanisms as defined
-in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
-mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
-the default. This abstraction layer can use AT&T's sfio (if you already
-have sfio installed) or regular stdio. Using PerlIO with sfio may cause
-problems with some extension modules. Using PerlIO with stdio is safe,
-but it is slower than plain stdio and therefore is not the default.
+Previous version of $package used the standard IO mechanisms as
+defined in <stdio.h>. Versions 5.003_02 and later of perl allow
+alternate IO mechanisms via the PerlIO abstraction layer, but the
+stdio mechanism is still the default. This abstraction layer can
+use AT&T's sfio (if you already have sfio installed) or regular stdio.
+Using PerlIO with sfio may cause problems with some extension modules.
If this doesn't make any sense to you, just accept the default '$dflt'.
EOM
val="$define"
;;
*)
- echo "Ok, doing things the stdio way"
+ echo "Ok, doing things the stdio way."
val="$undef"
;;
esac
set useperlio
eval $setvar
+case "$usesocks" in
+$define|true|[yY]*)
+ case "$useperlio" in
+ $define|true|[yY]*) ;;
+ *) cat >&4 <<EOM
+
+You are using the SOCKS proxy protocol library which means that you
+should also use the PerlIO layer. You may be headed for trouble.
+
+EOM
+ ;;
+ esac
+ ;;
+esac
+
+
case "$vendorprefix" in
'') d_vendorbin="$undef"
vendorbin=''
;;
esac
+: see if _fwalk exists
+set fwalk d__fwalk
+eval $inlibc
+
: Initialize h_fcntl
h_fcntl=false
eval $inlibc
+: see if fsync exists
+set fsync d_fsync
+eval $inlibc
+
: see if ftello exists
set ftello d_ftello
eval $inlibc
set d_getnetprotos getnetent $i_netdb netdb.h
eval $hasproto
+: see if getpagesize exists
+set getpagesize d_getpagsz
+eval $inlibc
+
: see if getprotobyname exists
set getprotobyname d_getpbyname
set d_sanemcmp
eval $setvar
+: see if prototype for sbrk is available
+echo " "
+set d_sbrkproto sbrk $i_unistd unistd.h
+eval $hasproto
+
: see if select exists
set select d_select
eval $inlibc
;;
esac
+: see if strtoq exists
+set strtoq d_strtoq
+eval $inlibc
+
: see if strtoul exists
set strtoul d_strtoul
eval $inlibc
+case "$d_strtoul" in
+"$define")
+ $cat <<EOM
+Checking whether your strtoul() works okay...
+EOM
+ $cat >try.c <<'EOCP'
+#include <errno.h>
+#include <stdio.h>
+extern unsigned long int strtoul(char *s, char **, int);
+static int bad = 0;
+void check(char *s, unsigned long eul, int een) {
+ unsigned long gul;
+ errno = 0;
+ gul = strtoul(s, 0, 10);
+ if (!((gul == eul) && (errno == een)))
+ bad++;
+}
+int main() {
+ check(" 1", 1L, 0);
+ check(" 0", 0L, 0);
+EOCP
+ case "$longsize" in
+ 8)
+ $cat >>try.c <<'EOCP'
+ check("18446744073709551615", 18446744073709551615UL, 0);
+ check("18446744073709551616", 18446744073709551615UL, ERANGE);
+#if 0 /* strtoul() for /^-/ strings is undefined. */
+ check("-1", 18446744073709551615UL, 0);
+ check("-18446744073709551614", 2, 0);
+ check("-18446744073709551615", 1, 0);
+ check("-18446744073709551616", 18446744073709551615UL, ERANGE);
+ check("-18446744073709551617", 18446744073709551615UL, ERANGE);
+#endif
+EOCP
+ ;;
+ 4)
+ $cat >>try.c <<'EOCP'
+ check("4294967295", 4294967295UL, 0);
+ check("4294967296", 4294967295UL, ERANGE);
+#if 0 /* strtoul() for /^-/ strings is undefined. */
+ check("-1", 4294967295UL, 0);
+ check("-4294967294", 2, 0);
+ check("-4294967295", 1, 0);
+ check("-4294967296", 4294967295UL, ERANGE);
+ check("-4294967297", 4294967295UL, ERANGE);
+#endif
+EOCP
+ ;;
+ *)
+: Should we write these tests to be more portable by sprintf-ing
+: ~0 and then manipulating that char string as input for strtol?
+ ;;
+ esac
+ $cat >>try.c <<'EOCP'
+ if (!bad)
+ printf("ok\n");
+ return 0;
+}
+EOCP
+ set try
+ if eval $compile; then
+ case "`./try`" in
+ ok) echo "Your strtoul() seems to be working okay." ;;
+ *) cat <<EOM >&4
+Your strtoul() doesn't seem to be working okay.
+EOM
+ d_strtoul="$undef"
+ ;;
+ esac
+ fi
+ ;;
+esac
+
: see if strtoull exists
set strtoull d_strtoull
eval $inlibc
bad++;
}
int main() {
- check(" 1", 1LL, 0);
- check(" 0", 0LL, 0);
- check("18446744073709551615", 18446744073709551615ULL, 0);
- check("18446744073709551616", 18446744073709551615ULL, ERANGE);
+ check(" 1", 1LL, 0);
+ check(" 0", 0LL, 0);
+ check("18446744073709551615", 18446744073709551615ULL, 0);
+ check("18446744073709551616", 18446744073709551615ULL, ERANGE);
+#if 0 /* strtoull() for /^-/ strings is undefined. */
+ check("-1", 18446744073709551615ULL, 0);
+ check("-18446744073709551614", 2LL, 0);
+ check("-18446744073709551615", 1LL, 0);
+ check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
+ check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
+#endif
if (!bad)
printf("ok\n");
}
set strtouq d_strtouq
eval $inlibc
+case "$d_strtouq" in
+"$define")
+ $cat <<EOM
+Checking whether your strtouq() works okay...
+EOM
+ $cat >try.c <<'EOCP'
+#include <errno.h>
+#include <stdio.h>
+extern unsigned long long int strtouq(char *s, char **, int);
+static int bad = 0;
+void check(char *s, unsigned long long eull, int een) {
+ unsigned long long gull;
+ errno = 0;
+ gull = strtouq(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 0 /* strtouq() for /^-/ strings is undefined. */
+ check("-1", 18446744073709551615ULL, 0);
+ check("-18446744073709551614", 2LL, 0);
+ check("-18446744073709551615", 1LL, 0);
+ check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
+ check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
+#endif
+ if (!bad)
+ printf("ok\n");
+ return 0;
+}
+EOCP
+ set try
+ if eval $compile; then
+ case "`./try`" in
+ ok) echo "Your strtouq() seems to be working okay." ;;
+ *) cat <<EOM >&4
+Your strtouq() doesn't seem to be working okay.
+EOM
+ d_strtouq="$undef"
+ ;;
+ esac
+ fi
+ ;;
+esac
+
: see if strxfrm exists
set strxfrm d_strxfrm
eval $inlibc
set mode_t modetype int stdio.h sys/types.h
eval $typedef_ask
+: see if stdarg is available
+echo " "
+if $test `./findhdr stdarg.h`; then
+ echo "<stdarg.h> found." >&4
+ valstd="$define"
+else
+ echo "<stdarg.h> NOT found." >&4
+ valstd="$undef"
+fi
+
+: see if varags is available
+echo " "
+if $test `./findhdr varargs.h`; then
+ echo "<varargs.h> found." >&4
+else
+ echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
+fi
+
+: set up the varargs testing programs
+$cat > varargs.c <<EOP
+#ifdef I_STDARG
+#include <stdarg.h>
+#endif
+#ifdef I_VARARGS
+#include <varargs.h>
+#endif
+
+#ifdef I_STDARG
+int f(char *p, ...)
+#else
+int f(va_alist)
+va_dcl
+#endif
+{
+ va_list ap;
+#ifndef I_STDARG
+ char *p;
+#endif
+#ifdef I_STDARG
+ va_start(ap,p);
+#else
+ va_start(ap);
+ p = va_arg(ap, char *);
+#endif
+ va_end(ap);
+}
+EOP
+$cat > varargs <<EOP
+$startsh
+if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
+ echo "true"
+else
+ echo "false"
+fi
+$rm -f varargs$_o
+EOP
+chmod +x varargs
+
+: now check which varargs header should be included
+echo " "
+i_varhdr=''
+case "$valstd" in
+"$define")
+ if `./varargs I_STDARG`; then
+ val='stdarg.h'
+ elif `./varargs I_VARARGS`; then
+ val='varargs.h'
+ fi
+ ;;
+*)
+ if `./varargs I_VARARGS`; then
+ val='varargs.h'
+ fi
+ ;;
+esac
+case "$val" in
+'')
+echo "I could not find the definition for va_dcl... You have problems..." >&4
+ val="$undef"; set i_stdarg; eval $setvar
+ val="$undef"; set i_varargs; eval $setvar
+ ;;
+*)
+ set i_varhdr
+ eval $setvar
+ case "$i_varhdr" in
+ stdarg.h)
+ val="$define"; set i_stdarg; eval $setvar
+ val="$undef"; set i_varargs; eval $setvar
+ ;;
+ varargs.h)
+ val="$undef"; set i_stdarg; eval $setvar
+ val="$define"; set i_varargs; eval $setvar
+ ;;
+ esac
+ echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
+esac
+$rm -f varargs*
+
+: see if we need va_copy
+echo " "
+case "$i_stdarg" in
+"$define")
+ $cat >try.c <<EOCP
+#include <stdarg.h>
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#include <signal.h>
+
+int
+ivfprintf(FILE *f, const char *fmt, va_list *valp)
+{
+ return vfprintf(f, fmt, *valp);
+}
+
+int
+myvfprintf(FILE *f, const char *fmt, va_list val)
+{
+ return ivfprintf(f, fmt, &val);
+}
+
+int
+myprintf(char *fmt, ...)
+{
+ va_list val;
+ va_start(val, fmt);
+ return myvfprintf(stdout, fmt, val);
+}
+
+int
+main(int ac, char **av)
+{
+ signal(SIGSEGV, exit);
+
+ myprintf("%s%cs all right, then\n", "that", '\'');
+ exit(0);
+}
+EOCP
+ set try
+ if eval $compile && ./try 2>&1 >/dev/null; then
+ case "`./try`" in
+ "that's all right, then")
+ okay=yes
+ ;;
+ esac
+ fi
+ case "$okay" in
+ yes) echo "It seems that you don't need va_copy()." >&4
+ need_va_copy="$undef"
+ ;;
+ *) echo "It seems that va_copy() or similar will be needed." >&4
+ need_va_copy="$define"
+ ;;
+ esac
+ $rm -f try.* core core.* *.core *.core.*
+ ;;
+*) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
+ ;;
+esac
+
: define a fucntion to check prototypes
$cat > protochk <<EOSH
$startsh
set d_socklen_t
eval $setvar
+: see if this is a socks.h system
+set socks.h i_socks
+eval $inhdr
+
: check for type of the size argument to socket calls
case "$d_socket" in
"$define")
Checking to see what type is the last argument of accept().
EOM
- hdrs="$define sys/types.h $d_socket sys/socket.h"
yyy=''
case "$d_socklen_t" in
"$define") yyy="$yyy socklen_t"
for xxx in $yyy; do
case "$socksizetype" in
'') try="extern int accept(int, struct sockaddr *, $xxx *);"
- if ./protochk "$try" $hdrs; then
- echo "Your system accepts '$xxx *' for the last argument of accept()."
- socksizetype="$xxx"
- fi
+ case "$usesocks" in
+ "$define")
+ if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
+ echo "Your system accepts '$xxx *' for the last argument of accept()."
+ socksizetype="$xxx"
+ fi
+ ;;
+ *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
+ echo "Your system accepts '$xxx *' for the last argument of accept()."
+ socksizetype="$xxx"
+ fi
+ ;;
+ esac
;;
esac
done
: see what type of char stdio uses.
echo " "
-if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
+echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
+if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
echo "Your stdio uses unsigned chars." >&4
stdchar="unsigned char"
else
echo "Your stdio uses signed chars." >&4
stdchar="char"
fi
+$rm -f stdioh
+
+
: see if time exists
echo " "
set shadow.h i_shadow
eval $inhdr
-: see if this is a socks.h system
-set socks.h i_socks
-eval $inhdr
-
-: see if stdarg is available
-echo " "
-if $test `./findhdr stdarg.h`; then
- echo "<stdarg.h> found." >&4
- valstd="$define"
-else
- echo "<stdarg.h> NOT found." >&4
- valstd="$undef"
-fi
-
-: see if varags is available
-echo " "
-if $test `./findhdr varargs.h`; then
- echo "<varargs.h> found." >&4
-else
- echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
-fi
-
-: set up the varargs testing programs
-$cat > varargs.c <<EOP
-#ifdef I_STDARG
-#include <stdarg.h>
-#endif
-#ifdef I_VARARGS
-#include <varargs.h>
-#endif
-
-#ifdef I_STDARG
-int f(char *p, ...)
-#else
-int f(va_alist)
-va_dcl
-#endif
-{
- va_list ap;
-#ifndef I_STDARG
- char *p;
-#endif
-#ifdef I_STDARG
- va_start(ap,p);
-#else
- va_start(ap);
- p = va_arg(ap, char *);
-#endif
- va_end(ap);
-}
-EOP
-$cat > varargs <<EOP
-$startsh
-if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
- echo "true"
-else
- echo "false"
-fi
-$rm -f varargs$_o
-EOP
-chmod +x varargs
-
-: now check which varargs header should be included
-echo " "
-i_varhdr=''
-case "$valstd" in
-"$define")
- if `./varargs I_STDARG`; then
- val='stdarg.h'
- elif `./varargs I_VARARGS`; then
- val='varargs.h'
- fi
- ;;
-*)
- if `./varargs I_VARARGS`; then
- val='varargs.h'
- fi
- ;;
-esac
-case "$val" in
-'')
-echo "I could not find the definition for va_dcl... You have problems..." >&4
- val="$undef"; set i_stdarg; eval $setvar
- val="$undef"; set i_varargs; eval $setvar
- ;;
-*)
- set i_varhdr
- eval $setvar
- case "$i_varhdr" in
- stdarg.h)
- val="$define"; set i_stdarg; eval $setvar
- val="$undef"; set i_varargs; eval $setvar
- ;;
- varargs.h)
- val="$undef"; set i_stdarg; eval $setvar
- val="$define"; set i_varargs; eval $setvar
- ;;
- esac
- echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
-esac
-$rm -f varargs*
-
: see if stddef is available
set stddef.h i_stddef
eval $inhdr
d_PRIu64='$d_PRIu64'
d_PRIx64='$d_PRIx64'
d_SCNfldbl='$d_SCNfldbl'
+d__fwalk='$d__fwalk'
d_access='$d_access'
d_accessx='$d_accessx'
d_alarm='$d_alarm'
d_fsetpos='$d_fsetpos'
d_fstatfs='$d_fstatfs'
d_fstatvfs='$d_fstatvfs'
+d_fsync='$d_fsync'
d_ftello='$d_ftello'
d_ftime='$d_ftime'
d_getcwd='$d_getcwd'
d_getnbyname='$d_getnbyname'
d_getnent='$d_getnent'
d_getnetprotos='$d_getnetprotos'
+d_getpagsz='$d_getpagsz'
d_getpbyname='$d_getpbyname'
d_getpbynumber='$d_getpbynumber'
d_getpent='$d_getpent'
d_safebcpy='$d_safebcpy'
d_safemcpy='$d_safemcpy'
d_sanemcmp='$d_sanemcmp'
+d_sbrkproto='$d_sbrkproto'
d_sched_yield='$d_sched_yield'
d_scm_rights='$d_scm_rights'
d_seekdir='$d_seekdir'
d_strtol='$d_strtol'
d_strtold='$d_strtold'
d_strtoll='$d_strtoll'
+d_strtoq='$d_strtoq'
d_strtoul='$d_strtoul'
d_strtoull='$d_strtoull'
d_strtouq='$d_strtouq'
installvendorbin='$installvendorbin'
installvendorlib='$installvendorlib'
intsize='$intsize'
+issymlink='$issymlink'
ivdformat='$ivdformat'
ivsize='$ivsize'
ivtype='$ivtype'
myhostname='$myhostname'
myuname='$myuname'
n='$n'
+need_va_copy='$need_va_copy'
netdb_hlen_type='$netdb_hlen_type'
netdb_host_type='$netdb_host_type'
netdb_name_type='$netdb_name_type'