X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/46fcf6af865510acbf782947f6b836299b8cc42d..6ab0e26eaad9ac45167b946aa56788746af949e9:/Configure diff --git a/Configure b/Configure index 57fc01f..8991f1a 100755 --- a/Configure +++ b/Configure @@ -17,10 +17,16 @@ # comp.sources.misc and is available on CPAN under authors/id/RAM so # you may fetch it yourself from your nearest archive site.) # +# +# Though this script was generated by metaconfig, it is OK to send +# patches against it. It's up to the Configure pumpkin to backport +# the patch to the metaunits if it is accepted. +# See Porting/pumpkin.pod for more information on metaconfig. +# # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Fri Jan 21 16:11:32 MET 2005 [metaconfig 3.0 PL70] +# Generated on Mon Sep 12 15:44:06 CEST 2005 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <&1 echo 'int main(void) { return 0; }' > gcctest.c - if $cc -O2 -pipe -o gcctest gcctest.c; then + if $cc -pipe -o gcctest gcctest.c; then echo "Yes, it does." 2>&1 case "$ccflags" in *-pipe*) @@ -4755,6 +4772,20 @@ default|recommended) else echo "Nope, it doesn't, but that's ok." 2>&1 fi + + echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1 + echo 'int main(void) { return 0; }' > gcctest.c + if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then + echo "Yes, it does." 2>&1 + case "$ccflags" in + *-Wdeclaration-after-statement*) + echo "Leaving current flags $ccflags alone." 2>&1 + ;; + *) dflt="$dflt -Wdeclaration-after-statement" ;; + esac + else + echo "Nope, it doesn't, but that's ok." 2>&1 + fi ;; esac ;; @@ -7105,7 +7136,7 @@ esac : for archive libraries. Thank you, Linux. case "$nm_so_opt" in '') case "$myuname" in - *linux*) + *linux*|gnu*) if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then nm_so_opt='--dynamic' fi @@ -7627,7 +7658,7 @@ EOM '') dflt="$dflt +vnocompatwarnings" ;; esac ;; - linux|irix*) dflt='-shared' ;; + linux|irix*|gnu*) dflt='-shared' ;; next) dflt='none' ;; solaris) dflt='-G' ;; sunos) dflt='-assert nodefinitions' ;; @@ -7674,7 +7705,7 @@ say "none". EOM case "$ccdlflags" in '') case "$osname" in - linux|hpux) dflt='-Wl,-E' ;; + linux|hpux|gnu*) dflt='-Wl,-E' ;; next|sunos) dflt='none' ;; *) dflt='none' ;; esac ;; @@ -7735,7 +7766,7 @@ any other libraries needed on this system (such as -lm, etc.). Since your system supports dynamic loading, it is probably possible to build a shared libperl.$so. If you will have more than one executable linked to libperl.$so, this will significantly reduce the size of each -executable, but it may have a noticeable affect on performance. The +executable, but it may have a noticeable effect on performance. The default is probably sensible for your system. $also @@ -7771,7 +7802,7 @@ true) dflt=libperl.5.$so # XXX How handle the --version stuff for MAB? ;; - linux*) # ld won't link with a bare -lperl otherwise. + linux*|gnu*) # ld won't link with a bare -lperl otherwise. dflt=libperl.$so ;; cygwin*) # ld links against an importlib @@ -7858,7 +7889,7 @@ if "$useshrplib"; then freebsd|netbsd|openbsd|interix) xxx="-Wl,-R$shrpdir" ;; - bsdos|linux|irix*|dec_osf) + bsdos|linux|irix*|dec_osf|gnu*) xxx="-Wl,-rpath,$shrpdir" ;; next) @@ -9862,21 +9893,189 @@ eval $inlibc set atoll d_atoll eval $inlibc -: Look for GNU-cc style attribute checking -case "$d_attribut" in +: Look for GCC-style attribute format +case "$d_attribute_format" in +'') +echo " " +echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4 +$cat >attrib.c <<'EOCP' +#include +void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2))); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((format))." + val="$undef" + else + echo "Your C compiler supports __attribute__((format))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_format" ;; +esac +set d_attribute_format +eval $setvar +$rm -f attrib* + +: Look for GCC-style attribute malloc +case "$d_attribute_malloc" in +'') +echo " " +echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4 +$cat >attrib.c <<'EOCP' +#include +char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc)); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((malloc))." + val="$undef" + else + echo "Your C compiler supports __attribute__((malloc))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_malloc" ;; +esac +set d_attribute_malloc +eval $setvar +$rm -f attrib* + +: Look for GCC-style attribute nonnull +case "$d_attribute_nonnull" in +'') +echo " " +echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4 +$cat >attrib.c <<'EOCP' +#include +void do_something (char *some_pointer,...) __attribute__((nonnull(1))); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((nonnull))." + val="$undef" + else + echo "Your C compiler supports __attribute__((nonnull))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_nonnull" ;; +esac +set d_attribute_nonnull +eval $setvar +$rm -f attrib* + +: Look for GCC-style attribute noreturn +case "$d_attribute_noreturn" in +'') +echo " " +echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4 +$cat >attrib.c <<'EOCP' +#include +void fall_over_dead( void ) __attribute__((noreturn)); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((noreturn))." + val="$undef" + else + echo "Your C compiler supports __attribute__((noreturn))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_noreturn" ;; +esac +set d_attribute_noreturn +eval $setvar +$rm -f attrib* + +: Look for GCC-style attribute pure +case "$d_attribute_pure" in +'') +echo " " +echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4 +$cat >attrib.c <<'EOCP' +#include +int square( int n ) __attribute__((pure)); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((pure))." + val="$undef" + else + echo "Your C compiler supports __attribute__((pure))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_pure" ;; +esac +set d_attribute_pure +eval $setvar +$rm -f attrib* + +: Look for GCC-style attribute unused +case "$d_attribute_unused" in +'') +echo " " +echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4 +$cat >attrib.c <<'EOCP' +#include +int do_something( int dummy __attribute__((unused)), int n ); +EOCP +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't support __attribute__((unused))." + val="$undef" + else + echo "Your C compiler supports __attribute__((unused))." + val="$define" + fi +else + echo "Your C compiler doesn't seem to understand __attribute__ at all." + val="$undef" +fi +;; +*) val="$d_attribute_unused" ;; +esac +set d_attribute_unused +eval $setvar +$rm -f attrib* + +: Look for GCC-style attribute warn_unused_result +case "$d_attribute_warn_unused_result" in '') echo " " -echo "Checking whether your compiler can handle __attribute__ ..." >&4 +echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4 $cat >attrib.c <<'EOCP' #include -void croak (char* pat,...) __attribute__((__format__(__printf__,1,2),noreturn)); +int I_will_not_be_ignored(void) __attribute__((warn_unused_result)); EOCP if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then if $contains 'warning' attrib.out >/dev/null 2>&1; then - echo "Your C compiler doesn't fully support __attribute__." + echo "Your C compiler doesn't support __attribute__((warn_unused_result))." val="$undef" else - echo "Your C compiler supports __attribute__." + echo "Your C compiler supports __attribute__((warn_unused_result))." val="$define" fi else @@ -9884,9 +10083,9 @@ else val="$undef" fi ;; -*) val="$d_attribut" ;; +*) val="$d_attribute_warn_unused_result" ;; esac -set d_attribut +set d_attribute_warn_unused_result eval $setvar $rm -f attrib* @@ -10834,6 +11033,7 @@ int main() { exit(1); } EOM +val=$undef set dirfd if eval $compile; then val="$define" @@ -13947,6 +14147,38 @@ $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 + +d_libm_lib_version="$undef" +case $i_math in + $define) + : check to see if math.h defines _LIB_VERSION + echo " " + echo "Checking to see if your libm supports _LIB_VERSION..." >&4 + $cat >try.c < +#include +int main (int argc, char *argv[]) +{ + printf ("%d\n", _LIB_VERSION); + return (0); + } /* main */ +EOCP + set try + if eval $compile; then + foo=`$run ./try` + echo "Yes, it does ($foo)" >&4 + d_libm_lib_version="$define" + else + echo "No, it does not (probably harmless)\n" >&4 + fi + $rm -f try.* try core core.try.* + ;; + + esac + : see if link exists set link d_link eval $inlibc @@ -14017,6 +14249,14 @@ eval $inlibc set madvise d_madvise eval $inlibc +: see if malloc_size exists +set malloc_size d_malloc_size +eval $inlibc + +: see if malloc_size_good exists +set malloc_good_size d_malloc_good_size +eval $inlibc + : see if mblen exists set mblen d_mblen eval $inlibc @@ -14114,7 +14354,7 @@ eval $inlibc : see if prototype for modfl is available echo " " -set d_modflproto modfl math.h +set d_modflproto modfl $i_math math.h eval $hasproto d_modfl_pow32_bug="$undef" @@ -14611,6 +14851,128 @@ esac $rm -f try.* try +$echo "Checking whether NV 0.0 is all bits zero in memory..." >&4 +: volatile so that the compiler has to store it out to memory. +if test X"$d_volatile" = X"$define"; then + volatile=volatile +fi +$cat <try.c +#include +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#endif +#$i_string I_STRING +#ifdef I_STRING +# include +#else +# include +#endif +#include +#include +#ifdef SIGFPE +$volatile int bletched = 0; +$signal_t blech(s) int s; { bletched = 1; } +#endif + +int checkit($nvtype d, char *where) { + unsigned char *p = (char *)&d; + unsigned char *end = p + sizeof(d); + int fail = 0; + + while (p < end) + fail += *p++; + + if (!fail) + return 0; + + p = (char *)&d; + printf("No - %s: 0x", where); + while (p < end) + printf ("%02X", *p++); + printf("\n"); + return 1; +} + +int main(int argc, char **argv) { + $nvtype d = 0.0; + int fail = 0; + fail += checkit(d, "0.0"); + + /* The compiler shouldn't be assuming that bletched is 0 */ + d = bletched; + + fail += checkit(d, "bleched"); + +#ifdef SIGFPE + signal(SIGFPE, blech); +#endif + + /* Paranoia - the compiler should have no way of knowing that ANSI says + that argv[argc] will always be NULL. Actually, if it did assume this it + would be buggy, as this is C and main() can be called from elsewhere in + the program. */ + d = argv[argc] ? 1 : 0; + + if (d) { + printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d); + } + + fail += checkit(d, "ternary"); + + memset(&d, sizeof(d), argv[argc] ? 1 : 0); + + if (d != 0.0) { + printf("No - memset doesn't give 0.0\n"); + /* This might just blow up: */ + printf("(gives %g)\n", d); + return 1; + } + +#ifdef SIGFPE + if (bletched) { + printf("No - something bleched\n"); + return 1; + } +#endif + if (fail) { + printf("No - %d fail(s)\n", fail); + return 1; + } + printf("Yes\n"); + return 0; +} +EOP +set try + +d_nv_zero_is_allbits_zero="$undef" +if eval $compile; then + xxx="`$run ./try`" + case "$?" in + 0) + case "$xxx" in + Yes) cat >&4 <&4 <&4 < /dev/null 2>&1 && $run ./foobar >/dev/null 2>&1; then echo "$ar appears to generate random libraries itself." orderlib=false - ranlib=":" + if [ "X$ranlib" = "X" ]; then + ranlib=":" + fi elif $ar ts bar$_a >/dev/null 2>&1 && $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 && $run ./foobar >/dev/null 2>&1; then @@ -18985,6 +19349,12 @@ int main() { #endif #ifndef NSIG +# ifdef _SIG_MAX +# define NSIG (_SIG_MAX+1) +# endif +#endif + +#ifndef NSIG # ifdef MAXSIG # define NSIG (MAXSIG+1) # endif @@ -18998,7 +19368,7 @@ int main() { #ifndef NSIG # ifdef SIGARRAYSIZE -# define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */ +# define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */ # endif #endif @@ -19483,6 +19853,16 @@ case "$uidsign" in ;; esac + +case "$usesitecustomize" in + $define|true|[Yy]*) + usesitecustomize="$define" + ;; + *) + usesitecustomize="$undef" + ;; + esac + : determine compiler compiler case "$yacc" in '') @@ -19543,10 +19923,6 @@ fi -: see if this is a math.h system -set math.h i_math -eval $inhdr - : see if this is a mntent.h system set mntent.h i_mntent eval $inhdr @@ -19631,13 +20007,13 @@ $echo "Guessing which symbols your C compiler and preprocessor define..." >&4 $cat <<'EOSH' > Cppsym.know a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE -alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX +alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi bull c cadmus clipper CMU COFF COMPILER_VERSION concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX -CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO +CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR @@ -19689,7 +20065,7 @@ USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 -Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286 +Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED z8000 @@ -20577,7 +20953,13 @@ d_archlib='$d_archlib' d_asctime_r='$d_asctime_r' d_atolf='$d_atolf' d_atoll='$d_atoll' -d_attribut='$d_attribut' +d_attribute_format='$d_attribute_format' +d_attribute_malloc='$d_attribute_malloc' +d_attribute_nonnull='$d_attribute_nonnull' +d_attribute_noreturn='$d_attribute_noreturn' +d_attribute_pure='$d_attribute_pure' +d_attribute_unused='$d_attribute_unused' +d_attribute_warn_unused_result='$d_attribute_warn_unused_result' d_bcmp='$d_bcmp' d_bcopy='$d_bcopy' d_bsd='$d_bsd' @@ -20732,6 +21114,7 @@ d_isnanl='$d_isnanl' d_killpg='$d_killpg' d_lchown='$d_lchown' d_ldbl_dig='$d_ldbl_dig' +d_libm_lib_version='$d_libm_lib_version' d_link='$d_link' d_localtime_r='$d_localtime_r' d_locconv='$d_locconv' @@ -20741,6 +21124,8 @@ d_longlong='$d_longlong' d_lseekproto='$d_lseekproto' d_lstat='$d_lstat' d_madvise='$d_madvise' +d_malloc_good_size='$d_malloc_good_size' +d_malloc_size='$d_malloc_size' d_mblen='$d_mblen' d_mbstowcs='$d_mbstowcs' d_mbtowc='$d_mbtowc' @@ -20777,6 +21162,7 @@ d_mymalloc='$d_mymalloc' d_nice='$d_nice' d_nl_langinfo='$d_nl_langinfo' d_nv_preserves_uv='$d_nv_preserves_uv' +d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero' d_off64_t='$d_off64_t' d_old_pthread_create_joinable='$d_old_pthread_create_joinable' d_oldpthreads='$d_oldpthreads' @@ -21438,6 +21824,7 @@ usereentrant='$usereentrant' userelocatableinc='$userelocatableinc' usesfio='$usesfio' useshrplib='$useshrplib' +usesitecustomize='$usesitecustomize' usesocks='$usesocks' usethreads='$usethreads' usevendorprefix='$usevendorprefix'