# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Thu Apr 17 18:50:57 EET DST 2003 [metaconfig 3.0 PL70]
+# Generated on Fri Jun 13 16:12:49 EET DST 2003 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
targetarch=''
to=''
usecrosscompile=''
+mistrustnm=''
perllibs=''
dynamic_ext=''
extensions=''
d_endsent=''
d_endservent_r=''
endservent_r_proto=''
+d_faststdio=''
d_fchdir=''
d_fchmod=''
d_fchown=''
d_old_pthread_create_joinable=''
old_pthread_create_joinable=''
d_pthread_atfork=''
+d_pthread_attr_setscope=''
d_pthread_yield=''
d_sched_yield=''
sched_yield=''
archname64=''
use64bitall=''
use64bitint=''
+usefaststdio=''
ccflags_uselargefiles=''
ldflags_uselargefiles=''
libswanted_uselargefiles=''
mips) osname=mips_osf1 ;;
esac
;;
- unixware) osname=svr5
+ # UnixWare 7.1.2 is known as Open UNIX 8
+ openunix|unixware) osname=svr5
osvers="$4"
;;
uts) osname=uts
;;
esac
+case "$d_quad:$use64bitint" in
+$undef:$define)
+ cat >&4 <<EOF
+
+*** You have chosen to use 64-bit integers,
+*** but none cannot be found.
+*** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
+*** Cannot continue, aborting.
+
+EOF
+ exit 1
+ ;;
+esac
+
: check for length of double
echo " "
case "$doublesize" in
esac
;;
esac
+if $test -f archname.cbu; then
+ echo "Your platform has some specific hints for architecture name, using them..."
+ . ./archname.cbu
+fi
: determine root of directory hierarchy where package will be installed.
case "$prefix" in
case "$ptrsize" in
4) cat <<EOM >&4
-*** You have chosen a maximally 64-bit build, but your pointers
-*** are only 4 bytes wide, disabling maximal 64-bitness.
-
+*** You have chosen a maximally 64-bit build,
+*** but your pointers are only 4 bytes wide.
+*** Please rerun Configure without -Duse64bitall.
EOM
- use64bitall="$undef"
- case "$use64bitint" in
- "$define"|true|[yY]*) ;;
- *) cat <<EOM >&4
-
-*** Downgrading from maximal 64-bitness to using 64-bit integers.
-
+ case "$d_quad" in
+ define)
+ cat <<EOM >&4
+*** Since you have quads, you could possibly try with -Duse64bitint.
EOM
- use64bitint="$define"
;;
esac
+ cat <<EOM >&4
+*** Cannot continue, aborting.
+
+EOM
+
+ exit 1
;;
esac
;;
xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
xxx='[ADTSIW]'
-if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
+if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
eval $xscan;\
$contains '^fprintf$' libc.list >/dev/null 2>&1; then
eval $xrun
case "$3" in
-v) tf=libc.tmp; tc=""; tdc="";;
-a) tf=libc.tmp; tc="[0]"; tdc="[]";;
-*) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
+*) tlook="^$1\$"; tf=libc.list; tc=""; tdc="()";;
esac;
tx=yes;
case "$reuseval-$4" in
esac;
case "$tx" in
yes)
- case "$runnm" in
- true)
- if $contains $tlook $tf >/dev/null 2>&1;
- then tval=true;
- else tval=false;
- fi;;
- *)
- echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
- if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
- then tval=true;
- else tval=false;
+ tval=false;
+ if $test "$runnm" = true; then
+ if $contains $tlook $tf >/dev/null 2>&1; then
+ tval=true;
+ elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
+ echo "int main() { extern void *$1$tdc; if (&$1$tc) return(0); else return(1); }" > try.c;
+ $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
+ $test "$mistrustnm" = run -a -x try && { $run ./try >/dev/null 2>&1 || tval=false; };
+ $rm -f try try.c core;
fi;
- $rm -f t t.c;;
- esac;;
+ else
+ echo "#include <stdio.h>" > try.c;
+ echo "int main() { extern void *$1$tdc; if(&$1$tc) return(0); else return(1); }" > try.c;
+ $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
+ $rm -f try try.c;
+ fi;
+ ;;
*)
case "$tval" in
$define) tval=true;;
*) tval=false;;
- esac;;
+ esac;
+ ;;
esac;
eval "$2=$tval"'
installsitescript="$sitescriptexp"
fi
+case "$usefaststdio" in
+$define|true|[yY]*|'')
+ xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
+ case "$xversion" in
+ [68]) dflt='y' ;;
+ *) dflt='n' ;;
+ esac
+ ;;
+*) dflt='n';;
+esac
+cat <<EOM
+
+Perl can be built to use 'fast stdio', which means using the stdio
+library but also directly manipulating the stdio buffers to enable
+faster I/O. Using stdio is better for backward compatibility (especially
+for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
+interface has been preferred instead of stdio.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+rp='Use the "fast stdio" if available?'
+. ./myread
+case "$ans" in
+y|Y) val="$define" ;;
+*) val="$undef" ;;
+esac
+set usefaststdio
+eval $setvar
+
+
: define an is-a-typedef? function
typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
case "$inclist" in
echo "Checking whether your compiler can handle __attribute__ ..." >&4
$cat >attrib.c <<'EOCP'
#include <stdio.h>
-void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
+void croak (char* pat,...) __attribute__((__format__(__printf__,1,2),noreturn));
EOCP
if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
if $contains 'warning' attrib.out >/dev/null 2>&1; then
esac
$rm -f try try.* .out core head.c mtry
-: see if fchdir exists
-set fchdir d_fchdir
-eval $inlibc
-
-: see if fchmod exists
-set fchmod d_fchmod
-eval $inlibc
-
-: see if fchown exists
-set fchown d_fchown
-eval $inlibc
+: see if _ptr and _cnt from stdio act std
+echo " "
-: see if this is an fcntl system
-set fcntl d_fcntl
-eval $inlibc
+if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
+ echo "(Looks like you have stdio.h from BSD.)"
+ case "$stdio_ptr" in
+ '') stdio_ptr='((fp)->_p)'
+ ptr_lval=$define
+ ;;
+ *) ptr_lval=$d_stdio_ptr_lval;;
+ esac
+ case "$stdio_cnt" in
+ '') stdio_cnt='((fp)->_r)'
+ cnt_lval=$define
+ ;;
+ *) cnt_lval=$d_stdio_cnt_lval;;
+ esac
+ case "$stdio_base" in
+ '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
+ esac
+ case "$stdio_bufsiz" in
+ '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
+ esac
+elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
+ echo "(Looks like you have stdio.h from Linux.)"
+ case "$stdio_ptr" in
+ '') stdio_ptr='((fp)->_IO_read_ptr)'
+ ptr_lval=$define
+ ;;
+ *) ptr_lval=$d_stdio_ptr_lval;;
+ esac
+ case "$stdio_cnt" in
+ '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
+ cnt_lval=$undef
+ ;;
+ *) cnt_lval=$d_stdio_cnt_lval;;
+ esac
+ case "$stdio_base" in
+ '') stdio_base='((fp)->_IO_read_base)';;
+ esac
+ case "$stdio_bufsiz" in
+ '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
+ esac
+else
+ case "$stdio_ptr" in
+ '') stdio_ptr='((fp)->_ptr)'
+ ptr_lval=$define
+ ;;
+ *) ptr_lval=$d_stdio_ptr_lval;;
+ esac
+ case "$stdio_cnt" in
+ '') stdio_cnt='((fp)->_cnt)'
+ cnt_lval=$define
+ ;;
+ *) cnt_lval=$d_stdio_cnt_lval;;
+ esac
+ case "$stdio_base" in
+ '') stdio_base='((fp)->_base)';;
+ esac
+ case "$stdio_bufsiz" in
+ '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
+ esac
+fi
-echo " "
-: See if fcntl-based locking works.
-$cat >try.c <<EOCP
+: test whether _ptr and _cnt really work
+echo "Checking how std your stdio is..." >&4
+$cat >try.c <<EOP
+#include <stdio.h>
#$i_stdlib I_STDLIB
#ifdef I_STDLIB
#include <stdlib.h>
#endif
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-$signal_t blech(x) int x; { exit(3); }
+#define FILE_ptr(fp) $stdio_ptr
+#define FILE_cnt(fp) $stdio_cnt
int main() {
-#if defined(F_SETLK) && defined(F_SETLKW)
- struct flock flock;
- int retval, fd;
- fd = open("try.c", O_RDONLY);
- flock.l_type = F_RDLCK;
- flock.l_whence = SEEK_SET;
- flock.l_start = flock.l_len = 0;
- signal(SIGALRM, blech);
- alarm(10);
- retval = fcntl(fd, F_SETLK, &flock);
- close(fd);
- (retval < 0 ? exit(2) : exit(0));
-#else
- exit(2);
-#endif
+ FILE *fp = fopen("try.c", "r");
+ char c = getc(fp);
+ if (
+ 18 <= FILE_cnt(fp) &&
+ strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
+ )
+ exit(0);
+ exit(1);
}
-EOCP
-echo "Checking if fcntl-based file locking works... "
-case "$d_fcntl" in
-"$define")
- set try
- if eval $compile_ok; then
- if $run ./try; then
- echo "Yes, it seems to work."
- val="$define"
- else
- echo "Nope, it didn't work."
- val="$undef"
- case "$?" in
- 3) $cat >&4 <<EOM
-***
-*** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
-*** This is (almost) impossible.
-*** If your NFS lock daemons are not feeling well, something like
-*** this may happen, please investigate. Cannot continue, aborting.
-***
-EOM
- exit 1
- ;;
- esac
- fi
+EOP
+val="$undef"
+set try
+if eval $compile && $to try.c; then
+ if $run ./try; then
+ echo "Your stdio acts pretty std."
+ val="$define"
else
- echo "I'm unable to compile the test program, so I'll assume not."
- val="$undef"
+ echo "Your stdio isn't very std."
fi
- ;;
-*) val="$undef";
- echo "Nope, since you don't even have fcntl()."
+else
+ echo "Your stdio doesn't appear very std."
+fi
+$rm -f try.c try
+
+# glibc 2.2.90 and above apparently change stdio streams so Perl's
+# direct buffer manipulation no longer works. The Configure tests
+# should be changed to correctly detect this, but until then,
+# the following check should at least let perl compile and run.
+# (This quick fix should be updated before 5.8.1.)
+# To be defensive, reject all unknown versions, and all versions > 2.2.9.
+# A. Dougherty, June 3, 2002.
+case "$d_gnulibc" in
+$define)
+ case "$gnulibc_version" in
+ 2.[01]*) ;;
+ 2.2) ;;
+ 2.2.[0-9]) ;;
+ *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
+ val="$undef"
+ ;;
+ esac
;;
esac
-set d_fcntl_can_lock
+set d_stdstdio
+eval $setvar
+
+: Can _ptr be used as an lvalue?
+case "$d_stdstdio$ptr_lval" in
+$define$define) val=$define ;;
+*) val=$undef ;;
+esac
+set d_stdio_ptr_lval
eval $setvar
-$rm -f try*
+: Can _cnt be used as an lvalue?
+case "$d_stdstdio$cnt_lval" in
+$define$define) val=$define ;;
+*) val=$undef ;;
+esac
+set d_stdio_cnt_lval
+eval $setvar
-: check for fd_set items
-$cat <<EOM
-Checking to see how well your C compiler handles fd_set and friends ...
-EOM
-$cat >try.c <<EOCP
+: test whether setting _ptr sets _cnt as a side effect
+d_stdio_ptr_lval_sets_cnt="$undef"
+d_stdio_ptr_lval_nochange_cnt="$undef"
+case "$d_stdio_ptr_lval$d_stdstdio" in
+$define$define)
+ echo "Checking to see what happens if we set the stdio ptr..." >&4
+$cat >try.c <<EOP
+#include <stdio.h>
+/* Can we scream? */
+/* Eat dust sed :-) */
+/* In the buffer space, no one can hear you scream. */
#$i_stdlib I_STDLIB
#ifdef I_STDLIB
#include <stdlib.h>
#endif
-#$i_systime I_SYS_TIME
-#$i_sysselct I_SYS_SELECT
-#$d_socket HAS_SOCKET
+#define FILE_ptr(fp) $stdio_ptr
+#define FILE_cnt(fp) $stdio_cnt
+#include <sys/types.h>
+int main() {
+ FILE *fp = fopen("try.c", "r");
+ int c;
+ char *ptr;
+ size_t cnt;
+ if (!fp) {
+ puts("Fail even to read");
+ exit(1);
+ }
+ c = getc(fp); /* Read away the first # */
+ if (c == EOF) {
+ puts("Fail even to read");
+ exit(1);
+ }
+ if (!(
+ 18 <= FILE_cnt(fp) &&
+ strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
+ )) {
+ puts("Fail even to read");
+ exit (1);
+ }
+ ptr = (char*) FILE_ptr(fp);
+ cnt = (size_t)FILE_cnt(fp);
+
+ FILE_ptr(fp) += 42;
+
+ if ((char*)FILE_ptr(fp) != (ptr + 42)) {
+ printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
+ exit (1);
+ }
+ if (FILE_cnt(fp) <= 20) {
+ printf ("Fail (<20 chars to test)");
+ exit (1);
+ }
+ if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
+ puts("Fail compare");
+ exit (1);
+ }
+ if (cnt == FILE_cnt(fp)) {
+ puts("Pass_unchanged");
+ exit (0);
+ }
+ if (FILE_cnt(fp) == (cnt - 42)) {
+ puts("Pass_changed");
+ exit (0);
+ }
+ printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
+ return 1;
+
+}
+EOP
+ set try
+ if eval $compile && $to try.c; then
+ case `$run ./try` in
+ Pass_changed)
+ echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
+ d_stdio_ptr_lval_sets_cnt="$define" ;;
+ Pass_unchanged)
+ echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
+ d_stdio_ptr_lval_nochange_cnt="$define" ;;
+ Fail*)
+ echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
+ *)
+ echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
+ esac
+ else
+ echo "It seems we can't set ptr in your stdio. Nevermind." >&4
+ fi
+ $rm -f try.c try
+ ;;
+esac
+
+: see if _base is also standard
+val="$undef"
+case "$d_stdstdio" in
+$define)
+ $cat >try.c <<EOP
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#define FILE_base(fp) $stdio_base
+#define FILE_bufsiz(fp) $stdio_bufsiz
+int main() {
+ FILE *fp = fopen("try.c", "r");
+ char c = getc(fp);
+ if (
+ 19 <= FILE_bufsiz(fp) &&
+ strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
+ )
+ exit(0);
+ exit(1);
+}
+EOP
+ set try
+ if eval $compile && $to try.c; then
+ if $run ./try; then
+ echo "And its _base field acts std."
+ val="$define"
+ else
+ echo "But its _base field isn't std."
+ fi
+ else
+ echo "However, it seems to be lacking the _base field."
+ fi
+ $rm -f try.c try
+ ;;
+esac
+set d_stdiobase
+eval $setvar
+
+: see if fast_stdio exists
+val="$undef"
+case "$d_stdstdio:$d_stdio_ptr_lval" in
+"$define:$define")
+ case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
+ *$define*)
+ echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
+ val="$define"
+ ;;
+ esac
+ ;;
+esac
+set d_faststdio
+eval $setvar
+
+
+
+: see if fchdir exists
+set fchdir d_fchdir
+eval $inlibc
+
+: see if fchmod exists
+set fchmod d_fchmod
+eval $inlibc
+
+: see if fchown exists
+set fchown d_fchown
+eval $inlibc
+
+: see if this is an fcntl system
+set fcntl d_fcntl
+eval $inlibc
+
+echo " "
+: See if fcntl-based locking works.
+$cat >try.c <<EOCP
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#include <unistd.h>
+#include <fcntl.h>
+#include <signal.h>
+$signal_t blech(x) int x; { exit(3); }
+int main() {
+#if defined(F_SETLK) && defined(F_SETLKW)
+ struct flock flock;
+ int retval, fd;
+ fd = open("try.c", O_RDONLY);
+ flock.l_type = F_RDLCK;
+ flock.l_whence = SEEK_SET;
+ flock.l_start = flock.l_len = 0;
+ signal(SIGALRM, blech);
+ alarm(10);
+ retval = fcntl(fd, F_SETLK, &flock);
+ close(fd);
+ (retval < 0 ? exit(2) : exit(0));
+#else
+ exit(2);
+#endif
+}
+EOCP
+echo "Checking if fcntl-based file locking works... "
+case "$d_fcntl" in
+"$define")
+ set try
+ if eval $compile_ok; then
+ if $run ./try; then
+ echo "Yes, it seems to work."
+ val="$define"
+ else
+ echo "Nope, it didn't work."
+ val="$undef"
+ case "$?" in
+ 3) $cat >&4 <<EOM
+***
+*** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
+*** This is (almost) impossible.
+*** If your NFS lock daemons are not feeling well, something like
+*** this may happen, please investigate. Cannot continue, aborting.
+***
+EOM
+ exit 1
+ ;;
+ esac
+ fi
+ else
+ echo "I'm unable to compile the test program, so I'll assume not."
+ val="$undef"
+ fi
+ ;;
+*) val="$undef";
+ echo "Nope, since you don't even have fcntl()."
+ ;;
+esac
+set d_fcntl_can_lock
+eval $setvar
+$rm -f try*
+
+
+: check for fd_set items
+$cat <<EOM
+
+Checking to see how well your C compiler handles fd_set and friends ...
+EOM
+$cat >try.c <<EOCP
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#$i_systime I_SYS_TIME
+#$i_sysselct I_SYS_SELECT
+#$d_socket HAS_SOCKET
#include <sys/types.h>
#ifdef HAS_SOCKET
#include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
set sqrtl d_sqrtl
eval $inlibc
+: see if scalbnl exists
+set scalbnl d_scalbnl
+eval $inlibc
+
: see if modfl exists
set modfl d_modfl
eval $inlibc
esac
if $test "$uselongdouble" = "$define"; then
- message=none
- case "$d_sqrtl:$d_modfl" in
- $define:$define)
- : You have both
- ;;
- $define:$undef)
+ message=""
+ if $test "$d_sqrtl" != "$define"; then
+ message="$message sqrtl"
+ fi
+ if $test "$d_modfl" != "$define"; then
if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
echo "You have both aintl and copysignl, so I can emulate modfl."
else
- message="I could not find modfl."
+ message="$message modfl"
fi
- ;;
- $undef:$define)
- message="I could not find sqrtl."
- ;;
- $undef:$undef)
- message="I found neither sqrtl nor modfl."
- ;;
- esac
+ fi
+ if $test "$d_frexpl" != "$define"; then
+ if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
+ echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
+ else
+ message="$message frexpl"
+ fi
+ fi
- if $test "$message" != none; then
+ if $test "$message" != ""; then
$cat <<EOM >&4
*** You requested the use of long doubles but you do not seem to have
-*** the mathematic functions for long doubles.
-*** ($message)
-*** I'm disabling the use of long doubles.
+*** the following mathematical functions needed for long double support:
+*** $message
+*** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
+*** Cannot continue, aborting.
EOM
- uselongdouble=$undef
+ exit 1
fi
fi
set d_pthread_atfork
eval $setvar
+: see if pthread_attr_setscope exists
+set pthread_attr_setscope d_pthread_attr_setscope
+eval $inlibc
+
: see whether the various POSIXish _yields exist
$cat >try.c <<EOP
set d_sbrkproto sbrk $i_unistd unistd.h
eval $hasproto
-: see if scalbnl exists
-set scalbnl d_scalbnl
-eval $inlibc
-
: see if select exists
set select d_select
eval $inlibc
*) echo "No, it doesn't." ;;
esac
-: see if _ptr and _cnt from stdio act std
-echo " "
-
-if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
- echo "(Looks like you have stdio.h from BSD.)"
- case "$stdio_ptr" in
- '') stdio_ptr='((fp)->_p)'
- ptr_lval=$define
- ;;
- *) ptr_lval=$d_stdio_ptr_lval;;
- esac
- case "$stdio_cnt" in
- '') stdio_cnt='((fp)->_r)'
- cnt_lval=$define
- ;;
- *) cnt_lval=$d_stdio_cnt_lval;;
- esac
- case "$stdio_base" in
- '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
- esac
- case "$stdio_bufsiz" in
- '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
- esac
-elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
- echo "(Looks like you have stdio.h from Linux.)"
- case "$stdio_ptr" in
- '') stdio_ptr='((fp)->_IO_read_ptr)'
- ptr_lval=$define
- ;;
- *) ptr_lval=$d_stdio_ptr_lval;;
- esac
- case "$stdio_cnt" in
- '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
- cnt_lval=$undef
- ;;
- *) cnt_lval=$d_stdio_cnt_lval;;
- esac
- case "$stdio_base" in
- '') stdio_base='((fp)->_IO_read_base)';;
- esac
- case "$stdio_bufsiz" in
- '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
- esac
-else
- case "$stdio_ptr" in
- '') stdio_ptr='((fp)->_ptr)'
- ptr_lval=$define
- ;;
- *) ptr_lval=$d_stdio_ptr_lval;;
- esac
- case "$stdio_cnt" in
- '') stdio_cnt='((fp)->_cnt)'
- cnt_lval=$define
- ;;
- *) cnt_lval=$d_stdio_cnt_lval;;
- esac
- case "$stdio_base" in
- '') stdio_base='((fp)->_base)';;
- esac
- case "$stdio_bufsiz" in
- '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
- esac
-fi
-
-: test whether _ptr and _cnt really work
-echo "Checking how std your stdio is..." >&4
-$cat >try.c <<EOP
-#include <stdio.h>
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-#define FILE_ptr(fp) $stdio_ptr
-#define FILE_cnt(fp) $stdio_cnt
-int main() {
- FILE *fp = fopen("try.c", "r");
- char c = getc(fp);
- if (
- 18 <= FILE_cnt(fp) &&
- strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
- )
- exit(0);
- exit(1);
-}
-EOP
-val="$undef"
-set try
-if eval $compile && $to try.c; then
- if $run ./try; then
- echo "Your stdio acts pretty std."
- val="$define"
- else
- echo "Your stdio isn't very std."
- fi
-else
- echo "Your stdio doesn't appear very std."
-fi
-$rm -f try.c try
-
-# glibc 2.2.90 and above apparently change stdio streams so Perl's
-# direct buffer manipulation no longer works. The Configure tests
-# should be changed to correctly detect this, but until then,
-# the following check should at least let perl compile and run.
-# (This quick fix should be updated before 5.8.1.)
-# To be defensive, reject all unknown versions, and all versions > 2.2.9.
-# A. Dougherty, June 3, 2002.
-case "$d_gnulibc" in
-$define)
- case "$gnulibc_version" in
- 2.[01]*) ;;
- 2.2) ;;
- 2.2.[0-9]) ;;
- *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
- val="$undef"
- ;;
- esac
- ;;
-esac
-set d_stdstdio
-eval $setvar
-
-: Can _ptr be used as an lvalue?
-case "$d_stdstdio$ptr_lval" in
-$define$define) val=$define ;;
-*) val=$undef ;;
-esac
-set d_stdio_ptr_lval
-eval $setvar
-
-: Can _cnt be used as an lvalue?
-case "$d_stdstdio$cnt_lval" in
-$define$define) val=$define ;;
-*) val=$undef ;;
-esac
-set d_stdio_cnt_lval
-eval $setvar
-
-
-: test whether setting _ptr sets _cnt as a side effect
-d_stdio_ptr_lval_sets_cnt="$undef"
-d_stdio_ptr_lval_nochange_cnt="$undef"
-case "$d_stdio_ptr_lval$d_stdstdio" in
-$define$define)
- echo "Checking to see what happens if we set the stdio ptr..." >&4
-$cat >try.c <<EOP
-#include <stdio.h>
-/* Can we scream? */
-/* Eat dust sed :-) */
-/* In the buffer space, no one can hear you scream. */
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-#define FILE_ptr(fp) $stdio_ptr
-#define FILE_cnt(fp) $stdio_cnt
-#include <sys/types.h>
-int main() {
- FILE *fp = fopen("try.c", "r");
- int c;
- char *ptr;
- size_t cnt;
- if (!fp) {
- puts("Fail even to read");
- exit(1);
- }
- c = getc(fp); /* Read away the first # */
- if (c == EOF) {
- puts("Fail even to read");
- exit(1);
- }
- if (!(
- 18 <= FILE_cnt(fp) &&
- strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
- )) {
- puts("Fail even to read");
- exit (1);
- }
- ptr = (char*) FILE_ptr(fp);
- cnt = (size_t)FILE_cnt(fp);
-
- FILE_ptr(fp) += 42;
-
- if ((char*)FILE_ptr(fp) != (ptr + 42)) {
- printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
- exit (1);
- }
- if (FILE_cnt(fp) <= 20) {
- printf ("Fail (<20 chars to test)");
- exit (1);
- }
- if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
- puts("Fail compare");
- exit (1);
- }
- if (cnt == FILE_cnt(fp)) {
- puts("Pass_unchanged");
- exit (0);
- }
- if (FILE_cnt(fp) == (cnt - 42)) {
- puts("Pass_changed");
- exit (0);
- }
- printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
- return 1;
-
-}
-EOP
- set try
- if eval $compile && $to try.c; then
- case `$run ./try` in
- Pass_changed)
- echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
- d_stdio_ptr_lval_sets_cnt="$define" ;;
- Pass_unchanged)
- echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
- d_stdio_ptr_lval_nochange_cnt="$define" ;;
- Fail*)
- echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
- *)
- echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
- esac
- else
- echo "It seems we can't set ptr in your stdio. Nevermind." >&4
- fi
- $rm -f try.c try
- ;;
-esac
-
-: see if _base is also standard
-val="$undef"
-case "$d_stdstdio" in
-$define)
- $cat >try.c <<EOP
-#include <stdio.h>
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-#define FILE_base(fp) $stdio_base
-#define FILE_bufsiz(fp) $stdio_bufsiz
-int main() {
- FILE *fp = fopen("try.c", "r");
- char c = getc(fp);
- if (
- 19 <= FILE_bufsiz(fp) &&
- strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
- )
- exit(0);
- exit(1);
-}
-EOP
- set try
- if eval $compile && $to try.c; then
- if $run ./try; then
- echo "And its _base field acts std."
- val="$define"
- else
- echo "But its _base field isn't std."
- fi
- else
- echo "However, it seems to be lacking the _base field."
- fi
- $rm -f try.c try
- ;;
-esac
-set d_stdiobase
-eval $setvar
-
$cat >&4 <<EOM
Checking how to access stdio streams by file descriptor number...
EOM
: set the base revision
baserev=5.0
-: how do we catenate cpp tokens here?
+: how do we concatenate cpp tokens here?
echo " "
-echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
+echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
$cat >cpp_stuff.c <<'EOCP'
#define RCAT(a,b)a/**/b
#define ACAT(a,b)a ## b
cpp_stuff=1
else
$cat >&4 <<EOM
-Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
-to have to edit the values of CAT[2-5] in config.h...
+Hmm, I don't seem to be able to concatenate tokens with your cpp.
+You're going to have to edit the values of CAT[2-5] in config.h...
EOM
cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
fi
shift
avail_ext="$*"
+case "$onlyextensions" in
+'') ;;
+*) keepextensions=''
+ echo "You have requested that only certains extensions be included..." >&4
+ for i in $onlyextensions; do
+ case " $avail_ext " in
+ *" $i "*)
+ echo "Keeping extension $i."
+ keepextensions="$keepextensions $i"
+ ;;
+ *) echo "Ignoring extension $i." ;;
+ esac
+ done
+ avail_ext="$keepextensions"
+ ;;
+esac
+
+case "$noextensions" in
+'') ;;
+*) keepextensions=''
+ echo "You have requested that certain extensions be ignored..." >&4
+ for i in $avail_ext; do
+ case " $noextensions " in
+ *" $i "*) echo "Ignoring extension $i." ;;
+ *) echo "Keeping extension $i.";
+ keepextensions="$keepextensions $i"
+ ;;
+ esac
+ done
+ avail_ext="$keepextensions"
+ ;;
+esac
+
: Now see which nonxs extensions are supported on this system.
: For now assume all are.
nonxs_ext=''
shift
extensions="$*"
+# Sanity check: We require an extension suitable for use with
+# AnyDBM_File, as well as Fcntl and IO. (Failure to have these
+# should show up as failures in the test suite, but it's helpful to
+# catch them now.) The 'extensions' list is normally sorted
+# alphabetically, so we need to accept either
+# DB_File ... Fcntl ... IO ....
+# or something like
+# Fcntl ... NDBM_File ... IO ....
+case " $extensions" in
+*"_File "*" Fcntl "*" IO "*) ;; # DB_File
+*" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
+*" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
+*) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
+ echo "WARNING: The Perl you are building will be quite crippled." >& 4
+ ;;
+esac
+
: Remove libraries needed only for extensions
: The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
: The exception is SunOS 4.x, which needs them.
d_endservent_r='$d_endservent_r'
d_eofnblk='$d_eofnblk'
d_eunice='$d_eunice'
+d_faststdio='$d_faststdio'
d_fchdir='$d_fchdir'
d_fchmod='$d_fchmod'
d_fchown='$d_fchown'
d_portable='$d_portable'
d_procselfexe='$d_procselfexe'
d_pthread_atfork='$d_pthread_atfork'
+d_pthread_attr_setscope='$d_pthread_attr_setscope'
d_pthread_yield='$d_pthread_yield'
d_pwage='$d_pwage'
d_pwchange='$d_pwchange'
man3direxp='$man3direxp'
man3ext='$man3ext'
mips_type='$mips_type'
+mistrustnm='$mistrustnm'
mkdir='$mkdir'
mmaptype='$mmaptype'
modetype='$modetype'
use64bitint='$use64bitint'
usecrosscompile='$usecrosscompile'
usedl='$usedl'
+usefaststdio='$usefaststdio'
useithreads='$useithreads'
uselargefiles='$uselargefiles'
uselongdouble='$uselongdouble'