X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/47ef2f80a353917e46d5ef248320c351162a97b2..b88265bf55b10378bad9d6fa48c8bc3d9e1e763d:/Configure diff --git a/Configure b/Configure index 4453f38..3d65fd2 100755 --- a/Configure +++ b/Configure @@ -11,10 +11,13 @@ # Yes, you may rip this off to use in other distribution packages. This # script belongs to the public domain and cannot be copyrighted. # -# Note: this Configure script was generated automatically. Rather than -# working with this copy of Configure, you may wish to get metaconfig. -# The dist package (which contains metaconfig) is available via SVN: -# svn co https://svn.code.sf.net/p/dist/code/trunk/dist +# Note: this Configure script was generated automatically by the tool +# called "metaconfig". Rather than working with this copy of Configure, +# you may wish to get metaconfig. Perl uses a modified version of this +# tool, available in the "dist" folder in the checkout of the git repo +# $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig +# The original dist package (including metaconfig) is available via SVN: +# $ svn co https://svn.code.sf.net/p/dist/code/trunk/dist # # Though this script was generated by metaconfig from metaunits, it is # OK to send patches against Configure itself. It's up to the Configure @@ -26,7 +29,6 @@ # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig # # See Porting/pumpkin.pod for more information on metaconfig. -# # Generated using [metaconfig 3.5 PL0] # (with additional metaconfig patches by perlbug@perl.org) @@ -67,7 +69,10 @@ EOF exit 1 fi -if test ! -c /dev/null ; then +if test -f /sys/utilities/MultiView ; then + # AmigaOS, test -c for /dev/null is not useful + : +elif test ! -c /dev/null ; then cat <optdef.sh </dev/null 2>&1 +if test $? = 0; then + echo "Configure does not support \\ in -D arguments" + exit 1 +fi . ./optdef.sh : create the posthint manipulation script and leave the file out there... touch posthint.sh @@ -1799,8 +1885,8 @@ touch posthint.sh package='perl5' first=`echo $package | sed -e 's/^\(.\).*/\1/'` last=`echo $package | sed -e 's/^.\(.*\)/\1/'` -case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in -ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;; +case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in +ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;; *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;; esac @@ -1961,7 +2047,7 @@ true) echo "Fetching answers from $config_sh..." cd .. . $config_sh - test "$override" && . ./optdef.sh + . UU/optdef.sh echo " " . UU/extract rm -rf UU @@ -2649,11 +2735,11 @@ EOM # The most common problem is -D_REENTRANT for threads. # This heuristic catches that case, but gets false positives # if -Dusethreads was not actually specified. Better to - # bail out here with a useful message than fail + # bail out here with a useful message than fail # mysteriously later. Should we perhaps just try to # re-invoke Configure -Dcc=gcc config_args ? if $test -f usethreads.cbu; then - $cat >&4 <&4 <&2 exit 1 fi - fi + fi case "$ans" in [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no; esac @@ -2691,9 +2777,9 @@ cat <checkcc $startsh EOS cat <<'EOSC' >>checkcc -case "$cc" in +case "$cc" in '') ;; -*) $rm -f try try.* +*) $rm -f try try.* $cat >try.c <&4 fi - $cat >&4 <&4 <&4 - echo "(First creating the subdirectories...)" >&4 cd .. - awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do - read directory - test -z "$directory" && break - mkdir -p $directory - done + awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' | + awk 'NF == 1 { + dir="."; + file=$1 ""; + } + NF == 2 { + dir=$1 ""; + file=$2 ""; + } + { + print "# dir = ", dir, "file = ", file + mf[dir] = mf[dir]" "source"/"dir"/"file; + } END { + for (d in mf) { + if (d != ".") { print("mkdir -p "d) } + print("ln -sf "mf[d]" "d); + } + }' source="$src" > UU/mksymlinks.$$ + sh UU/mksymlinks.$$ + rm UU/mksymlinks.$$ # Sanity check 1. if test ! -d t/base; then echo "Failed to create the subdirectories. Aborting." >&4 exit 1 fi - echo "(Then creating the symlinks...)" >&4 - awk '{print $1}' $src/MANIFEST | while true; do - read filename - test -z "$filename" && break - if test -f $filename; then - if $issymlink $filename; then - rm -f $filename - fi - fi - if test -f $filename; then - echo "$filename already exists, not symlinking." - else - ln -s $src/$filename $filename - fi - done # Sanity check 2. if test ! -f t/base/lex.t; then echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4 exit 1 fi + if test ! -f win32/win32.c; then + echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4 + exit 1 + fi cd UU ;; *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4 @@ -3129,8 +3218,8 @@ esac : see whether [:lower:] and [:upper:] are supported character classes echo " " -case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in -ABYZ) +case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in +ABYZ-abyz) echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4 up='[:upper:]' low='[:lower:]' @@ -3278,8 +3367,9 @@ EOM $test -f /bin/mips && /bin/mips && osname=mips $test -d /usr/apollo/bin && osname=apollo $test -f /etc/saf/_sactab && osname=svr4 - $test -d /usr/include/minix && osname=minix + $test -d /usr/include/minix && osname=minix && osvers=`$uname -r` $test -f /system/gnu_library/bin/ar.pm && osname=vos + $test -f /sys/utilities/MultiView && osname=amigaos if $test -d /MachTen -o -d /MachTen_Folder; then osname=machten if $test -x /sbin/version; then @@ -3710,7 +3800,7 @@ cd UU hint=previous ;; esac -test "$override" && . ./optdef.sh +. ./optdef.sh : Restore computed paths for file in $loclist $trylist; do @@ -4257,15 +4347,15 @@ case "$osname" in dos|vms) : XXX Should be a Configure test for double-dots in filenames. version=`echo $revision $patchlevel $subversion | \ - $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` + $awk '{ printf "%d_%d_%d", $1, $2, $3 }'` api_versionstring=`echo $api_revision $api_version $api_subversion | \ - $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` + $awk '{ printf "%d_%d_%d", $1, $2, $3 }'` ;; *) version=`echo $revision $patchlevel $subversion | \ - $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` + $awk '{ printf "%d.%d.%d", $1, $2, $3 }'` api_versionstring=`echo $api_revision $api_version $api_subversion | \ - $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` + $awk '{ printf "%d.%d.%d", $1, $2, $3 }'` ;; esac : Special case the 5.005_xx maintenance series, which used 5.005 @@ -5137,6 +5227,12 @@ EOM esac fi +: Check if quadmath is requested +case "$usequadmath" in +"$define"|true|[yY]*) usequadmath="$define" ;; +*) usequadmath="$undef" ;; +esac + : Looking for optional libraries echo " " echo "Checking for optional libraries..." >&4 @@ -5153,6 +5249,9 @@ esac case "$usecbacktrace" in "$define") libswanted="$libswanted bfd" ;; esac +case "$usequadmath" in +"$define") libswanted="$libswanted quadmath" ;; +esac libsfound='' libsfiles='' libsdirs='' @@ -5167,6 +5266,9 @@ for thislib in $libswanted; do xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'` $test -f "$xxx" && eval $libscheck $test -f "$xxx" && libstyle=shared + xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'` + $test -f "$xxx" && eval $libscheck + $test -f "$xxx" && libstyle=shared fi if test ! -f "$xxx"; then xxx=$thisdir/lib$thislib.$so @@ -5366,9 +5468,20 @@ default|recommended) # is to add the flag to the flags passed to the compiler at link time, # as that way the compiler can do the right implementation dependant # thing. (NWC) - case "$gccversion" in - ?*) set stack-protector -fstack-protector - eval $checkccflag + case "$osname" in + amigaos) ;; # -fstack-protector builds but doesn't work + *) case "$gccversion" in + ?*) set stack-protector-strong -fstack-protector-strong + eval $checkccflag + case "$dflt" in + *-fstack-protector-strong*) ;; # It got added. + *) # Try the plain/older -fstack-protector. + set stack-protector -fstack-protector + eval $checkccflag + ;; + esac + ;; + esac ;; esac ;; @@ -5444,7 +5557,12 @@ esac : the following weeds options from ccflags that are of no interest to cpp case "$cppflags" in '') cppflags="$ccflags" ;; -*) cppflags="$cppflags $ccflags" ;; +*) set X $ccflags; shift + case " $cppflags " in + *" $1 "*) ;; # Try to avoid doubling the cppflags. + *) cppflags="$cppflags $ccflags" ;; + esac + ;; esac case "$gccversion" in 1*) cppflags="$cppflags -D__GNUC__" @@ -5511,6 +5629,12 @@ case "$ldflags" in esac # See note above about -fstack-protector case "$ccflags" in +*-fstack-protector-strong*) + case "$dflt" in + *-fstack-protector-strong*) ;; # Don't add it again + *) dflt="$dflt -fstack-protector-strong" ;; + esac + ;; *-fstack-protector*) case "$dflt" in *-fstack-protector*) ;; # Don't add it again @@ -5642,6 +5766,11 @@ $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;' echo " " echo "Computing filename position in cpp output for #include directives..." >&4 case "$osname" in +amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh). +esac +case "$fieldn" in +'') +case "$osname" in vos) testaccess=-e ;; *) testaccess=-r ;; esac @@ -5666,6 +5795,8 @@ EOF chmod +x fieldn fieldn=`./fieldn` $rm -f foo.c fieldn +;; +esac case $fieldn in '') pos='???';; 1) pos=first;; @@ -6190,1857 +6321,1997 @@ EOF ;; esac -: check for length of double +: Check if we are using the GNU C library echo " " -case "$doublesize" in -'') - echo "Checking to see how big your double precision numbers are..." >&4 - $cat >try.c <&4 +cat >try.c <<'EOCP' +/* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__ + alone are insufficient to distinguish different versions, such as + 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in + libc version 2.1.0. A. Dougherty, June 3, 2002. +*/ #include -#$i_stdlib I_STDLIB -#ifdef I_STDLIB -#include -#endif -int main() +int main(void) { - printf("%d\n", (int)sizeof(double)); - exit(0); +#ifdef __GLIBC__ +# ifdef __GLIBC_MINOR__ +# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus) +# include + printf("%s\n", gnu_get_libc_version()); +# else + printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__); +# endif +# else + printf("%d\n", __GLIBC__); +# endif + return 0; +#else + return 1; +#endif } EOCP - set try - if eval $compile_ok; then - doublesize=`$run ./try` - echo "Your double is $doublesize bytes long." - else - dflt='8' - echo "(I can't seem to compile the test program. Guessing...)" - rp="What is the size of a double precision number (in bytes)?" - . ./myread - doublesize="$ans" - fi - ;; -esac -$rm_try - -: check for long doubles -echo " " -echo "Checking to see if you have long double..." >&4 -echo 'int main() { long double x = 7.0; }' > try.c set try -if eval $compile; then +if eval $compile_ok && $run ./try > glibc.ver; then val="$define" - echo "You have long double." + gnulibc_version=`$cat glibc.ver` + echo "You are using the GNU C Library version $gnulibc_version" else val="$undef" - echo "You do not have long double." + gnulibc_version='' + echo "You are not using the GNU C Library" fi -$rm_try -set d_longdbl +$rm_try glibc.ver +set d_gnulibc eval $setvar -: check for length of long double -case "${d_longdbl}${longdblsize}" in -$define) - echo " " - echo "Checking to see how big your long doubles are..." >&4 - $cat >try.c <<'EOCP' -#include -int main() -{ - printf("%d\n", sizeof(long double)); -} -EOCP - set try - set try - if eval $compile; then - longdblsize=`$run ./try` - echo "Your long doubles are $longdblsize bytes long." - else - dflt='8' +: see if nm is to be used to determine whether a symbol is defined or not +case "$usenm" in +'') + dflt='' + case "$d_gnulibc" in + "$define") echo " " - echo "(I can't seem to compile the test program. Guessing...)" >&4 - rp="What is the size of a long double (in bytes)?" - . ./myread - longdblsize="$ans" - fi - if $test "X$doublesize" = "X$longdblsize"; then - 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 + echo "nm probably won't work on the GNU C Library." >&4 + dflt=n + ;; + esac + case "$dflt" in + '') + if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then + echo " " + echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4 + echo "'nm' won't be sufficient on this system." >&4 + dflt=n + fi + ;; + esac + case "$dflt" in + '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null` + if $test $dflt -gt 20; then + dflt=y + else + dflt=n + fi + ;; + esac ;; -esac -$rm_try - -: determine the architecture name -echo " " -if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then - tarch=`arch`"-$osname" -elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then - if uname -m > tmparch 2>&1 ; then - tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ - -e 's/$/'"-$osname/" tmparch` - else - tarch="$osname" - fi - $rm -f tmparch -else - tarch="$osname" -fi -case "$myarchname" in -''|"$tarch") ;; *) - echo "(Your architecture name used to be $myarchname.)" - archname='' + case "$usenm" in + true|$define) dflt=y;; + *) dflt=n;; + esac ;; esac -case "$targetarch" in -'') ;; -*) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;; -esac -myarchname="$tarch" -case "$archname" in -'') dflt="$tarch";; -*) dflt="$archname";; -esac -rp='What is your architecture name' -. ./myread -archname="$ans" +$cat <&4 - ;; - *) - archname="$archname-$api_versionstring" - echo "...setting architecture name to $archname." >&4 - ;; - esac - ;; + +runnm=$usenm +case "$reuseval" in +true) runnm=false;; esac -case "$usethreads" in -$define) - echo "Threads selected." >&4 - case "$archname" in - *-thread*) echo "...and architecture name already has -thread." >&4 - ;; - *) archname="$archname-thread" - echo "...setting architecture name to $archname." >&4 - ;; - esac - ;; +: nm options which may be necessary +case "$nm_opt" in +'') if $test -f /mach_boot; then + nm_opt='' # Mach + elif $test -d /usr/ccs/lib; then + nm_opt='-p' # Solaris (and SunOS?) + elif $test -f /dgux; then + nm_opt='-p' # DG-UX + elif $test -f /lib64/rld; then + nm_opt='-p' # 64-bit Irix + else + nm_opt='' + fi;; esac -case "$usemultiplicity" in -$define) - echo "Multiplicity selected." >&4 - case "$archname" in - *-multi*) echo "...and architecture name already has -multi." >&4 - ;; - *) archname="$archname-multi" - echo "...setting architecture name to $archname." >&4 - ;; - esac + +: nm options which may be necessary for shared libraries but illegal +: for archive libraries. Thank you, Linux. +case "$nm_so_opt" in +'') case "$myuname" in + *linux*|gnu*) + if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then + nm_so_opt='--dynamic' + fi + ;; + esac ;; esac -case "$use64bitint$use64bitall" in -*"$define"*) - case "$archname64" in - '') - echo "This architecture is naturally 64-bit, not changing architecture name." >&4 - ;; - *) - case "$use64bitint" in - "$define") echo "64 bit integers selected." >&4 ;; - esac - case "$use64bitall" in - "$define") echo "Maximal 64 bitness selected." >&4 ;; - esac - case "$archname" in - *-$archname64*) echo "...and architecture name already has $archname64." >&4 - ;; - *) archname="$archname-$archname64" - echo "...setting architecture name to $archname." >&4 - ;; - esac - ;; + +: Figure out where the libc is located +case "$runnm" in +true) +: get list of predefined functions in a handy place +echo " " +case "$libc" in +'') libc=unknown + case "$libs" in + *-lc_s*) libc=`./loc libc_s$_a $libc $libpth` esac + ;; esac -case "$uselongdouble" in -$define) - echo "Long doubles selected." >&4 - case "$longdblsize" in - $doublesize) - echo "...but long doubles are equal to doubles, not changing architecture name." >&4 +case "$libs" in +'') ;; +*) for thislib in $libs; do + case "$thislib" in + -lc|-lc_s) + : Handle C library specially below. ;; - *) - case "$archname" in - *-ld*) echo "...and architecture name already has -ld." >&4 - ;; - *) archname="$archname-ld" - echo "...setting architecture name to $archname." >&4 - ;; - esac + -l*) + thislib=`echo $thislib | $sed -e 's/^-l//'` + if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then + : + elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then + : + elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then + : + elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then + : + elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then + : + elif try=`./loc $thislib X $libpth`; $test -f "$try"; then + : + elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then + : + else + try='' + fi + libnames="$libnames $try" ;; + *) libnames="$libnames $thislib" ;; esac + done ;; esac -if $test -f archname.cbu; then - echo "Your platform has some specific hints for architecture name, using them..." - . ./archname.cbu -fi - -: set the prefixit variable, to compute a suitable default value -prefixit='case "$3" in -""|none) - case "$oldprefix" in - "") eval "$1=\"\$$2\"";; - *) - case "$3" in - "") eval "$1=";; - none) - eval "tp=\"\$$2\""; - case "$tp" in - ""|" ") eval "$1=\"\$$2\"";; - *) eval "$1=";; - esac;; - esac;; - esac;; +xxx=normal +case "$libc" in +unknown) + set /lib/libc.$so + for xxx in $libpth; do + $test -r $1 || set $xxx/libc.$so + : The messy sed command sorts on library version numbers. + $test -r $1 || \ + set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \ + tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e ' + h + s/[0-9][0-9]*/0000&/g + s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g + G + s/\n/ /' | \ + $sort | $sed -e 's/^.* //'` + eval set \$$# + done + $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so + $test -r $1 || set $sysroot/lib/libsys_s$_a + ;; *) - eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; - case "$tp" in - --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; - /*-$oldprefix/*|\~*-$oldprefix/*) - eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; - *) eval "$1=\"\$$2\"";; - esac;; -esac' - -: determine installation style -: For now, try to deduce it from prefix unless it is already set. -: Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7. -case "$installstyle" in -'') case "$prefix" in - *perl*) dflt='lib';; - *) dflt='lib/perl5' ;; - esac + set blurfl ;; -*) dflt="$installstyle" ;; esac -: Probably not worth prompting for this since we prompt for all -: the directories individually, and the prompt would be too long and -: confusing anyway. -installstyle=$dflt - -: determine where public executables go -echo " " -set dflt bin bin -eval $prefixit -fn=d~ -rp='Pathname where the public executables will reside?' -. ./getfile -if $test "X$ansexp" != "X$binexp"; then - installbin='' +if $test -r "$1"; then + echo "Your (shared) C library seems to be in $1." + libc="$1" +elif $test -r /lib/libc && $test -r /lib/clib; then + echo "Your C library seems to be in both /lib/clib and /lib/libc." + xxx=apollo + libc='/lib/clib /lib/libc' + if $test -r /lib/syslib; then + echo "(Your math library is in /lib/syslib.)" + libc="$libc /lib/syslib" + fi +elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then + echo "Your C library seems to be in $libc, as you said before." +elif $test -r $incpath/usr/lib/libc$_a; then + libc=$incpath/usr/lib/libc$_a; + echo "Your C library seems to be in $libc. That's fine." +elif $test -r /lib/libc$_a; then + libc=/lib/libc$_a; + echo "Your C library seems to be in $libc. You're normal." +else + if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then + : + elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then + libnames="$libnames "`./loc clib blurfl/dyick $libpth` + elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then + : + elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then + : + elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then + : + else + tans=`./loc Llibc$_a blurfl/dyick $xlibpth` + fi + if $test -r "$tans"; then + echo "Your C library seems to be in $tans, of all places." + libc=$tans + else + libc='blurfl' + fi fi -prefixvar=bin -: XXX Bug? -- ignores Configure -Dinstallprefix setting. -: XXX If this is fixed, also fix the "start perl" hunk below, which relies on -: this via initialinstalllocation -. ./setprefixvar - -case "$userelocatableinc" in -$define|true|[yY]*) dflt='y' ;; -*) dflt='n' ;; -esac -cat </dev/null 2>&1; then + dflt="$libc" + cat < libpath + cat >&4 < libnames +set X `cat libnames` +shift +xxx=files +case $# in 1) xxx=file; esac +echo "Extracting names from the following $xxx for later perusal:" >&4 +echo " " +$sed 's/^/ /' libnames >&4 +echo " " +$echo $n "This may take a while...$c" >&4 -$spackage contains architecture-dependent library files. If you are -sharing libraries in a heterogeneous environment, you might store -these files in a separate location. Otherwise, you can just include -them with the rest of the public library files. +for file in $*; do + case $file in + *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;; + *) $nm $nm_opt $file 2>/dev/null;; + esac +done >libc.tmp -EOM -fn=$binexp -fn=d+~ -rp='Where do you want to put the public architecture-dependent libraries?' -. ./getfile -prefixvar=archlib -. ./setprefixvar -if $test X"$archlib" = X"$privlib"; then - d_archlib="$undef" +$echo $n ".$c" +$grep fprintf libc.tmp > libc.ptf +xscan='eval "libc.list"; $echo $n ".$c" >&4' +xrun='eval "libc.list"; echo "done." >&4' +xxx='[ADTSIWi]' +if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \ + -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun +elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\ + eval $xscan;\ + $contains '^fprintf$' libc.list >/dev/null 2>&1; then + eval $xrun else - d_archlib="$define" -fi - -: see if setuid scripts can be secure -$cat <reflect - chmod +x,u+s reflect - ./reflect >flect 2>&1 - if $contains "/dev/fd" flect >/dev/null; then - echo "Congratulations, your kernel has secure setuid scripts!" >&4 - val="$define" + $nm -p $* 2>/dev/null >libc.tmp + $grep fprintf libc.tmp > libc.ptf + if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\ + eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1 + then + nm_opt='-p' + eval $xrun else - $cat <&4 - dflt=n;; - "$undef") - echo "Well, the $hint value is *not* secure." >&4 - dflt=n;; - *) echo "Well, the $hint value *is* secure." >&4 - dflt=y;; - esac - ;; - *) - $rm -f reflect flect - echo "#!$ls" >reflect - chmod +x,u+s reflect - echo >flect - chmod a+w flect - echo '"su" will (probably) prompt you for '"$ans's password." - su $ans -c './reflect >flect' - if $contains "/dev/fd" flect >/dev/null; then - echo "Okay, it looks like setuid scripts are secure." >&4 - dflt=y + echo " " + echo "$nm didn't seem to work right. Trying $ar instead..." >&4 + com='' + if $ar t $libc > libc.tmp && \ + $contains '^fprintf$' libc.tmp >/dev/null 2>&1 + then + for thisname in $libnames $libc; do + $ar t $thisname >>libc.tmp + done + $sed -e "s/\\$_o\$//" < libc.tmp > libc.list + echo "Ok." >&4 + elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then + for thisname in $libnames $libc; do + $ar tv $thisname >>libc.tmp + emximp -o tmp.imp $thisname \ + 2>/dev/null && \ + $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \ + < tmp.imp >>libc.tmp + $rm -f tmp.imp + done + $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list + echo "Ok." >&4 + else + echo "$ar didn't seem to work right." >&4 + echo "Maybe this is a Cray...trying bld instead..." >&4 + if bld t $libc | \ + $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list && + $test -s libc.list + then + for thisname in $libnames; do + bld t $libnames | \ + $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list + $ar t $thisname >>libc.tmp + done + echo "Ok." >&4 else - echo "I don't think setuid scripts are secure." >&4 - dflt=n + echo "That didn't work either. Giving up." >&4 + exit 1 fi - ;; - esac - rp='Does your kernel have *secure* setuid scripts?' - . ./myread - case "$ans" in - [yY]*) val="$define";; - *) val="$undef";; - esac + fi fi -else - echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4 - echo "(That's for file descriptors, not floppy disks.)" - val="$undef" fi -set d_suidsafe -eval $setvar +nm_extract="$com" +case "$PASE" in +define) + echo " " + echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4 + dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list + ;; +*) if $test -f /lib/syscalls.exp; then + echo " " + echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4 + $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \ + /lib/syscalls.exp >>libc.list + fi + ;; +esac +;; +esac +$rm -f libnames libpath -$rm -f reflect flect - -: now see if they want to do setuid emulation -if $test $patchlevel -lt 11; then +: Check if we are using C++ echo " " -val="$undef" -case "$d_suidsafe" in -"$define") +echo "Checking for C++..." >&4 +$cat >try.c <<'EOCP' +#include +int main(void) +{ +#ifdef __cplusplus + return 0; +#else + return 1; +#endif +} +EOCP +set try +if eval $compile_ok && $run ./try; then + val="$define" + echo "You are using a C++ compiler." +else val="$undef" - echo "No need to emulate SUID scripts since they are secure here." >&4 + echo "You are not using a C++ compiler." +fi +$rm_try cplusplus$$ +set d_cplusplus +eval $setvar + +: is a C symbol defined? +csym='tlook=$1; +case "$3" in +-v) tf=libc.tmp; tdc="";; +-a) tf=libc.tmp; tdc="[]";; +*) tlook="^$1\$"; tf=libc.list; tdc="()";; +esac; +case "$d_cplusplus" in + $define) extern_C="extern \"C\"" ;; + *) extern_C="extern" ;; +esac; +tx=yes; +case "$reuseval-$4" in +true-) ;; +true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;; +esac; +case "$tx" in +yes) + 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 "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) 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_try; + fi; + else + echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c; + $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true; + $rm_try; + fi; ;; *) - $cat <&4 </dev/null 2>&1; then - perl5=$tdir/perl - break; - elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then - perl5=$tdir/perl5 - break; - fi - done - ;; -*) perl5="$perl5" +: check for length of double +echo " " +case "$doublesize" in +'') + echo "Checking to see how big your double precision numbers are..." >&4 + $cat >try.c < +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#endif +int main() +{ + printf("%d\n", (int)sizeof(double)); + exit(0); +} +EOCP + set try + if eval $compile_ok; then + doublesize=`$run ./try` + echo "Your double is $doublesize bytes long." + else + dflt='8' + echo "(I can't seem to compile the test program. Guessing...)" + rp="What is the size of a double precision number (in bytes)?" + . ./myread + doublesize="$ans" + fi ;; esac -case "$perl5" in -'') echo "None found. That's ok.";; -*) echo "Using $perl5." ;; -esac - -: Set the siteprefix variables -$cat <&4 +echo 'int main() { long double x = 7.0; }' > try.c +set try +if eval $compile; then + val="$define" + echo "You have long double." +else + val="$undef" + echo "You do not have long double." +fi +$rm_try +set d_longdbl +eval $setvar -The default should be fine for most people. +: see if ldexpl exists +set ldexpl d_ldexpl +eval $inlibc -EOM -fn=d~+ -rp='Installation prefix to use for add-on modules and utilities?' -: XXX Here might be another good place for an installstyle setting. -case "$siteprefix" in -'') dflt=$prefix ;; -*) dflt=$siteprefix ;; +: check for length of long double +case "${d_longdbl}${longdblsize}" in +$define) + echo " " + echo "Checking to see how big your long doubles are..." >&4 + $cat >try.c <<'EOCP' +#include +int main() +{ + printf("%d\n", sizeof(long double)); +} +EOCP + set try + set try + if eval $compile; then + longdblsize=`$run ./try` + echo "Your long doubles are $longdblsize bytes long." + else + dflt='8' + echo " " + echo "(I can't seem to compile the test program. Guessing...)" >&4 + rp="What is the size of a long double (in bytes)?" + . ./myread + longdblsize="$ans" + fi + if $test "X$doublesize" = "X$longdblsize"; then + 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 -. ./getfile -: XXX Prefixit unit does not yet support siteprefix and vendorprefix -oldsiteprefix='' -case "$siteprefix" in -'') ;; -*) case "$ans" in - "$prefix") ;; - *) oldsiteprefix="$prefix";; - esac - ;; -esac -siteprefix="$ans" -siteprefixexp="$ansexp" - -: determine where site specific libraries go. -: Usual default is /usr/local/lib/perl5/site_perl/$version -: The default "style" setting is made in installstyle.U -: XXX No longer works with Prefixit stuff. -prog=`echo $package | $sed 's/-*[0-9.]*$//'` -case "$sitelib" in -'') case "$installstyle" in - *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;; - *) dflt=$siteprefix/lib/site_$prog/$version ;; - esac - ;; -*) dflt="$sitelib" - ;; -esac -$cat < getverlist <> getverlist <<'EOPL' -# The list found is store twice for each entry: the original name, and -# the binary broken down version as pack "sss", so sorting is easy and -# unambiguous. This will work for all versions that have a maximum of -# three digit groups, separate by '.'s or '_'s. Names are extended with -# ".0.0" to ensure at least three elements for the pack. -# -- H.Merijn Brand (m)'06 23-10-2006 - -# Can't have leading @ because metaconfig interprets it as a command! -;@inc_version_list=(); -# XXX Redo to do opendir/readdir? -if (-d $stem) { - chdir($stem); - ;@candidates = map { - [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*"); - ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates; -} -else { - ;@candidates = (); -} +$rm_try -($pversion, $aversion, $vsn5005) = map { - pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005"; -foreach $d (@candidates) { - if ($d->[1] lt $pversion) { - if ($d->[1] ge $aversion) { - unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]); - } - elsif ($d->[1] ge $vsn5005) { - unshift(@inc_version_list, grep { -d } $d->[0]); - } - } - else { - # Skip newer version. I.e. don't look in - # 5.7.0 if we're installing 5.6.1. - } +$echo "Checking the kind of long doubles you have..." >&4 +case "$d_longdbl" in +define) +$cat <try.c +#$i_float I_FLOAT +#$i_stdlib I_STDLIB +#define LONGDBLSIZE $longdblsize +#define DOUBLESIZE $doublesize +#ifdef I_FLOAT +#include +#endif +#ifdef I_STDLIB +#include +#endif +#include +static const long double d = -0.1L; +int main() { + unsigned const char* b = (unsigned const char*)(&d); +#if DOUBLESIZE == LONGDBLSIZE + printf("0\n"); /* if it floats like double */ + exit(0); +#endif +#if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16 + if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) { + /* IEEE 754 128-bit little-endian */ + printf("1\n"); + exit(0); + } + if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) { + /* IEEE 128-bit big-endian, e.g. solaris sparc */ + printf("2\n"); + exit(0); + } +#endif +/* For alignment 32-bit platforms have the 80 bits in 12 bytes, + * while 64-bits platforms have it in 16 bytes. The trailing bytes + * cannot be trusted. */ +#if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12) + if (b[0] == 0xCD && b[9] == 0xBF) { + /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86) + * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding. + * Also known as "extended precision". */ + printf("3\n"); + exit(0); + } + if (b[0] == 0xBF && b[9] == 0xCD) { + /* Is there ever big-endian 80-bit, really? + * + * The Motorola 68881 had another "extended precision" format: + * sign:1 exp:15 zero:16 integer:1 mantissa:63 + * for total of 96 bits of bytes. The zero bits were unused. + * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details. + * If it ever becomes relevant, this format should be allocated + * a new doublekind code since it's quite different from the Intel x87. + */ + printf("4\n"); + exit(0); + } +#endif +#if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16 + /* software "double double", the 106 is 53+53. + * but irix thinks it is 107. */ + if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) { + /* double double 128-bit fully little-endian, + * little-endian doubles in little-endian order, + * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */ + printf("5\n"); + exit(0); + } + if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) { + /* double double 128-bit fully big-endian, + * big-endian doubles in big-endian order, + * e.g. PPC/Power and MIPS: + * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */ + printf("6\n"); + exit(0); + } + if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) { + /* double double 128-bit mixed endian. + * little-endian doubles in big-endian order, + * e.g. ppc64el, + * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */ + printf("7\n"); + exit(0); + } + if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) { + /* double double 128-bit mixed endian, + * big-endian doubles in little-endian order, + * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */ + printf("8\n"); + exit(0); + } +#endif + printf("-1\n"); /* unknown */ + exit(0); } +EOP +set try +if eval $compile; then + longdblkind=`$run ./try` +else + longdblkind=-1 +fi +;; +*) longdblkind=0 ;; +esac +case "$longdblkind" in +0) echo "Your long doubles are doubles." >&4 ;; +1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;; +2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;; +3) echo "You have x86 80-bit little endian long doubles." >& 4 ;; +4) echo "You have x86 80-bit big endian long doubles." >& 4 ;; +5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;; +6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;; +7) echo "You have 128-bit mixed double-double long doubles (64-bit LEs in BE)." >& 4 ;; +8) echo "You have 128-bit mixed double-double long doubles (64-bit BEs in LE)." >& 4 ;; +*) echo "Cannot figure out your long double." >&4 ;; +esac +$rm_try -if (@inc_version_list) { - print join(' ', @inc_version_list); -} -else { - # Blank space to preserve value for next Configure run. - print " "; -} -EOPL -chmod +x getverlist -case "$inc_version_list" in -'') if test -x "$perl5$exe_ext"; then - dflt=`$perl5 getverlist` +: determine the architecture name +echo " " +if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then + tarch=`arch`"-$osname" +elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then + if uname -m > tmparch 2>&1 ; then + tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ + -e 's/$/'"-$osname/" tmparch` else - dflt='none' + tarch="$osname" fi + $rm -f tmparch +else + tarch="$osname" +fi +case "$myarchname" in +''|"$tarch") ;; +*) + echo "(Your architecture name used to be $myarchname.)" + archname='' ;; -$undef) dflt='none' ;; -*) eval dflt=\"$inc_version_list\" ;; esac -case "$dflt" in -''|' ') dflt=none ;; +case "$targetarch" in +'') ;; +*) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;; esac -case "$dflt" in -5.005) dflt=none ;; +myarchname="$tarch" +case "$archname" in +'') dflt="$tarch";; +*) dflt="$archname";; esac -$cat <&4 + ;; + *) + archname="$archname-$api_versionstring" + echo "...setting architecture name to $archname." >&4 + ;; + esac ;; esac -$rm -f getverlist - -: see if malloc/malloc.h has to be included -set malloc/malloc.h i_mallocmalloc -eval $inhdr - -: see if this is a malloc.h system -: we want a real compile instead of Inhdr because some systems have a -: malloc.h that just gives a compile error saying to use stdlib.h instead -echo " " -$cat >try.c < -#include -#$i_mallocmalloc I_MALLOCMALLOC -#ifdef I_MALLOCMALLOC -# include -#endif - -int main () { return 0; } -EOCP -set try -if eval $compile; then - echo " found." >&4 - val="$define" -else - echo " NOT found." >&4 - val="$undef" -fi -$rm_try -set i_malloc -eval $setvar -: check for length of pointer -echo " " -case "$ptrsize" in -'') - echo "Checking to see how big your pointers are..." >&4 - $cat >>try.c < -#$i_stdlib I_STDLIB -#ifdef I_STDLIB -#include -#endif -int main() -{ - printf("%d\n", (int)sizeof(void *)); - exit(0); -} -EOCP - set try - if eval $compile_ok; then - ptrsize=`$run ./try` - echo "Your pointers are $ptrsize bytes long." - else - dflt='4' - echo "(I can't seem to compile the test program. Guessing...)" >&4 - rp="What is the size of a pointer (in bytes)?" - . ./myread - ptrsize="$ans" - fi - ;; -esac -$rm_try -case "$use64bitall" in -"$define"|true|[yY]*) - case "$ptrsize" in - 4) cat <&4 - -*** You have chosen a maximally 64-bit build, -*** but your pointers are only 4 bytes wide. -*** Please rerun Configure without -Duse64bitall. -EOM - case "$d_quad" in - define) - cat <&4 -*** Since you have quads, you could possibly try with -Duse64bitint. -EOM - ;; - esac - cat <&4 -*** Cannot continue, aborting. - -EOM - - exit 1 +case "$usethreads" in +$define) + echo "Threads selected." >&4 + case "$archname" in + *-thread*) echo "...and architecture name already has -thread." >&4 + ;; + *) archname="$archname-thread" + echo "...setting architecture name to $archname." >&4 ;; 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' ;; +case "$usemultiplicity" in +$define) + echo "Multiplicity selected." >&4 + case "$archname" in + *-multi*) echo "...and architecture name already has -multi." >&4 + ;; + *) archname="$archname-multi" + echo "...setting architecture name to $archname." >&4 + ;; 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" ;; +case "$use64bitint$use64bitall" in +*"$define"*) + case "$archname64" in + '') + echo "This architecture is naturally 64-bit, not changing architecture name." >&4 + ;; + *) + case "$use64bitint" in + "$define") echo "64 bit integers selected." >&4 ;; + esac + case "$use64bitall" in + "$define") echo "Maximal 64 bitness selected." >&4 ;; + esac + case "$archname" in + *-$archname64*) echo "...and architecture name already has $archname64." >&4 + ;; + *) archname="$archname-$archname64" + echo "...setting architecture name to $archname." >&4 + ;; + esac + ;; + esac esac - -: determine which malloc to compile in -echo " " -case "$usemymalloc" in -[yY]*|true|$define) dflt='y' ;; -[nN]*|false|$undef) dflt='n' ;; -*) case "$ptrsize" in - 4) dflt='y' ;; - *) dflt='n' ;; +case "$uselongdouble" in +$define) + echo "Long doubles selected." >&4 + case "$longdblsize" in + $doublesize) + echo "...but long doubles are equal to doubles, not changing architecture name." >&4 + ;; + *) + case "$archname" in + *-ld*) echo "...and architecture name already has -ld." >&4 + ;; + *) archname="$archname-ld" + echo "...setting architecture name to $archname." >&4 + ;; + esac + ;; esac - if test "$useithreads" = "$define"; then dflt='n'; fi ;; esac -rp="Do you wish to attempt to use the malloc that comes with $package?" -. ./myread -usemymalloc="$ans" -case "$ans" in -y*|true) - usemymalloc='y' - mallocsrc='malloc.c' - mallocobj="malloc$_o" - d_mymalloc="$define" - case "$libs" in - *-lmalloc*) - : Remove malloc from list of libraries to use - echo "Removing unneeded -lmalloc from library list" >&4 - set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` - shift - libs="$*" - echo "libs = $libs" >&4 +case "$usequadmath" in +$define) + echo "quadmath selected." >&4 + case "$archname" in + *-ld*) echo "...and architecture name already has -quadmath." >&4 + ;; + *) archname="$archname-quadmath" + echo "...setting architecture name to $archname." >&4 ;; esac ;; +esac +if $test -f archname.cbu; then + echo "Your platform has some specific hints for architecture name, using them..." + . ./archname.cbu +fi + +: set the prefixit variable, to compute a suitable default value +prefixit='case "$3" in +""|none) + case "$oldprefix" in + "") eval "$1=\"\$$2\"";; + *) + case "$3" in + "") eval "$1=";; + none) + eval "tp=\"\$$2\""; + case "$tp" in + ""|" ") eval "$1=\"\$$2\"";; + *) eval "$1=";; + esac;; + esac;; + esac;; *) - usemymalloc='n' - mallocsrc='' - mallocobj='' - d_mymalloc="$undef" + eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; + case "$tp" in + --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; + /*-$oldprefix/*|\~*-$oldprefix/*) + eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; + *) eval "$1=\"\$$2\"";; + esac;; +esac' + +: determine installation style +: For now, try to deduce it from prefix unless it is already set. +: Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7. +case "$installstyle" in +'') case "$prefix" in + *perl*) dflt='lib';; + *) dflt='lib/perl5' ;; + esac ;; +*) dflt="$installstyle" ;; esac +: Probably not worth prompting for this since we prompt for all +: the directories individually, and the prompt would be too long and +: confusing anyway. +installstyle=$dflt -: compute the return types of malloc and free +: determine where public executables go echo " " -$cat >malloc.c < -#include -#ifdef I_MALLOC -#include -#endif -#ifdef I_STDLIB -#include -#endif -#ifdef TRY_MALLOC -void *malloc(); -#endif -#ifdef TRY_FREE -void free(); -#endif -END -case "$malloctype" in -'') - if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then - malloctype='void *' - else - malloctype='char *' - fi - ;; -esac -echo "Your system wants malloc to return '$malloctype', it would seem." >&4 +set dflt bin bin +eval $prefixit +fn=d~ +rp='Pathname where the public executables will reside?' +. ./getfile +if $test "X$ansexp" != "X$binexp"; then + installbin='' +fi +prefixvar=bin +: XXX Bug? -- ignores Configure -Dinstallprefix setting. +: XXX If this is fixed, also fix the "start perl" hunk below, which relies on +: this via initialinstalllocation +. ./setprefixvar -case "$freetype" in -'') - if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then - freetype='void' - else - freetype='int' - fi - ;; -esac -echo "Your system uses $freetype free(), it would seem." >&4 -$rm -f malloc.[co] -: determine where site specific architecture-dependent libraries go. -: sitelib default is /usr/local/lib/perl5/site_perl/$version -: sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname -: sitelib may have an optional trailing /share. -case "$sitearch" in -'') dflt=`echo $sitelib | $sed 's,/share$,,'` - dflt="$dflt/$archname" - ;; -*) dflt="$sitearch" - ;; +case "$userelocatableinc" in +$define|true|[yY]*) dflt='y' ;; +*) dflt='n' ;; esac -set sitearch sitearch none -eval $prefixit -$cat <&4 -$cat >prototype.c < -#endif -int main(int argc, char *argv[]) { - exit(0);} -EOCP -if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then - echo "Your C compiler appears to support function prototypes." - val="$define" +$spackage contains architecture-dependent library files. If you are +sharing libraries in a heterogeneous environment, you might store +these files in a separate location. Otherwise, you can just include +them with the rest of the public library files. + +EOM +fn=$binexp +fn=d+~ +rp='Where do you want to put the public architecture-dependent libraries?' +. ./getfile +prefixvar=archlib +. ./setprefixvar +if $test X"$archlib" = X"$privlib"; then + d_archlib="$undef" else - echo "Your C compiler doesn't seem to understand function prototypes." - val="$undef" + d_archlib="$define" fi -set prototype -eval $setvar -$rm -f prototype* -: Check if ansi2knr is required -case "$prototype" in -"$define") ;; -*) ansi2knr='ansi2knr' - echo " " - cat <&4 +: see if setuid scripts can be secure +$cat <. - -Aborting Configure now. EOM - exit 2 - ;; -esac -: DTrace support -dflt_dtrace='/usr/sbin/dtrace' -$test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace' +val="$undef" +if $test -d /dev/fd; then + echo "#!$ls" >reflect + chmod +x,u+s reflect + ./reflect >flect 2>&1 + if $contains "/dev/fd" flect >/dev/null; then + echo "Congratulations, your kernel has secure setuid scripts!" >&4 + val="$define" + else + $cat <&4 + dflt=n;; + "$undef") + echo "Well, the $hint value is *not* secure." >&4 + dflt=n;; + *) echo "Well, the $hint value *is* secure." >&4 + dflt=y;; + esac + ;; + *) + $rm -f reflect flect + echo "#!$ls" >reflect + chmod +x,u+s reflect + echo >flect + chmod a+w flect + echo '"su" will (probably) prompt you for '"$ans's password." + su $ans -c './reflect >flect' + if $contains "/dev/fd" flect >/dev/null; then + echo "Okay, it looks like setuid scripts are secure." >&4 + dflt=y + else + echo "I don't think setuid scripts are secure." >&4 + dflt=n + fi + ;; + esac + rp='Does your kernel have *secure* setuid scripts?' + . ./myread + case "$ans" in + [yY]*) val="$define";; + *) val="$undef";; + esac + fi +else + echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4 + echo "(That's for file descriptors, not floppy disks.)" + val="$undef" +fi +set d_suidsafe +eval $setvar -Perl can be built to support DTrace on platforms that support it. -DTrace is a diagnosis and performance analysis tool from Sun. +$rm -f reflect flect -If this doesn't make any sense to you, just accept the default '$dflt'. -EOM +: now see if they want to do setuid emulation +if $test $patchlevel -lt 11; then +echo " " +val="$undef" +case "$d_suidsafe" in +"$define") + val="$undef" + echo "No need to emulate SUID scripts since they are secure here." >&4 + ;; +*) + $cat <&4 </dev/null 2>&1 \ - && rm -f perldtrace.tmp - then - echo " " - echo "Good: your $dtrace knows about the -h flag." - else - cat >&2 </dev/null 2>&1; then + perl5=$tdir/perl + break; + elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then + perl5=$tdir/perl5 + break; + fi + done + ;; +*) perl5="$perl5" + ;; +esac +case "$perl5" in +'') echo "None found. That's ok.";; +*) echo "Using $perl5." ;; +esac -*** $me: Fatal Error: $dtrace doesn't support -h flag -*** -*** Your installed dtrace doesn't support the -h switch to compile a D -*** program into a C header. Can't continue. +: Set the siteprefix variables +$cat <&2 < ../extras.lst - val="'$extras'" - ;; -esac -set extras -eval $setvar -echo " " - -: determine where html pages for programs go -set html1dir html1dir none -eval $prefixit -$cat < getverlist <> getverlist <<'EOPL' +# The list found is store twice for each entry: the original name, and +# the binary broken down version as pack "sss", so sorting is easy and +# unambiguous. This will work for all versions that have a maximum of +# three digit groups, separate by '.'s or '_'s. Names are extended with +# ".0.0" to ensure at least three elements for the pack. +# -- H.Merijn Brand (m)'06 23-10-2006 -If you wish to install html files for modules associated with $spackage, -indicate the appropriate directory here. To skip installing html files, -answer "none". -EOM -: There is no obvious default. If they have specified html1dir, then -: try to key off that, possibly changing .../html1 into .../html3. -case "$html3dir" in -'') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;; -*) dflt=$html3dir ;; -esac -fn=dn+~ -rp="Directory for the $spackage module html pages?" -. ./getfile -prefixvar=html3dir -. ./setprefixvar -: Use ' ' for none so value is preserved next time through Configure -$test X"$html3dir" = "X" && html3dir=' ' +# Can't have leading @ because metaconfig interprets it as a command! +;@inc_version_list=(); +# XXX Redo to do opendir/readdir? +if (-d $stem) { + chdir($stem); + ;@candidates = map { + [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*"); + ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates; +} +else { + ;@candidates = (); +} -: determine whether to install perl also as /usr/bin/perl +($pversion, $aversion, $vsn5005) = map { + pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005"; +foreach $d (@candidates) { + if ($d->[1] lt $pversion) { + if ($d->[1] ge $aversion) { + unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]); + } + elsif ($d->[1] ge $vsn5005) { + unshift(@inc_version_list, grep { -d } $d->[0]); + } + } + else { + # Skip newer version. I.e. don't look in + # 5.7.0 if we're installing 5.6.1. + } +} -echo " " -if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then - $cat <try.c < +#include +#$i_mallocmalloc I_MALLOCMALLOC +#ifdef I_MALLOCMALLOC +# include +#endif -EOM - case "$installusrbinperl" in - "$undef"|[nN]*) dflt='n';; - *) dflt='y';; - esac - fi - rp="Do you want to install perl as /usr/bin/perl?" - . ./myread - case "$ans" in - [yY]*) val="$define";; - *) val="$undef" ;; - esac +int main () { return 0; } +EOCP +set try +if eval $compile; then + echo " found." >&4 + val="$define" else - val="$undef" + echo " NOT found." >&4 + val="$undef" fi -set installusrbinperl +$rm_try +set i_malloc eval $setvar -: Check if we are using the GNU C library +: check for length of pointer echo " " -echo "Checking for GNU C Library..." >&4 -cat >try.c <<'EOCP' -/* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__ - alone are insufficient to distinguish different versions, such as - 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in - libc version 2.1.0. A. Dougherty, June 3, 2002. -*/ +case "$ptrsize" in +'') + echo "Checking to see how big your pointers are..." >&4 + $cat >try.c < -int main(void) +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#endif +int main() { -#ifdef __GLIBC__ -# ifdef __GLIBC_MINOR__ -# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus) -# include - printf("%s\n", gnu_get_libc_version()); -# else - printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__); -# endif -# else - printf("%d\n", __GLIBC__); -# endif - return 0; -#else - return 1; -#endif + printf("%d\n", (int)sizeof(void *)); + exit(0); } EOCP -set try -if eval $compile_ok && $run ./try > glibc.ver; then - val="$define" - gnulibc_version=`$cat glibc.ver` - echo "You are using the GNU C Library version $gnulibc_version" -else - val="$undef" - gnulibc_version='' - echo "You are not using the GNU C Library" -fi -$rm_try glibc.ver -set d_gnulibc -eval $setvar - -: see if nm is to be used to determine whether a symbol is defined or not -case "$usenm" in -'') - dflt='' - case "$d_gnulibc" in - "$define") - echo " " - echo "nm probably won't work on the GNU C Library." >&4 - dflt=n - ;; - esac - case "$dflt" in - '') - if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then - echo " " - echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4 - echo "'nm' won't be sufficient on this system." >&4 - dflt=n - fi - ;; - esac - case "$dflt" in - '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null` - if $test $dflt -gt 20; then - dflt=y - else - dflt=n - fi - ;; - esac - ;; -*) - case "$usenm" in - true|$define) dflt=y;; - *) dflt=n;; - esac + set try + if eval $compile_ok; then + ptrsize=`$run ./try` + echo "Your pointers are $ptrsize bytes long." + else + dflt='4' + echo "(I can't seem to compile the test program. Guessing...)" >&4 + rp="What is the size of a pointer (in bytes)?" + . ./myread + ptrsize="$ans" + fi ;; esac -$cat <&4 -You probably shouldn't let me use 'nm' if you are using the GNU C Library. +*** You have chosen a maximally 64-bit build, +*** but your pointers are only 4 bytes wide. +*** Please rerun Configure without -Duse64bitall. +EOM + case "$d_quad" in + define) + cat <&4 +*** Since you have quads, you could possibly try with -Duse64bitint. +EOM + ;; + esac + cat <&4 +*** Cannot continue, aborting. EOM -rp="Shall I use $nm to extract C symbols from the libraries?" -. ./myread -case "$ans" in -[Nn]*) usenm=false;; -*) usenm=true;; -esac -runnm=$usenm -case "$reuseval" in -true) runnm=false;; + exit 1 + ;; + esac + ;; esac -: nm options which may be necessary -case "$nm_opt" in -'') if $test -f /mach_boot; then - nm_opt='' # Mach - elif $test -d /usr/ccs/lib; then - nm_opt='-p' # Solaris (and SunOS?) - elif $test -f /dgux; then - nm_opt='-p' # DG-UX - elif $test -f /lib64/rld; then - nm_opt='-p' # 64-bit Irix - else - nm_opt='' - fi;; -esac -: nm options which may be necessary for shared libraries but illegal -: for archive libraries. Thank you, Linux. -case "$nm_so_opt" in -'') case "$myuname" in - *linux*|gnu*) - if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then - nm_so_opt='--dynamic' - fi - ;; +: 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 -: Figure out where the libc is located -case "$runnm" in -true) -: get list of predefined functions in a handy place +: determine which malloc to compile in echo " " -case "$libc" in -'') libc=unknown - case "$libs" in - *-lc_s*) libc=`./loc libc_s$_a $libc $libpth` +case "$usemymalloc" in +[yY]*|true|$define) dflt='y' ;; +[nN]*|false|$undef) dflt='n' ;; +*) case "$ptrsize" in + 4) dflt='y' ;; + *) dflt='n' ;; esac + if test "$useithreads" = "$define"; then dflt='n'; fi ;; esac -case "$libs" in -'') ;; -*) for thislib in $libs; do - case "$thislib" in - -lc|-lc_s) - : Handle C library specially below. - ;; - -l*) - thislib=`echo $thislib | $sed -e 's/^-l//'` - if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then - : - elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then - : - elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then - : - elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then - : - elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then - : - elif try=`./loc $thislib X $libpth`; $test -f "$try"; then - : - elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then - : - else - try='' - fi - libnames="$libnames $try" +rp="Do you wish to attempt to use the malloc that comes with $package?" +. ./myread +usemymalloc="$ans" +case "$ans" in +y*|true) + usemymalloc='y' + mallocsrc='malloc.c' + mallocobj="malloc$_o" + d_mymalloc="$define" + case "$libs" in + *-lmalloc*) + : Remove malloc from list of libraries to use + echo "Removing unneeded -lmalloc from library list" >&4 + set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` + shift + libs="$*" + echo "libs = $libs" >&4 ;; - *) libnames="$libnames $thislib" ;; esac - done - ;; -esac -xxx=normal -case "$libc" in -unknown) - set /lib/libc.$so - for xxx in $libpth; do - $test -r $1 || set $xxx/libc.$so - : The messy sed command sorts on library version numbers. - $test -r $1 || \ - set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \ - tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e ' - h - s/[0-9][0-9]*/0000&/g - s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g - G - s/\n/ /' | \ - $sort | $sed -e 's/^.* //'` - eval set \$$# - done - $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so - $test -r $1 || set $sysroot/lib/libsys_s$_a ;; *) - set blurfl + usemymalloc='n' + mallocsrc='' + mallocobj='' + d_mymalloc="$undef" ;; esac -if $test -r "$1"; then - echo "Your (shared) C library seems to be in $1." - libc="$1" -elif $test -r /lib/libc && $test -r /lib/clib; then - echo "Your C library seems to be in both /lib/clib and /lib/libc." - xxx=apollo - libc='/lib/clib /lib/libc' - if $test -r /lib/syslib; then - echo "(Your math library is in /lib/syslib.)" - libc="$libc /lib/syslib" - fi -elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then - echo "Your C library seems to be in $libc, as you said before." -elif $test -r $incpath/usr/lib/libc$_a; then - libc=$incpath/usr/lib/libc$_a; - echo "Your C library seems to be in $libc. That's fine." -elif $test -r /lib/libc$_a; then - libc=/lib/libc$_a; - echo "Your C library seems to be in $libc. You're normal." -else - if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then - : - elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then - libnames="$libnames "`./loc clib blurfl/dyick $libpth` - elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then - : - elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then - : - elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then - : + +: compute the return types of malloc and free +echo " " +$cat >malloc.c < +#include +#ifdef I_MALLOC +#include +#endif +#ifdef I_STDLIB +#include +#endif +#ifdef TRY_MALLOC +void *malloc(); +#endif +#ifdef TRY_FREE +void free(); +#endif +END +case "$malloctype" in +'') + if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then + malloctype='void *' else - tans=`./loc Llibc$_a blurfl/dyick $xlibpth` + malloctype='char *' fi - if $test -r "$tans"; then - echo "Your C library seems to be in $tans, of all places." - libc=$tans + ;; +esac +echo "Your system wants malloc to return '$malloctype', it would seem." >&4 + +case "$freetype" in +'') + if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then + freetype='void' else - libc='blurfl' + freetype='int' fi -fi -if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then - dflt="$libc" - cat <&4 +$rm -f malloc.[co] +: determine where site specific architecture-dependent libraries go. +: sitelib default is /usr/local/lib/perl5/site_perl/$version +: sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname +: sitelib may have an optional trailing /share. +case "$sitearch" in +'') dflt=`echo $sitelib | $sed 's,/share$,,'` + dflt="$dflt/$archname" + ;; +*) dflt="$sitearch" + ;; +esac +set sitearch sitearch none +eval $prefixit +$cat < libpath - cat >&4 < libnames -set X `cat libnames` -shift -xxx=files -case $# in 1) xxx=file; esac -echo "Extracting names from the following $xxx for later perusal:" >&4 -echo " " -$sed 's/^/ /' libnames >&4 -echo " " -$echo $n "This may take a while...$c" >&4 +: Set the vendorlib variables +case "$vendorprefix" in +'') d_vendorlib="$undef" + vendorlib='' + vendorlibexp='' + ;; +*) d_vendorlib="$define" + : determine where vendor-supplied modules go. + : Usual default is /usr/local/lib/perl5/vendor_perl/$version + case "$vendorlib" in + '') + prog=`echo $package | $sed 's/-*[0-9.]*$//'` + case "$installstyle" in + *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;; + *) dflt=$vendorprefix/lib/vendor_$prog/$version ;; + esac + ;; + *) dflt="$vendorlib" + ;; + esac + fn=d~+ + rp='Pathname for the vendor-supplied library files?' + . ./getfile + vendorlib="$ans" + vendorlibexp="$ansexp" + ;; +esac +vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"` +prefixvar=vendorlib +. ./installprefix -for file in $*; do - case $file in - *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;; - *) $nm $nm_opt $file 2>/dev/null;; +: Set the vendorarch variables +case "$vendorprefix" in +'') d_vendorarch="$undef" + vendorarch='' + vendorarchexp='' + ;; +*) d_vendorarch="$define" + : determine where vendor-supplied architecture-dependent libraries go. + : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version + : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname + : vendorlib may have an optional trailing /share. + case "$vendorarch" in + '') dflt=`echo $vendorlib | $sed 's,/share$,,'` + dflt="$dflt/$archname" + ;; + *) dflt="$vendorarch" ;; esac -done >libc.tmp + fn=d~+ + rp='Pathname for vendor-supplied architecture-dependent files?' + . ./getfile + vendorarch="$ans" + vendorarchexp="$ansexp" + ;; +esac +prefixvar=vendorarch +. ./installprefix +if $test X"$vendorarch" = X"$vendorlib"; then + d_vendorarch="$undef" +else + d_vendorarch="$define" +fi -$echo $n ".$c" -$grep fprintf libc.tmp > libc.ptf -xscan='eval "libc.list"; $echo $n ".$c" >&4' -xrun='eval "libc.list"; echo "done." >&4' -xxx='[ADTSIWi]' -if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \ - -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\ - eval $xscan;\ - $contains '^fprintf$' libc.list >/dev/null 2>&1; then - eval $xrun -else - $nm -p $* 2>/dev/null >libc.tmp - $grep fprintf libc.tmp > libc.ptf - if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\ - eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1 - then - nm_opt='-p' - eval $xrun - else - echo " " - echo "$nm didn't seem to work right. Trying $ar instead..." >&4 - com='' - if $ar t $libc > libc.tmp && \ - $contains '^fprintf$' libc.tmp >/dev/null 2>&1 - then - for thisname in $libnames $libc; do - $ar t $thisname >>libc.tmp - done - $sed -e "s/\\$_o\$//" < libc.tmp > libc.list - echo "Ok." >&4 - elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then - for thisname in $libnames $libc; do - $ar tv $thisname >>libc.tmp - emximp -o tmp.imp $thisname \ - 2>/dev/null && \ - $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \ - < tmp.imp >>libc.tmp - $rm -f tmp.imp - done - $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list - echo "Ok." >&4 - else - echo "$ar didn't seem to work right." >&4 - echo "Maybe this is a Cray...trying bld instead..." >&4 - if bld t $libc | \ - $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list && - $test -s libc.list - then - for thisname in $libnames; do - bld t $libnames | \ - $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list - $ar t $thisname >>libc.tmp - done - echo "Ok." >&4 - else - echo "That didn't work either. Giving up." >&4 - exit 1 - fi - fi - fi -fi -nm_extract="$com" -case "$PASE" in -define) - echo " " - echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4 - dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list - ;; -*) if $test -f /lib/syscalls.exp; then - echo " " - echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4 - $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \ - /lib/syscalls.exp >>libc.list - fi - ;; +: Final catch-all directories to search +$cat <&4 -$cat >try.c <<'EOCP' -#include -int main(void) -{ -#ifdef __cplusplus - return 0; -#else - return 1; +echo "Checking out function prototypes..." >&4 +$cat >prototype.c < #endif -} +int main(int argc, char *argv[]) { + exit(0);} EOCP -set try -if eval $compile_ok && $run ./try; then +if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then + echo "Your C compiler appears to support function prototypes." val="$define" - echo "You are using a C++ compiler." else + echo "Your C compiler doesn't seem to understand function prototypes." val="$undef" - echo "You are not using a C++ compiler." fi -$rm_try cplusplus$$ -set d_cplusplus +set prototype eval $setvar +$rm -f prototype* -: is a C symbol defined? -csym='tlook=$1; -case "$3" in --v) tf=libc.tmp; tdc="";; --a) tf=libc.tmp; tdc="[]";; -*) tlook="^$1\$"; tf=libc.list; tdc="()";; -esac; -case "$d_cplusplus" in - $define) extern_C="extern \"C\"" ;; - *) extern_C="extern" ;; -esac; -tx=yes; -case "$reuseval-$4" in -true-) ;; -true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;; -esac; -case "$tx" in -yes) - 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 "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) 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_try; - fi; - else - echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c; - $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true; - $rm_try; - fi; - ;; -*) - case "$tval" in - $define) tval=true;; - *) tval=false;; - esac; +: Check if ansi2knr is required +case "$prototype" in +"$define") ;; +*) ansi2knr='ansi2knr' + echo " " + cat <&4 + +$me: FATAL ERROR: +This version of $package can only be compiled by a compiler that +understands function prototypes. Unfortunately, your C compiler + $cc $ccflags +doesn't seem to understand them. Sorry about that. + +If GNU cc is available for your system, perhaps you could try that instead. + +Eventually, we hope to support building Perl with pre-ANSI compilers. +If you would like to help in that effort, please contact . + +Aborting Configure now. +EOM + exit 2 ;; -esac; -eval "$2=$tval"' +esac -: define an is-in-libc? function -inlibc='echo " "; td=$define; tu=$undef; -sym=$1; var=$2; eval "was=\$$2"; -tx=yes; -case "$reuseval$was" in -true) ;; -true*) tx=no;; -esac; -case "$tx" in -yes) - set $sym tres -f; - eval $csym; - case "$tres" in - true) - echo "$sym() found." >&4; - case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";; +: DTrace support +dflt_dtrace='/usr/sbin/dtrace' +$test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace' + +cat <&4; - case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";; - esac;; -*) - case "$was" in - $define) echo "$sym() found." >&4;; - *) echo "$sym() NOT found." >&4;; - esac;; -esac' + dflt='n' + ;; + esac + + rp='Support DTrace if available?' + . ./myread + case "$ans" in + y|Y) val="$define" ;; + *) val="$undef" ;; + esac + set usedtrace + eval $setvar + + test "X$usedtrace" != "X$define" && break + + echo " " + rp='Where is the dtrace executable?' + dflt=$dflt_dtrace + . ./getfile + val="$ans" + set dtrace + eval $setvar + + if $test -f $dtrace + then + if $dtrace -h -s ../perldtrace.d \ + -o perldtrace.tmp >/dev/null 2>&1 \ + && rm -f perldtrace.tmp + then + echo " " + echo "Good: your $dtrace knows about the -h flag." + else + cat >&2 <&2 < ../extras.lst + val="'$extras'" + ;; +esac +set extras +eval $setvar +echo " " + +: determine where html pages for programs go +set html1dir html1dir none +eval $prefixit +$cat </dev/null 2>&1 && $run ./a.out; then + if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then bin_ELF="$define" fi $rm_try @@ -8293,6 +8565,12 @@ EOM esac case "$ldflags" in + *-fstack-protector-strong*) + case "$dflt" in + *-fstack-protector-strong*) ;; # Don't add it again + *) dflt="$dflt -fstack-protector-strong" ;; + esac + ;; *-fstack-protector*) case "$dflt" in *-fstack-protector*) ;; # Don't add it again @@ -8529,12 +8807,9 @@ if "$useshrplib"; then freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig) xxx="-Wl,-R$shrpdir" ;; - bsdos|linux|irix*|dec_osf|gnu*) + bsdos|linux|irix*|dec_osf|gnu*|haiku) xxx="-Wl,-rpath,$shrpdir" ;; - haiku) - # Haiku doesn't like the default, either. - ;; hpux*) # hpux doesn't like the default, either. tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\"" @@ -9821,6 +10096,93 @@ esac set qgcvt d_qgcvt eval $inlibc +: Check what kind of doubles your system has +$echo "Checking the kind of doubles you have..." >&4 +$cat >try.c < +#endif +#include +static const double d = -0.1; +int main() { + unsigned const char* b = (unsigned const char*)(&d); +#if DOUBLESIZE == 4 + if (b[0] == 0xCD && b[3] == 0xBD) { + /* IEEE 754 32-bit little-endian */ + printf("1\n"); + exit(0); + } + if (b[0] == 0xBD && b[3] == 0xCD) { + /* IEEE 754 32-bit big-endian */ + printf("2\n"); + exit(0); + } +#endif +#if DOUBLESIZE == 8 + if (b[0] == 0x9A && b[7] == 0xBF) { + /* IEEE 754 64-bit little-endian */ + printf("3\n"); + exit(0); + } + if (b[0] == 0xBF && b[7] == 0x9A) { + /* IEEE 754 64-bit big-endian */ + printf("4\n"); + exit(0); + } + if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) { + /* ARM mixed endian: two little-endian 32-bit floats, in big endian order: + * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0) + * 99 99 b9 bf 9a 99 99 99 */ + printf("7\n"); + exit(0); + } + if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) { + /* The opposite of case 7, mixed endian: two big-endian 32-bit floats, + * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0) + * 99 99 99 9a bf b9 99 99 */ + printf("8\n"); + exit(0); + } +#endif +#if DOUBLESIZE == 16 + if (b[0] == 0x9A && b[15] == 0xBF) { + /* IEEE 754 128-bit little-endian */ + printf("5\n"); + exit(0); + } + if (b[0] == 0xBF && b[15] == 0x9A) { + /* IEEE 754 128-bit big-endian */ + printf("6\n"); + exit(0); + } +#endif + /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY. + * Whether those environments can still build Perl is debatable. */ + printf("-1\n"); /* unknown */ + exit(0); +} +EOP +set try +if eval $compile; then + doublekind=`$run ./try` +else + doublekind=-1 +fi +case "$doublekind" in +1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;; +2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;; +3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;; +4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;; +5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;; +6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;; +7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;; +8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;; +*) echo "Cannot figure out your double. You VAX, or something?" >&4 ;; +esac +$rm_try + : Check print/scan long double stuff echo " " @@ -9843,7 +10205,7 @@ EOCP case "$yyy" in 123.456) sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"'; - sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"'; + sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"'; echo "We will use %f." ;; esac @@ -9865,7 +10227,7 @@ EOCP case "$yyy" in 123.456) sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"'; - sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"'; + sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"'; echo "We will use %Lf." ;; esac @@ -9887,7 +10249,7 @@ EOCP case "$yyy" in 123.456) sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"'; - sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"'; + sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"'; echo "We will use %llf." ;; esac @@ -9909,7 +10271,7 @@ EOCP case "$yyy" in 123.456) sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"'; - sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"'; + sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"'; echo "We will use %lf." ;; esac @@ -9937,6 +10299,38 @@ case "$sPRIfldbl" in ;; esac +: Before committing on uselongdouble, see whether that looks sane. +if $test "$uselongdouble" = "$define"; then + message="" + echo " " + echo "Checking if your long double math functions work right..." >&4 + $cat > try.c < +#include +int main() { + printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L))); +} +EOF + case "$osname:$gccversion" in + aix:) saveccflags="$ccflags" + ccflags="$ccflags -qlongdouble" ;; # to avoid core dump + esac + set try + if eval $compile_ok; then + yyy=`$run ./try` + fi + case "$yyy" in + 3) echo "Your long double math functions are working correctly." >&4 ;; + *) echo "Your long double math functions are broken, not using long doubles." >&4 + uselongdouble=$undef + ;; + esac + $rm_try + case "$osname:$gccversion" in + aix:) ccflags="$saveccflags" ;; # restore + esac +fi + : Check how to convert floats to strings. if test "X$d_Gconvert" = X; then @@ -10236,6 +10630,10 @@ $rm -f access* set accessx d_accessx eval $inlibc +: see if acosh exists +set acosh d_acosh +eval $inlibc + : see if aintl exists set aintl d_aintl eval $inlibc @@ -10367,6 +10765,25 @@ set $varname; eval $setvar; $rm_try' +: Define hasfield_t macro for Configure internal use +hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift; +while $test $# -ge 2; do + case "$1" in + $define) echo "#include <$2>";; + esac ; + shift 2; +done > try.c; +echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c; +set try; +if eval $compile; then + val="$define"; +else + val="$undef"; +fi; +set $varname; +eval $setvar; +$rm_try' + : see if we should include time.h, sys/time.h, or both echo " " if test "X$timeincl" = X; then @@ -10542,6 +10959,14 @@ case "$d_asctime_r" in ;; esac +: see if asinh exists +set asinh d_asinh +eval $inlibc + +: see if atanh exists +set atanh d_atanh +eval $inlibc + : see if atolf exists set atolf d_atolf eval $inlibc @@ -11268,7 +11693,7 @@ int main() EOCP set try if eval $compile_ok; then - $run ./try + $run ./try 2>/dev/null yyy=$? else echo "(I can't seem to compile the test program--assuming it can't)" @@ -11368,7 +11793,7 @@ int main() EOCP set try if eval $compile_ok; then - $run ./try + $run ./try 2>/dev/null castflags=$? else echo "(I can't seem to compile the test program--assuming it can't)" @@ -11386,6 +11811,10 @@ set d_castneg eval $setvar $rm_try +: see if cbrt exists +set cbrt d_cbrt +eval $inlibc + : see if vprintf exists echo " " if set vprintf val -f d_vprintf; eval $csym; $val; then @@ -11750,6 +12179,10 @@ fi set d_const eval $setvar +: see if copysign exists +set copysign d_copysign +eval $inlibc + : see if copysignl exists set copysignl d_copysignl eval $inlibc @@ -11960,10 +12393,6 @@ eval $inlibc set limits.h i_limits eval $inhdr -: see if this is a float.h system -set float.h i_float -eval $inhdr - : See if number of significant digits in a double precision number is known echo " " $cat >dbl_dig.c <&4 case "$eagain" in '') - case "$d_fork:$d_pipe" in - define:define) + case "$d_fork:$d_pipe:$d_alarm" in + define:define:define) $cat head.c > try.c $cat >>try.c < @@ -13128,6 +13557,22 @@ EOCP esac $rm_try head.c mtry +: see if erf exists +set erf d_erf +eval $inlibc + +: see if erfc exists +set erfc d_erfc +eval $inlibc + +: see if exp2 exists +set exp2 d_exp2 +eval $inlibc + +: see if expm1 exists +set expm1 d_expm1 +eval $inlibc + : see if _ptr and _cnt from stdio act std echo " " @@ -13573,6 +14018,18 @@ EOM fi $rm_try +: see if fdclose exists +set fdclose d_fdclose +eval $inlibc + +: see if fdim exists +set fdim d_fdim +eval $inlibc + +: see if fegetround exists +set fegetround d_fegetround +eval $inlibc + : see if fgetpos exists set fgetpos d_fgetpos eval $inlibc @@ -13594,10 +14051,55 @@ echo " " set d_flockproto flock $i_sysfile sys/file.h eval $hasproto +: see if fma exists +set fma d_fma +eval $inlibc + +: see if fmax exists +set fmax d_fmax +eval $inlibc + +: see if fmin exists +set fmin d_fmin +eval $inlibc + : see if fp_class exists set fp_class d_fp_class eval $inlibc +: see if this is a math.h system +set math.h i_math +eval $inhdr + +: check for fpclassify +echo "Checking to see if you have fpclassify..." >&4 +$cat >try.c < +#endif +int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; } +EOCP +set try +if eval $compile; then + val="$define" + echo "You have fpclassify." +else + val="$undef" + echo "You do not have fpclassify." +fi +$rm_try +set d_fpclassify +eval $setvar + +: see if fp_classify exists +set fp_classify d_fp_classify +eval $inlibc + +: see if fp_classl exists +set fp_classl d_fp_classl +eval $inlibc + : see if pathconf exists set pathconf d_pathconf eval $inlibc @@ -13610,14 +14112,14 @@ eval $inlibc set fpclass d_fpclass eval $inlibc -: see if fpclassify exists -set fpclassify d_fpclassify -eval $inlibc - : see if fpclassl exists set fpclassl d_fpclassl eval $inlibc +: see if fpgetround exists +set fpgetround d_fpgetround +eval $inlibc + : check for fpos64_t echo " " echo "Checking to see if you have fpos64_t..." >&4 @@ -15245,6 +15747,14 @@ esac set d_htonl eval $setvar +: see if hypot exists +set hypot d_hypot +eval $inlibc + +: see if ilogb exists +set ilogb d_ilogb +eval $inlibc + : see if ilogbl exists set ilogbl d_ilogbl eval $inlibc @@ -15336,36 +15846,170 @@ int main() { return 1 ; } EOCP -if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then - echo "isblank() found." >&4 +if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then + echo "isblank() found." >&4 + val="$define" +else + echo "isblank() NOT found." >&4 + val="$undef" +fi +set d_isblank +eval $setvar +$rm -f isblank* + +: check for isfinite +echo "Checking to see if you have isfinite..." >&4 +$cat >try.c < +#endif +int main() { return isfinite(0.0); } +EOCP +set try +if eval $compile; then + val="$define" + echo "You have isfinite." +else + val="$undef" + echo "You do not have isfinite." +fi +$rm_try +set d_isfinite +eval $setvar + +: see if isfinitel exists +set isfinitel d_isfinitel +eval $inlibc + +: check for isinf +echo "Checking to see if you have isinf..." >&4 +$cat >try.c < +#endif +int main() { return isinf(0.0); } +EOCP +set try +if eval $compile; then + val="$define" + echo "You have isinf." +else + val="$undef" + echo "You do not have isinf." +fi +$rm_try +set d_isinf +eval $setvar + +: see if isinfl exists +set isinfl d_isinfl +eval $inlibc + +: check for isless +echo "Checking to see if you have isless..." >&4 +$cat >try.c < +#endif +int main() { return isless(0.0); } +EOCP +set try +if eval $compile; then + val="$define" + echo "You have isless." +else + val="$undef" + echo "You do not have isless." +fi +$rm_try +set d_isless +eval $setvar + +: check for isnan +echo "Checking to see if you have isnan..." >&4 +$cat >try.c < +#endif +int main() { return isnan(0.0); } +EOCP +set try +if eval $compile; then + val="$define" + echo "You have isnan." +else + val="$undef" + echo "You do not have isnan." +fi +$rm_try +set d_isnan +eval $setvar + +: see if isnanl exists +set isnanl d_isnanl +eval $inlibc + +: check for isnormal +echo "Checking to see if you have isnormal..." >&4 +$cat >try.c < +#endif +int main() { return isnormal(0.0); } +EOCP +set try +if eval $compile; then val="$define" + echo "You have isnormal." else - echo "isblank() NOT found." >&4 val="$undef" + echo "You do not have isnormal." fi -set d_isblank +$rm_try +set d_isnormal eval $setvar -$rm -f isblank* -: see if isfinite exists -set isfinite d_isfinite +: see if j0 exists +set j0 d_j0 eval $inlibc -: see if isinf exists -set isinf d_isinf +: see if j0l exists +set j0l d_j0l eval $inlibc -: see if isnan exists -set isnan d_isnan +: see if killpg exists +set killpg d_killpg eval $inlibc -: see if isnanl exists -set isnanl d_isnanl +: see if localeconv exists +set localeconv d_locconv eval $inlibc -: see if killpg exists -set killpg d_killpg -eval $inlibc +: see if libc has the POSIX.1-2008 currency locale rules +case "$d_locconv:$d_lc_monetary_2008" in +$define:) + $cat >try.c < +int main() { + struct lconv *lc = localeconv(); + char int_p_cs_precedes = lc->int_p_cs_precedes; + return 0; +} +EOCP + set try + if eval $compile; then + d_lc_monetary_2008="$define" + else + d_lc_monetary_2008="$undef" + fi; + $rm_try + ;; +esac : see if lchown exists echo " " @@ -15426,9 +16070,13 @@ $rm -f ldbl_dig.? set d_ldbl_dig eval $setvar -: see if this is a math.h system -set math.h i_math -eval $inhdr +: see if lgamma exists +set lgamma d_lgamma +eval $inlibc + +: see if lgamma_r exists +set lgamma_r d_lgamma_r +eval $inlibc : check to see if math.h defines _LIB_VERSION d_libm_lib_version="$undef" @@ -15462,6 +16110,22 @@ EOCP set link d_link eval $inlibc +: see if llrint exists +set llrint d_llrint +eval $inlibc + +: see if llrintl exists +set llrintl d_llrintl +eval $inlibc + +: see if llround exists +set llround d_llround +eval $inlibc + +: see if llroundl exists +set llroundl d_llroundl +eval $inlibc + : see if localtime_r exists set localtime_r d_localtime_r eval $inlibc @@ -15581,14 +16245,38 @@ EOCP esac $rm_try -: see if localeconv exists -set localeconv d_locconv -eval $inlibc - : see if lockf exists set lockf d_lockf eval $inlibc +: see if log1p exists +set log1p d_log1p +eval $inlibc + +: see if log2 exists +set log2 d_log2 +eval $inlibc + +: see if logb exists +set logb d_logb +eval $inlibc + +: see if lrint exists +set lrint d_lrint +eval $inlibc + +: see if lrintl exists +set lrintl d_lrintl +eval $inlibc + +: see if lround exists +set lround d_lround +eval $inlibc + +: see if lroundl exists +set lroundl d_lroundl +eval $inlibc + : see if prototype for lseek is available echo " " set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h @@ -15701,6 +16389,10 @@ eval $inlibc set scalbnl d_scalbnl eval $inlibc +: see if truncl exists +set truncl d_truncl +eval $inlibc + : see if modfl exists set modfl d_modfl eval $inlibc @@ -15779,10 +16471,14 @@ if $test "$uselongdouble" = "$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." + if $test "$d_truncl:$d_copysignl" = "$define:$define"; then + echo "You have both truncl and copysignl, so I can emulate modfl." else - message="$message modfl" + if $test "$d_aintl:$d_copysignl" = "$define:$define"; then + echo "You have both aintl and copysignl, so I can emulate modfl." + else + message="$message modfl" + fi fi fi if $test "$d_frexpl" != "$define"; then @@ -15792,6 +16488,9 @@ if $test "$uselongdouble" = "$define"; then message="$message frexpl" fi fi + if $test "$d_ldexpl" != "$define"; then + message="$message ldexpl" + fi if $test "$message" != ""; then $cat <&4 @@ -15883,6 +16582,22 @@ eval $inlibc set munmap d_munmap eval $inlibc +: see if nan exists +set nan d_nan +eval $inlibc + +: see if nearbyint exists +set nearbyint d_nearbyint +eval $inlibc + +: see if nextafter exists +set nextafter d_nextafter +eval $inlibc + +: see if nexttoward exists +set nexttoward d_nexttoward +eval $inlibc + : see if nice exists set nice d_nice eval $inlibc @@ -15895,6 +16610,10 @@ eval $inhdr set nl_langinfo d_nl_langinfo eval $inlibc +: see if this is a quadmath.h system +set quadmath.h i_quadmath +eval $inhdr + : check for volatile keyword echo " " echo 'Checking to see if your C compiler knows about "volatile"...' >&4 @@ -15954,6 +16673,48 @@ define:define) ;; esac +case "$usequadmath:$i_quadmath" in +define:define) + nvtype="__float128" + nvsize=16 + case "$libs" in + *quadmath*) ;; + *) $cat <&4 + +*** You requested the use of the quadmath library, but you +*** do not seem to have the quadmath library installed. +*** Cannot continue, aborting. +EOM + exit 1 + ;; + esac + ;; +define:*) $cat <&4 + +*** You requested the use of the quadmath library, but you +*** do not seem to have the required header, . +EOM + case "$gccversion" in + [23].*|4.[0-5]*) + $cat <&4 +*** Your gcc looks a bit old: +*** $gccversion +EOM + ;; + '') + $cat <&4 +*** You are not running a gcc. +EOM + ;; + esac + $cat <&4 +*** For the quadmath library you need at least gcc 4.6. +*** Cannot continue, aborting. +EOM + exit 1 + ;; +esac + $echo "(IV will be "$ivtype", $ivsize bytes)" $echo "(UV will be "$uvtype", $uvsize bytes)" $echo "(NV will be "$nvtype", $nvsize bytes)" @@ -16440,6 +17201,9 @@ d_prctl_set_name=$undef case $d_prctl in $define) $cat >try.c < +#endif #include int main (int argc, char *argv[]) @@ -16460,14 +17224,21 @@ EOM set readlink d_readlink eval $inlibc -: Check if exe is symlink to abs path of executing program +: Check if there is a /proc symlink to the abs path of +: the executing program. We will honor hints of d_procselfexe=$undef +: or procselfexe being non-empty, otherwise will try to determine both +: if we have readlink. +: AmigaOS will attempt to mount proc: aka /proc, if /proc/... is +: referenced, and AmigaOS does not have a proc filesystem anyway. echo " " -procselfexe='' val="$undef" -case "$d_readlink" in - "$define") - : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels - : more tidy to avoid an extra level of symlink +if $test "X$d_procselfexe" = Xundef; then + procselfexe='' +elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then + val="$define" +elif $test "X$d_readlink" = Xdefine; then + : NetBSD first as /proc/self is a symlink to /proc/curproc, + : and it feels more tidy to avoid an extra level of symlink set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out while test $# -gt 0; do type=$1; try=$2 @@ -16483,8 +17254,7 @@ case "$d_readlink" in fi fi done - ;; -esac +fi $rm -f reflect set d_procselfexe eval $setvar @@ -16814,14 +17584,56 @@ eval $inlibc set recvmsg d_recvmsg eval $inlibc +: see if regcomp, regcmp, or re_comp exist, for regular pattern matching +echo " " +if set regcomp val -f d_regcomp; eval $csym; $val; then + echo 'regcomp() found.' >&4 + d_regcomp="$define" + d_regcmp="$undef" + d_re_comp="$undef" +elif set regcmp val -f d_regcmp; eval $csym; $val; then + echo 'regcmp() found.' >&4 + d_regcmp="$define" + d_regcomp="$undef" + d_re_comp="$undef" +elif set re_comp val -f d_re_comp; eval $csym; $val; then + echo 're_comp() found, assuming re_exec() also exists.' >&4 + d_re_comp="$define" + d_regcomp="$undef" + d_regcmp="$undef" +else + $cat >&4 <&4 +$cat >try.c < +#endif +#include +/* Note that whether the sign bit is on or off + * for NaN depends on the CPU/FPU, and possibly + * can be affected by the build toolchain. + * + * For example for older MIPS and HP-PA 2.0 the quiet NaN is: + * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + * (respectively) as opposed to the more usual + * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + */ +static void bytes(unsigned char *p, unsigned int n) { + int i; + for (i = 0; i < n; i++) { + printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n"); + } +} +int main(int argc, char *argv[]) { + /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double) + * because some compilers are 'smart' and not only warn but refuse to + * compile such 'illegal' values. */ + double dinf = exp(1e9); + double dnan = sqrt(-1.0); +#ifdef HAS_LONG_DOUBLE + long double ldinf = (long double)exp(1e9); + long double ldnan = (long double)sqrt(-1.0); +#endif + if (argc == 2) { + switch (argv[1][0]) { + case '1': bytes(&dinf, sizeof(dinf)); break; + case '2': bytes(&dnan, sizeof(dnan)); break; +#ifdef HAS_LONG_DOUBLE +# if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4 +/* the 80-bit long doubles might have garbage in their excess bytes */ + memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10); +# endif + case '3': bytes(&ldinf, sizeof(ldinf)); break; + case '4': bytes(&ldnan, sizeof(ldnan)); break; +#endif + } + } + return 0; +} +EOP +set try +if eval $compile; then + doubleinfbytes=`$run ./try 1` + doublenanbytes=`$run ./try 2` + case "$d_longdbl" in + $define) + longdblinfbytes=`$run ./try 3` + longdblnanbytes=`$run ./try 4` + ;; + esac +else + # Defaults in case the above test program failed. + case "$doublekind" in + 1) # IEEE 754 32-bit LE + doubleinfbytes='0x00, 0x00, 0xf0, 0x7f' + doublenanbytes='0x00, 0x00, 0xf8, 0x7f' + ;; + 2) # IEEE 754 32-bit BE + doubleinfbytes='0x7f, 0xf0, 0x00, 0x00' + doublenanbytes='0x7f, 0xf8, 0x00, 0x00' + ;; + 3) # IEEE 754 64-bit LE + doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' + doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' + ;; + 4) # IEEE 754 64-bit BE + doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + ;; + 5) # IEEE 754 128-bit LE + doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' + doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' + ;; + 6) # IEEE 754 128-bit BE + doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + ;; + 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE + doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00' + doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00' + ;; + 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE + doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00' + doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00' + ;; + *) # No idea. + doubleinfbytes=$undef + doublenanbytes=$undef + ;; + esac + case "$longdblkind" in + 1) # IEEE 754 128-bit LE + longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f' + longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f' + ;; + 2) # IEEE 754 128-bit BE + longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + ;; + 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86) + case "$longdblsize" in + 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8) + longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00' + longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00' + ;; + 16) # x86_64 + longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + ;; + *) # No idea. + longdblinfbytes=$undef + longdblnanbytes=$undef + ;; + esac + ;; + 4) # IEEE 754 80-bit BE, 12 or 16 bytes + case "$longdblsize" in + 12) # 32-bit system + longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + ;; + 16) # 64-bit system + longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + ;; + *) # No idea. + longdblinfbytes=$undef + longdblnanbytes=$undef + ;; + esac + ;; + 5) # 128-bit LE-LE "double double" + longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' + longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' + ;; + 6) # 128-bit BE-BE "double double" + longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + ;; + 7) # 128-bit LE-BE "double double" + longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + ;; + 8) # 128-bit BE-LE "double double" + longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' + ;; + *) # No idea. + longdblinfbytes=$undef + longdblnanbytes=$undef + ;; + esac +fi +$rm_try + +: Check the length of the double mantissa +$echo "Checking how many mantissa bits your doubles have..." >&4 +$cat >try.c < +#endif +#ifdef I_SUNMATH +# include +#endif +#ifdef DBL_MANT_DIG +# define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */ +#endif +#include +int main(int argc, char *argv[]) { +#ifdef BITS + printf("%d\n", BITS); +#endif + return 0; +} +EOP +set try +if eval $compile; then + doublemantbits=`$run ./try` +else + doublemantbits="$undef" +fi +$rm_try + +: Check the length of the longdouble mantissa +$echo "Checking how many mantissa bits your long doubles have..." >&4 +$cat >try.c < +#endif +#ifdef I_SUNMATH +# include +#endif +#$d_longdbl HAS_LONG_DOUBLE +#if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG) +# if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */ +/* This format has no implicit bit. Beware, however, that for + * this format the bare LDBL_MANT_DIG is misleading for inf/nan: + * the top three bits are used for inf (100) / qnan (11x) / snan (101), + * and the top bit must have been one since 387, zero is plain invalid. + * For normal fp values, the LDBL_MANT_DIG is fine, though. */ +# define BITS LDBL_MANT_DIG +# elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */ +/* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some + * reason e.g. Irix thinks 107. But in any case, we want only + * the number of real bits, the implicit bits are of no interest. */ +# define BITS 2 * (DBL_MANT_DIG - 1) +# else +# define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */ +# endif +#endif +#include +int main(int argc, char *argv[]) { +#ifdef BITS + printf("%d\n", BITS); +#endif + return 0; +} +EOP +set try +if eval $compile; then + longdblmantbits=`$run ./try` +else + longdblmantbits="$undef" +fi +$rm_try + +: Check the length of the NV mantissa +$echo "Checking how many mantissa bits your NVs have..." >&4 +if test "X$usequadmath" = "X$define"; then + nvmantbits=112 # 128-1-15 +else + if test "X$nvsize" = "X$doublesize"; then + nvmantbits="$doublemantbits" + else + if test "X$nvsize" = "X$longdblsize"; then + nvmantbits="$longdblmantbits" + else + nvmantbits="$undef" + fi + fi +fi + : How can we generate normalized random numbers ? echo " " echo "Using our internal random number implementation..." >&4 @@ -20252,20 +21343,29 @@ else fi fi -if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then +if $test X"$usequadmath" = X"$define"; then + nveformat='"Qe"' + nvfformat='"Qf"' + nvgformat='"Qg"' + nvEUformat='"QE"' + nvFUformat='"QF"' + nvGUformat='"QG"' +else + if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then nveformat="$sPRIeldbl" nvfformat="$sPRIfldbl" nvgformat="$sPRIgldbl" nvEUformat="$sPRIEUldbl" nvFUformat="$sPRIFUldbl" nvGUformat="$sPRIGUldbl" -else + else nveformat='"e"' nvfformat='"f"' nvgformat='"g"' nvEUformat='"E"' nvFUformat='"F"' nvGUformat='"G"' + fi fi case "$ivdformat" in @@ -20438,7 +21538,7 @@ rp="What is the type used for the length parameter for string functions?" set size_t sizetype 'unsigned int' stdio.h sys/types.h eval $typedef_ask -: check for type of arguments to gethostbyaddr. +: check for type of arguments to gethostbyaddr. if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then case "$d_gethbyaddr" in $define) @@ -20447,8 +21547,8 @@ if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then Checking to see what type of arguments are accepted by gethostbyaddr(). EOM hdrs="$define sys/types.h - $d_socket sys/socket.h - $i_niin netinet/in.h + $d_socket sys/socket.h + $i_niin netinet/in.h $i_netdb netdb.h $i_unistd unistd.h" : The first arg can 'char *' or 'void *' @@ -20485,12 +21585,12 @@ EOM netdb_hlen_type="$sizetype" ;; esac - # Remove the "const" if needed. -- but then we'll have a + # Remove the "const" if needed. -- but then we'll have a # prototype clash! # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'` fi -: check for type of argument to gethostbyname. +: check for type of argument to gethostbyname. if test "X$netdb_name_type" = X ; then case "$d_gethbyname" in $define) @@ -20499,8 +21599,8 @@ if test "X$netdb_name_type" = X ; then Checking to see what type of argument is accepted by gethostbyname(). EOM hdrs="$define sys/types.h - $d_socket sys/socket.h - $i_niin netinet/in.h + $d_socket sys/socket.h + $i_niin netinet/in.h $i_netdb netdb.h $i_unistd unistd.h" for xxx in "const char *" "char *"; do @@ -20528,7 +21628,7 @@ EOM esac fi -: check for type of 1st argument to getnetbyaddr. +: check for type of 1st argument to getnetbyaddr. if test "X$netdb_net_type" = X ; then case "$d_getnbyaddr" in $define) @@ -20537,8 +21637,8 @@ if test "X$netdb_net_type" = X ; then Checking to see what type of 1st argument is accepted by getnetbyaddr(). EOM hdrs="$define sys/types.h - $d_socket sys/socket.h - $i_niin netinet/in.h + $d_socket sys/socket.h + $i_niin netinet/in.h $i_netdb netdb.h $i_unistd unistd.h" for xxx in in_addr_t "unsigned long" long "unsigned int" int; do @@ -20728,7 +21828,7 @@ int check_min () int main (int argc, char *argv[]) { - fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); + /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */ check_max (); check_min (); return (0); @@ -20736,7 +21836,7 @@ int main (int argc, char *argv[]) EOCP set try if eval $compile; then - eval `$run ./try` + eval `$run ./try 2>/dev/null` else echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4 fi @@ -20817,7 +21917,7 @@ int main (int argc, char *argv[]) EOCP set try if eval $compile; then - eval `$run ./try` + eval `$run ./try 2>/dev/null` else echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4 fi @@ -20949,7 +22049,7 @@ int main() { EOCP set try if eval $compile_ok; then - selectminbits=`$run ./try` + selectminbits=`$run ./try 2>/dev/null` case "$selectminbits" in '') cat >&4 <&4 + set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h + eval $hasfield_t; + + echo "Checking if your siginfo_t has si_pid field...">&4 + set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h + eval $hasfield_t; + + echo "Checking if your siginfo_t has si_uid field...">&4 + set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h + eval $hasfield_t; + + echo "Checking if your siginfo_t has si_addr field...">&4 + set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h + eval $hasfield_t; + + echo "Checking if your siginfo_t has si_status field...">&4 + set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h + eval $hasfield_t; + + echo "Checking if your siginfo_t has si_band field...">&4 + set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h + eval $hasfield_t; + + echo "Checking if your siginfo_t has si_value field...">&4 + set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h + eval $hasfield_t; + + ;; +esac + : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program echo " " echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4 @@ -21902,6 +23040,10 @@ eval $inhdr set execinfo.h i_execinfo eval $inhdr +: see if this is a fenv.h system +set fenv.h i_fenv +eval $inhdr + : see if this is a fp.h system set fp.h i_fp eval $inhdr @@ -22218,7 +23360,7 @@ fi : add -D_FORTIFY_SOURCE if feasible and not already there case "$gccversion" in -4.*) case "$optimize$ccflags" in +[45].*) case "$optimize$ccflags" in *-O*) case "$ccflags$cppsymbols" in *_FORTIFY_SOURCE=*) # Don't add it again. echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4 @@ -22228,11 +23370,11 @@ case "$gccversion" in ;; esac ;; - *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4 + *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4 ;; esac ;; -*) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4 +*) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4 ;; esac @@ -22324,6 +23466,10 @@ eval $setvar set stddef.h i_stddef eval $inhdr +: see if stdint is available +set stdint.h i_stdint +eval $inhdr + : see if sys/access.h is available set sys/access.h i_sysaccess eval $inhdr @@ -22445,13 +23591,13 @@ find_extensions=' case "$xxx" in DynaLoader|dynaload) ;; *) - this_ext=`echo $xxx | $sed -e s/-/\\\//g`; + this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`; case "$this_ext" in Scalar/List/Utils) this_ext="List/Util" ;; PathTools) this_ext="Cwd" ;; esac; - echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp; - if $contains " $this_ext " $tdir/$$.tmp; then + echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp"; + if $contains " $this_ext " "$tdir/$$.tmp"; then echo >&4; echo "Duplicate directories detected for extension $xxx" >&4; echo "Configure cannot correctly recover from this - shall I abort?" >&4; @@ -22469,15 +23615,15 @@ find_extensions=' esac; echo "Ok. You will need to correct config.sh before running make." >&4; fi; - $ls -1 $xxx > $tdir/$$.tmp; - if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then + $ls -1 "$xxx" > "$tdir/$$.tmp"; + if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then xs_extensions="$xs_extensions $this_ext"; - elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then + elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then xs_extensions="$xs_extensions $this_ext"; - elif $test -d $xxx; then + elif $test -d "$xxx"; then nonxs_extensions="$nonxs_extensions $this_ext"; fi; - $rm -f $tdir/$$.tmp; + $rm -f "$tdir/$$.tmp"; ;; esac; done' @@ -22507,6 +23653,11 @@ known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort avail_ext='' for xxx in $xs_extensions ; do case "$xxx" in + Amiga*) + case "$osname" in + amigaos) avail_ext="$avail_ext $xxx" ;; + esac + ;; DB_File|db_file) case "$i_db" in $define) avail_ext="$avail_ext $xxx" ;; @@ -22576,9 +23727,14 @@ for xxx in $xs_extensions ; do esac ;; Sys/Syslog|sys/syslog) - : XXX syslog requires socket - case "$d_socket" in - true|$define|y) avail_ext="$avail_ext $xxx" ;; + case $osname in + amigaos) ;; # not really very useful on AmigaOS + *) + : XXX syslog requires socket + case "$d_socket" in + true|$define|y) avail_ext="$avail_ext $xxx" ;; + esac + ;; esac ;; Thread|thread) @@ -23029,11 +24185,14 @@ d_SCNfldbl='$d_SCNfldbl' d__fwalk='$d__fwalk' d_access='$d_access' d_accessx='$d_accessx' +d_acosh='$d_acosh' d_aintl='$d_aintl' d_alarm='$d_alarm' d_archlib='$d_archlib' d_asctime64='$d_asctime64' d_asctime_r='$d_asctime_r' +d_asinh='$d_asinh' +d_atanh='$d_atanh' d_atolf='$d_atolf' d_atoll='$d_atoll' d_attribute_deprecated='$d_attribute_deprecated' @@ -23056,6 +24215,7 @@ d_bzero='$d_bzero' d_c99_variadic_macros='$d_c99_variadic_macros' d_casti32='$d_casti32' d_castneg='$d_castneg' +d_cbrt='$d_cbrt' d_charvspr='$d_charvspr' d_chown='$d_chown' d_chroot='$d_chroot' @@ -23065,6 +24225,7 @@ d_clearenv='$d_clearenv' d_closedir='$d_closedir' d_cmsghdr_s='$d_cmsghdr_s' d_const='$d_const' +d_copysign='$d_copysign' d_copysignl='$d_copysignl' d_cplusplus='$d_cplusplus' d_crypt='$d_crypt' @@ -23104,7 +24265,11 @@ d_endpwent_r='$d_endpwent_r' d_endsent='$d_endsent' d_endservent_r='$d_endservent_r' d_eofnblk='$d_eofnblk' +d_erf='$d_erf' +d_erfc='$d_erfc' d_eunice='$d_eunice' +d_exp2='$d_exp2' +d_expm1='$d_expm1' d_faststdio='$d_faststdio' d_fchdir='$d_fchdir' d_fchmod='$d_fchmod' @@ -23113,19 +24278,28 @@ d_fcntl='$d_fcntl' d_fcntl_can_lock='$d_fcntl_can_lock' d_fd_macros='$d_fd_macros' d_fd_set='$d_fd_set' +d_fdclose='$d_fdclose' +d_fdim='$d_fdim' d_fds_bits='$d_fds_bits' +d_fegetround='$d_fegetround' d_fgetpos='$d_fgetpos' d_finite='$d_finite' d_finitel='$d_finitel' d_flexfnam='$d_flexfnam' d_flock='$d_flock' d_flockproto='$d_flockproto' +d_fma='$d_fma' +d_fmax='$d_fmax' +d_fmin='$d_fmin' d_fork='$d_fork' d_fp_class='$d_fp_class' +d_fp_classify='$d_fp_classify' +d_fp_classl='$d_fp_classl' d_fpathconf='$d_fpathconf' d_fpclass='$d_fpclass' d_fpclassify='$d_fpclassify' d_fpclassl='$d_fpclassl' +d_fpgetround='$d_fpgetround' d_fpos64_t='$d_fpos64_t' d_frexpl='$d_frexpl' d_fs_data_s='$d_fs_data_s' @@ -23203,6 +24377,8 @@ d_gnulibc='$d_gnulibc' d_grpasswd='$d_grpasswd' d_hasmntopt='$d_hasmntopt' d_htonl='$d_htonl' +d_hypot='$d_hypot' +d_ilogb='$d_ilogb' d_ilogbl='$d_ilogbl' d_inc_version_list='$d_inc_version_list' d_index='$d_index' @@ -23217,22 +24393,43 @@ d_ipv6_mreq_source='$d_ipv6_mreq_source' d_isascii='$d_isascii' d_isblank='$d_isblank' d_isfinite='$d_isfinite' +d_isfinitel='$d_isfinitel' d_isinf='$d_isinf' +d_isinfl='$d_isinfl' +d_isless='$d_isless' d_isnan='$d_isnan' d_isnanl='$d_isnanl' +d_isnormal='$d_isnormal' +d_j0='$d_j0' +d_j0l='$d_j0l' d_killpg='$d_killpg' +d_lc_monetary_2008='$d_lc_monetary_2008' d_lchown='$d_lchown' d_ldbl_dig='$d_ldbl_dig' +d_ldexpl='$d_ldexpl' +d_lgamma='$d_lgamma' +d_lgamma_r='$d_lgamma_r' d_libm_lib_version='$d_libm_lib_version' d_libname_unique='$d_libname_unique' d_link='$d_link' +d_llrint='$d_llrint' +d_llrintl='$d_llrintl' +d_llround='$d_llround' +d_llroundl='$d_llroundl' d_localtime64='$d_localtime64' d_localtime_r='$d_localtime_r' d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset' d_locconv='$d_locconv' d_lockf='$d_lockf' +d_log1p='$d_log1p' +d_log2='$d_log2' +d_logb='$d_logb' d_longdbl='$d_longdbl' d_longlong='$d_longlong' +d_lrint='$d_lrint' +d_lrintl='$d_lrintl' +d_lround='$d_lround' +d_lroundl='$d_lroundl' d_lseekproto='$d_lseekproto' d_lstat='$d_lstat' d_madvise='$d_madvise' @@ -23272,8 +24469,12 @@ d_msgsnd='$d_msgsnd' d_msync='$d_msync' d_munmap='$d_munmap' d_mymalloc='$d_mymalloc' +d_nan='$d_nan' d_ndbm='$d_ndbm' d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes' +d_nearbyint='$d_nearbyint' +d_nextafter='$d_nextafter' +d_nexttoward='$d_nexttoward' d_nice='$d_nice' d_nl_langinfo='$d_nl_langinfo' d_nv_preserves_uv='$d_nv_preserves_uv' @@ -23310,19 +24511,27 @@ d_pwquota='$d_pwquota' d_qgcvt='$d_qgcvt' d_quad='$d_quad' d_random_r='$d_random_r' +d_re_comp='$d_re_comp' d_readdir64_r='$d_readdir64_r' d_readdir='$d_readdir' d_readdir_r='$d_readdir_r' d_readlink='$d_readlink' d_readv='$d_readv' d_recvmsg='$d_recvmsg' +d_regcmp='$d_regcmp' +d_regcomp='$d_regcomp' +d_remainder='$d_remainder' +d_remquo='$d_remquo' d_rename='$d_rename' d_rewinddir='$d_rewinddir' +d_rint='$d_rint' d_rmdir='$d_rmdir' +d_round='$d_round' d_safebcpy='$d_safebcpy' d_safemcpy='$d_safemcpy' d_sanemcmp='$d_sanemcmp' d_sbrkproto='$d_sbrkproto' +d_scalbn='$d_scalbn' d_scalbnl='$d_scalbnl' d_sched_yield='$d_sched_yield' d_scm_rights='$d_scm_rights' @@ -23374,6 +24583,13 @@ d_shmctl='$d_shmctl' d_shmdt='$d_shmdt' d_shmget='$d_shmget' d_sigaction='$d_sigaction' +d_siginfo_si_errno='$d_siginfo_si_errno' +d_siginfo_si_pid='$d_siginfo_si_pid' +d_siginfo_si_uid='$d_siginfo_si_uid' +d_siginfo_si_addr='$d_siginfo_si_addr' +d_siginfo_si_status='$d_siginfo_si_status' +d_siginfo_si_band='$d_siginfo_si_band' +d_siginfo_si_value='$d_siginfo_si_value' d_signbit='$d_signbit' d_sigprocmask='$d_sigprocmask' d_sigsetjmp='$d_sigsetjmp' @@ -23394,6 +24610,7 @@ d_srand48_r='$d_srand48_r' d_srandom_r='$d_srandom_r' d_sresgproto='$d_sresgproto' d_sresuproto='$d_sresuproto' +d_stat='$d_stat' d_statblks='$d_statblks' d_statfs_f_flags='$d_statfs_f_flags' d_statfs_s='$d_statfs_s' @@ -23436,13 +24653,16 @@ d_tcgetpgrp='$d_tcgetpgrp' d_tcsetpgrp='$d_tcsetpgrp' d_telldir='$d_telldir' d_telldirproto='$d_telldirproto' +d_tgamma='$d_tgamma' d_time='$d_time' d_timegm='$d_timegm' d_times='$d_times' d_tm_tm_gmtoff='$d_tm_tm_gmtoff' d_tm_tm_zone='$d_tm_tm_zone' d_tmpnam_r='$d_tmpnam_r' +d_trunc='$d_trunc' d_truncate='$d_truncate' +d_truncl='$d_truncl' d_ttyname_r='$d_ttyname_r' d_tzname='$d_tzname' d_u32align='$d_u32align' @@ -23483,6 +24703,10 @@ db_version_patch='$db_version_patch' direntrytype='$direntrytype' dlext='$dlext' dlsrc='$dlsrc' +doubleinfbytes='$doubleinfbytes' +doublekind='$doublekind' +doublemantbits='$doublemantbits' +doublenanbytes='$doublenanbytes' doublesize='$doublesize' drand01='$drand01' drand48_r_proto='$drand48_r_proto' @@ -23582,6 +24806,7 @@ i_dirent='$i_dirent' i_dlfcn='$i_dlfcn' i_execinfo='$i_execinfo' i_fcntl='$i_fcntl' +i_fenv='$i_fenv' i_float='$i_float' i_fp='$i_fp' i_fp_class='$i_fp_class' @@ -23610,6 +24835,7 @@ i_poll='$i_poll' i_prot='$i_prot' i_pthread='$i_pthread' i_pwd='$i_pwd' +i_quadmath='$i_quadmath' i_rpcsvcdbm='$i_rpcsvcdbm' i_sgtty='$i_sgtty' i_shadow='$i_shadow' @@ -23617,6 +24843,7 @@ i_socks='$i_socks' i_stdarg='$i_stdarg' i_stdbool='$i_stdbool' i_stddef='$i_stddef' +i_stdint='$i_stdint' i_stdlib='$i_stdlib' i_string='$i_string' i_sunmath='$i_sunmath' @@ -23727,6 +24954,10 @@ lns='$lns' localtime_r_proto='$localtime_r_proto' locincpth='$locincpth' loclibpth='$loclibpth' +longdblinfbytes='$longdblinfbytes' +longdblkind='$longdblkind' +longdblmantbits='$longdblmantbits' +longdblnanbytes='$longdblnanbytes' longdblsize='$longdblsize' longlongsize='$longlongsize' longsize='$longsize' @@ -23779,6 +25010,7 @@ nv_preserves_uv_bits='$nv_preserves_uv_bits' nveformat='$nveformat' nvfformat='$nvfformat' nvgformat='$nvgformat' +nvmantbits='$nvmantbits' nvsize='$nvsize' nvtype='$nvtype' o_nonblock='$o_nonblock' @@ -23986,6 +25218,7 @@ usensgetexecutablepath='$usensgetexecutablepath' useopcode='$useopcode' useperlio='$useperlio' useposix='$useposix' +usequadmath='$usequadmath' usereentrant='$usereentrant' userelocatableinc='$userelocatableinc' useshrplib='$useshrplib'