1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- AC_DEFUN(AM_PROG_CC_STDC,
- [AC_REQUIRE([AC_PROG_CC])
- AC_BEFORE([$0], [AC_C_INLINE])
- AC_BEFORE([$0], [AC_C_CONST])
- dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
- dnl a magic option to avoid problems with ANSI preprocessor commands
- dnl like #elif.
- dnl FIXME: can't do this because then AC_AIX won't work due to a
- dnl circular dependency.
- dnl AC_BEFORE([$0], [AC_PROG_CPP])
- AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
- AC_CACHE_VAL(am_cv_prog_cc_stdc,
- [am_cv_prog_cc_stdc=no
- ac_save_CC="$CC"
- # Don't try gcc -ansi; that turns off useful extensions and
- for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
- do
- CC="$ac_save_CC $ac_arg"
- AC_TRY_COMPILE(
- [
- 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);};
- 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"
- ])
- if test -z "$am_cv_prog_cc_stdc"; then
- AC_MSG_RESULT([none needed])
- else
- AC_MSG_RESULT($am_cv_prog_cc_stdc)
- fi
- case "x$am_cv_prog_cc_stdc" in
- x|xno) ;;
- *) CC="$CC $am_cv_prog_cc_stdc" ;;
- esac
- ])
|