From: Tom Tromey Date: Thu, 25 Sep 1997 05:44:17 +0000 (+0000) Subject: stdc fix from paul eggert X-Git-Tag: Release-1-2b~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6d7829f799645929fef3911c517cff6e5ba20a2;p=thirdparty%2Fautomake.git stdc fix from paul eggert --- diff --git a/ChangeLog b/ChangeLog index 6d6b516fd..e3bd8f053 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Sep 12 00:04:19 1997 Paul Eggert + + * m4/ccstdc.m4 (AM_PROG_CC_STDC): Don't look at __STDC__; + look only at whether function prototypes are supported. + Wed Sep 24 16:10:37 1997 Tom Tromey * Various: Put "-" before each `rm' line. This avoids a bug in diff --git a/THANKS b/THANKS index 5c5208135..7fdaec80b 100644 --- a/THANKS +++ b/THANKS @@ -42,6 +42,7 @@ Markku Rossi Michael Brantley Noah Friedman Nyul Laszlo +Paul Eggert Per Bothner Peter Mattis Phil Nelson diff --git a/automake.texi b/automake.texi index 0b5f256d4..ce6dbbbd0 100644 --- a/automake.texi +++ b/automake.texi @@ -1074,8 +1074,7 @@ variable @code{lispdir} to the full path to Emacs' site-lisp directory. If the C compiler in not in ANSI C mode by default, try to add an option to output variable @code{CC} to make it so. This macro tries various options that select ANSI C on some system or another. It considers the -compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and -handles function prototypes correctly. +compiler to be in ANSI C mode if it handles function prototypes correctly. If you use this macro, you should check after calling it whether the C compiler has been set to accept ANSI C; if not, the shell variable diff --git a/m4/ccstdc.m4 b/m4/ccstdc.m4 index 0ff3a1373..74e8c5e75 100644 --- a/m4/ccstdc.m4 +++ b/m4/ccstdc.m4 @@ -11,8 +11,7 @@ # If the C compiler in not in ANSI C mode by default, try to add an option # to output variable @code{CC} to make it so. This macro tries various # options that select ANSI C on some system or another. It considers the -# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and -# handles function prototypes correctly. +# compiler to be in ANSI C mode if it handles function prototypes correctly. # # If you use this macro, you should check after calling it whether the C # compiler has been set to accept ANSI C; if not, the shell variable @@ -39,18 +38,37 @@ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__ do CC="$ac_save_CC $ac_arg" AC_TRY_COMPILE( -[#if !defined(__STDC__) || __STDC__ != 1 -choke me -#endif -/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */ -#ifdef _SEQUENT_ -# include -# include -#endif -], [ +[#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} int test (int i, double x); struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);};], +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +], [ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; +], [am_cv_prog_cc_stdc="$ac_arg"; break]) done CC="$ac_save_CC"