# comp.sources.misc and is available on CPAN under authors/id/RAM so
# you may fetch it yourself from your nearest archive site.)
#
+#
+# Though this script was generated by metaconfig, it is OK to send
+# patches against it. It's up to the Configure pumpkin to backport
+# the patch to the metaunits if it is accepted.
+# See Porting/pumpkin.pod for more information on metaconfig.
+#
# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Wed Apr 16 12:35:41 EET DST 2003 [metaconfig 3.0 PL70]
+# Generated on Wed Jan 11 21:57:24 CET 2006 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
-paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
+paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
paths="$paths /sbin /usr/sbin /usr/libexec"
paths="$paths /system/gnu_library/bin"
targetarch=''
to=''
usecrosscompile=''
+mistrustnm=''
perllibs=''
dynamic_ext=''
extensions=''
d_alarm=''
asctime_r_proto=''
d_asctime_r=''
-d_attribut=''
+d_attribute_format=''
+d_attribute_malloc=''
+d_attribute_nonnull=''
+d_attribute_noreturn=''
+d_attribute_pure=''
+d_attribute_unused=''
+d_attribute_warn_unused_result=''
d_bcmp=''
d_bcopy=''
d_bzero=''
d_chroot=''
d_chsize=''
d_class=''
+d_clearenv=''
d_closedir=''
d_void_closedir=''
d_cmsghdr_s=''
d_endsent=''
d_endservent_r=''
endservent_r_proto=''
+d_faststdio=''
d_fchdir=''
d_fchmod=''
d_fchown=''
d_ftello=''
d_ftime=''
d_gettimeod=''
+d_futimes=''
d_Gconvert=''
d_getcwd=''
d_getespwnam=''
d_killpg=''
d_lchown=''
d_ldbl_dig=''
+d_libm_lib_version=''
d_link=''
d_localtime_r=''
localtime_r_proto=''
d_lseekproto=''
d_lstat=''
d_madvise=''
+d_malloc_good_size=''
+d_malloc_size=''
d_mblen=''
d_mbstowcs=''
d_mbtowc=''
d_msgsnd=''
d_msync=''
d_munmap=''
-d_nanosleep=''
d_nice=''
d_nl_langinfo=''
d_off64_t=''
d_old_pthread_create_joinable=''
old_pthread_create_joinable=''
d_pthread_atfork=''
+d_pthread_attr_setscope=''
d_pthread_yield=''
d_sched_yield=''
sched_yield=''
d_sigaction=''
d_sigprocmask=''
d_sigsetjmp=''
+usesitecustomize=''
+d_snprintf=''
+d_vsnprintf=''
d_sockatmark=''
d_sockatmarkproto=''
d_msg_ctrunc=''
socketlib=''
d_socklen_t=''
d_socks5_init=''
+d_sprintf_returns_strlen=''
d_sqrtl=''
d_srand48_r=''
srand48_r_proto=''
d_strerror_r=''
strerror_r_proto=''
d_strftime=''
+d_strlcat=''
+d_strlcpy=''
d_strtod=''
d_strtol=''
d_strtold=''
d_semctl_semun=''
d_union_semun=''
d_unordered=''
+d_unsetenv=''
d_usleep=''
d_usleepproto=''
d_ustat=''
mallocobj=''
mallocsrc=''
malloctype=''
+usemallocwrap=''
usemymalloc=''
installman1dir=''
man1dir=''
perladmin=''
perlpath=''
d_nv_preserves_uv=''
+d_nv_zero_is_allbits_zero=''
i16size=''
i16type=''
i32size=''
installsitebin=''
sitebin=''
sitebinexp=''
-installsitehtml1=''
-sitehtml1=''
-sitehtml1exp=''
-installsitehtml3=''
-sitehtml3=''
-sitehtml3exp=''
+installsitehtml1dir=''
+sitehtml1dir=''
+sitehtml1direxp=''
+installsitehtml3dir=''
+sitehtml3dir=''
+sitehtml3direxp=''
installsitelib=''
sitelib=''
sitelib_stem=''
sitelibexp=''
-installsiteman1=''
-siteman1=''
-siteman1exp=''
-installsiteman3=''
-siteman3=''
-siteman3exp=''
+installsiteman1dir=''
+siteman1dir=''
+siteman1direxp=''
+installsiteman3dir=''
+siteman3dir=''
+siteman3direxp=''
siteprefix=''
siteprefixexp=''
installsitescript=''
archname64=''
use64bitall=''
use64bitint=''
+usefaststdio=''
ccflags_uselargefiles=''
ldflags_uselargefiles=''
libswanted_uselargefiles=''
runnm=''
usenm=''
useperlio=''
+userelocatableinc=''
usesocks=''
d_oldpthreads=''
use5005threads=''
installvendorbin=''
vendorbin=''
vendorbinexp=''
-installvendorhtml1=''
-vendorhtml1=''
-vendorhtml1exp=''
-installvendorhtml3=''
-vendorhtml3=''
-vendorhtml3exp=''
+installvendorhtml1dir=''
+vendorhtml1dir=''
+vendorhtml1direxp=''
+installvendorhtml3dir=''
+vendorhtml3dir=''
+vendorhtml3direxp=''
d_vendorlib=''
installvendorlib=''
vendorlib=''
vendorlib_stem=''
vendorlibexp=''
-installvendorman1=''
-vendorman1=''
-vendorman1exp=''
-installvendorman3=''
-vendorman3=''
-vendorman3exp=''
+installvendorman1dir=''
+vendorman1dir=''
+vendorman1direxp=''
+installvendorman3dir=''
+vendorman3dir=''
+vendorman3direxp=''
usevendorprefix=''
vendorprefix=''
vendorprefixexp=''
versiononly=''
defvoidused=''
voidflags=''
-pm_apiversion=''
-xs_apiversion=''
yacc=''
yaccflags=''
CONFIG=''
fi
i_whoami=''
+ccname=''
+ccversion=''
+perllibs=''
+: set useposix=false in your hint file to disable the POSIX extension.
+useposix=true
+: set useopcode=false in your hint file to disable the Opcode extension.
+useopcode=true
+: Trailing extension. Override this in a hint file, if needed.
+: Extra object files, if any, needed on this platform.
+archobjs=''
+archname=''
: Possible local include directories to search.
: Set locincpth to "" in a hint file to defeat local include searches.
locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
: no include file wanted by default
inclwanted=''
-siteman1=''
-siteman3=''
-sitescript=''
-: Trailing extension. Override this in a hint file, if needed.
-: Extra object files, if any, needed on this platform.
-archobjs=''
groupstype=''
libnames=''
: change the next line if compiling for Xenix/286 on Xenix/386
libswanted=''
: some systems want to use only the non-versioned libso:s
ignore_versioned_solibs=''
-: full support for void wanted by default
-defvoidused=15
-
-ccname=''
-ccversion=''
-perllibs=''
-: set useposix=false in your hint file to disable the POSIX extension.
-useposix=true
-: set useopcode=false in your hint file to disable the Opcode extension.
-useopcode=true
+siteman1dir=''
+siteman3dir=''
+sitescript=''
archname64=''
ccflags_uselargefiles=''
ldflags_uselargefiles=''
libswanted_uselargefiles=''
: set usemultiplicity on the Configure command line to enable multiplicity.
: set usesocks on the Configure command line to enable socks.
-archname=''
: set usethreads on the Configure command line to enable threads.
usereentrant='undef'
+: full support for void wanted by default
+defvoidused=15
+
: List of libraries we want.
-: If anyone needs -lnet, put it in a hint file.
-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 util rt posix4"
+: If anyone needs extra -lxxx, put those in a hint file.
+libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
+libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
: 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 ! !'`
up='[:upper:]'
low='[:lower:]'
;;
-*) # There is a discontinuity in EBCDIC between 'I' and 'J'
- # (0xc9 and 0xd1), therefore that is a nice testing point.
- if test "X$up" = X -o "X$low" = X; then
- case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
- ij) up='[A-Z]'
- low='[a-z]'
+*) # There is a discontinuity in EBCDIC between 'R' and 'S'
+ # (0xd9 and 0xe2), therefore that is a nice testing point.
+ if test "X$up" = X -o "X$low" = X; then
+ case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
+ rs) up='[A-Z]'
+ low='[a-z]'
;;
esac
- fi
+ fi
if test "X$up" = X -o "X$low" = X; then
- case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
- ij) up='A-Z'
+ case "`echo RS | $tr R-S r-s 2>/dev/null`" in
+ rs) up='A-Z'
low='a-z'
;;
esac
- fi
+ fi
if test "X$up" = X -o "X$low" = X; then
- case "`echo IJ | od -x 2>/dev/null`" in
- *C9D1*|*c9d1*)
+ case "`echo RS | od -x 2>/dev/null`" in
+ *D9E2*|*d9e2*)
echo "Hey, this might be EBCDIC." >&4
if test "X$up" = X -o "X$low" = X; then
- case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
- ij) up='[A-IJ-RS-Z]'
- low='[a-ij-rs-z]'
+ case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
+ rs) up='[A-IJ-RS-Z]'
+ low='[a-ij-rs-z]'
;;
esac
fi
if test "X$up" = X -o "X$low" = X; then
- case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
- ij) up='A-IJ-RS-Z'
- low='a-ij-rs-z'
+ case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
+ rs) up='A-IJ-RS-Z'
+ low='a-ij-rs-z'
;;
esac
fi
esac
fi
esac
-case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
-ij)
+case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
+rs)
echo "Using $up and $low to convert case." >&4
;;
*)
aix) osname=aix
tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
case "$tmp" in
- 'not found') osvers="$4"."$3" ;;
+ # oslevel can fail with:
+ # oslevel: Unable to acquire lock.
+ *not\ found) osvers="$4"."$3" ;;
'<3240'|'<>3240') osvers=3.2.0 ;;
'=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
'=3250'|'>3250') osvers=3.2.5 ;;
domainos) osname=apollo
osvers="$3"
;;
- dgux) osname=dgux
+ dgux) osname=dgux
osvers="$3"
;;
dynixptx*) osname=dynixptx
;;
freebsd) osname=freebsd
osvers="$3" ;;
- genix) osname=genix ;;
- hp*) osname=hpux
+ genix) osname=genix ;;
+ gnu) osname=gnu
+ osvers="$3" ;;
+ hp*) osname=hpux
osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
;;
- irix*) osname=irix
+ irix*) osname=irix
case "$3" in
4*) osvers=4 ;;
5*) osvers=5 ;;
*) osvers="$3" ;;
esac
;;
- linux) osname=linux
+ linux) osname=linux
case "$3" in
*) osvers="$3" ;;
esac
;;
- MiNT) osname=mint
+ MiNT) osname=mint
;;
netbsd*) osname=netbsd
osvers="$3"
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
: who configured the system
cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
-cf_by=`(logname) 2>/dev/null`
case "$cf_by" in
"")
- cf_by=`(whoami) 2>/dev/null`
+ cf_by=`(logname) 2>/dev/null`
case "$cf_by" in
- "") cf_by=unknown ;;
+ "")
+ cf_by=`(whoami) 2>/dev/null`
+ case "$cf_by" in
+ "") cf_by=unknown ;;
+ esac ;;
esac ;;
esac
eval $setvar
-case "$usethreads" in
-"$define"|true|[yY]*)
: Look for a hint-file generated 'call-back-unit'. If the
: user has specified that a threading perl is to be built,
: we may need to set or change some other defaults.
- if $test -f usethreads.cbu; then
- echo "Your platform has some specific hints for threaded builds, using them..."
- . ./usethreads.cbu
- else
+if $test -f usethreads.cbu; then
+ echo "Your platform has some specific hints regarding threaded builds, using them..."
+ . ./usethreads.cbu
+else
+ case "$usethreads" in
+ "$define"|true|[yY]*)
$cat <<EOM
-(Your platform doesn't have any specific hints for threaded builds.
+(Your platform does not have any specific hints for threaded builds.
Assuming POSIX threads, then.)
EOM
- fi
;;
-esac
+ esac
+fi
cat <<EOM
true|[yY]*) uselongdouble="$define" ;;
esac
-case "$uselongdouble" in
-$define)
: Look for a hint-file generated 'call-back-unit'. If the
: user has specified that long doubles should be used,
: we may need to set or change some other defaults.
- if $test -f uselongdouble.cbu; then
- echo "Your platform has some specific hints for long doubles, using them..."
- . ./uselongdouble.cbu
- else
+if $test -f uselongdouble.cbu; then
+ echo "Your platform has some specific hints regarding long doubles, using them..."
+ . ./uselongdouble.cbu
+else
+ case "$uselongdouble" in
+ $define)
$cat <<EOM
-(Your platform doesn't have any specific hints for long doubles.)
+(Your platform does not have any specific hints for long doubles.)
EOM
- fi
;;
-esac
+ esac
+fi
: Looking for optional libraries
echo " "
2*) if test -d /etc/conf/kconfig.d &&
$contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
then
+ # Interactive Systems (ISC) POSIX mode.
dflt="$dflt -posix"
fi
;;
if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
echo "Yes, it does." 2>&1
case "$ccflags" in
- *strict-aliasing*)
+ *strict-aliasing*)
echo "Leaving current flags $ccflags alone." 2>&1
;;
*) dflt="$dflt -fno-strict-aliasing" ;;
fi
;;
esac
+ # For gcc, adding -pipe speeds up compilations for some, but apparently
+ # some assemblers can't read from stdin. (It also slows down compilations
+ # in other cases, but those are apparently rarer these days.) AD 5/2004.
+ case "$gccversion" in
+ ?*) echo " "
+ echo "Checking if your compiler accepts -pipe" 2>&1
+ echo 'int main(void) { return 0; }' > gcctest.c
+ if $cc -pipe -o gcctest gcctest.c; then
+ echo "Yes, it does." 2>&1
+ case "$ccflags" in
+ *-pipe*)
+ echo "Leaving current flags $ccflags alone." 2>&1
+ ;;
+ *) dflt="$dflt -pipe" ;;
+ esac
+ else
+ echo "Nope, it doesn't, but that's ok." 2>&1
+ fi
+
+ echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
+ echo 'int main(void) { return 0; }' > gcctest.c
+ if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
+ echo "Yes, it does." 2>&1
+ case "$ccflags" in
+ *-Wdeclaration-after-statement*)
+ echo "Leaving current flags $ccflags alone." 2>&1
+ ;;
+ *) dflt="$dflt -Wdeclaration-after-statement" ;;
+ esac
+ else
+ echo "Nope, it doesn't, but that's ok." 2>&1
+ fi
+ ;;
+ esac
;;
esac
if $test -d $thisincl; then
if $test x$thisincl != x$usrinc; then
case "$dflt" in
- *" -I$thisincl "*);;
- *) dflt="$dflt -I$thisincl ";;
+ *" -I$thisincl "*);;
+ *) dflt="$dflt -I$thisincl ";;
esac
fi
fi
for thislibdir in $libpth; do
case " $loclibpth " in
*" $thislibdir "*)
- case "$dflt " in
+ case "$dflt " in
*"-L$thislibdir "*) ;;
*) dflt="$dflt -L$thislibdir" ;;
esac
;;
esac
-case "$use64bitint" in
-"$define"|true|[yY]*)
: Look for a hint-file generated 'call-back-unit'. If the
: 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 integers, using them..."
- . ./use64bitint.cbu
- fi
+if $test -f use64bitint.cbu; then
+ echo "Your platform has some specific hints regarding 64-bit integers, using them..."
+ . ./use64bitint.cbu
+fi
+case "$use64bitint" in
+"$define"|true|[yY]*)
case "$longsize" 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 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 64-bit builds, using them..."
- . ./use64bitall.cbu
- fi
+if $test -f use64bitall.cbu; then
+ echo "Your platform has some specific hints regarding 64-bit builds, using them..."
+ . ./use64bitall.cbu
+fi
+case "$use64bitall" in
+"$define"|true|[yY]*)
case "$longsize" in
4) case "$archname64" in
''|64int) archname64=64all ;;
;;
esac
+case "$d_quad:$use64bitint" in
+$undef:$define)
+ cat >&4 <<EOF
+
+*** You have chosen to use 64-bit integers,
+*** but none can 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
longdblsize="$ans"
fi
if $test "X$doublesize" = "X$longdblsize"; then
- echo "(That isn't any different from an ordinary double.)"
+ echo "That isn't any different from an ordinary double."
+ echo "I'll keep your setting anyway, but you may see some"
+ echo "harmless compilation warnings."
fi
;;
esac
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
api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
- perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
+ perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
else
revision=0
patchlevel=0
perl_patchlevel=0
$echo "(You do not have patchlevel.h. Eek.)"
fi
-if $test -r $rsrc/.patch ; then
- if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
+if $test -r $rsrc/.patch ; then
+ if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
perl_patchlevel=`cat $rsrc/.patch`
fi
fi
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
;;
esac
+: determine whether to use malloc wrapping
+echo " "
+case "$usemallocwrap" in
+[yY]*|true|$define) dflt='y' ;;
+[nN]*|false|$undef) dflt='n' ;;
+*) case "$usedevel" in
+ [yY]*|true|$define) dflt='y' ;;
+ *) dflt='n' ;;
+ esac
+ ;;
+esac
+rp="Do you wish to wrap malloc calls to protect against potential overflows?"
+. ./myread
+usemallocwrap="$ans"
+case "$ans" in
+y*|true)
+ usemallocwrap="$define" ;;
+*)
+ usemallocwrap="$undef" ;;
+esac
+
: determine which malloc to compile in
echo " "
case "$usemymalloc" in
rp='List of earlier versions to include in @INC?'
. ./myread
case "$ans" in
-[Nn]one|''|' ') inc_version_list=' ' ;;
+[Nn]one|''|' '|$undef) inc_version_list=' ' ;;
*) inc_version_list="$ans" ;;
esac
case "$inc_version_list" in
: for archive libraries. Thank you, Linux.
case "$nm_so_opt" in
'') case "$myuname" in
- *linux*)
+ *linux*|gnu*)
if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
nm_so_opt='--dynamic'
fi
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
: is a C symbol defined?
csym='tlook=$1;
case "$3" in
--v) tf=libc.tmp; tc=""; tdc="";;
--a) tf=libc.tmp; tc="[0]"; tdc="[]";;
-*) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
+-v) tf=libc.tmp; tdc="";;
+-a) tf=libc.tmp; tdc="[]";;
+*) tlook="^$1\$"; tf=libc.list; 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 "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) 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$_exe >/dev/null 2>&1 || tval=false; };
+ $rm -f try$_exe try.c core core.* try.core;
fi;
- $rm -f t t.c;;
- esac;;
+ else
+ echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) 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$_exe try.c;
+ fi;
+ ;;
*)
case "$tval" in
$define) tval=true;;
*) tval=false;;
- esac;;
+ esac;
+ ;;
esac;
eval "$2=$tval"'
'') dflt="$dflt +vnocompatwarnings" ;;
esac
;;
- linux|irix*) dflt='-shared' ;;
+ linux|irix*|gnu*) dflt='-shared' ;;
next) dflt='none' ;;
solaris) dflt='-G' ;;
sunos) dflt='-assert nodefinitions' ;;
EOM
case "$ccdlflags" in
'') case "$osname" in
- hpux) dflt='-Wl,-E' ;;
- linux) dflt='-rdynamic' ;;
- next) dflt='none' ;;
- sunos) dflt='none' ;;
- *) dflt='none' ;;
+ linux|hpux|gnu*) dflt='-Wl,-E' ;;
+ next|sunos) dflt='none' ;;
+ *) dflt='none' ;;
esac ;;
' ') dflt='none' ;;
*) dflt="$ccdlflags" ;;
your system supports dynamic loading, it is probably possible to build
a shared libperl.$so. If you will have more than one executable linked
to libperl.$so, this will significantly reduce the size of each
-executable, but it may have a noticeable affect on performance. The
+executable, but it may have a noticeable effect on performance. The
default is probably sensible for your system.
$also
dflt=libperl.5.$so
# XXX How handle the --version stuff for MAB?
;;
- linux*) # ld won't link with a bare -lperl otherwise.
+ linux*|gnu*) # ld won't link with a bare -lperl otherwise.
dflt=libperl.$so
;;
cygwin*) # ld links against an importlib
solaris)
xxx="-R $shrpdir"
;;
- freebsd|netbsd|openbsd)
+ freebsd|netbsd|openbsd|interix)
xxx="-Wl,-R$shrpdir"
;;
- bsdos|linux|irix*|dec_osf)
+ bsdos|linux|irix*|dec_osf|gnu*)
xxx="-Wl,-rpath,$shrpdir"
;;
next)
fi
: determine where add-on html pages go
-: There is no standard location, so try to copy the previously-selected
+: There is no standard location, so try to copy the previously-selected
: directory structure for the core html pages.
-case "$sitehtml1" in
-'') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
-*) dflt=$sitehtml1 ;;
+case "$sitehtml1dir" in
+'') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
+*) dflt=$sitehtml1dir ;;
esac
case "$dflt" in
''|' ') dflt=none ;;
fn=dn+~
rp='Pathname where the site-specific html pages should be installed?'
. ./getfile
-sitehtml1="$ans"
-sitehtml1exp="$ansexp"
-: Use ' ' for none so value is preserved next time through Configure
-$test X"$sitehtml1" = "X" && sitehtml1=' '
+sitehtml1dir="$ans"
+sitehtml1direxp="$ansexp"
: Change installation prefix, if necessary.
if $test X"$prefix" != X"$installprefix"; then
- installsitehtml1=`echo "$sitehtml1exp" | $sed "s#^$prefix#$installprefix#"`
+ installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
else
- installsitehtml1="$sitehtml1exp"
+ installsitehtml1dir="$sitehtml1direxp"
fi
: determine where add-on library html pages go
: There is no standard location, so try to copy the previously-selected
: directory structure for the core html pages.
-case "$sitehtml3" in
-'') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
-*) dflt=$sitehtml3 ;;
+case "$sitehtml3dir" in
+'') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
+*) dflt=$sitehtml3dir ;;
esac
case "$dflt" in
''|' ') dflt=none ;;
fn=dn+~
rp='Pathname where the site-specific library html pages should be installed?'
. ./getfile
-sitehtml3="$ans"
-sitehtml3exp="$ansexp"
-: Use ' ' for none so value is preserved next time through Configure
-$test X"$sitehtml3" = "X" && sitehtml3=' '
+sitehtml3dir="$ans"
+sitehtml3direxp="$ansexp"
: Change installation prefix, if necessary.
if $test X"$prefix" != X"$installprefix"; then
- installsitehtml3=`echo "$sitehtml3exp" | $sed "s#^$prefix#$installprefix#"`
+ installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
else
- installsitehtml3="$sitehtml3exp"
+ installsitehtml3dir="$sitehtml3direxp"
fi
: determine where add-on manual pages go
-case "$siteman1" in
-'') dflt=`echo "$man1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
-*) dflt=$siteman1 ;;
+case "$siteman1dir" in
+'') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
+*) dflt=$siteman1dir ;;
esac
case "$dflt" in
''|' ') dflt=none ;;
fn=dn+~
rp='Pathname where the site-specific manual pages should be installed?'
. ./getfile
-siteman1="$ans"
-siteman1exp="$ansexp"
-: Use ' ' for none so value is preserved next time through Configure
-$test X"$siteman1" = "X" && siteman1=' '
+siteman1dir="$ans"
+siteman1direxp="$ansexp"
: Change installation prefix, if necessary.
if $test X"$prefix" != X"$installprefix"; then
- installsiteman1=`echo "$siteman1exp" | $sed "s#^$prefix#$installprefix#"`
+ installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
else
- installsiteman1="$siteman1exp"
+ installsiteman1dir="$siteman1direxp"
fi
: determine where add-on library man pages go
-case "$siteman3" in
-'') dflt=`echo "$man3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
-*) dflt=$siteman3 ;;
+case "$siteman3dir" in
+'') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
+*) dflt=$siteman3dir ;;
esac
case "$dflt" in
''|' ') dflt=none ;;
fn=dn+~
rp='Pathname where the site-specific library manual pages should be installed?'
. ./getfile
-siteman3="$ans"
-siteman3exp="$ansexp"
-: Use ' ' for none so value is preserved next time through Configure
-$test X"$siteman3" = "X" && siteman3=' '
+siteman3dir="$ans"
+siteman3direxp="$ansexp"
: Change installation prefix, if necessary.
if $test X"$prefix" != X"$installprefix"; then
- installsiteman3=`echo "$siteman3exp" | $sed "s#^$prefix#$installprefix#"`
+ installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
else
- installsiteman3="$siteman3exp"
+ installsiteman3dir="$siteman3direxp"
fi
: determine where add-on public executable scripts go
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
esac
set uselargefiles
eval $setvar
-case "$uselargefiles" in
-"$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 uselargefiles.cbu; then
+ echo "Your platform has some specific hints regarding large file builds, using them..."
+ . ./uselargefiles.cbu
+fi
+case "$uselargefiles" in
+"$define")
if $test -f uselargefiles.cbu; then
- echo "Your platform has some specific hints for large file builds, using them..."
- . ./uselargefiles.cbu
echo " "
echo "Rechecking to see how big your file offsets are..." >&4
$cat >try.c <<EOCP
;;
esac
+# probably will refer to
+# $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
+need_relocation=0
+userelocatableinc=undef
+
case "$vendorprefix" in
'') d_vendorbin="$undef"
vendorbin=''
fi
case "$vendorprefix" in
-'') vendorhtml1=''
- vendorhtml1exp=''
+'') vendorhtml1dir=''
+ vendorhtml1direxp=''
;;
*) : determine where vendor-supplied html pages go.
: There is no standard location, so try to copy the previously-selected
: directory structure for the core html pages.
: XXX Better default suggestions would be welcome.
- case "$vendorhtml1" in
+ case "$vendorhtml1dir" in
'') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
- *) dflt=$vendorhtml1 ;;
+ *) dflt=$vendorhtml1dir ;;
esac
case "$dflt" in
''|' ') dflt=none ;;
fn=dn+~
rp='Pathname for the vendor-supplied html pages?'
. ./getfile
- vendorhtml1="$ans"
- vendorhtml1exp="$ansexp"
+ vendorhtml1dir="$ans"
+ vendorhtml1direxp="$ansexp"
;;
esac
: Use ' ' for none so value is preserved next time through Configure
-$test X"$vendorhtml1" = "X" && vendorhtml1=' '
+$test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
: Change installation prefix, if necessary.
if $test X"$prefix" != X"$installprefix"; then
- installvendorhtml1=`echo $vendorhtml1exp | $sed "s#^$prefix#$installprefix#"`
+ installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
else
- installvendorhtml1="$vendorhtml1exp"
+ installvendorhtml1dir="$vendorhtml1direxp"
fi
case "$vendorprefix" in
-'') vendorhtml3=''
- vendorhtml3exp=''
+'') vendorhtml3dir=''
+ vendorhtml3direxp=''
;;
*) : determine where vendor-supplied module html pages go.
: There is no standard location, so try to copy the previously-selected
: directory structure for the core html pages.
: XXX Better default suggestions would be welcome.
- case "$vendorhtml3" in
+ case "$vendorhtml3dir" in
'') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
- *) dflt=$vendorhtml3 ;;
+ *) dflt=$vendorhtml3dir ;;
esac
case "$dflt" in
''|' ') dflt=none ;;
fn=dn+~
rp='Pathname for the vendor-supplied html pages?'
. ./getfile
- vendorhtml3="$ans"
- vendorhtml3exp="$ansexp"
+ vendorhtml3dir="$ans"
+ vendorhtml3direxp="$ansexp"
;;
esac
: Use ' ' for none so value is preserved next time through Configure
-$test X"$vendorhtml3" = "X" && vendorhtml3=' '
+$test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
: Change installation prefix, if necessary.
if $test X"$prefix" != X"$installprefix"; then
- installvendorhtml3=`echo $vendorhtml3exp | $sed "s#^$prefix#$installprefix#"`
+ installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
else
- installvendorhtml3="$vendorhtml3exp"
+ installvendorhtml3dir="$vendorhtml3direxp"
fi
case "$vendorprefix" in
-'') vendorman1=''
- vendorman1exp=''
+'') vendorman1dir=''
+ vendorman1direxp=''
;;
*) : determine where vendor-supplied manual pages go.
- case "$vendorman1" in
+ case "$vendorman1dir" in
'') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
- *) dflt=$vendorman1 ;;
+ *) dflt=$vendorman1dir ;;
esac
case "$dflt" in
''|' ') dflt=none ;;
fn=nd~+
rp='Pathname for the vendor-supplied manual section 1 pages?'
. ./getfile
- vendorman1="$ans"
- vendorman1exp="$ansexp"
+ vendorman1dir="$ans"
+ vendorman1direxp="$ansexp"
;;
esac
: Use ' ' for none so value is preserved next time through Configure
-$test X"$vendorman1" = "X" && vendorman1=' '
+$test X"$vendorman1dir" = "X" && vendorman1dir=' '
: Change installation prefix, if necessary.
if $test X"$prefix" != X"$installprefix"; then
- installvendorman1=`echo "$vendorman1exp" | $sed "s#^$prefix#$installprefix#"`
+ installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
else
- installvendorman1="$vendorman1exp"
+ installvendorman1dir="$vendorman1direxp"
fi
case "$vendorprefix" in
-'') vendorman3=''
- vendorman3exp=''
+'') vendorman3dir=''
+ vendorman3direxp=''
;;
*) : determine where vendor-supplied module manual pages go.
- case "$vendorman3" in
+ case "$vendorman3dir" in
'') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
- *) dflt=$vendorman3 ;;
+ *) dflt=$vendorman3dir ;;
esac
case "$dflt" in
''|' ') dflt=none ;;
fn=nd~+
rp='Pathname for the vendor-supplied manual section 3 pages?'
. ./getfile
- vendorman3="$ans"
- vendorman3exp="$ansexp"
+ vendorman3dir="$ans"
+ vendorman3direxp="$ansexp"
;;
esac
: Use ' ' for none so value is preserved next time through Configure
-$test X"$vendorman3" = "X" && vendorman3=' '
+$test X"$vendorman3dir" = "X" && vendorman3dir=' '
: Change installation prefix, if necessary.
if $test X"$prefix" != X"$installprefix"; then
- installvendorman3=`echo "$vendorman3exp" | $sed "s#^$prefix#$installprefix#"`
+ installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
else
- installvendorman3="$vendorman3exp"
+ installvendorman3dir="$vendorman3direxp"
fi
case "$vendorprefix" in
set atoll d_atoll
eval $inlibc
-: Look for GNU-cc style attribute checking
+: Look for GCC-style attribute format
+case "$d_attribute_format" in
+'')
echo " "
-echo "Checking whether your compiler can handle __attribute__ ..." >&4
+echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
$cat >attrib.c <<'EOCP'
#include <stdio.h>
-void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
+void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
EOCP
if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
if $contains 'warning' attrib.out >/dev/null 2>&1; then
- echo "Your C compiler doesn't fully support __attribute__."
+ echo "Your C compiler doesn't support __attribute__((format))."
val="$undef"
else
- echo "Your C compiler supports __attribute__."
+ echo "Your C compiler supports __attribute__((format))."
val="$define"
fi
else
echo "Your C compiler doesn't seem to understand __attribute__ at all."
val="$undef"
fi
-set d_attribut
+;;
+*) val="$d_attribute_format" ;;
+esac
+set d_attribute_format
eval $setvar
$rm -f attrib*
-: see if bcmp exists
-set bcmp d_bcmp
-eval $inlibc
-
-: see if bcopy exists
-set bcopy d_bcopy
-eval $inlibc
-
-: see if this is a unistd.h system
-set unistd.h i_unistd
-eval $inhdr
-
-: see if getpgrp exists
-set getpgrp d_getpgrp
-eval $inlibc
-
-case "$d_getpgrp" in
-"$define")
- echo " "
- echo "Checking to see which flavor of getpgrp is in use..."
- $cat >try.c <<EOP
-#$i_unistd I_UNISTD
-#include <sys/types.h>
-#ifdef I_UNISTD
-# include <unistd.h>
-#endif
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-int main()
-{
- if (getuid() == 0) {
- printf("(I see you are running Configure as super-user...)\n");
- setuid(1);
- }
-#ifdef TRY_BSD_PGRP
- if (getpgrp(1) == 0)
- exit(0);
-#else
- if (getpgrp() > 0)
- exit(0);
-#endif
- exit(1);
-}
-EOP
- if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
- echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
- val="$define"
- elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
- echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
+: Look for GCC-style attribute malloc
+case "$d_attribute_malloc" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+ if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ echo "Your C compiler doesn't support __attribute__((malloc))."
val="$undef"
else
- echo "I can't seem to compile and run the test program."
- if ./usg; then
- xxx="a USG one, i.e. you use getpgrp()."
- else
- # SVR4 systems can appear rather BSD-ish.
- case "$i_unistd" in
- $undef)
- xxx="a BSD one, i.e. you use getpgrp(pid)."
- val="$define"
- ;;
- $define)
- xxx="probably a USG one, i.e. you use getpgrp()."
- val="$undef"
- ;;
- esac
- fi
- echo "Assuming your getpgrp is $xxx" >&4
+ echo "Your C compiler supports __attribute__((malloc))."
+ val="$define"
fi
- ;;
-*) val="$undef";;
+else
+ echo "Your C compiler doesn't seem to understand __attribute__ at all."
+ val="$undef"
+fi
+;;
+*) val="$d_attribute_malloc" ;;
esac
-set d_bsdgetpgrp
+set d_attribute_malloc
eval $setvar
-$rm -f try try.*
-
-: see if setpgrp exists
-set setpgrp d_setpgrp
-eval $inlibc
+$rm -f attrib*
-case "$d_setpgrp" in
-"$define")
- echo " "
+: Look for GCC-style attribute nonnull
+case "$d_attribute_nonnull" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+ if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ echo "Your C compiler doesn't support __attribute__((nonnull))."
+ val="$undef"
+ else
+ echo "Your C compiler supports __attribute__((nonnull))."
+ val="$define"
+ fi
+else
+ echo "Your C compiler doesn't seem to understand __attribute__ at all."
+ val="$undef"
+fi
+;;
+*) val="$d_attribute_nonnull" ;;
+esac
+set d_attribute_nonnull
+eval $setvar
+$rm -f attrib*
+
+: Look for GCC-style attribute noreturn
+case "$d_attribute_noreturn" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+void fall_over_dead( void ) __attribute__((noreturn));
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+ if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ echo "Your C compiler doesn't support __attribute__((noreturn))."
+ val="$undef"
+ else
+ echo "Your C compiler supports __attribute__((noreturn))."
+ val="$define"
+ fi
+else
+ echo "Your C compiler doesn't seem to understand __attribute__ at all."
+ val="$undef"
+fi
+;;
+*) val="$d_attribute_noreturn" ;;
+esac
+set d_attribute_noreturn
+eval $setvar
+$rm -f attrib*
+
+: Look for GCC-style attribute pure
+case "$d_attribute_pure" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+int square( int n ) __attribute__((pure));
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+ if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ echo "Your C compiler doesn't support __attribute__((pure))."
+ val="$undef"
+ else
+ echo "Your C compiler supports __attribute__((pure))."
+ val="$define"
+ fi
+else
+ echo "Your C compiler doesn't seem to understand __attribute__ at all."
+ val="$undef"
+fi
+;;
+*) val="$d_attribute_pure" ;;
+esac
+set d_attribute_pure
+eval $setvar
+$rm -f attrib*
+
+: Look for GCC-style attribute unused
+case "$d_attribute_unused" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+int do_something( int dummy __attribute__((unused)), int n );
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+ if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ echo "Your C compiler doesn't support __attribute__((unused))."
+ val="$undef"
+ else
+ echo "Your C compiler supports __attribute__((unused))."
+ val="$define"
+ fi
+else
+ echo "Your C compiler doesn't seem to understand __attribute__ at all."
+ val="$undef"
+fi
+;;
+*) val="$d_attribute_unused" ;;
+esac
+set d_attribute_unused
+eval $setvar
+$rm -f attrib*
+
+: Look for GCC-style attribute warn_unused_result
+case "$d_attribute_warn_unused_result" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+ if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
+ val="$undef"
+ else
+ echo "Your C compiler supports __attribute__((warn_unused_result))."
+ val="$define"
+ fi
+else
+ echo "Your C compiler doesn't seem to understand __attribute__ at all."
+ val="$undef"
+fi
+;;
+*) val="$d_attribute_warn_unused_result" ;;
+esac
+set d_attribute_warn_unused_result
+eval $setvar
+$rm -f attrib*
+
+: see if bcmp exists
+set bcmp d_bcmp
+eval $inlibc
+
+: see if bcopy exists
+set bcopy d_bcopy
+eval $inlibc
+
+: see if this is a unistd.h system
+set unistd.h i_unistd
+eval $inhdr
+
+: see if getpgrp exists
+set getpgrp d_getpgrp
+eval $inlibc
+
+case "$d_getpgrp" in
+"$define")
+ echo " "
+ echo "Checking to see which flavor of getpgrp is in use..."
+ $cat >try.c <<EOP
+#$i_unistd I_UNISTD
+#include <sys/types.h>
+#ifdef I_UNISTD
+# include <unistd.h>
+#endif
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+int main()
+{
+ if (getuid() == 0) {
+ printf("(I see you are running Configure as super-user...)\n");
+ setuid(1);
+ }
+#ifdef TRY_BSD_PGRP
+ if (getpgrp(1) == 0)
+ exit(0);
+#else
+ if (getpgrp() > 0)
+ exit(0);
+#endif
+ exit(1);
+}
+EOP
+ if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
+ echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
+ val="$define"
+ elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
+ echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
+ val="$undef"
+ else
+ echo "I can't seem to compile and run the test program."
+ if ./usg; then
+ xxx="a USG one, i.e. you use getpgrp()."
+ else
+ # SVR4 systems can appear rather BSD-ish.
+ case "$i_unistd" in
+ $undef)
+ xxx="a BSD one, i.e. you use getpgrp(pid)."
+ val="$define"
+ ;;
+ $define)
+ xxx="probably a USG one, i.e. you use getpgrp()."
+ val="$undef"
+ ;;
+ esac
+ fi
+ echo "Assuming your getpgrp is $xxx" >&4
+ fi
+ ;;
+*) val="$undef";;
+esac
+set d_bsdgetpgrp
+eval $setvar
+$rm -f try try.*
+
+: see if setpgrp exists
+set setpgrp d_setpgrp
+eval $inlibc
+
+case "$d_setpgrp" in
+"$define")
+ echo " "
echo "Checking to see which flavor of setpgrp is in use..."
$cat >try.c <<EOP
#$i_unistd I_UNISTD
i32 = ($xxx) g;
/* x86 processors will probably give 0x8000 0000, which is a
- sign change. We don't want that. We want to mimic SPARC
+ sign change. We don't want that. We want to mimic SPARC
behavior here, which is to preserve the sign and give
back 0x7fff ffff.
*/
set class d_class
eval $inlibc
+: see if clearenv exists
+set clearenv d_clearenv
+eval $inlibc
+
hasstruct='varname=$1; struct=$2; shift; shift;
while $test $# -ge 2; do
case "$1" in
exit(1);
}
EOM
+val=$undef
set dirfd
if eval $compile; then
val="$define"
esac
$rm -f try try.* .out core head.c mtry
-: see if fchdir exists
-set fchdir d_fchdir
-eval $inlibc
+: see if _ptr and _cnt from stdio act std
+echo " "
-: see if fchmod exists
-set fchmod d_fchmod
-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
+
+: 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
+
+: 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
8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
esac
+d_futimes="$undef"
+: check for a working futimes
+echo " "
+echo "Checking for a working futimes()" >&4
+$cat >try.c <<EOCP
+#include <stdio.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <fcntl.h>
+
+int main ()
+{
+ int fd, rv;
+ fd = open ("try.c", O_RDWR);
+ if (-1 == fd) exit (1);
+ rv = futimes (fd, NULL);
+ exit (rv == -1 ? errno : 0);
+}
+EOCP
+set try
+if eval $compile; then
+ `$run ./try`
+ rc=$?
+ case "$rc" in
+ 0) echo "Yes, it does" >&4
+ d_futimes="$define"
+ ;;
+ *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
+ ;;
+ esac
+else
+ echo "No, it does not (probably harmless)\n" >&4
+fi
+$rm -f try.* try core core.try.*
+
: see if getcwd exists
set getcwd d_getcwd
eval $inlibc
set d_ldbl_dig
eval $setvar
-: see if link exists
-set link d_link
-eval $inlibc
+: see if this is a math.h system
+set math.h i_math
+eval $inhdr
-: see if localtime_r exists
-set localtime_r d_localtime_r
-eval $inlibc
-case "$d_localtime_r" in
-"$define")
- hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
- case "$d_localtime_r_proto:$usethreads" in
- ":define") d_localtime_r_proto=define
- set d_localtime_r_proto localtime_r $hdrs
- eval $hasproto ;;
+d_libm_lib_version="$undef"
+case $i_math in
+ $define)
+ : check to see if math.h defines _LIB_VERSION
+ echo " "
+ echo "Checking to see if your libm supports _LIB_VERSION..." >&4
+ $cat >try.c <<EOCP
+#include <unistd.h>
+#include <math.h>
+int main (int argc, char *argv[])
+{
+ printf ("%d\n", _LIB_VERSION);
+ return (0);
+ } /* main */
+EOCP
+ set try
+ if eval $compile; then
+ foo=`$run ./try`
+ echo "Yes, it does ($foo)" >&4
+ d_libm_lib_version="$define"
+ else
+ echo "No, it does not (probably harmless)\n" >&4
+ fi
+ $rm -f try.* try core core.try.*
+ ;;
+
+ esac
+
+: see if link exists
+set link d_link
+eval $inlibc
+
+: see if localtime_r exists
+set localtime_r d_localtime_r
+eval $inlibc
+case "$d_localtime_r" in
+"$define")
+ hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
+ case "$d_localtime_r_proto:$usethreads" in
+ ":define") d_localtime_r_proto=define
+ set d_localtime_r_proto localtime_r $hdrs
+ eval $hasproto ;;
*) ;;
esac
case "$d_localtime_r_proto" in
set madvise d_madvise
eval $inlibc
+: see if malloc_size exists
+set malloc_size d_malloc_size
+eval $inlibc
+
+: see if malloc_size_good exists
+set malloc_good_size d_malloc_good_size
+eval $inlibc
+
: see if mblen exists
set mblen d_mblen
eval $inlibc
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
: see if prototype for modfl is available
echo " "
-set d_modflproto modfl math.h
+set d_modflproto modfl $i_math math.h
eval $hasproto
d_modfl_pow32_bug="$undef"
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 munmap d_munmap
eval $inlibc
-: see if nanosleep exists
-set nanosleep d_nanosleep
-eval $inlibc
-
: see if nice exists
set nice d_nice
eval $inlibc
$rm -f try.* try
+$echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
+: volatile so that the compiler has to store it out to memory.
+if test X"$d_volatile" = X"$define"; then
+ volatile=volatile
+fi
+$cat <<EOP >try.c
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#$i_string I_STRING
+#ifdef I_STRING
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+#include <sys/types.h>
+#include <signal.h>
+#ifdef SIGFPE
+$volatile int bletched = 0;
+$signal_t blech(s) int s; { bletched = 1; }
+#endif
+
+int checkit($nvtype d, char *where) {
+ unsigned char *p = (char *)&d;
+ unsigned char *end = p + sizeof(d);
+ int fail = 0;
+
+ while (p < end)
+ fail += *p++;
+
+ if (!fail)
+ return 0;
+
+ p = (char *)&d;
+ printf("No - %s: 0x", where);
+ while (p < end)
+ printf ("%02X", *p++);
+ printf("\n");
+ return 1;
+}
+
+int main(int argc, char **argv) {
+ $nvtype d = 0.0;
+ int fail = 0;
+ fail += checkit(d, "0.0");
+
+ /* The compiler shouldn't be assuming that bletched is 0 */
+ d = bletched;
+
+ fail += checkit(d, "bleched");
+
+#ifdef SIGFPE
+ signal(SIGFPE, blech);
+#endif
+
+ /* Paranoia - the compiler should have no way of knowing that ANSI says
+ that argv[argc] will always be NULL. Actually, if it did assume this it
+ would be buggy, as this is C and main() can be called from elsewhere in
+ the program. */
+ d = argv[argc] ? 1 : 0;
+
+ if (d) {
+ printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
+ }
+
+ fail += checkit(d, "ternary");
+
+ memset(&d, sizeof(d), argv[argc] ? 1 : 0);
+
+ if (d != 0.0) {
+ printf("No - memset doesn't give 0.0\n");
+ /* This might just blow up: */
+ printf("(gives %g)\n", d);
+ return 1;
+ }
+
+#ifdef SIGFPE
+ if (bletched) {
+ printf("No - something bleched\n");
+ return 1;
+ }
+#endif
+ if (fail) {
+ printf("No - %d fail(s)\n", fail);
+ return 1;
+ }
+ printf("Yes\n");
+ return 0;
+}
+EOP
+set try
+
+d_nv_zero_is_allbits_zero="$undef"
+if eval $compile; then
+ xxx="`$run ./try`"
+ case "$?" in
+ 0)
+ case "$xxx" in
+ Yes) cat >&4 <<EOM
+0.0 is represented as all bits zero in memory
+EOM
+ d_nv_zero_is_allbits_zero="$define"
+ ;;
+ *) cat >&4 <<EOM
+0.0 is not represented as all bits zero in memory
+EOM
+ d_nv_zero_is_allbits_zero="$undef"
+ ;;
+ esac
+ ;;
+ *) cat >&4 <<EOM
+0.0 is not represented as all bits zero in memory
+EOM
+ d_nv_zero_is_allbits_zero="$undef"
+ ;;
+ esac
+fi
+
+$rm -f try.* try
+
: check for off64_t
echo " "
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 "You do not have union semun in <sys/sem.h>." >&4
val="$undef"
fi
-$rm -f try try.c try.h
+$rm -f try try.c
set d_union_semun
eval $setvar
: see how to do semctl IPC_STAT
case "$d_sem" in
$define)
- : see whether semctl IPC_STAT can use union semun
echo " "
$cat > try.h <<END
#ifndef S_IRUSR
# define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
#endif
END
-
- $cat > try.c <<END
+ : see whether semctl IPC_STAT can use union semun
+ case "$d_semctl_semun" in
+ '')
+ val="$undef"
+ $cat > try.c <<END
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
printf("semctl IPC_STAT failed: errno = %d\n", errno);
# ifdef IPC_RMID
if (semctl(sem, 0, IPC_RMID, arg) != 0)
-# endif /* IPC_RMID */
+# endif /* IPC_RMID */
printf("semctl IPC_RMID failed: errno = %d\n", errno);
} else
#endif /* IPC_PRIVATE && ... */
return 0;
}
END
- val="$undef"
- set try
- if eval $compile; then
- xxx=`$run ./try`
- case "$xxx" in
- semun) val="$define" ;;
- esac
- fi
- $rm -f try try.c
- set d_semctl_semun
- eval $setvar
+ set try
+ if eval $compile; then
+ xxx=`$run ./try`
+ case "$xxx" in
+ semun) val="$define" ;;
+ esac
+ fi
+ $rm -f try try.c
+ set d_semctl_semun
+ eval $setvar
+ ;;
+ esac
case "$d_semctl_semun" in
$define)
echo "You can use union semun for semctl IPC_STAT." >&4
esac
: see whether semctl IPC_STAT can use struct semid_ds pointer
- $cat > try.c <<'END'
+ case "$d_semctl_semid_ds" in
+ '')
+ val="$undef"
+ $cat > try.c <<'END'
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
return 0;
}
END
- val="$undef"
- set try
- if eval $compile; then
- xxx=`$run ./try`
- case "$xxx" in
- semid_ds) val="$define" ;;
- esac
- fi
- $rm -f try try.c
- set d_semctl_semid_ds
- eval $setvar
+ set try
+ if eval $compile; then
+ xxx=`$run ./try`
+ case "$xxx" in
+ semid_ds) val="$define" ;;
+ esac
+ fi
+ $rm -f try try.c
+ set d_semctl_semid_ds
+ eval $setvar
+ ;;
+ esac
case "$d_semctl_semid_ds" in
$define)
echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
eval $setvar
$rm -f try.c try
+: see if snprintf exists
+set snprintf d_snprintf
+eval $inlibc
+
+: see if vsnprintf exists
+set vsnprintf d_vsnprintf
+eval $inlibc
+
+case "$d_snprintf-$d_vsnprintf" in
+"$define-$define")
+ $cat <<EOM
+Checking whether your snprintf() and vsnprintf() work okay...
+EOM
+ $cat >try.c <<'EOCP'
+/* v?snprintf testing logic courtesy of Russ Allbery.
+ * According to C99:
+ * - if the buffer is too short it still must be \0-terminated
+ * - if the buffer is too short the potentially required length
+ * must be returned and not -1
+ * - if the buffer is NULL the potentially required length
+ * must be returned and not -1 or core dump
+ */
+#include <stdio.h>
+#include <stdarg.h>
+
+char buf[2];
+
+int test (char *format, ...)
+{
+ va_list args;
+ int count;
+
+ va_start (args, format);
+ count = vsnprintf (buf, sizeof buf, format, args);
+ va_end (args);
+ return count;
+}
+
+int main ()
+{
+ return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
+ && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
+}
+EOCP
+ set try
+ if eval $compile; then
+ `$run ./try`
+ case "$?" in
+ 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
+ *) cat <<EOM >&4
+Your snprintf() and snprintf() don't seem to be working okay.
+EOM
+ d_snprintf="$undef"
+ d_vsnprintf="$undef"
+ ;;
+ esac
+ else
+ echo "(I can't seem to compile the test program--assuming they don't)"
+ d_snprintf="$undef"
+ d_vsnprintf="$undef"
+ fi
+ $rm -f try.* try core core.try.*
+ ;;
+esac
+
: see if sockatmark exists
set sockatmark d_sockatmark
eval $inlibc
set socks5_init d_socks5_init
eval $inlibc
+: see if sprintf returns the length of the string in the buffer as per ANSI
+$echo "Checking whether sprintf returns the length of the string..." >&4
+$cat <<EOP >try.c
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#$i_string I_STRING
+#ifdef I_STRING
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+#$i_math I_MATH
+#ifdef I_MATH
+#include <math.h>
+#endif
+
+char buffer[256];
+
+int check (size_t expect, int test) {
+ size_t got = strlen(buffer);
+ if (expect == got)
+ return 0;
+
+ printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
+ test, buffer);
+ exit (test);
+}
+
+int main(int argc, char **argv) {
+ int test = 0;
+
+ check(sprintf(buffer, ""), ++test);
+ check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
+ check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
+
+ return 0;
+}
+EOP
+set try
+
+d_sprintf_returns_strlen="$undef"
+if eval $compile; then
+ xxx="`$run ./try`"
+ case "$?" in
+ 0) cat >&4 <<EOM
+sprintf returns the length of the string (as ANSI says it should)
+EOM
+ d_sprintf_returns_strlen="$define"
+ ;;
+ *) cat >&4 <<EOM
+sprintf does not return the length of the string (how old is this system?)
+EOM
+ d_sprintf_returns_strlen="$undef"
+ ;;
+ esac
+fi
+
+$rm -f try.* try
+
: see if srand48_r exists
set srand48_r d_srand48_r
eval $inlibc
define)
case "$srandom_r_proto" in
''|0) try='int srandom_r(unsigned int, struct random_data*);'
- ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
- esac
- case "$srandom_r_proto" in
- ''|0) d_srandom_r=undef
- srandom_r_proto=0
- echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
- * ) case "$srandom_r_proto" in
- REENTRANT_PROTO*) ;;
- *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
- esac
- echo "Prototype: $try" ;;
- esac
- ;;
- *) case "$usethreads" in
- define) echo "srandom_r has no prototype, not using it." >&4 ;;
- esac
- d_srandom_r=undef
- srandom_r_proto=0
- ;;
- esac
- ;;
-*) srandom_r_proto=0
- ;;
-esac
-
-: see if prototype for setresgid is available
-echo " "
-set d_sresgproto setresgid $i_unistd unistd.h
-eval $hasproto
-
-: see if prototype for setresuid is available
-echo " "
-set d_sresuproto setresuid $i_unistd unistd.h
-eval $hasproto
-
-: 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 '_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"
+ ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
+ esac
+ case "$srandom_r_proto" in
+ ''|0) d_srandom_r=undef
+ srandom_r_proto=0
+ echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
+ * ) case "$srandom_r_proto" in
+ REENTRANT_PROTO*) ;;
+ *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
+ esac
+ echo "Prototype: $try" ;;
+ esac
+ ;;
+ *) case "$usethreads" in
+ define) echo "srandom_r has no prototype, not using it." >&4 ;;
+ esac
+ d_srandom_r=undef
+ srandom_r_proto=0
;;
esac
;;
+*) srandom_r_proto=0
+ ;;
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
+: see if prototype for setresgid is available
+echo " "
+set d_sresgproto setresgid $i_unistd unistd.h
+eval $hasproto
-: 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
+: see if prototype for setresuid is available
+echo " "
+set d_sresuproto setresuid $i_unistd unistd.h
+eval $hasproto
+: see if sys/stat.h is available
+set sys/stat.h i_sysstat
+eval $inhdr
-: 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;
+: 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
- 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
- ;;
+: 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 _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
+
+
+: 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
-set d_stdiobase
-eval $setvar
+case "$d_statfs_f_flags" in
+"$define") echo "Yes, it does." ;;
+*) echo "No, it doesn't." ;;
+esac
$cat >&4 <<EOM
Checking how to access stdio streams by file descriptor number...
set strftime d_strftime
eval $inlibc
+: see if strlcat exists
+set strlcat d_strlcat
+eval $inlibc
+
+: see if strlcpy exists
+set strlcpy d_strlcpy
+eval $inlibc
+
: see if strtod exists
set strtod d_strtod
eval $inlibc
buf[1] = 0;
buf[2] = 0;
buf[3] = 1;
+ buf[4] = 0;
buf[5] = 0;
buf[6] = 0;
- buf[7] = 0;
- buf[8] = 1;
+ buf[7] = 1;
for (i = 0; i < 4; i++) {
up = (U32*)(buf + i);
set unordered d_unordered
eval $inlibc
+: see if unsetenv exists
+set unsetenv d_unsetenv
+eval $inlibc
+
: see if usleep exists
set usleep d_usleep
eval $inlibc
: 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
set pid_t pidtype int stdio.h sys/types.h
eval $typedef_ask
-: Find earliest binary compatible site_perl subdirectory perl can use.
-xs_apiversion=$version # The current site_perl version.
-: Find earliest pure perl site_perl subdirectory perl can use.
-: The versioned directories started at 5.005.
-pm_apiversion='5.005'
-
: see if ar generates random libraries by itself
echo " "
echo "Checking how to generate random libraries on your machine..." >&4
$run ./foobar >/dev/null 2>&1; then
echo "$ar appears to generate random libraries itself."
orderlib=false
- ranlib=":"
+ if [ "X$ranlib" = "X" ]; then
+ ranlib=":"
+ fi
elif $ar ts bar$_a >/dev/null 2>&1 &&
$cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
$run ./foobar >/dev/null 2>&1; then
: check for the select 'width'
case "$selectminbits" in
-'') case "$d_select" in
+'') safebits=`expr $ptrsize \* 8`
+ case "$d_select" in
$define)
$cat <<EOM
#define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
#define NBITS (NBYTES * 8)
int main() {
- char s[NBYTES];
+ char *s = malloc(NBYTES);
struct timeval t;
int i;
FILE* fp;
int fd;
+ if (!s)
+ exit(1);
fclose(stdin);
fp = fopen("try.c", "r");
if (fp == 0)
- exit(1);
+ exit(2);
fd = fileno(fp);
if (fd < 0)
- exit(2);
+ exit(3);
b = ($selecttype)s;
for (i = 0; i < NBITS; i++)
FD_SET(i, b);
t.tv_usec = 0;
select(fd + 1, b, 0, 0, &t);
for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
+ free(s);
printf("%d\n", i + 1);
return 0;
}
case "$selectminbits" in
'') cat >&4 <<EOM
Cannot figure out on how many bits at a time your select() operates.
-I'll play safe and guess it is 32 bits.
+I'll play safe and guess it is $safebits bits.
EOM
- selectminbits=32
- bits="32 bits"
+ selectminbits=$safebits
+ bits="$safebits bits"
;;
1) bits="1 bit" ;;
*) bits="$selectminbits bits" ;;
else
rp='What is the minimum number of bits your select() operates on?'
case "$byteorder" in
- 1234|12345678) dflt=32 ;;
+ 12345678) dflt=64 ;;
+ 1234) dflt=32 ;;
*) dflt=1 ;;
esac
. ./myread
$rm -f try.* try
;;
*) : no select, so pick a harmless default
- selectminbits='32'
+ selectminbits=$safebits
;;
esac
;;
#endif
#ifndef NSIG
+# ifdef _SIG_MAX
+# define NSIG (_SIG_MAX+1)
+# endif
+#endif
+
+#ifndef NSIG
# ifdef MAXSIG
# define NSIG (MAXSIG+1)
# endif
#ifndef NSIG
# ifdef SIGARRAYSIZE
-# define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
+# define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
# endif
#endif
: see what type of char stdio uses.
echo " "
-echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
+echo '#include <stdio.h>' > stdio.c
+$cppstdin $cppminus < stdio.c > stdioh
if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
echo "Your stdio uses unsigned chars." >&4
stdchar="unsigned char"
echo "Your stdio uses signed chars." >&4
stdchar="char"
fi
-$rm -f stdioh
-
-
+$rm -f stdio.* stdioh
: see what type uids are declared as in the kernel
echo " "
;;
esac
+
+case "$usesitecustomize" in
+ $define|true|[Yy]*)
+ usesitecustomize="$define"
+ ;;
+ *)
+ usesitecustomize="$undef"
+ ;;
+ esac
+
: determine compiler compiler
case "$yacc" in
'')
-: see if this is a math.h system
-set math.h i_math
-eval $inhdr
-
: see if this is a mntent.h system
set mntent.h i_mntent
eval $inhdr
$cat <<'EOSH' > Cppsym.know
a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
-alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
+alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
bull c cadmus clipper CMU COFF COMPILER_VERSION
concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
-CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
+CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
GLIBC GLIBC_MINOR
USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
USGr4 USGr4_2
-Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
+Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
z8000
$startsh
cat <<'EOCP' > try.c
#include <stdio.h>
+#if cpp_stuff == 1
+#define STRINGIFY(a) "a"
+#endif
+#if cpp_stuff == 42
+#define StGiFy(a) #a
+#define STRINGIFY(a) StGiFy(a)
+#endif
+#if $cpp_stuff != 1 && $cpp_stuff != 42
+# include "Bletch: How does this C preprocessor stringify macros?"
+#endif
int main() {
EOCP
$awk \\
EOSH
cat <<'EOSH' >> Cppsym.try
'length($1) > 0 {
- printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", (long)%s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
- printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", (long)_%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
- printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", (long)__%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
- printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", (long)__%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
+ printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
+ printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
+ printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
+ printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
}' >> try.c
echo 'return 0;}' >> try.c
EOSH
irix-) ccflags="\$ccflags -woff 1178" ;;
os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
esac
-$cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
+$cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
EOSH
chmod +x Cppsym.try
$eunicefix Cppsym.try
$awk '/\=/ { print $0; next }
{ print $0"=1" }' ccsym.raw >ccsym.list
-$awk '/\=/ { print $0; next }
- { print $0"=1" }' Cppsym.true >ccsym.true
-$comm -13 ccsym.true ccsym.list >ccsym.own
-$comm -12 ccsym.true ccsym.list >ccsym.com
-$comm -23 ccsym.true ccsym.list >ccsym.cpp
+$comm -13 Cppsym.true ccsym.list >ccsym.own
+$comm -12 Cppsym.true ccsym.list >ccsym.com
+$comm -23 Cppsym.true ccsym.list >ccsym.cpp
also=''
if $test -z ccsym.raw; then
echo "Your C compiler doesn't seem to define any symbols!" >&4
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_asctime_r='$d_asctime_r'
d_atolf='$d_atolf'
d_atoll='$d_atoll'
-d_attribut='$d_attribut'
+d_attribute_format='$d_attribute_format'
+d_attribute_malloc='$d_attribute_malloc'
+d_attribute_nonnull='$d_attribute_nonnull'
+d_attribute_noreturn='$d_attribute_noreturn'
+d_attribute_pure='$d_attribute_pure'
+d_attribute_unused='$d_attribute_unused'
+d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
d_bcmp='$d_bcmp'
d_bcopy='$d_bcopy'
d_bsd='$d_bsd'
d_chroot='$d_chroot'
d_chsize='$d_chsize'
d_class='$d_class'
+d_clearenv='$d_clearenv'
d_closedir='$d_closedir'
d_cmsghdr_s='$d_cmsghdr_s'
d_const='$d_const'
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_fsync='$d_fsync'
d_ftello='$d_ftello'
d_ftime='$d_ftime'
+d_futimes='$d_futimes'
d_getcwd='$d_getcwd'
d_getespwnam='$d_getespwnam'
d_getfsstat='$d_getfsstat'
d_killpg='$d_killpg'
d_lchown='$d_lchown'
d_ldbl_dig='$d_ldbl_dig'
+d_libm_lib_version='$d_libm_lib_version'
d_link='$d_link'
d_localtime_r='$d_localtime_r'
d_locconv='$d_locconv'
d_lseekproto='$d_lseekproto'
d_lstat='$d_lstat'
d_madvise='$d_madvise'
+d_malloc_good_size='$d_malloc_good_size'
+d_malloc_size='$d_malloc_size'
d_mblen='$d_mblen'
d_mbstowcs='$d_mbstowcs'
d_mbtowc='$d_mbtowc'
d_msync='$d_msync'
d_munmap='$d_munmap'
d_mymalloc='$d_mymalloc'
-d_nanosleep='$d_nanosleep'
d_nice='$d_nice'
d_nl_langinfo='$d_nl_langinfo'
d_nv_preserves_uv='$d_nv_preserves_uv'
+d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
d_off64_t='$d_off64_t'
d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
d_oldpthreads='$d_oldpthreads'
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'
d_sigaction='$d_sigaction'
d_sigprocmask='$d_sigprocmask'
d_sigsetjmp='$d_sigsetjmp'
+d_snprintf='$d_snprintf'
d_sockatmark='$d_sockatmark'
d_sockatmarkproto='$d_sockatmarkproto'
d_socket='$d_socket'
d_socklen_t='$d_socklen_t'
d_sockpair='$d_sockpair'
d_socks5_init='$d_socks5_init'
+d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
d_sqrtl='$d_sqrtl'
d_srand48_r='$d_srand48_r'
d_srandom_r='$d_srandom_r'
d_strerror='$d_strerror'
d_strerror_r='$d_strerror_r'
d_strftime='$d_strftime'
+d_strlcat='$d_strlcat'
+d_strlcpy='$d_strlcpy'
d_strtod='$d_strtod'
d_strtol='$d_strtol'
d_strtold='$d_strtold'
d_uname='$d_uname'
d_union_semun='$d_union_semun'
d_unordered='$d_unordered'
+d_unsetenv='$d_unsetenv'
d_usleep='$d_usleep'
d_usleepproto='$d_usleepproto'
d_ustat='$d_ustat'
d_voidtty='$d_voidtty'
d_volatile='$d_volatile'
d_vprintf='$d_vprintf'
+d_vsnprintf='$d_vsnprintf'
d_wait4='$d_wait4'
d_waitpid='$d_waitpid'
d_wcstombs='$d_wcstombs'
installscript='$installscript'
installsitearch='$installsitearch'
installsitebin='$installsitebin'
-installsitehtml1='$installsitehtml1'
-installsitehtml3='$installsitehtml3'
+installsitehtml1dir='$installsitehtml1dir'
+installsitehtml3dir='$installsitehtml3dir'
installsitelib='$installsitelib'
-installsiteman1='$installsiteman1'
-installsiteman3='$installsiteman3'
+installsiteman1dir='$installsiteman1dir'
+installsiteman3dir='$installsiteman3dir'
installsitescript='$installsitescript'
installstyle='$installstyle'
installusrbinperl='$installusrbinperl'
installvendorarch='$installvendorarch'
installvendorbin='$installvendorbin'
-installvendorhtml1='$installvendorhtml1'
-installvendorhtml3='$installvendorhtml3'
+installvendorhtml1dir='$installvendorhtml1dir'
+installvendorhtml3dir='$installvendorhtml3dir'
installvendorlib='$installvendorlib'
-installvendorman1='$installvendorman1'
-installvendorman3='$installvendorman3'
+installvendorman1dir='$installvendorman1dir'
+installvendorman3dir='$installvendorman3dir'
installvendorscript='$installvendorscript'
intsize='$intsize'
issymlink='$issymlink'
man3direxp='$man3direxp'
man3ext='$man3ext'
mips_type='$mips_type'
+mistrustnm='$mistrustnm'
mkdir='$mkdir'
mmaptype='$mmaptype'
modetype='$modetype'
phostname='$phostname'
pidtype='$pidtype'
plibpth='$plibpth'
-pm_apiversion='$pm_apiversion'
pmake='$pmake'
pr='$pr'
prefix='$prefix'
sitearchexp='$sitearchexp'
sitebin='$sitebin'
sitebinexp='$sitebinexp'
-sitehtml1='$sitehtml1'
-sitehtml1exp='$sitehtml1exp'
-sitehtml3='$sitehtml3'
-sitehtml3exp='$sitehtml3exp'
+sitehtml1dir='$sitehtml1dir'
+sitehtml1direxp='$sitehtml1direxp'
+sitehtml3dir='$sitehtml3dir'
+sitehtml3direxp='$sitehtml3direxp'
sitelib='$sitelib'
sitelib_stem='$sitelib_stem'
sitelibexp='$sitelibexp'
-siteman1='$siteman1'
-siteman1exp='$siteman1exp'
-siteman3='$siteman3'
-siteman3exp='$siteman3exp'
+siteman1dir='$siteman1dir'
+siteman1direxp='$siteman1direxp'
+siteman3dir='$siteman3dir'
+siteman3direxp='$siteman3direxp'
siteprefix='$siteprefix'
siteprefixexp='$siteprefixexp'
sitescript='$sitescript'
use64bitint='$use64bitint'
usecrosscompile='$usecrosscompile'
usedl='$usedl'
+usefaststdio='$usefaststdio'
useithreads='$useithreads'
uselargefiles='$uselargefiles'
uselongdouble='$uselongdouble'
+usemallocwrap='$usemallocwrap'
usemorebits='$usemorebits'
usemultiplicity='$usemultiplicity'
usemymalloc='$usemymalloc'
useperlio='$useperlio'
useposix='$useposix'
usereentrant='$usereentrant'
+userelocatableinc='$userelocatableinc'
usesfio='$usesfio'
useshrplib='$useshrplib'
+usesitecustomize='$usesitecustomize'
usesocks='$usesocks'
usethreads='$usethreads'
usevendorprefix='$usevendorprefix'
vendorarchexp='$vendorarchexp'
vendorbin='$vendorbin'
vendorbinexp='$vendorbinexp'
-vendorhtml1='$vendorhtml1'
-vendorhtml1exp='$vendorhtml1exp'
-vendorhtml3='$vendorhtml3'
-vendorhtml3exp='$vendorhtml3exp'
+vendorhtml1dir='$vendorhtml1dir'
+vendorhtml1direxp='$vendorhtml1direxp'
+vendorhtml3dir='$vendorhtml3dir'
+vendorhtml3direxp='$vendorhtml3direxp'
vendorlib='$vendorlib'
vendorlib_stem='$vendorlib_stem'
vendorlibexp='$vendorlibexp'
-vendorman1='$vendorman1'
-vendorman1exp='$vendorman1exp'
-vendorman3='$vendorman3'
-vendorman3exp='$vendorman3exp'
+vendorman1dir='$vendorman1dir'
+vendorman1direxp='$vendorman1direxp'
+vendorman3dir='$vendorman3dir'
+vendorman3direxp='$vendorman3direxp'
vendorprefix='$vendorprefix'
vendorprefixexp='$vendorprefixexp'
vendorscript='$vendorscript'
vi='$vi'
voidflags='$voidflags'
xlibpth='$xlibpth'
-xs_apiversion='$xs_apiversion'
yacc='$yacc'
yaccflags='$yaccflags'
zcat='$zcat'