diff options
author | Aaron Crane <arc@cpan.org> | 2017-10-12 18:05:57 +0200 |
---|---|---|
committer | Aaron Crane <arc@cpan.org> | 2017-10-21 16:52:05 +0100 |
commit | abaa7af6d89122e8180f976675a72244f6cf3f95 (patch) | |
tree | 53a08b0c3d1f391a00ee1e4a5f4eae52c0b3d557 /Configure | |
parent | edee246148d0f7e22ea026e09413d4bcc0cb51dd (diff) | |
download | perl-abaa7af6d89122e8180f976675a72244f6cf3f95.tar.gz |
Configure: assume C89 headers in need_va_copy probe
This matches a recent change to metaconfig.
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 254 |
1 files changed, 122 insertions, 132 deletions
@@ -21429,126 +21429,12 @@ 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 "<stdarg.h> found." >&4 - valstd="$define" -else - echo "<stdarg.h> NOT found." >&4 - valstd="$undef" -fi - -: see if varargs is available -echo " " -if $test `./findhdr varargs.h`; then - echo "<varargs.h> found." >&4 -else - echo "<varargs.h> NOT found, but that's ok (I hope)." >&4 -fi - -: set up the varargs testing programs -$cat > varargs.c <<EOP -#ifdef I_STDARG -#include <stdarg.h> -#endif -#ifdef I_VARARGS -#include <varargs.h> -#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 <<EOP -$startsh -if $cc -c $ccflags -D\$1 varargs.c >/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='' -val='' -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 " " - echo "*** WHOA THERE!!! ***" >&4 - echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4 - case "$knowitall" in - '') - echo " I'm giving up; maybe you can try again with a different compiler?" >&4 - exit 1 - ;; - esac -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 -"$define") - $cat >try.c <<EOCP +$cat >try.c <<EOCP #include <stdarg.h> #include <stdio.h> -#$i_stdlib I_STDLIB -#ifdef I_STDLIB #include <stdlib.h> -#endif #include <signal.h> int @@ -21580,28 +21466,23 @@ main(int ac, char **av) exit(0); } EOCP - set try - if eval $compile && $run ./try 2>&1 >/dev/null; then - case "`$run ./try`" in - "that's all right, then") - okay=yes - ;; - esac - fi - case "$okay" in - yes) echo "It seems that you don't need va_copy()." >&4 - need_va_copy="$undef" - ;; - *) echo "It seems that va_copy() or similar will be needed." >&4 - need_va_copy="$define" +set try +if eval $compile && $run ./try 2>&1 >/dev/null; then + case "`$run ./try`" in + "that's all right, then") + okay=yes ;; esac - $rm_try - ;; -*) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4 +fi +case "$okay" in +yes) echo "It seems that you don't need va_copy()." >&4 need_va_copy="$undef" ;; +*) echo "It seems that va_copy() or similar will be needed." >&4 + need_va_copy="$define" + ;; esac +$rm_try : see what type is used for size_t rp="What is the type used for the length parameter for string functions?" @@ -22993,6 +22874,115 @@ case "$usesitecustomize" in ;; esac +: see if stdarg is available +echo " " +if $test `./findhdr stdarg.h`; then + echo "<stdarg.h> found." >&4 + valstd="$define" +else + echo "<stdarg.h> NOT found." >&4 + valstd="$undef" +fi + +: see if varargs is available +echo " " +if $test `./findhdr varargs.h`; then + echo "<varargs.h> found." >&4 +else + echo "<varargs.h> NOT found, but that's ok (I hope)." >&4 +fi + +: set up the varargs testing programs +$cat > varargs.c <<EOP +#ifdef I_STDARG +#include <stdarg.h> +#endif +#ifdef I_VARARGS +#include <varargs.h> +#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 <<EOP +$startsh +if $cc -c $ccflags -D\$1 varargs.c >/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='' +val='' +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 " " + echo "*** WHOA THERE!!! ***" >&4 + echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4 + case "$knowitall" in + '') + echo " I'm giving up; maybe you can try again with a different compiler?" >&4 + exit 1 + ;; + esac +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 prototypes support variable argument declarations echo " " case "$prototype$i_stdarg" in |