From: H.Merijn Brand Date: Mon, 22 May 2006 17:37:33 +0000 (+0000) Subject: Re-generation after backports of X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a2d23ec243cb32ad5ac90ab8101b59ec7d77e541;p=p5sagit%2Fp5-mst-13.2.git Re-generation after backports of #28188 Only ask about MAD for 5.9.0 and greater. Otherwise silently #28189 A Configure probe for C99 variadic macros, based on code from #28202 Take advantage of the bug that binexp ignores the Configure #28263 Oops. Fix bad #! lines when not using userelocatableinc One small cleanup fix added. Some small re-ordering. Some whitespace. p4raw-id: //depot/perl@28283 --- diff --git a/Configure b/Configure index 831ef12..8fee5eb 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 Mon May 22 19:21:39 CEST 2006 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ < 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 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` @@ -19008,104 +19152,6 @@ rp="What is the type used for file modes for system calls (e.g. fchmod())?" set mode_t modetype int stdio.h sys/types.h eval $typedef_ask -: 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); -} -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 @@ -19170,46 +19216,6 @@ EOCP ;; esac -: 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 - ;; - *) - echo "You don't have and , so not checking for C99 variadic macros." >&4 - d_c99_variadic_macros="$undef" - ;; -esac - : see what type is used for size_t rp="What is the type used for the length parameter for string functions?" set size_t sizetype 'unsigned int' stdio.h sys/types.h @@ -21304,6 +21310,7 @@ d_bsdsetpgrp='$d_bsdsetpgrp' d_builtin_choose_expr='$d_builtin_choose_expr' d_builtin_expect='$d_builtin_expect' d_bzero='$d_bzero' +d_c99_variadic_macros='$d_c99_variadic_macros' d_casti32='$d_casti32' d_castneg='$d_castneg' d_charvspr='$d_charvspr' @@ -21322,7 +21329,6 @@ d_csh='$d_csh' d_ctermid_r='$d_ctermid_r' d_ctime_r='$d_ctime_r' d_cuserid='$d_cuserid' -d_c99_variadic_macros='$d_c99_variadic_macros' d_dbl_dig='$d_dbl_dig' d_dbminitproto='$d_dbminitproto' d_difftime='$d_difftime' diff --git a/Porting/Glossary b/Porting/Glossary index 767db1c..43723bb 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -482,6 +482,11 @@ d_bzero (d_bzero.U): This variable conditionally defines the HAS_BZERO symbol if the bzero() routine is available to set memory to 0. +d_c99_variadic_macros (d_c99_variadic.U): + This variable conditionally defines the HAS_C99_VARIADIC_MACROS + symbol, which indicates to the C program that C99 variadic macros + are available. + d_casti32 (d_casti32.U): This variable conditionally defines CASTI32, which indicates whether the C compiler can cast large floats to 32-bit ints. @@ -558,11 +563,6 @@ d_ctime_r (d_ctime_r.U): which indicates to the C program that the ctime_r() routine is available. -d_c99_variadic_macros (d_c99_variadic_macros.U): - This variable conditionally defines the HAS_C99_VARIADIC_MACROS - symbol, which indicates to the C program that C99 variadic macros - are available. - d_cuserid (d_cuserid.U): This variable conditionally defines the HAS_CUSERID symbol, which indicates to the C program that the cuserid() routine is available diff --git a/Porting/config.sh b/Porting/config.sh index 2ff22ce..9cf8297 100644 --- a/Porting/config.sh +++ b/Porting/config.sh @@ -126,6 +126,7 @@ d_bsdsetpgrp='undef' d_builtin_choose_expr='define' d_builtin_expect='undef' d_bzero='define' +d_c99_variadic_macros='define' d_casti32='undef' d_castneg='define' d_charvspr='define' diff --git a/config_h.SH b/config_h.SH index ee4c292..95b8230 100644 --- a/config_h.SH +++ b/config_h.SH @@ -1198,6 +1198,11 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un #$d_builtin_expect HAS_BUILTIN_EXPECT /**/ #$d_builtin_choose_expr HAS_BUILTIN_CHOOSE_EXPR /**/ +/* HAS_C99_VARIADIC_MACROS: + * If defined, the compiler supports C99 variadic macros. + */ +#$d_c99_variadic_macros HAS_C99_VARIADIC_MACROS /**/ + /* CASTI32: * This symbol is defined if the C compiler can cast negative * or large floating point numbers to 32-bit ints. @@ -4421,10 +4426,4 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un #endif #endif - -/* HAS_C99_VARIADIC_MACROS: - * If defined, the compiler supports C99 variadic macros. - */ -#$d_c99_variadic_macros HAS_C99_VARIADIC_MACROS /**/ - !GROK!THIS!