X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/4059ba8734da3986285ad50019afbd56b586ad25..8dc9a321dd4ceb65a6f39ababf8cb6a8f0de247a:/Configure diff --git a/Configure b/Configure index b48aaff..16d6370 100755 --- a/Configure +++ b/Configure @@ -16,7 +16,7 @@ # you should use metaconfig. Perl uses a modified version of this # tool, and this, together with the metaconfig units, are available # in the git repository: -# $ git clone https://github.com/perl5-metaconfig/metaconfig metaconfig +# $ git clone https://github.com/Perl/metaconfig metaconfig # The original dist package (including metaconfig) is available on github: # $ git clone https://github.com/rmanfredi/dist.git dist-git # @@ -28,7 +28,7 @@ # Porting/pumpkin.pod. # Generated using [metaconfig 3.5 PL0] -# (with additional metaconfig patches by perlbug@perl.org) +# with additional metaconfig patches from https://github.com/Perl/metaconfig cat >c1$$ <&4 + echo "AGH! Grep doesn't return a status. Attempting remedial action." >&4 cat >contains <<'EOSS' grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp EOSS -chmod +x contains +contains=./contains +chmod +x $contains esac : Find the path to the source tree @@ -2106,7 +2124,7 @@ THIS PACKAGE SEEMS TO BE INCOMPLETE. You have the option of continuing the configuration process, despite the distinct possibility that your kit is damaged, by typing 'y'es. If you do, don't blame me if something goes wrong. I advise you to type 'n'o -and contact the author (perlbug@perl.org). +and contact the author (https://github.com/Perl/perl5/issues). EOM echo $n "Continue? [n] $c" >&4 @@ -2386,7 +2404,7 @@ Much effort has been expended to ensure that this shell script will run on any Unix system. If despite that it blows up on yours, your best bet is to edit Configure and run it again. If you can't run Configure for some reason, you'll have to generate a config.sh file by hand. Whatever problems you -have, let me (perlbug@perl.org) know how I blew it. +have, let me (https://github.com/Perl/perl5/issues) know how I blew it. This installation script affects things in two ways: @@ -3355,7 +3373,7 @@ EOM (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4 dflt='' : Half the following guesses are probably wrong... If you have better - : tests or hints, please send them to perlbug@perl.org + : tests or hints, please send them to https://github.com/Perl/perl5/issues : The metaconfig authors would also appreciate a copy... $test -f /irix && osname=irix $test -f /xenix && osname=sco_xenix @@ -3491,6 +3509,9 @@ EOM ;; MiNT) osname=mint ;; + minix) osname=minix + osvers=`$uname -r` + ;; netbsd*) osname=netbsd osvers="$3" ;; @@ -3502,8 +3523,8 @@ EOM ;; nonstop-ux) osname=nonstopux ;; openbsd) osname=openbsd - osvers="$3" - ;; + osvers="$3" + ;; os2) osname=os2 osvers="$4" ;; @@ -4154,14 +4175,9 @@ EOSC : determine root of directory hierarchy where package will be installed. case "$prefix" in -'') - dflt=`./loc . /usr/local /usr/local /local /opt /usr` +'') dflt=`./loc . /usr/local /usr/local /local /opt /usr` ;; -*?/) - dflt=`echo "$prefix" | sed 's/.$//'` - ;; -*) - dflt="$prefix" +*) dflt="$prefix" ;; esac $cat <&4 -if $test -r $rsrc/patchlevel.h;then - revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h` - patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` - subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` - api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h` - api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h` - api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` - perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'` -else - revision=0 - patchlevel=0 - subversion=0 - api_revision=0 - api_version=0 - api_subversion=0 - perl_patchlevel=0 - $echo "(You do not have patchlevel.h. Eek.)" -fi -: Define a handy string here to avoid duplication in myconfig.SH and configpm. -version_patchlevel_string="version $patchlevel subversion $subversion" -case "$perl_patchlevel" in -0|'') ;; -*) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'` - version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" - ;; -esac - -$echo "(You have $package $version_patchlevel_string.)" - -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", $1, $2, $3 }'` - api_versionstring=`echo $api_revision $api_version $api_subversion | \ - $awk '{ printf "%d_%d_%d", $1, $2, $3 }'` - ;; -*) - version=`echo $revision $patchlevel $subversion | \ - $awk '{ printf "%d.%d.%d", $1, $2, $3 }'` - api_versionstring=`echo $api_revision $api_version $api_subversion | \ - $awk '{ printf "%d.%d.%d", $1, $2, $3 }'` - ;; -esac -: Special case the 5.005_xx maintenance series, which used 5.005 -: without any subversion label as a subdirectory in $sitelib -if test "${api_revision}${api_version}${api_subversion}" = "550"; then - api_versionstring='5.005' -fi - : Do we want threads support and if so, what type case "$usethreads" in $define|true|[yY]*) dflt='y';; -*) # Catch case where user specified ithreads or 5005threads but +*) # Catch case where user specified ithreads but # forgot -Dusethreads (A.D. 4/2002) - case "$useithreads$use5005threads" in + case "$useithreads" in *$define*) dflt='y';; *) dflt='n';; esac @@ -4395,74 +4367,7 @@ esac set usethreads eval $setvar -if $test $patchlevel -lt 9; then - case "$usethreads" in - $define) - : Default to ithreads unless overridden on command line or with - : old config.sh - dflt='y' - case "$use5005threads" in - $define|true|[yY]*) - echo "5.005 threads are no longer supported" - exit 1 - ;; - esac - case "$useithreads" in - $undef|false|[nN]*) dflt='n';; - esac - rp='Use the newer interpreter-based ithreads?' - . ./myread - case "$ans" in - y|Y) val="$define" ;; - *) val="$undef" ;; - esac - set useithreads - eval $setvar - : Now set use5005threads to the opposite value. - case "$useithreads" in - $define) val="$undef" ;; - *) val="$define" ;; - esac - set use5005threads - eval $setvar - ;; - *) - useithreads="$undef" - use5005threads="$undef" - ;; - esac - - case "$useithreads$use5005threads" in - "$define$define") - $cat >&4 <&4 <try.c for incdir in $locincpth; do warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \ @@ -5202,7 +5107,7 @@ EOM rp='Try to use long doubles if available?' . ./myread case "$ans" in -y|Y) val="$define" ;; +y|Y) val="$define" ;; *) val="$undef" ;; esac set uselongdouble @@ -5447,13 +5352,13 @@ fi case "$hint" in default|recommended) case "$gccversion" in - 1*) dflt="$dflt -fpcc-struct-return" ;; + 1.*) dflt="$dflt -fpcc-struct-return" ;; esac case "$optimize:$DEBUGGING" in *-g*:old) dflt="$dflt -DDEBUGGING";; esac case "$gccversion" in - 2*) if $test -d /etc/conf/kconfig.d && + 2.*) if $test -d /etc/conf/kconfig.d && $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 then # Interactive Systems (ISC) POSIX mode. @@ -5462,7 +5367,7 @@ default|recommended) ;; esac case "$gccversion" in - 1*) ;; + 1.*) ;; 2.[0-8]*) ;; ?*) set strict-aliasing -fno-strict-aliasing eval $checkccflag @@ -5483,23 +5388,24 @@ 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 "$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 - ;; + case "$ccflags" in + *-fno-stack-protector*) + echo "Do not add -fstack-protector nor -fstack-protector-strong" 2>&1 + ;; + *) 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 - ;; esac case "$mips_type" in @@ -5580,7 +5486,7 @@ case "$cppflags" in ;; esac case "$gccversion" in -1*) cppflags="$cppflags -D__GNUC__" +1.*) cppflags="$cppflags -D__GNUC__" esac case "$mips_type" in '');; @@ -5766,7 +5672,7 @@ compile=' mc_file=$1; shift; case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then -echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4; +echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to https://github.com/Perl/perl5/issues" >&4; exit 1; fi; esac; @@ -5775,7 +5681,7 @@ $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null compile_ok=' mc_file=$1; shift; -$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;' +$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;' : stub, used only to satisfy other units i_stdlib='define' @@ -6886,16 +6792,16 @@ esac $rm_try : check for long doubles -echo " " +echo " " >&4 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 val="$define" - echo "You have long double." + echo "You have long double." >&4 else val="$undef" - echo "You do not have long double." + echo "You do not have long double." >&4 fi $rm_try set d_longdbl @@ -6908,7 +6814,7 @@ eval $inlibc : check for length of long double case "${d_longdbl}${longdblsize}" in $define) - echo " " + echo " " >&4 echo "Checking to see how big your long doubles are..." >&4 $cat >try.c <<'EOCP' #include @@ -6921,19 +6827,19 @@ EOCP set try if eval $compile; then longdblsize=`$run ./try` - echo "Your long doubles are $longdblsize bytes long." + echo "Your long doubles are $longdblsize bytes long." >&4 else dflt='8' - echo " " + echo " " >&4 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." + echo "That isn't any different from an ordinary double." >&4 + echo "I'll keep your setting anyway, but you may see some" >&4 + echo "harmless compilation warnings." >&4 fi ;; esac @@ -7056,13 +6962,13 @@ 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-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;; -8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;; -9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 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-endian double-double long doubles (64-bit LEs in BE)." >&4 ;; +8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >&4 ;; +9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >&4 ;; *) echo "Cannot figure out your long double." >&4 ;; esac d_long_double_style_ieee=$undef @@ -7087,6 +6993,59 @@ case "$longdblkind" in esac $rm_try +: get the patchlevel +echo " " +echo "Getting the current patchlevel..." >&4 +if $test -r $rsrc/patchlevel.h;then + revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h` + patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` + subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` + api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h` + api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h` + api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` + perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'` +else + revision=0 + patchlevel=0 + subversion=0 + api_revision=0 + api_version=0 + api_subversion=0 + perl_patchlevel=0 + $echo "(You do not have patchlevel.h. Eek.)" +fi +: Define a handy string here to avoid duplication in myconfig.SH and configpm. +version_patchlevel_string="version $patchlevel subversion $subversion" +case "$perl_patchlevel" in +0|'') ;; +*) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'` + version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" + ;; +esac + +$echo "(You have $package $version_patchlevel_string.)" + +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", $1, $2, $3 }'` + api_versionstring=`echo $api_revision $api_version $api_subversion | \ + $awk '{ printf "%d_%d_%d", $1, $2, $3 }'` + ;; +*) + version=`echo $revision $patchlevel $subversion | \ + $awk '{ printf "%d.%d.%d", $1, $2, $3 }'` + api_versionstring=`echo $api_revision $api_version $api_subversion | \ + $awk '{ printf "%d.%d.%d", $1, $2, $3 }'` + ;; +esac +: Special case the 5.005_xx maintenance series, which used 5.005 +: without any subversion label as a subdirectory in $sitelib +if test "${api_revision}${api_version}${api_subversion}" = "550"; then + api_versionstring='5.005' +fi + : determine the architecture name echo " " if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then @@ -7241,7 +7200,7 @@ prefixit='case "$3" in none) eval "tp=\"\$$2\""; case "$tp" in - ""|" ") eval "$1=\"\$$2\"";; + ""|" "|none) eval "$1=\"\$$2\"";; *) eval "$1=";; esac;; esac;; @@ -7600,37 +7559,39 @@ sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"` : Determine list of previous versions to include in @INC $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=(); +# The list found is stored twice for each entry: the original name, and +# the binary broken down version into pack "s>s>s>", so sorting is easy +# and unambiguous. This will work for all versions that have a maximum +# of three digit per group 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 + +my @inc_version_list; +my @candidates; # XXX Redo to do opendir/readdir? if (-d $stem) { chdir($stem); ;@candidates = map { - [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*"); + [ $_, pack "s>s>s>", split m/[._]/, "$_.0.0" ] } glob("5.*"); ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates; } else { ;@candidates = (); } -($pversion, $aversion, $vsn5005) = map { - pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005"; -foreach $d (@candidates) { +my ($pversion, $aversion, $vsn5005) = map { + pack "s>s>s>", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005"; +foreach my $d (@candidates) { if ($d->[1] lt $pversion) { if ($d->[1] ge $aversion) { unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]); @@ -7790,7 +7751,6 @@ EOM ;; esac - : determine whether to use malloc wrapping echo " " case "$usemallocwrap" in @@ -8096,6 +8056,10 @@ while $test 1 ; do $define|true|[yY]*) dflt='y' ;; + $undef|false|[nN]*) + dflt='n' + dflt_dtrace="" + ;; ?*) dflt='y' dflt_dtrace=$usedtrace @@ -8532,7 +8496,7 @@ EOM if $test "X$sysroot" != X; then case "$gccversion" in '') ;; - *) dflt="$dflt --sysroot $sysroot" ;; + *) dflt="$dflt --sysroot=$sysroot" ;; esac fi @@ -8759,7 +8723,7 @@ case "$shrpdir" in *) $cat >&4 <$first) 2>/dev/null; then echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 val="$undef" else - echo 'You can have filenames longer than 14 characters.'>&4 - val="$define" + echo 'You can have filenames longer than 14 characters.'>&4 + val="$define" fi else $cat <<'EOM' @@ -9200,7 +9164,7 @@ case "$myhostname" in $test -s hosts } || { test "X$hostcat" != "X" && - $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ / + $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ / /[ ]$myhostname[ . ]/p" > hosts } tmp_re="[ . ]" @@ -9233,7 +9197,7 @@ case "$myhostname" in .) dflt=.`$sed -n -e 's/ / /g' \ -e 's/^domain *\([^ ]*\).*/\1/p' $tans \ -e 1q 2>/dev/null` - ;; + ;; esac fi ;; @@ -9593,16 +9557,12 @@ prefixvar=sitescript set backtrace d_backtrace eval $inlibc -: add flags if using c backtrace +: Check if C backtrace is actually supported. case "$usecbacktrace" in "") usecbacktrace=$undef ;; [yY]*|true|$define) case "$d_backtrace" in [yY]*|true|$define) - case " $ccflags " in - *" -DUSE_C_BACKTRACE "*) ;; # Already there. - *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;; - esac ;; *) echo "This system does not support backtrace" >&4 @@ -9642,7 +9602,6 @@ esac set usefaststdio eval $setvar - : define an is-a-typedef? function typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; case "$inclist" in @@ -9805,8 +9764,8 @@ EOM rp='Try to understand large files, if available?' . ./myread case "$ans" in - y|Y) val="$define" ;; - *) val="$undef" ;; + y|Y) val="$define" ;; + *) val="$undef" ;; esac ;; esac @@ -10365,15 +10324,15 @@ esac $cat >>try.c < -int checkit(char *expect, char *got) +void checkit(const char *expect, char *got) { if (strcmp(expect, got)) { printf("%s oddity: Expected %s, got %s\n", @@ -10554,6 +10513,7 @@ for xxx_convert in $xxx_list; do fi else echo "$xxx_convert NOT found." >&4 + xxx_convert='' fi done @@ -10584,6 +10544,10 @@ $rm_try set fwalk d__fwalk eval $inlibc +: see if accept4 exists +set accept4 d_accept4 +eval $inlibc + : Initialize h_fcntl h_fcntl=false @@ -10727,6 +10691,7 @@ hasproto='varname=$1; func=$2; shift; shift; while $test $# -ge 2; do case "$1" in $define) echo "#include <$2>";; + literal) echo "$2" ;; esac ; shift 2; done > try.c; @@ -10914,7 +10879,7 @@ case "$d_asctime_r" in esac case "$asctime_r_proto" in ''|0) d_asctime_r=undef - asctime_r_proto=0 + asctime_r_proto=0 echo "Disabling asctime_r, cannot determine prototype." >&4 ;; * ) case "$asctime_r_proto" in REENTRANT_PROTO*) ;; @@ -10951,6 +10916,26 @@ eval $inlibc set atoll d_atoll eval $inlibc +: See if a file contains compiler warnings +: See if a file contains compiler warnings +case "$osname" in + 'aix') + cat >compiler_warning <attrib.c <<'EOCP' void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2))); EOCP if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then - if $contains 'warning' attrib.out >/dev/null 2>&1; then + if $compiler_warning attrib.out >/dev/null 2>&1; then echo "Your C compiler doesn't support __attribute__((format))." val="$undef" else @@ -10991,14 +10976,21 @@ $cat >attrib.c < #endif +#$i_inttypes I_INTTYPES +#ifdef I_INTTYPES +#include +#endif +#ifndef INTPTR_MAX +#define intptr_t int +#endif int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2))); -int null_printf (char* pat,...) { return (int)pat; } +int null_printf (char* pat,...) { return (int)(intptr_t)pat; } int main () { exit(null_printf(NULL)); } EOCP if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then : run the executable in case it produces a run-time warning if $run ./attrib >>attrib.out 2>&1; then - if $contains 'warning' attrib.out >/dev/null 2>&1; then + if $compiler_warning attrib.out >/dev/null 2>&1; then echo "Your C compiler doesn't allow __printf__ format to be null." val="$undef" else @@ -11033,7 +11025,7 @@ $cat >attrib.c <<'EOCP' char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc)); EOCP if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then - if $contains 'warning' attrib.out >/dev/null 2>&1; then + if $compiler_warning attrib.out >/dev/null 2>&1; then echo "Your C compiler doesn't support __attribute__((malloc))." val="$undef" else @@ -11061,7 +11053,7 @@ $cat >attrib.c <<'EOCP' void do_something (char *some_pointer,...) __attribute__((nonnull(1))); EOCP if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then - if $contains 'warning' attrib.out >/dev/null 2>&1; then + if $compiler_warning attrib.out >/dev/null 2>&1; then echo "Your C compiler doesn't support __attribute__((nonnull))." val="$undef" else @@ -11089,7 +11081,7 @@ $cat >attrib.c <<'EOCP' void fall_over_dead( void ) __attribute__((noreturn)); EOCP if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then - if $contains 'warning' attrib.out >/dev/null 2>&1; then + if $compiler_warning attrib.out >/dev/null 2>&1; then echo "Your C compiler doesn't support __attribute__((noreturn))." val="$undef" else @@ -11117,7 +11109,7 @@ $cat >attrib.c <<'EOCP' int square( int n ) __attribute__((pure)); EOCP if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then - if $contains 'warning' attrib.out >/dev/null 2>&1; then + if $compiler_warning attrib.out >/dev/null 2>&1; then echo "Your C compiler doesn't support __attribute__((pure))." val="$undef" else @@ -11145,7 +11137,7 @@ $cat >attrib.c <<'EOCP' int do_something( int dummy __attribute__((unused)), int n ); EOCP if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then - if $contains 'warning' attrib.out >/dev/null 2>&1; then + if $compiler_warning attrib.out >/dev/null 2>&1; then echo "Your C compiler doesn't support __attribute__((unused))." val="$undef" else @@ -11173,7 +11165,7 @@ $cat >attrib.c <<'EOCP' int I_am_deprecated(void) __attribute__((deprecated)); EOCP if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then - if $contains 'warning' attrib.out >/dev/null 2>&1; then + if $compiler_warning attrib.out >/dev/null 2>&1; then echo "Your C compiler doesn't support __attribute__((deprecated))." val="$undef" else @@ -11201,7 +11193,7 @@ $cat >attrib.c <<'EOCP' int I_will_not_be_ignored(void) __attribute__((warn_unused_result)); EOCP if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then - if $contains 'warning' attrib.out >/dev/null 2>&1; then + if $compiler_warning attrib.out >/dev/null 2>&1; then echo "Your C compiler doesn't support __attribute__((warn_unused_result))." val="$undef" else @@ -11219,6 +11211,34 @@ set d_attribute_warn_unused_result eval $setvar $rm -f attrib* +: Look for GCC-style attribute always_inline +case "$d_attribute_always_inline" in +'') +echo " " +echo "Checking whether your compiler can handle __attribute__((always_inline)) ..." >&4 +$cat >attrib.c <<'EOCP' +#include +static __inline__ __attribute__((always_inline)) int I_will_always_be_inlined(void); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $compiler_warning attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((always_inline))." + val="$undef" + else + echo "Your C compiler supports __attribute__((always_inline))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_always_inline" ;; +esac +set d_attribute_always_inline +eval $setvar +$rm -f attrib* + : see if getpgrp exists set getpgrp d_getpgrp eval $inlibc @@ -11228,6 +11248,7 @@ case "$d_getpgrp" in echo " " echo "Checking to see which flavor of getpgrp is in use..." $cat >try.c < #$i_unistd I_UNISTD #include #ifdef I_UNISTD @@ -11294,6 +11315,7 @@ case "$d_setpgrp" in echo " " echo "Checking to see which flavor of setpgrp is in use..." $cat >try.c < #$i_unistd I_UNISTD #include #ifdef I_UNISTD @@ -11876,7 +11898,6 @@ set socketpair d_sockpair eval $inlibc -echo " " echo "Checking the availability sa_len in the sock struct ..." >&4 $cat >try.c < @@ -11893,7 +11914,6 @@ fi set d_sockaddr_sa_len; eval $setvar $rm_try -echo " " echo "Checking the availability struct sockaddr_in6 ..." >&4 $cat >try.c < @@ -11911,7 +11931,23 @@ fi set d_sockaddr_in6; eval $setvar $rm_try -echo " " +echo "Checking the availability struct sockaddr_storage ..." >&4 +$cat >try.c < +#include +#include +int main() { +struct sockaddr_storage sastor; +return (sastor.ss_family); +} +EOF +val="$undef" +set try; if eval $compile; then + val="$define" +fi +set d_sockaddr_storage; eval $setvar +$rm_try + echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4 $cat >try.c < @@ -11929,7 +11965,6 @@ fi set d_sin6_scope_id; eval $setvar $rm_try -echo " " echo "Checking the availability struct ip_mreq ..." >&4 $cat >try.c < @@ -11947,7 +11982,6 @@ fi set d_ip_mreq; eval $setvar $rm_try -echo " " echo "Checking the availability struct ip_mreq_source ..." >&4 $cat >try.c < @@ -11965,7 +11999,6 @@ fi set d_ip_mreq_source; eval $setvar $rm_try -echo " " echo "Checking the availability struct ipv6_mreq ..." >&4 $cat >try.c < @@ -11983,7 +12016,6 @@ fi set d_ipv6_mreq; eval $setvar $rm_try -echo " " echo "Checking the availability struct ipv6_mreq_source ..." >&4 $cat >try.c < @@ -12001,7 +12033,6 @@ fi set d_ipv6_mreq_source; eval $setvar $rm_try -echo " " echo "Checking the availability of certain socket constants..." >&4 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'` @@ -12034,28 +12065,6 @@ case "$d_cmsghdr_s" in *) echo "No, it doesn't." ;; esac - -: check for const keyword -echo " " -echo 'Checking to see if your C compiler knows about "const"...' >&4 -$cat >const.c <<'EOCP' -typedef struct spug { int drokk; } spug; -int main() -{ - const char *foo; - const spug y = { 0 }; -} -EOCP -if $cc -c $ccflags const.c >/dev/null 2>&1 ; then - val="$define" - echo "Yup, it does." -else - val="$undef" - echo "Nope, it doesn't." -fi -set d_const -eval $setvar - : see if copysign exists set copysign d_copysign eval $inlibc @@ -12131,7 +12140,7 @@ case "$d_crypt_r" in esac case "$crypt_r_proto" in ''|0) d_crypt_r=undef - crypt_r_proto=0 + crypt_r_proto=0 echo "Disabling crypt_r, cannot determine prototype." >&4 ;; * ) case "$crypt_r_proto" in REENTRANT_PROTO*) ;; @@ -12188,7 +12197,7 @@ case "$d_ctermid_r" in esac case "$ctermid_r_proto" in ''|0) d_ctermid_r=undef - ctermid_r_proto=0 + ctermid_r_proto=0 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;; * ) case "$ctermid_r_proto" in REENTRANT_PROTO*) ;; @@ -12241,7 +12250,7 @@ case "$d_ctime_r" in esac case "$ctime_r_proto" in ''|0) d_ctime_r=undef - ctime_r_proto=0 + ctime_r_proto=0 echo "Disabling ctime_r, cannot determine prototype." >&4 ;; * ) case "$ctime_r_proto" in REENTRANT_PROTO*) ;; @@ -12609,7 +12618,7 @@ case "$d_drand48_r" in esac case "$drand48_r_proto" in ''|0) d_drand48_r=undef - drand48_r_proto=0 + drand48_r_proto=0 echo "Disabling drand48_r, cannot determine prototype." >&4 ;; * ) case "$drand48_r_proto" in REENTRANT_PROTO*) ;; @@ -12635,8 +12644,36 @@ echo " " set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h eval $hasproto -: see if dup2 exists -set dup2 d_dup2 +: see if dup2 exists +set dup2 d_dup2 +eval $inlibc + +: see if dup3 exists +set dup3 d_dup3 +eval $inlibc + +: see if this is an xlocale.h system +set xlocale.h i_xlocale +eval $inhdr + +: see if newlocale exists +set newlocale d_newlocale +eval $inlibc + +: see if freelocale exists +set freelocale d_freelocale +eval $inlibc + +: see if uselocale exists +set uselocale d_uselocale +eval $inlibc + +: see if duplocale exists +set duplocale d_duplocale +eval $inlibc + +: see if querylocale exists +set querylocale d_querylocale eval $inlibc : see if eaccess exists @@ -12696,7 +12733,7 @@ case "$d_endgrent_r" in esac case "$endgrent_r_proto" in ''|0) d_endgrent_r=undef - endgrent_r_proto=0 + endgrent_r_proto=0 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;; * ) case "$endgrent_r_proto" in REENTRANT_PROTO*) ;; @@ -12749,7 +12786,7 @@ case "$d_endhostent_r" in esac case "$endhostent_r_proto" in ''|0) d_endhostent_r=undef - endhostent_r_proto=0 + endhostent_r_proto=0 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;; * ) case "$endhostent_r_proto" in REENTRANT_PROTO*) ;; @@ -12798,7 +12835,7 @@ case "$d_endnetent_r" in esac case "$endnetent_r_proto" in ''|0) d_endnetent_r=undef - endnetent_r_proto=0 + endnetent_r_proto=0 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;; * ) case "$endnetent_r_proto" in REENTRANT_PROTO*) ;; @@ -12847,7 +12884,7 @@ case "$d_endprotoent_r" in esac case "$endprotoent_r_proto" in ''|0) d_endprotoent_r=undef - endprotoent_r_proto=0 + endprotoent_r_proto=0 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;; * ) case "$endprotoent_r_proto" in REENTRANT_PROTO*) ;; @@ -12984,7 +13021,7 @@ case "$d_endpwent_r" in esac case "$endpwent_r_proto" in ''|0) d_endpwent_r=undef - endpwent_r_proto=0 + endpwent_r_proto=0 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;; * ) case "$endpwent_r_proto" in REENTRANT_PROTO*) ;; @@ -13033,7 +13070,7 @@ case "$d_endservent_r" in esac case "$endservent_r_proto" in ''|0) d_endservent_r=undef - endservent_r_proto=0 + endservent_r_proto=0 echo "Disabling endservent_r, cannot determine prototype." >&4 ;; * ) case "$endservent_r_proto" in REENTRANT_PROTO*) ;; @@ -13619,7 +13656,7 @@ int main() { EOP set try if eval $compile && $to try.c; then - case `$run ./try` in + case `$run ./try` in Pass_changed) echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4 d_stdio_ptr_lval_sets_cnt="$define" ;; @@ -13693,8 +13730,6 @@ esac set d_faststdio eval $setvar - - : see if fchdir exists set fchdir d_fchdir eval $inlibc @@ -13988,30 +14023,6 @@ $rm_try set d_fpos64_t eval $setvar -: see if this is an xlocale.h system -set xlocale.h i_xlocale -eval $inhdr - -: see if newlocale exists -set newlocale d_newlocale -eval $inlibc - -: see if freelocale exists -set freelocale d_freelocale -eval $inlibc - -: see if uselocale exists -set uselocale d_uselocale -eval $inlibc - -: see if duplocale exists -set duplocale d_duplocale -eval $inlibc - -: see if querylocale exists -set querylocale d_querylocale -eval $inlibc - : see if frexpl exists set frexpl d_frexpl eval $inlibc @@ -14057,7 +14068,6 @@ eval $inlibc set fstatvfs d_fstatvfs eval $inlibc - : see if fsync exists set fsync d_fsync eval $inlibc @@ -14075,9 +14085,11 @@ echo " " echo "Checking if you have a working futimes()" >&4 $cat >try.c < +#include #include #include #include +#include int main () { @@ -14246,7 +14258,7 @@ case "$d_getgrent_r" in esac case "$getgrent_r_proto" in ''|0) d_getgrent_r=undef - getgrent_r_proto=0 + getgrent_r_proto=0 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;; * ) case "$getgrent_r_proto" in REENTRANT_PROTO*) ;; @@ -14299,7 +14311,7 @@ case "$d_getgrgid_r" in esac case "$getgrgid_r_proto" in ''|0) d_getgrgid_r=undef - getgrgid_r_proto=0 + getgrgid_r_proto=0 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;; * ) case "$getgrgid_r_proto" in REENTRANT_PROTO*) ;; @@ -14356,7 +14368,7 @@ case "$d_getgrnam_r" in esac case "$getgrnam_r_proto" in ''|0) d_getgrnam_r=undef - getgrnam_r_proto=0 + getgrnam_r_proto=0 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;; * ) case "$getgrnam_r_proto" in REENTRANT_PROTO*) ;; @@ -14534,7 +14546,7 @@ case "$d_gethostbyaddr_r" in esac case "$gethostbyaddr_r_proto" in ''|0) d_gethostbyaddr_r=undef - gethostbyaddr_r_proto=0 + gethostbyaddr_r_proto=0 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;; * ) case "$gethostbyaddr_r_proto" in REENTRANT_PROTO*) ;; @@ -14583,7 +14595,7 @@ case "$d_gethostbyname_r" in esac case "$gethostbyname_r_proto" in ''|0) d_gethostbyname_r=undef - gethostbyname_r_proto=0 + gethostbyname_r_proto=0 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;; * ) case "$gethostbyname_r_proto" in REENTRANT_PROTO*) ;; @@ -14644,7 +14656,7 @@ case "$d_gethostent_r" in esac case "$gethostent_r_proto" in ''|0) d_gethostent_r=undef - gethostent_r_proto=0 + gethostent_r_proto=0 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;; * ) case "$gethostent_r_proto" in REENTRANT_PROTO*) ;; @@ -14710,7 +14722,7 @@ case "$d_getlogin_r" in esac case "$getlogin_r_proto" in ''|0) d_getlogin_r=undef - getlogin_r_proto=0 + getlogin_r_proto=0 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;; * ) case "$getlogin_r_proto" in REENTRANT_PROTO*) ;; @@ -14803,7 +14815,7 @@ case "$d_getnetbyaddr_r" in esac case "$getnetbyaddr_r_proto" in ''|0) d_getnetbyaddr_r=undef - getnetbyaddr_r_proto=0 + getnetbyaddr_r_proto=0 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;; * ) case "$getnetbyaddr_r_proto" in REENTRANT_PROTO*) ;; @@ -14856,7 +14868,7 @@ case "$d_getnetbyname_r" in esac case "$getnetbyname_r_proto" in ''|0) d_getnetbyname_r=undef - getnetbyname_r_proto=0 + getnetbyname_r_proto=0 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;; * ) case "$getnetbyname_r_proto" in REENTRANT_PROTO*) ;; @@ -14917,7 +14929,7 @@ case "$d_getnetent_r" in esac case "$getnetent_r_proto" in ''|0) d_getnetent_r=undef - getnetent_r_proto=0 + getnetent_r_proto=0 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;; * ) case "$getnetent_r_proto" in REENTRANT_PROTO*) ;; @@ -15005,7 +15017,7 @@ case "$d_getprotobyname_r" in esac case "$getprotobyname_r_proto" in ''|0) d_getprotobyname_r=undef - getprotobyname_r_proto=0 + getprotobyname_r_proto=0 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;; * ) case "$getprotobyname_r_proto" in REENTRANT_PROTO*) ;; @@ -15054,7 +15066,7 @@ case "$d_getprotobynumber_r" in esac case "$getprotobynumber_r_proto" in ''|0) d_getprotobynumber_r=undef - getprotobynumber_r_proto=0 + getprotobynumber_r_proto=0 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;; * ) case "$getprotobynumber_r_proto" in REENTRANT_PROTO*) ;; @@ -15107,7 +15119,7 @@ case "$d_getprotoent_r" in esac case "$getprotoent_r_proto" in ''|0) d_getprotoent_r=undef - getprotoent_r_proto=0 + getprotoent_r_proto=0 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;; * ) case "$getprotoent_r_proto" in REENTRANT_PROTO*) ;; @@ -15181,7 +15193,7 @@ case "$d_getpwent_r" in esac case "$getpwent_r_proto" in ''|0) d_getpwent_r=undef - getpwent_r_proto=0 + getpwent_r_proto=0 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;; * ) case "$getpwent_r_proto" in REENTRANT_PROTO*) ;; @@ -15234,7 +15246,7 @@ case "$d_getpwnam_r" in esac case "$getpwnam_r_proto" in ''|0) d_getpwnam_r=undef - getpwnam_r_proto=0 + getpwnam_r_proto=0 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;; * ) case "$getpwnam_r_proto" in REENTRANT_PROTO*) ;; @@ -15287,7 +15299,7 @@ case "$d_getpwuid_r" in esac case "$getpwuid_r_proto" in ''|0) d_getpwuid_r=undef - getpwuid_r_proto=0 + getpwuid_r_proto=0 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;; * ) case "$getpwuid_r_proto" in REENTRANT_PROTO*) ;; @@ -15350,7 +15362,7 @@ case "$d_getservbyname_r" in esac case "$getservbyname_r_proto" in ''|0) d_getservbyname_r=undef - getservbyname_r_proto=0 + getservbyname_r_proto=0 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;; * ) case "$getservbyname_r_proto" in REENTRANT_PROTO*) ;; @@ -15399,7 +15411,7 @@ case "$d_getservbyport_r" in esac case "$getservbyport_r_proto" in ''|0) d_getservbyport_r=undef - getservbyport_r_proto=0 + getservbyport_r_proto=0 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;; * ) case "$getservbyport_r_proto" in REENTRANT_PROTO*) ;; @@ -15452,7 +15464,7 @@ case "$d_getservent_r" in esac case "$getservent_r_proto" in ''|0) d_getservent_r=undef - getservent_r_proto=0 + getservent_r_proto=0 echo "Disabling getservent_r, cannot determine prototype." >&4 ;; * ) case "$getservent_r_proto" in REENTRANT_PROTO*) ;; @@ -15510,7 +15522,7 @@ case "$d_getspnam_r" in esac case "$getspnam_r_proto" in ''|0) d_getspnam_r=undef - getspnam_r_proto=0 + getspnam_r_proto=0 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;; * ) case "$getspnam_r_proto" in REENTRANT_PROTO*) ;; @@ -15574,7 +15586,7 @@ case "$d_gmtime_r" in esac case "$gmtime_r_proto" in ''|0) d_gmtime_r=undef - gmtime_r_proto=0 + gmtime_r_proto=0 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;; * ) case "$gmtime_r_proto" in REENTRANT_PROTO*) ;; @@ -15770,7 +15782,7 @@ eval $inlibc echo "Checking to see if you have isless..." >&4 $cat >try.c < -int main() { return isless(0.0); } +int main() { return isless(2.0, 1.0); } EOCP set try if eval $compile; then @@ -15863,27 +15875,24 @@ esac : see if lchown exists echo " " -$cat > try.c <<'EOCP' -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char lchown(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char lchown(); -int main() { - /* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_lchown) || defined (__stub___lchown) -choke me -#else -lchown(); +$cat > try.c < +#include +#include +#$i_unistd I_UNISTD +#ifdef I_UNISTD +# include #endif -; return 0; } +int main(int argc, char *argv[]) +{ + if (lchown("./try.c", -1, getgid()) == -1) { + exit(EXIT_FAILURE); + } + exit(EXIT_SUCCESS); +} EOCP set try -if eval $compile; then +if eval $compile && ./try; then $echo "lchown() found." >&4 val="$define" else @@ -15892,6 +15901,7 @@ else fi set d_lchown eval $setvar +$rm_try : See if number of significant digits in a double precision number is known echo " " @@ -15993,7 +16003,7 @@ case "$d_localtime_r" in esac case "$localtime_r_proto" in ''|0) d_localtime_r=undef - localtime_r_proto=0 + localtime_r_proto=0 echo "Disabling localtime_r, cannot determine prototype." >&4 ;; * ) case "$localtime_r_proto" in REENTRANT_PROTO*) ;; @@ -16044,6 +16054,7 @@ REENTRANT_PROTO*) #endif int main() { + int result = 0; time_t t = time(0L); char w_tz[]="TZ" "=GMT+5", e_tz[]="TZ" "=GMT-5", @@ -16062,8 +16073,10 @@ int main() localtime_r(&t, &tm_w); if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 ) - return 1; - return 0; + result = 1; + + free(tz_e);free(tz_w); + return result; } EOCP set try @@ -16136,6 +16149,10 @@ eval $inlibc set malloc_good_size d_malloc_good_size eval $inlibc +: see if malloc_usable_size exists +set malloc_usable_size d_malloc_usable_size +eval $inlibc + : see if mblen exists set mblen d_mblen eval $inlibc @@ -16157,12 +16174,46 @@ set mbtowc d_mbtowc eval $inlibc : see if memmem exists -set memmem d_memmem -eval $inlibc +: We need both a prototype in string.h and the symbol in libc. +echo " " +d_memmem_proto='' +xx1="#$d_gnulibc HAS_GNULIBC" +xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)' +xx3='# define _GNU_SOURCE' +xx4='#endif' +set d_memmem_proto memmem literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h +eval $hasproto +case "$d_memmem_proto" in + define) # see if memmem exists + set memmem d_memmem + eval $inlibc + ;; + *) val=$undef + set d_memmem + eval $setvar + ;; +esac : see if memrchr exists -set memrchr d_memrchr -eval $inlibc +: We need both a prototype in string.h and the symbol in libc. +echo " " +d_memrchr_proto='' +xx1="#$d_gnulibc HAS_GNULIBC" +xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)' +xx3='# define _GNU_SOURCE' +xx4='#endif' +set d_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h +eval $hasproto +case "$d_memrchr_proto" in + define) # see if memrchr exists + set memrchr d_memrchr + eval $inlibc + ;; + *) val=$undef + set d_memrchr + eval $setvar + ;; +esac : see if mkdir exists set mkdir d_mkdir @@ -16176,6 +16227,10 @@ eval $inlibc set mkfifo d_mkfifo eval $inlibc +: see if mkostemp exists +set mkostemp d_mkostemp +eval $inlibc + : see if mkstemp exists set mkstemp d_mkstemp eval $inlibc @@ -16213,8 +16268,6 @@ END ;; esac - - : see if sqrtl exists set sqrtl d_sqrtl eval $inlibc @@ -16344,7 +16397,6 @@ case "$d_msghdr_s" in *) echo "No, it doesn't." ;; esac - : see if msync exists set msync d_msync eval $inlibc @@ -16919,6 +16971,10 @@ fi set pause d_pause eval $inlibc +: see if pipe2 exists +set pipe2 d_pipe2 +eval $inlibc + : see if poll exists set poll d_poll eval $inlibc @@ -17186,7 +17242,7 @@ case "$d_random_r" in esac case "$random_r_proto" in ''|0) d_random_r=undef - random_r_proto=0 + random_r_proto=0 echo "Disabling random_r, cannot determine prototype." >&4 ;; * ) case "$random_r_proto" in REENTRANT_PROTO*) ;; @@ -17241,7 +17297,7 @@ case "$d_readdir64_r" in esac case "$readdir64_r_proto" in ''|0) d_readdir64_r=undef - readdir64_r_proto=0 + readdir64_r_proto=0 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;; * ) case "$readdir64_r_proto" in REENTRANT_PROTO*) ;; @@ -17286,7 +17342,7 @@ case "$d_readdir_r" in esac case "$readdir_r_proto" in ''|0) d_readdir_r=undef - readdir_r_proto=0 + readdir_r_proto=0 echo "Disabling readdir_r, cannot determine prototype." >&4 ;; * ) case "$readdir_r_proto" in REENTRANT_PROTO*) ;; @@ -17560,21 +17616,31 @@ END extern int errno; #endif int main() { - struct semid_ds arg; + union semun +#ifndef HAS_UNION_SEMUN + { + int val; + struct semid_ds *buf; + unsigned short *array; + } +#endif + arg; + struct semid_ds argbuf; int sem, st; #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT) sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT); if (sem > -1) { + arg.buf = &argbuf; # ifdef IPC_STAT - st = semctl(sem, 0, IPC_STAT, &arg); + st = semctl(sem, 0, IPC_STAT, arg); if (st == 0) printf("semid_ds\n"); else # endif /* IPC_STAT */ printf("semctl IPC_STAT failed: errno = %d\n", errno); # ifdef IPC_RMID - if (semctl(sem, 0, IPC_RMID, &arg) != 0) + if (semctl(sem, 0, IPC_RMID, arg) != 0) # endif /* IPC_RMID */ printf("semctl IPC_RMID failed: errno = %d\n", errno); } else @@ -17658,7 +17724,7 @@ case "$d_setgrent_r" in esac case "$setgrent_r_proto" in ''|0) d_setgrent_r=undef - setgrent_r_proto=0 + setgrent_r_proto=0 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;; * ) case "$setgrent_r_proto" in REENTRANT_PROTO*) ;; @@ -17707,7 +17773,7 @@ case "$d_sethostent_r" in esac case "$sethostent_r_proto" in ''|0) d_sethostent_r=undef - sethostent_r_proto=0 + sethostent_r_proto=0 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;; * ) case "$sethostent_r_proto" in REENTRANT_PROTO*) ;; @@ -17736,14 +17802,234 @@ eval $inlibc set setlinebuf d_setlinebuf eval $inlibc -: see if setlocale exists -set setlocale d_setlocale -eval $inlibc - : see if locale.h is available set locale.h i_locale eval $inhdr +: see if this system has wctype.h +set wctype.h i_wctype +eval $inhdr + +: see if towupper exists +set towupper d_towupper +eval $inlibc + +: check for setlocale function and behavior +case "$d_setlocale" in +'') +$cat >&4 <try.c < +#include +#$i_locale I_LOCALE +#ifdef I_LOCALE +# include +#endif +#$i_wctype I_WCTYPE +#ifdef I_WCTYPE +# include +#endif + +int main() { + const char * invalid_name = "\a"; /* This is really invalid! */ + int accepts_any_locale_name = 0; + int has_C_UTF8 = 0; + unsigned char bad_setlocale = 255; + + /* If LC_CTYPE isn't defined the compilation will fail, and locales will be + * disabled. It's hard to imagine an instance where meaningful locale + * handling could be done without LC_CTYPE */ + const char * name = setlocale(LC_CTYPE, "C"); + + if (name == NULL || strcmp(name, "C") != 0) { + exit(bad_setlocale); + } + + name = setlocale(LC_CTYPE, invalid_name); + if (name != NULL) { + + /* Let it pass if it accepts the name but gives back one of the C + * locales */ + if (strcmp(name, "C") != 0 && strcmp(name, "C.UTF-8") != 0) { + accepts_any_locale_name = 1; + } + } + + name = setlocale(LC_CTYPE, "C.UTF-8"); + if (name != NULL) { + unsigned char y_with_diaeresis = ('A' == 193) ? 0xDF : 0xFF; + +#$d_towupper HAS_TOWUPPER +#ifdef HAS_TOWUPPER + + /* We assume that if the machine doesn't have the C99 towupper, it + * doesn't have C.UTF-8, even if we successfully changed locales to + * include it. This seems safer even on platforms that didn't accept + * the really invalid name */ + + if (towupper(y_with_diaeresis) == 0x178) { + has_C_UTF8 = 1; + } + +#endif + + } + +#if 0 + + /* Currently unused code to determine if LC_ALL with disparate values uses + * category = value pairs or positional, and to determine the separator + * between the categories. We could add code so that if the separator were + * > '9', we subtract 10; similarly for 'Z' and 'z', and then just about + * every possible ASCII separator would fit in the 5 bits available in the + * exit code. This would not be true in EBCDIC. And then if LC_ALL is + * positional, we probably would want to know the order of the categories. + * Using a file between the C program and the shell script would really be + * require to do that */ +#ifdef LC_ALL + + unsigned char min_separator = ' ' - 1; + unsigned char separator = min_separator; + int uses_name_value_pair_names = 0; + + name = setlocale(LC_ALL, "C"); + if (name == NULL || strcmp(name, "C") != 0) { + exit(bad_setlocale); + } + + if (has_C_UTF8) { + char * pos; + + name = setlocale(LC_CTYPE, "C.UTF-8"); + if (name == NULL) { + exit(bad_setlocale); + } + name = setlocale(LC_ALL, NULL); + if (name == NULL) { + exit(bad_setlocale); + } + + pos = strstr(name, "LC_CTYPE" "=C.UTF-8"); + if (pos != NULL) { + uses_name_value_pair_names = 1; + if (pos == name) { + separator = name[sizeof("LC_CTYPE=C.UTF-8") - 1]; + } + else { + separator = *(pos - 1); + } + } + else { + pos = strstr(name, "C.UTF-8"); + if (pos == NULL) { + /* bad */ + } + else if (pos == name) { + separator = name[sizeof("C.UTF-8") - 1]; + } + else { + separator = *(pos - 1); + } + } + } + +#endif +#endif + + exit( 0 /* (separator - min_separator) << 3 + | uses_name_value_pair_names << 2 + */ + | has_C_UTF8 << 1 + | accepts_any_locale_name); + +} +EOCP +val= +set d_setlocale +eval $setvar +case $d_setlocale in + $undef) d_setlocale_accepts_any_locale_name="$undef" + d_has_C_UTF8="false" + ;; + *) set try + if eval $compile; then + echo "Your system has setlocale()..." >&4 + $run ./try + case $? in + 0) echo "and it seems sane; you don't have a C.UTF8 locale" >&4 + d_setlocale="$define" + d_setlocale_accepts_any_locale_name="$undef" + d_has_C_UTF8="false" + ;; + 1) echo "and it seems sane, but accepts any locale name as valid" >&4 + d_setlocale="$define" + d_setlocale_accepts_any_locale_name="$define" + d_has_C_UTF8="false" + ;; + 2) echo "and it seems sane; you have a C.UTF8 locale" >&4 + d_setlocale="$define" + d_setlocale_accepts_any_locale_name="$undef" + d_has_C_UTF8="true" + ;; + 3) echo "and it seems sane, but accepts any locale name as valid" >&4 + d_setlocale="$define" + d_setlocale_accepts_any_locale_name="$define" + d_has_C_UTF8="true" + ;; + *) echo "but it doesn't seem to work, so we won't use it." >&4 + d_setlocale="$undef" + d_setlocale_accepts_any_locale_name="$undef" + d_has_C_UTF8="false" + ;; + esac + else + echo "your system does not have setlocale()" >&4 + d_setlocale="$undef" + d_setlocale_accepts_any_locale_name="$undef" + d_has_C_UTF8="false" + fi +esac +$rm_try +;; +*) val="$d_setlocale" + set d_setlocale + eval $setvar + case "$d_setlocale" in + $undef) echo "There may be other ways to set the locale on your system, so we need to ask:" >&4 + ;; + esac + rp="Does your system have the C.UTF8 locale?" + dflt=n + . ./myread + case "$ans" in + [Yy]*) d_has_C_UTF8="true" + c_utf8_locale=" or C.UTF8" + ;; + *) d_has_C_UTF8="false" + c_utf8_locale="" + ;; + esac + case "$d_setlocale" in + $define) + rp="When you set your locale to something besides C$c_utf8_locale, does it do so, or just pretend to?" >&4 + dflt=n + . ./myread + case "$ans" in + true|[Yy]*) + d_setlocale_accepts_any_locale_name="$undef" + ;; + *) d_setlocale_accepts_any_locale_name="$define" + ;; + esac + ;; + *) d_setlocale_accepts_any_locale_name="$undef" + ;; + esac +esac + : see if setlocale_r exists set setlocale_r d_setlocale_r eval $inlibc @@ -17764,7 +18050,7 @@ case "$d_setlocale_r" in esac case "$setlocale_r_proto" in ''|0) d_setlocale_r=undef - setlocale_r_proto=0 + setlocale_r_proto=0 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;; * ) case "$setlocale_r_proto" in REENTRANT_PROTO*) ;; @@ -17813,7 +18099,7 @@ case "$d_setnetent_r" in esac case "$setnetent_r_proto" in ''|0) d_setnetent_r=undef - setnetent_r_proto=0 + setnetent_r_proto=0 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;; * ) case "$setnetent_r_proto" in REENTRANT_PROTO*) ;; @@ -17878,7 +18164,7 @@ case "$d_setprotoent_r" in esac case "$setprotoent_r_proto" in ''|0) d_setprotoent_r=undef - setprotoent_r_proto=0 + setprotoent_r_proto=0 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;; * ) case "$setprotoent_r_proto" in REENTRANT_PROTO*) ;; @@ -17927,7 +18213,7 @@ case "$d_setpwent_r" in esac case "$setpwent_r_proto" in ''|0) d_setpwent_r=undef - setpwent_r_proto=0 + setpwent_r_proto=0 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;; * ) case "$setpwent_r_proto" in REENTRANT_PROTO*) ;; @@ -17996,7 +18282,7 @@ case "$d_setservent_r" in esac case "$setservent_r_proto" in ''|0) d_setservent_r=undef - setservent_r_proto=0 + setservent_r_proto=0 echo "Disabling setservent_r, cannot determine prototype." >&4 ;; * ) case "$setservent_r_proto" in REENTRANT_PROTO*) ;; @@ -18430,7 +18716,7 @@ case "$d_srand48_r" in esac case "$srand48_r_proto" in ''|0) d_srand48_r=undef - srand48_r_proto=0 + srand48_r_proto=0 echo "Disabling srand48_r, cannot determine prototype." >&4 ;; * ) case "$srand48_r_proto" in REENTRANT_PROTO*) ;; @@ -18471,7 +18757,7 @@ case "$d_srandom_r" in esac case "$srandom_r_proto" in ''|0) d_srandom_r=undef - srandom_r_proto=0 + srandom_r_proto=0 echo "Disabling srandom_r, cannot determine prototype." >&4 ;; * ) case "$srandom_r_proto" in REENTRANT_PROTO*) ;; @@ -18534,7 +18820,6 @@ case "$d_statfs_s" in *) echo "No, it doesn't." ;; esac - : see if struct statfs knows about f_flags case "$d_statfs_s" in define) @@ -18664,7 +18949,7 @@ $cat >&4 <try.c <try.c < int main() { if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin) @@ -18675,7 +18960,7 @@ EOCP do set try -DSTDIO_STREAM_ARRAY=$s if eval $compile; then - case "`$run ./try`" in + case "`$run ./try`" in yes) stdio_stream_array=$s; break ;; esac fi @@ -18731,7 +19016,7 @@ case "$d_strerror_r" in esac case "$strerror_r_proto" in ''|0) d_strerror_r=undef - strerror_r_proto=0 + strerror_r_proto=0 echo "Disabling strerror_r, cannot determine prototype." >&4 ;; * ) case "$strerror_r_proto" in REENTRANT_PROTO*) ;; @@ -18757,12 +19042,46 @@ set strftime d_strftime eval $inlibc : see if strlcat exists -set strlcat d_strlcat -eval $inlibc +: We need both a prototype in string.h and the symbol in libc. +echo " " +d_strlcat_proto='' +xx1="#$d_gnulibc HAS_GNULIBC" +xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)' +xx3='# define _GNU_SOURCE' +xx4='#endif' +set d_strlcat_proto strlcat literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h +eval $hasproto +case "$d_strlcat_proto" in + define) # see if strlcat exists + set strlcat d_strlcat + eval $inlibc + ;; + *) val=$undef + set d_strlcat + eval $setvar + ;; +esac : see if strlcpy exists -set strlcpy d_strlcpy -eval $inlibc +: We need both a prototype in string.h and the symbol in libc. +echo " " +d_strlcpy_proto='' +xx1="#$d_gnulibc HAS_GNULIBC" +xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)' +xx3='# define _GNU_SOURCE' +xx4='#endif' +set d_strlcpy_proto strlcpy literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h +eval $hasproto +case "$d_strlcpy_proto" in + define) # see if strlcpy exists + set strlcpy d_strlcpy + eval $inlibc + ;; + *) val=$undef + set d_strlcpy + eval $setvar + ;; +esac : see if strnlen exists set strnlen d_strnlen @@ -18772,6 +19091,10 @@ eval $inlibc set strtod d_strtod eval $inlibc +: see if strtod_l exists +set strtod_l d_strtod_l +eval $inlibc + : see if strtol exists set strtol d_strtol eval $inlibc @@ -18802,9 +19125,9 @@ EOM #define strtoll _strtoll #endif #include -extern long long int strtoll(char *s, char **, int); +#include static int bad = 0; -int check(char *s, long long ell, int een) { +void check(const char *s, long long ell, int een) { long long gll; errno = 0; gll = strtoll(s, 0, 10); @@ -18857,11 +19180,11 @@ case "$d_strtoul" in Checking whether your strtoul() works okay... EOM $cat >try.c <<'EOCP' +#include #include #include -extern unsigned long int strtoul(char *s, char **, int); static int bad = 0; -void check(char *s, unsigned long eul, int een) { +void check(const char *s, unsigned long eul, int een) { unsigned long gul; errno = 0; gul = strtoul(s, 0, 10); @@ -18881,7 +19204,7 @@ EOCP check("-1", 18446744073709551615UL, 0); check("-18446744073709551614", 2, 0); check("-18446744073709551615", 1, 0); - check("-18446744073709551616", 18446744073709551615UL, ERANGE); + check("-18446744073709551616", 18446744073709551615UL, ERANGE); check("-18446744073709551617", 18446744073709551615UL, ERANGE); #endif EOCP @@ -18894,7 +19217,7 @@ EOCP check("-1", 4294967295UL, 0); check("-4294967294", 2, 0); check("-4294967295", 1, 0); - check("-4294967296", 4294967295UL, ERANGE); + check("-4294967296", 4294967295UL, ERANGE); check("-4294967297", 4294967295UL, ERANGE); #endif EOCP @@ -18937,14 +19260,14 @@ case "$d_longlong-$d_strtoull" in Checking whether your strtoull() works okay... EOM $cat >try.c <<'EOCP' +#include #include #ifdef __hpux #define strtoull __strtoull #endif #include -extern unsigned long long int strtoull(char *s, char **, int); static int bad = 0; -int check(char *s, long long eull, int een) { +void check(const char *s, long long eull, int een) { long long gull; errno = 0; gull = strtoull(s, 0, 10); @@ -18960,7 +19283,7 @@ int main() { check("-1", 18446744073709551615ULL, 0); check("-18446744073709551614", 2LL, 0); check("-18446744073709551615", 1LL, 0); - check("-18446744073709551616", 18446744073709551615ULL, ERANGE); + check("-18446744073709551616", 18446744073709551615ULL, ERANGE); check("-18446744073709551617", 18446744073709551615ULL, ERANGE); #endif if (!bad) @@ -18994,11 +19317,11 @@ case "$d_strtouq" in Checking whether your strtouq() works okay... EOM $cat >try.c <<'EOCP' +#include #include #include -extern unsigned long long int strtouq(char *s, char **, int); static int bad = 0; -void check(char *s, unsigned long long eull, int een) { +void check(const char *s, unsigned long long eull, int een) { unsigned long long gull; errno = 0; gull = strtouq(s, 0, 10); @@ -19014,7 +19337,7 @@ int main() { check("-1", 18446744073709551615ULL, 0); check("-18446744073709551614", 2LL, 0); check("-18446744073709551615", 1LL, 0); - check("-18446744073709551616", 18446744073709551615ULL, ERANGE); + check("-18446744073709551616", 18446744073709551615ULL, ERANGE); check("-18446744073709551617", 18446744073709551615ULL, ERANGE); #endif if (!bad) @@ -19241,7 +19564,7 @@ case "$d_tmpnam_r" in esac case "$tmpnam_r_proto" in ''|0) d_tmpnam_r=undef - tmpnam_r_proto=0 + tmpnam_r_proto=0 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;; * ) case "$tmpnam_r_proto" in REENTRANT_PROTO*) ;; @@ -19262,6 +19585,10 @@ case "$d_tmpnam_r" in ;; esac +: see if towlower exists +set towlower d_towlower +eval $inlibc + : see if trunc exists set trunc d_trunc eval $inlibc @@ -19298,7 +19625,7 @@ case "$d_ttyname_r" in esac case "$ttyname_r_proto" in ''|0) d_ttyname_r=undef - ttyname_r_proto=0 + ttyname_r_proto=0 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;; * ) case "$ttyname_r_proto" in REENTRANT_PROTO*) ;; @@ -19615,6 +19942,10 @@ eval $inlibc set waitpid d_waitpid eval $inlibc +: see if wcrtomb exists +set wcrtomb d_wcrtomb +eval $inlibc + : look for wcscmp echo " " $cat >try.c <<'EOCP' @@ -19818,10 +20149,6 @@ $define) echo " " echo "Checking Berkeley DB version ..." >&4 $cat >try.c < #include #$i_stdlib I_STDLIB @@ -19912,16 +20239,13 @@ define) echo " " echo "Checking return type needed for hash for Berkeley DB ..." >&4 $cat >try.c < #include #ifndef DB_VERSION_MAJOR u_int32_t hash_cb (const void* ptr, size_t size) { + return 0; } HASHINFO info; int main() @@ -19931,7 +20255,7 @@ int main() #endif EOCP if $cc $ccflags -c try.c >try.out 2>&1 ; then - if $contains warning try.out >>/dev/null 2>&1 ; then + if $compiler_warning try.out >>/dev/null 2>&1 ; then db_hashtype='int' else db_hashtype='u_int32_t' @@ -19955,16 +20279,13 @@ define) echo " " echo "Checking return type needed for prefix for Berkeley DB ..." >&4 cat >try.c < #include #ifndef DB_VERSION_MAJOR size_t prefix_cb (const DBT *key1, const DBT *key2) { + return 0; } BTREEINFO info; int main() @@ -19974,7 +20295,7 @@ int main() #endif EOCP if $cc $ccflags -c try.c >try.out 2>&1 ; then - if $contains warning try.out >>/dev/null 2>&1 ; then + if $compiler_warning try.out >>/dev/null 2>&1 ; then db_prefixtype='int' else db_prefixtype='size_t' @@ -20510,7 +20831,7 @@ if $test "X$fflushNULL" = X -o "X$fflushall" = X; then fi : check for fflush NULL behavior case "$fflushNULL" in -'') set try -DTRY_FFLUSH_NULL $output +'') set try -DTRY_FFLUSH_NULL $output if eval $compile; then $run ./try 2>/dev/null code="$?" @@ -20644,7 +20965,7 @@ Good, at least fflush(stdin) seems to behave okay when stdin is a pipe. EOM : now check for fflushall behaviour case "$fflushall" in - '') set try -DTRY_FFLUSH_ALL $output + '') set try -DTRY_FFLUSH_ALL $output if eval $compile; then $cat >&4 <&4 fi - : Check if GID is signed echo " " case "$gidtype" in @@ -20814,7 +21134,6 @@ else echo "(I can't compile the test program--guessing unsigned.)" >&4 fi - : Check 64bit sizes echo " " @@ -20837,7 +21156,7 @@ EOCP case "$yyy" in 12345678901) sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"'; - sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"'; + sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"'; echo "We will use %d." ;; esac @@ -20859,7 +21178,7 @@ EOCP case "$yyy" in 12345678901) sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"'; - sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"'; + sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"'; echo "We will use %ld." ;; esac @@ -20882,7 +21201,7 @@ EOCP case "$yyy" in 12345678901) sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64; - sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64; + sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64; echo "We will use the C9X style." ;; esac @@ -20904,7 +21223,7 @@ EOCP case "$yyy" in 12345678901) sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"'; - sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"'; + sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"'; echo "We will use %Ld." ;; esac @@ -20926,7 +21245,7 @@ EOCP case "$yyy" in 12345678901) sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"'; - sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"'; + sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"'; echo "We will use the %lld style." ;; esac @@ -20948,7 +21267,7 @@ EOCP case "$yyy" in 12345678901) sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"'; - sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"'; + sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"'; echo "We will use %qd." ;; esac @@ -21165,6 +21484,9 @@ int main(int ac, char **av) { signal(SIGSEGV, exit); +#ifdef SIGBUS + signal(SIGBUS, exit); +#endif myprintf("%s%cs all right, then\n", "that", '\''); exit(0); @@ -21960,17 +22282,17 @@ case "$doinit" in yes) echo "Generating a list of signal names and numbers..." >&4 . ./signal_cmd - sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst` - sig_name=`$awk 'BEGIN { printf "ZERO " } - !/^NSIG/ { printf "%s ", $1 }' signal.lst` - sig_num=`$awk 'BEGIN { printf "0 " } - !/^NSIG/ { printf "%d ", $2 }' signal.lst` - sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " } - !/^NSIG/ { printf "\"%s\", ", $1 } - END { printf "0\n" }' signal.lst` - sig_num_init=`$awk 'BEGIN { printf "0, " } - !/^NSIG/ { printf "%d, ", $2} - END { printf "0\n"}' signal.lst` + sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst` + sig_name=`$awk 'BEGIN { printf "ZERO " } + !/^NSIG/ { printf "%s ", $1 }' signal.lst` + sig_num=`$awk 'BEGIN { printf "0 " } + !/^NSIG/ { printf "%d ", $2 }' signal.lst` + sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " } + !/^NSIG/ { printf "\"%s\", ", $1 } + END { printf "0\n" }' signal.lst` + sig_num_init=`$awk 'BEGIN { printf "0, " } + !/^NSIG/ { printf "%d, ", $2} + END { printf "0\n"}' signal.lst` ;; esac echo "The following $sig_count signals are available:" @@ -22029,7 +22351,6 @@ else echo "(I can't compile the test program--guessing $sizesize.)" >&4 fi - : check for socklen_t echo " " echo "Checking to see if you have socklen_t..." >&4 @@ -22302,7 +22623,6 @@ else echo "(I can't compile the test program--guessing unsigned.)" >&4 fi - : Check format string for UID echo " " $echo "Checking the format string to be used for uids..." >&4 @@ -22342,6 +22662,34 @@ case "$uidsign" in ;; esac +: Ask about strict by default. +case "$usedefaultstrict" in + $define|true|[Yy]*) + dflt="y" + ;; + *) + dflt="n" + ;; + esac + +cat <&4 @@ -22735,7 +23083,7 @@ M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM -MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS +MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola MSDOS MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX @@ -22820,7 +23168,7 @@ cat <<'EOSH' >> Cppsym.try printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1 -}' >> try.c +}' >> try.c echo 'return 0;}' >> try.c EOSH cat <> Cppsym.try @@ -22926,7 +23274,7 @@ fi : add -D_FORTIFY_SOURCE if feasible and not already there case "$gccversion" in -[4567].*) case "$optimize$ccflags" in +[456789].*|[1-9][0-9]*) 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 @@ -23252,11 +23600,6 @@ for xxx in $xs_extensions ; do $define) avail_ext="$avail_ext $xxx" ;; esac ;; - I18N/Langinfo|i18n_lan) - case "$i_langinfo$d_nl_langinfo" in - $define$define) avail_ext="$avail_ext $xxx" ;; - esac - ;; IPC/SysV|ipc/sysv) : XXX Do we need a useipcsysv variable here case "${d_msg}${d_sem}${d_shm}" in @@ -23310,6 +23653,11 @@ for xxx in $xs_extensions ; do true|$define|y) avail_ext="$avail_ext $xxx" ;; esac ;; + I18N/Langinfo|langinfo) + case "$uselanginfo" in + true|define|y) avail_ext="$avail_ext $xxx" ;; + esac + ;; Sys/Syslog|sys/syslog) case $osname in amigaos) ;; # not really very useful on AmigaOS @@ -23321,14 +23669,6 @@ for xxx in $xs_extensions ; do ;; esac ;; - Thread|thread) - case "$usethreads" in - true|$define|y) - case "$use5005threads" in - $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;; - esac - esac - ;; threads|threads/shared) # threads and threads::shared are special cases. # To stop people from asking "Perl 5.8.0 was supposed @@ -23733,6 +24073,7 @@ chmod='$chmod' chown='$chown' clocktype='$clocktype' comm='$comm' +compiler_warning='$compiler_warning' compress='$compress' contains='$contains' cp='$cp' @@ -23766,6 +24107,7 @@ d_PRIu64='$d_PRIu64' d_PRIx64='$d_PRIx64' d_SCNfldbl='$d_SCNfldbl' d__fwalk='$d__fwalk' +d_accept4='$d_accept4' d_access='$d_access' d_accessx='$d_accessx' d_acosh='$d_acosh' @@ -23778,6 +24120,7 @@ d_asinh='$d_asinh' d_atanh='$d_atanh' d_atolf='$d_atolf' d_atoll='$d_atoll' +d_attribute_always_inline='$d_attribute_always_inline' d_attribute_deprecated='$d_attribute_deprecated' d_attribute_format='$d_attribute_format' d_attribute_malloc='$d_attribute_malloc' @@ -23806,7 +24149,6 @@ d_class='$d_class' 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' @@ -23840,6 +24182,7 @@ d_double_style_vax='$d_double_style_vax' d_drand48_r='$d_drand48_r' d_drand48proto='$d_drand48proto' d_dup2='$d_dup2' +d_dup3='$d_dup3' d_duplocale='$d_duplocale' d_eaccess='$d_eaccess' d_endgrent='$d_endgrent' @@ -23968,6 +24311,7 @@ d_gmtime64='$d_gmtime64' d_gmtime_r='$d_gmtime_r' d_gnulibc='$d_gnulibc' d_grpasswd='$d_grpasswd' +d_has_C_UTF8='$d_has_C_UTF8' d_hasmntopt='$d_hasmntopt' d_htonl='$d_htonl' d_hypot='$d_hypot' @@ -24034,6 +24378,7 @@ d_lstat='$d_lstat' d_madvise='$d_madvise' d_malloc_good_size='$d_malloc_good_size' d_malloc_size='$d_malloc_size' +d_malloc_usable_size='$d_malloc_usable_size' d_mblen='$d_mblen' d_mbrlen='$d_mbrlen' d_mbrtowc='$d_mbrtowc' @@ -24044,6 +24389,7 @@ d_memrchr='$d_memrchr' d_mkdir='$d_mkdir' d_mkdtemp='$d_mkdtemp' d_mkfifo='$d_mkfifo' +d_mkostemp='$d_mkostemp' d_mkstemp='$d_mkstemp' d_mkstemps='$d_mkstemps' d_mktime64='$d_mktime64' @@ -24088,6 +24434,7 @@ d_pathconf='$d_pathconf' d_pause='$d_pause' d_perl_otherlibdirs='$d_perl_otherlibdirs' d_phostname='$d_phostname' +d_pipe2='$d_pipe2' d_pipe='$d_pipe' d_poll='$d_poll' d_portable='$d_portable' @@ -24153,6 +24500,7 @@ d_sethostent_r='$d_sethostent_r' d_setitimer='$d_setitimer' d_setlinebuf='$d_setlinebuf' d_setlocale='$d_setlocale' +d_setlocale_accepts_any_locale_name='$d_setlocale_accepts_any_locale_name' d_setlocale_r='$d_setlocale_r' d_setnent='$d_setnent' d_setnetent_r='$d_setnetent_r' @@ -24198,6 +24546,7 @@ d_sitearch='$d_sitearch' d_snprintf='$d_snprintf' d_sockaddr_in6='$d_sockaddr_in6' d_sockaddr_sa_len='$d_sockaddr_sa_len' +d_sockaddr_storage='$d_sockaddr_storage' d_sockatmark='$d_sockatmark' d_sockatmarkproto='$d_sockatmarkproto' d_socket='$d_socket' @@ -24230,6 +24579,7 @@ d_strlcat='$d_strlcat' d_strlcpy='$d_strlcpy' d_strnlen='$d_strnlen' d_strtod='$d_strtod' +d_strtod_l='$d_strtod_l' d_strtol='$d_strtol' d_strtold='$d_strtold' d_strtold_l='$d_strtold_l' @@ -24259,6 +24609,8 @@ 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_towlower='$d_towlower' +d_towupper='$d_towupper' d_trunc='$d_trunc' d_truncate='$d_truncate' d_truncl='$d_truncl' @@ -24287,6 +24639,7 @@ d_voidtty='$d_voidtty' d_vsnprintf='$d_vsnprintf' d_wait4='$d_wait4' d_waitpid='$d_waitpid' +d_wcrtomb='$d_wcrtomb' d_wcscmp='$d_wcscmp' d_wcstombs='$d_wcstombs' d_wcsxfrm='$d_wcsxfrm' @@ -24478,6 +24831,7 @@ i_ustat='$i_ustat' i_utime='$i_utime' i_vfork='$i_vfork' i_wchar='$i_wchar' +i_wctype='$i_wctype' i_xlocale='$i_xlocale' ignore_versioned_solibs='$ignore_versioned_solibs' inc_version_list='$inc_version_list' @@ -24787,17 +25141,18 @@ uidtype='$uidtype' uname='$uname' uniq='$uniq' uquadtype='$uquadtype' -use5005threads='$use5005threads' use64bitall='$use64bitall' use64bitint='$use64bitint' usecbacktrace='$usecbacktrace' usecrosscompile='$usecrosscompile' +usedefaultstrict='$usedefaultstrict' usedevel='$usedevel' usedl='$usedl' usedtrace='$usedtrace' usefaststdio='$usefaststdio' useithreads='$useithreads' usekernprocpathname='$usekernprocpathname' +uselanginfo='$uselanginfo' uselargefiles='$uselargefiles' uselongdouble='$uselongdouble' usemallocwrap='$usemallocwrap'