X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/eaf812ae1a347289872c15b0fb8a27a85b03dc2f..328aef96c192c44093e580ff7a2614137052ba36:/Configure diff --git a/Configure b/Configure index 2dd947e..b317e44 100755 --- a/Configure +++ b/Configure @@ -26,7 +26,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Mon Apr 17 14:14:39 CEST 2006 [metaconfig 3.0 PL70] +# Generated on Fri Mar 9 20:00:14 CET 2007 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <&4 <>whoa dflt=y -echo " " -echo "*** WHOA THERE!!! ***" >&4 -echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 +case "$hint" in + recommended) + case "$hintfile" in + '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4 + ;; + *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4 + echo "the $hint value for \$$var on this machine was \"$was\"!" >&4 + ;; + esac + ;; + *) echo " " + echo "*** WHOA THERE!!! ***" >&4 + echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 + ;; +esac rp=" Keep the $hint value?" . ./myread case "$ans" in @@ -4014,6 +4052,62 @@ EOM esac +: 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 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'` +else + revision=0 + patchlevel=0 + subversion=0 + api_revision=0 + api_version=0 + api_subversion=0 + perl_patchlevel=0 + $echo "(You do not have patchlevel.h. Eek.)" +fi +if $test -r $rsrc/.patch ; then + if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then + perl_patchlevel=`cat $rsrc/.patch` + fi +fi +: 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|'') ;; +*) 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\n", $1, $2, $3 }'` + api_versionstring=`echo $api_revision $api_version $api_subversion | \ + $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` + ;; +*) + version=`echo $revision $patchlevel $subversion | \ + $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` + api_versionstring=`echo $api_revision $api_version $api_subversion | \ + $awk '{ printf "%d.%d.%d\n", $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 + case "$usethreads" in $define|true|[yY]*) dflt='y';; *) # Catch case where user specified ithreads or 5005threads but @@ -4050,8 +4144,9 @@ esac set usethreads eval $setvar -case "$usethreads" in -$define) +if $test $patchlevel -lt 9; then + case "$usethreads" in + $define) $cat <&4 <&4 <&4 $cat >try.c < int main() { -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) #ifdef __VERSION__ printf("%s\n", __VERSION__); #else @@ -4872,7 +4995,7 @@ case "$EBUGGING" in esac case "$DEBUGGING" in --g|$define) +-g|both|$define) case "$optimize" in *-g*) ;; *) optimize="$optimize -g" ;; @@ -4947,20 +5070,6 @@ 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 ;; @@ -5961,62 +6070,6 @@ prefixit='case "$3" in esac;; esac' -: 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 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'` -else - revision=0 - patchlevel=0 - subversion=0 - api_revision=0 - api_version=0 - api_subversion=0 - perl_patchlevel=0 - $echo "(You do not have patchlevel.h. Eek.)" -fi -if $test -r $rsrc/.patch ; then - if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then - perl_patchlevel=`cat $rsrc/.patch` - fi -fi -: 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|'') ;; -*) 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\n", $1, $2, $3 }'` - api_versionstring=`echo $api_revision $api_version $api_subversion | \ - $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` - ;; -*) - version=`echo $revision $patchlevel $subversion | \ - $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` - api_versionstring=`echo $api_revision $api_version $api_subversion | \ - $awk '{ printf "%d.%d.%d\n", $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 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. @@ -6045,6 +6098,8 @@ if $test "X$ansexp" != "X$binexp"; then 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 @@ -6069,10 +6124,10 @@ esac set userelocatableinc eval $setvar +initialinstalllocation="$binexp" : Default prefix is now "up one level from where the binaries are" case "$userelocatableinc" in $define|true|[yY]*) - initialinstalllocation="$binexp" bin=".../" binexp=".../" prefix=".../.." @@ -6351,30 +6406,34 @@ use File::Basename; \$archname = "$archname"; EOPL $cat >> 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 = glob("5.*"); + ;@candidates = map { + [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*"); } else { ;@candidates = (); } -# XXX ToDo: These comparisons must be reworked when two-digit -# subversions come along, so that 5.7.10 compares as greater than -# 5.7.3! By that time, hope that 5.6.x is sufficiently -# widespread that we can use the built-in version vectors rather -# than reinventing them here. For 5.6.0, however, we must -# assume this script will likely be run by 5.005_0x. --AD 1/2000. +($pversion, $aversion, $vsn5005) = map { + pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005"; foreach $d (@candidates) { - if ($d lt $version) { - if ($d ge $api_versionstring) { - unshift(@inc_version_list, grep { -d } "$d/$archname", $d); + if ($d->[1] lt $pversion) { + if ($d->[1] ge $aversion) { + unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]); } - elsif ($d ge "5.005") { - unshift(@inc_version_list, grep { -d } $d); + elsif ($d->[1] ge $vsn5005) { + unshift(@inc_version_list, grep { -d } $d->[0]); } } else { @@ -7099,7 +7158,7 @@ int main(void) { #ifdef __GLIBC__ # ifdef __GLIBC_MINOR__ -# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 +# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus) # include printf("%s\n", gnu_get_libc_version()); # else @@ -7523,18 +7582,21 @@ true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;; esac; case "$tx" in yes) + case "$d_cplusplus" in + $define) extern_C=\"C\";; + esac; tval=false; if $test "$runnm" = true; then if $contains $tlook $tf >/dev/null 2>&1; then tval=true; elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then - echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c; + echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c; $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true; $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; }; $rm -f try$_exe try.c core core.* try.core; fi; else - echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c; + echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c; $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true; $rm -f try$_exe try.c; fi; @@ -7575,12 +7637,53 @@ yes) esac;; esac' + +echo " " +echo "Checking for C++..." >&4 +cat >try.c <<'EOCP' +#include +int main(void) +{ +#ifdef __cplusplus + printf("define\n"); +#else + printf("undef\n"); +#endif + return 0; +} +EOCP +set try +if eval $compile_ok && $run ./try >cplusplus$$; then + val=`$cat cplusplus$$` + echo "You are using a C++ compiler." +else + val="$undef" + echo "You are not using a C++ compiler." +fi +$rm -f try try.* cplusplus$$ +set d_cplusplus +eval $setvar + : see if dlopen exists xxx_runnm="$runnm" +xxx_ccflags="$ccflags" runnm=false +: with g++ one needs -shared to get is-in-libc to work for dlopen +case "$gccversion" in +'') ;; +*) case "$d_cplusplus" in + "$define") ccflags="$ccflags -shared" ;; + esac + ;; +esac set dlopen d_dlopen eval $inlibc runnm="$xxx_runnm" +ccflags="$xxx_ccflags" + +: see if this is a unistd.h system +set unistd.h i_unistd +eval $inhdr : determine which dynamic loading, if any, to compile in echo " " @@ -7657,7 +7760,7 @@ EOM ;; *) case "$osname" in darwin) dflt='none' ;; - svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;; + linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;; *) dflt='-fpic' ;; esac ;; esac ;; @@ -7685,9 +7788,13 @@ EOM #ifdef I_STDLIB #include #endif -int main() { - char b[4]; - int i = open("a.out",O_RDONLY); +#$i_unistd I_UNISTD +#ifdef I_UNISTD +#include +#endif +int main() { + char b[4]; + int i = open("a.out",O_RDONLY); if(i == -1) exit(1); /* fail */ if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') @@ -7732,7 +7839,7 @@ EOM '') dflt="$dflt +vnocompatwarnings" ;; esac ;; - linux|irix*|gnu*) dflt='-shared' ;; + linux|irix*|gnu*) dflt="-shared $optimize" ;; next) dflt='none' ;; solaris) dflt='-G' ;; sunos) dflt='-assert nodefinitions' ;; @@ -8566,6 +8673,9 @@ case "$versiononly" in esac : figure out how to guarantee perl startup +: XXX Note that this currently takes advantage of the bug that binexp ignores +: the Configure -Dinstallprefix setting, which in turn means that under +: relocatable @INC, initialinstalllocation is what binexp started as. case "$startperl" in '') case "$sharpbang" in @@ -8575,13 +8685,13 @@ case "$startperl" in I can use the #! construct to start perl on your system. This will make startup of perl scripts faster, but may cause problems if you want to share those scripts and perl is not in a standard place -($binexp/perl) on all your platforms. The alternative is to force -a shell by starting the script with a single ':' character. +($initialinstalllocation/perl) on all your platforms. The alternative +is to force a shell by starting the script with a single ':' character. EOH case "$versiononly" in - "$define") dflt="$binexp/perl$version";; - *) dflt="$binexp/perl";; + "$define") dflt="$initialinstalllocation/perl$version";; + *) dflt="$initialinstalllocation/perl";; esac rp='What shall I put after the #! to start up perl ("none" to not use #!)?' . ./myread @@ -8610,8 +8720,8 @@ echo "I'll use $startperl to start perl scripts." case "$perlpath" in '') case "$versiononly" in - "$define") perlpath="$binexp/perl$version";; - *) perlpath="$binexp/perl";; + "$define") perlpath="$initialinstalllocation/perl$version";; + *) perlpath="$initialinstalllocation/perl";; esac case "$startperl" in *!*) ;; @@ -8621,10 +8731,10 @@ case "$perlpath" in I will use the "eval 'exec'" idiom to start Perl on your system. I can use the full path of your Perl binary for this purpose, but doing so may cause problems if you want to share those scripts and -Perl is not always in a standard place ($binexp/perl). +Perl is not always in a standard place ($initialinstalllocation/perl). EOH - dflt="$binexp/perl" + dflt="$initialinstalllocation/perl" rp="What path shall I use in \"eval 'exec'\"?" . ./myread perlpath="$ans" @@ -9915,6 +10025,50 @@ set d_attribute_format eval $setvar $rm -f attrib* +: Look for GCC-style attribute format with null format allowed +case "$d_printf_format_null" in +'') case "$d_attribute_format" in + $define) + echo " " + echo "Checking whether your compiler allows __printf__ format to be null ..." >&4 +$cat >attrib.c < +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#endif +int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2))); +int null_printf (char* pat,...) { return (int)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 + echo "Your C compiler doesn't allow __printf__ format to be null." + val="$undef" + else + echo "Your C compiler allows __printf__ format to be null." + val="$define" + fi + else + echo "Your C compiler executable failed with __printf__ format null." + val="$undef" + fi + else + echo "Your C compiler fails with __printf__ format null." + val="$undef" + fi + ;; + *) val="$undef" ;; + esac +;; +*) val="$d_printf_format_null" ;; +esac +set d_printf_format_null +eval $setvar +$rm -f attrib* + : Look for GCC-style attribute malloc case "$d_attribute_malloc" in '') @@ -10091,10 +10245,6 @@ eval $inlibc set bcopy d_bcopy eval $inlibc -: see if this is a unistd.h system -set unistd.h i_unistd -eval $inhdr - : see if getpgrp exists set getpgrp d_getpgrp eval $inlibc @@ -10295,6 +10445,146 @@ $rm -f try.* try core core.try.* set bzero d_bzero eval $inlibc +: see if stdarg is available +echo " " +if $test `./findhdr stdarg.h`; then + echo " found." >&4 + valstd="$define" +else + echo " NOT found." >&4 + valstd="$undef" +fi + +: see if varags is available +echo " " +if $test `./findhdr varargs.h`; then + echo " found." >&4 +else + echo " NOT found, but that's ok (I hope)." >&4 +fi + +: set up the varargs testing programs +$cat > varargs.c < +#endif +#ifdef I_VARARGS +#include +#endif + +#ifdef I_STDARG +int f(char *p, ...) +#else +int f(va_alist) +va_dcl +#endif +{ + va_list ap; +#ifndef I_STDARG + char *p; +#endif +#ifdef I_STDARG + va_start(ap,p); +#else + va_start(ap); + p = va_arg(ap, char *); +#endif + va_end(ap); + return 0; +} +EOP +$cat > varargs </dev/null 2>&1; then + echo "true" +else + echo "false" +fi +$rm -f varargs$_o +EOP +chmod +x varargs + +: now check which varargs header should be included +echo " " +i_varhdr='' +case "$valstd" in +"$define") + if `./varargs I_STDARG`; then + val='stdarg.h' + elif `./varargs I_VARARGS`; then + val='varargs.h' + fi + ;; +*) + if `./varargs I_VARARGS`; then + val='varargs.h' + fi + ;; +esac +case "$val" in +'') +echo "I could not find the definition for va_dcl... You have problems..." >&4 + val="$undef"; set i_stdarg; eval $setvar + val="$undef"; set i_varargs; eval $setvar + ;; +*) + set i_varhdr + eval $setvar + case "$i_varhdr" in + stdarg.h) + val="$define"; set i_stdarg; eval $setvar + val="$undef"; set i_varargs; eval $setvar + ;; + varargs.h) + val="$undef"; set i_stdarg; eval $setvar + val="$define"; set i_varargs; eval $setvar + ;; + esac + echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;; +esac +$rm -f varargs* + +: see if the Compiler supports C99 variadic macros +case "$i_stdarg$i_stdlib" in + "$define$define") + echo "You have and , so checking for C99 variadic macros." >&4 + $cat >try.c < +#include + +#define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__) + +int main() { + char buf[20]; + foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail"); + puts(buf); + return 0; +} +EOCP + set try + if eval $compile && $run ./try 2>&1 >/dev/null; then + case "`$run ./try`" in + "123 456 789") + echo "You have C99 variadic macros." >&4 + d_c99_variadic_macros="$define" + ;; + *) + echo "You don't have functional C99 variadic macros." >&4 + d_c99_variadic_macros="$undef" + ;; + esac + else + echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4 + d_c99_variadic_macros="$undef" + fi + $rm -f try.* try core core.try.* + ;; + *) + echo "You don't have and , so not checking for C99 variadic macros." >&4 + d_c99_variadic_macros="$undef" + ;; +esac + : see if signal is declared as pointer to function returning int or void echo " " xxx=`./findhdr signal.h` @@ -10355,7 +10645,7 @@ $cat >try.c < #include -$signal_t blech(s) int s; { exit(3); } +$signal_t blech(int s) { exit(3); } int main() { $xxx i32; @@ -10413,11 +10703,11 @@ $cat >try.c < #include -$signal_t blech(s) int s; { exit(7); } -$signal_t blech_in_list(s) int s; { exit(4); } -unsigned long dummy_long(p) unsigned long p; { return p; } -unsigned int dummy_int(p) unsigned int p; { return p; } -unsigned short dummy_short(p) unsigned short p; { return p; } +$signal_t blech(int s) { exit(7); } +$signal_t blech_in_list(int s) { exit(4); } +unsigned long dummy_long(unsigned long p) { return p; } +unsigned int dummy_int(unsigned int p) { return p; } +unsigned short dummy_short(unsigned short p) { return p; } int main() { double f; @@ -10690,7 +10980,7 @@ typedef struct spug { int drokk; } spug; int main() { const char *foo; - const spug y; + const spug y = { 0 }; } EOCP if $cc -c $ccflags const.c >/dev/null 2>&1 ; then @@ -10807,6 +11097,10 @@ case "$full_csh" in '') full_csh=$csh ;; esac +: see if ctermid exists +set ctermid d_ctermid +eval $inlibc + : see if ctermid_r exists set ctermid_r d_ctermid_r eval $inlibc @@ -11047,6 +11341,42 @@ set d_dirnamlen eval $setvar $rm -f try.c +: Look for DIR.dd_fd +case "$i_dirent" in +"$define") + echo "Checking to see if DIR has a dd_fd member variable" >&4 + $cat >try.c < +#endif +#include + +int main() { + DIR dir; + dir.dd_fd = 1; + return 0; +} +EOCP + val=$undef + set try + if eval $compile; then + echo "Yes, it does." + val="$define" + else + echo "No, it does not." + val="$undef" + fi + ;; +*) + echo "You don't have a , so not checking for dd_fd." >&4 + val="$undef" + ;; +esac +set d_dir_dd_fd +eval $setvar +$rm -f try try.* + : see if this is an sysdir system set sys/dir.h i_sysdir eval $inhdr @@ -11912,7 +12242,7 @@ extern int errno; #else #include #endif -$signal_t blech(x) int x; { exit(3); } +$signal_t blech(int x) { exit(3); } EOCP $cat >> try.c <<'EOCP' int main() @@ -12345,7 +12675,7 @@ $cat >try.c < #include #include -$signal_t blech(x) int x; { exit(3); } +$signal_t blech(int x) { exit(3); } int main() { #if defined(F_SETLK) && defined(F_SETLKW) struct flock flock; @@ -14326,6 +14656,59 @@ case "$d_localtime_r" in ;; esac +: see if localtime_r calls tzset +case "$localtime_r_proto" in +REENTRANT_PROTO*) + $cat >try.c < +#include +#include +#include +#include +int main() +{ + time_t t = time(0L); + char w_tz[]="TZ" "=GMT+5", + e_tz[]="TZ" "=GMT-5", + *tz_e = (char*)malloc(16), + *tz_w = (char*)malloc(16); + struct tm tm_e, tm_w; + memset(&tm_e,'\0',sizeof(struct tm)); + memset(&tm_w,'\0',sizeof(struct tm)); + strcpy(tz_e,e_tz); + strcpy(tz_w,w_tz); + + putenv(tz_e); + localtime_r(&t, &tm_e); + + putenv(tz_w); + localtime_r(&t, &tm_w); + + if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 ) + return 1; + return 0; +} +EOCP + set try + if eval $compile; then + if ./try; then + d_localtime_r_needs_tzset=undef; + else + d_localtime_r_needs_tzset=define; + fi; + else + d_localtime_r_needs_tzset=undef; + fi; + ;; + *) + d_localtime_r_needs_tzset=undef; + ;; +esac +$rm -f try try.* core + : see if localeconv exists set localeconv d_locconv eval $inlibc @@ -14898,7 +15281,7 @@ $cat <try.c #include #ifdef SIGFPE $volatile int bletched = 0; -$signal_t blech(s) int s; { bletched = 1; } +$signal_t blech(int s) { bletched = 1; } #endif int main() { $uvtype u = 0; @@ -14920,10 +15303,9 @@ int main() { if (($uvtype)d != (u - 1)) break; #ifdef SIGFPE - if (bletched) { + if (bletched) break; #endif - } } printf("%d\n", ((i == n) ? -n : i)); exit(0); @@ -14944,7 +15326,7 @@ case "$nv_preserves_uv_bits" in [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1 d_nv_preserves_uv="$undef" ;; *) $echo "Can't figure out how many bits your NVs preserve." 2>&1 - nv_preserves_uv_bits="$undef" ;; + nv_preserves_uv_bits="0" ;; esac $rm -f try.* try @@ -14970,7 +15352,7 @@ $cat <try.c #include #ifdef SIGFPE $volatile int bletched = 0; -$signal_t blech(s) int s; { bletched = 1; } +$signal_t blech(int s) { bletched = 1; } #endif int checkit($nvtype d, char *where) { @@ -15194,6 +15576,54 @@ $rm -f reflect set d_procselfexe eval $setvar +: backward compatibility for d_hvfork +if test X$d_hvfork != X; then + d_vfork="$d_hvfork" + d_hvfork='' +fi +: see if there is a vfork +val='' +set vfork val +eval $inlibc + +d_pseudofork=$undef + +: Ok, but do we want to use it. vfork is reportedly unreliable in +: perl on Solaris 2.x, and probably elsewhere. +case "$val" in +$define) + echo " " + case "$usevfork" in + false) dflt='n';; + *) dflt='y';; + esac + cat <<'EOM' + +Perl can only use a vfork() that doesn't suffer from strict +restrictions on calling functions or modifying global data in +the child. For example, glibc-2.1 contains such a vfork() +that is unsuitable. If your system provides a proper fork() +call, chances are that you do NOT want perl to use vfork(). + +EOM + rp="Do you still want to use vfork()?" + . ./myread + case "$ans" in + y|Y) ;; + *) + echo "Ok, we won't use vfork()." + val="$undef" + ;; + esac + ;; +esac +set d_vfork +eval $setvar +case "$d_vfork" in +$define) usevfork='true';; +*) usevfork='false';; +esac + : see whether the pthread_atfork exists $cat >try.c < @@ -16538,6 +16968,51 @@ fi set d_sigaction; eval $setvar $rm -f try try$_o try.c +: see if this is a sunmath.h system +set sunmath.h i_sunmath +eval $inhdr + +: see if signbit exists +$echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4 +$cat >try.c < +#endif +#ifdef I_SUNMATH /* Solaris special math library */ +# include +#endif +#define NV $nvtype +int main(int argc, char **argv) +{ + NV x = 0.0; + NV y = -0.0; + if ((signbit(x) == 0) && (signbit(y) != 0)) + return 0; + else + return 1; +} +EOCP +val="$undef" +set try +if eval $compile; then + if $run ./try; then + $echo "Yes." >&4 + val="$define" + else + $echo "Signbit seems to be available, but doesn't work as I expected." + $echo "I won't use it." >&4 + val="$undef" + fi +else + $echo "Nope." >&4 + dflt="$undef" +fi +set d_signbit +eval $setvar +$rm -f try.* try + : see if sigprocmask exists set sigprocmask d_sigprocmask eval $inlibc @@ -17586,7 +18061,7 @@ case "$d_u32align" in #define U8 $u8type #include #ifdef SIGBUS -$signal_t bletch(s) int s; { exit(4); } +$signal_t bletch(int s) { exit(4); } #endif int main() { #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321 @@ -17702,52 +18177,6 @@ eval $hasproto set ustat d_ustat eval $inlibc -: backward compatibility for d_hvfork -if test X$d_hvfork != X; then - d_vfork="$d_hvfork" - d_hvfork='' -fi -: see if there is a vfork -val='' -set vfork val -eval $inlibc - -: Ok, but do we want to use it. vfork is reportedly unreliable in -: perl on Solaris 2.x, and probably elsewhere. -case "$val" in -$define) - echo " " - case "$usevfork" in - false) dflt='n';; - *) dflt='y';; - esac - cat <<'EOM' - -Perl can only use a vfork() that doesn't suffer from strict -restrictions on calling functions or modifying global data in -the child. For example, glibc-2.1 contains such a vfork() -that is unsuitable. If your system provides a proper fork() -call, chances are that you do NOT want perl to use vfork(). - -EOM - rp="Do you still want to use vfork()?" - . ./myread - case "$ans" in - y|Y) ;; - *) - echo "Ok, we won't use vfork()." - val="$undef" - ;; - esac - ;; -esac -set d_vfork -eval $setvar -case "$d_vfork" in -$define) usevfork='true';; -*) usevfork='false';; -esac - : see if closedir exists set closedir d_closedir eval $inlibc @@ -18945,11 +19374,15 @@ EOM esac -case "$mad" in -$define|true|[yY]*) dflt='y' ;; -*) dflt='n' ;; -esac -cat < found." >&4 - valstd="$define" -else - echo " NOT found." >&4 - valstd="$undef" -fi - -: see if varags is available -echo " " -if $test `./findhdr varargs.h`; then - echo " found." >&4 -else - echo " NOT found, but that's ok (I hope)." >&4 -fi - -: set up the varargs testing programs -$cat > varargs.c < -#endif -#ifdef I_VARARGS -#include -#endif - -#ifdef I_STDARG -int f(char *p, ...) -#else -int f(va_alist) -va_dcl -#endif -{ - va_list ap; -#ifndef I_STDARG - char *p; -#endif -#ifdef I_STDARG - va_start(ap,p); -#else - va_start(ap); - p = va_arg(ap, char *); -#endif - va_end(ap); -} -EOP -$cat > varargs </dev/null 2>&1; then - echo "true" -else - echo "false" -fi -$rm -f varargs$_o -EOP -chmod +x varargs - -: now check which varargs header should be included -echo " " -i_varhdr='' -case "$valstd" in -"$define") - if `./varargs I_STDARG`; then - val='stdarg.h' - elif `./varargs I_VARARGS`; then - val='varargs.h' - fi - ;; -*) - if `./varargs I_VARARGS`; then - val='varargs.h' - fi - ;; -esac -case "$val" in -'') -echo "I could not find the definition for va_dcl... You have problems..." >&4 - val="$undef"; set i_stdarg; eval $setvar - val="$undef"; set i_varargs; eval $setvar - ;; -*) - set i_varhdr - eval $setvar - case "$i_varhdr" in - stdarg.h) - val="$define"; set i_stdarg; eval $setvar - val="$undef"; set i_varargs; eval $setvar - ;; - varargs.h) - val="$undef"; set i_stdarg; eval $setvar - val="$define"; set i_varargs; eval $setvar - ;; - esac - echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;; -esac -$rm -f varargs* - : see if we need va_copy echo " " case "$i_stdarg" in @@ -19479,7 +19815,7 @@ $selecttype b; #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8) #define NBITS (NBYTES * 8) int main() { - char *s = malloc(NBYTES); + char *s = (char *)malloc(NBYTES); struct timeval t; int i; FILE* fp; @@ -20164,6 +20500,26 @@ eval $inhdr set fp_class.h i_fp_class eval $inhdr +: see if gdbm.h is available +set gdbm.h t_gdbm +eval $inhdr +case "$t_gdbm" in +$define) + : see if gdbm_open exists + set gdbm_open d_gdbm_open + eval $inlibc + case "$d_gdbm_open" in + $undef) + t_gdbm="$undef" + echo "We won't be including " + ;; + esac + ;; +esac +val="$t_gdbm" +set i_gdbm +eval $setvar + : see if this is a ieeefp.h system case "$i_ieeefp" in '' ) set ieeefp.h i_ieeefp @@ -20544,10 +20900,6 @@ val=$val3; set i_termios; eval $setvar set stddef.h i_stddef eval $inhdr -: see if this is a sunmath.h system -set sunmath.h i_sunmath -eval $inhdr - : see if sys/access.h is available set sys/access.h i_sysaccess eval $inhdr @@ -20651,26 +21003,6 @@ case "$d_vfork" in ;; esac -: see if gdbm.h is available -set gdbm.h t_gdbm -eval $inhdr -case "$t_gdbm" in -$define) - : see if gdbm_open exists - set gdbm_open d_gdbm_open - eval $inlibc - case "$d_gdbm_open" in - $undef) - t_gdbm="$undef" - echo "We won't be including " - ;; - esac - ;; -esac -val="$t_gdbm" -set i_gdbm -eval $setvar - echo " " echo "Looking for extensions..." >&4 : If we are using the old config.sh, known_extensions may contain @@ -20686,24 +21018,24 @@ nonxs_extensions='' : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness find_extensions=' for xxx in *; do - case "$xxx" in - DynaLoader|dynaload) ;; - *) - if $test -f $xxx/$xxx.xs; then - known_extensions="$known_extensions $1$xxx"; - elif $test -f $xxx/Makefile.PL; then - nonxs_extensions="$nonxs_extensions $1$xxx"; - else - if $test -d $xxx -a $# -lt 10; then - set $1$xxx/ $*; - cd "$xxx"; - eval $find_extensions; - cd ..; - shift; - fi; - fi - ;; - esac; + case "$xxx" in + DynaLoader|dynaload) ;; + *) + if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then + known_extensions="$known_extensions $1$xxx"; + elif $test -f $xxx/Makefile.PL; then + nonxs_extensions="$nonxs_extensions $1$xxx"; + else + if $test -d $xxx -a $# -lt 10; then + set $1$xxx/ $*; + cd "$xxx"; + eval $find_extensions; + cd ..; + shift; + fi; + fi + ;; + esac; done' tdir=`pwd` cd "$rsrc/ext" @@ -20714,12 +21046,14 @@ eval $find_extensions # recursive find above (and adding in general recursive finding breaks # SDBM_File/sdbm). A.D. 10/25/2001. known_extensions="$known_extensions threads/shared" -set X $nonxs_extensions -shift -nonxs_extensions="$*" set X $known_extensions shift known_extensions="$*" +# Ditto for IO/Compress/Base and IO/Compress/Zlib +nonxs_extensions="$nonxs_extensions IO/Compress/Base IO/Compress/Zlib" +set X $nonxs_extensions +shift +nonxs_extensions="$*" cd "$tdir" : Now see which are supported on this system. @@ -20732,12 +21066,12 @@ for xxx in $known_extensions ; do esac ;; GDBM_File|gdbm_fil) - case "$i_gdbm" in + case "$i_gdbm" in $define) avail_ext="$avail_ext $xxx" ;; esac ;; I18N/Langinfo|i18n_lan) - case "$i_langinfo$d_nl_langinfo" in + case "$i_langinfo$d_nl_langinfo" in $define$define) avail_ext="$avail_ext $xxx" ;; esac ;; @@ -20755,7 +21089,7 @@ for xxx in $known_extensions ; do ;; esac ;; - ODBM_File|odbm_fil) + ODBM_File|odbm_fil) case "${i_dbm}${i_rpcsvcdbm}" in *"${define}"*) case "$osname-$use64bitint" in @@ -20780,7 +21114,7 @@ for xxx in $known_extensions ; do esac ;; Socket|socket) - case "$d_socket" in + case "$d_socket" in true|$define|y) case "$osname" in beos) ;; # not unless BONE @@ -20791,7 +21125,7 @@ for xxx in $known_extensions ; do ;; Sys/Syslog|sys/syslog) : XXX syslog requires socket - case "$d_socket" in + case "$d_socket" in true|$define|y) avail_ext="$avail_ext $xxx" ;; esac ;; @@ -20803,6 +21137,11 @@ for xxx in $known_extensions ; do esac esac ;; + Win32*) + case "$osname" in + cygwin) avail_ext="$avail_ext $xxx" ;; + esac + ;; XS/APItest|xs/apitest) # This is just for testing. Skip it unless we have dynamic loading. @@ -20832,7 +21171,7 @@ for xxx in $known_extensions ; do ;; IPC/SysV|ipc/sysv) : XXX Do we need a useipcsysv variable here - case "${d_msg}${d_sem}${d_shm}" in + case "${d_msg}${d_sem}${d_shm}" in *"${define}"*) avail_ext="$avail_ext $xxx" ;; esac ;; @@ -20922,11 +21261,11 @@ EOM previous) if test X"$dynamic_ext" != X"$avail_ext"; then $cat <