diff options
author | Peter Eisentraut | 2003-11-01 20:48:51 +0000 |
---|---|---|
committer | Peter Eisentraut | 2003-11-01 20:48:51 +0000 |
commit | 801427abc2924195b35be19abe4f64dbbea82263 (patch) | |
tree | 80fa9c8c1d3a902959d82457f22a23a4ecea0a8f /config/c-compiler.m4 | |
parent | 0543af2f12ce921074815e16f6b3a4168f41533b (diff) |
Unset CFLAGS before reading template. This should be more robust.
When --enable-debug is used, then the default CFLAGS for non-GCC is just
-g without -O.
Backpatch enhancement of Autoconf inline test that detects problems with
the HP C compiler.
Diffstat (limited to 'config/c-compiler.m4')
-rw-r--r-- | config/c-compiler.m4 | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/config/c-compiler.m4 b/config/c-compiler.m4 index 1649b105aa6..d5fdd2ff9e3 100644 --- a/config/c-compiler.m4 +++ b/config/c-compiler.m4 @@ -1,5 +1,5 @@ # Macros to detect C compiler features -# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.9 2003/10/25 15:32:11 petere Exp $ +# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.10 2003/11/01 20:48:51 petere Exp $ # PGAC_C_SIGNED @@ -149,3 +149,43 @@ CFLAGS=$pgac_save_CFLAGS if test "$ac_env_CFLAGS_set" != set; then CFLAGS="$CFLAGS $pgac_cv_prog_cc_no_strict_aliasing" fi])# PGAC_PROG_CC_NO_STRICT_ALIASING + + +# The below backpatches the following Autoconf change: +# +# 2002-03-28 Kevin Ryde <user42@zip.com.au> +# +# * lib/autoconf/c.m4 (AC_C_INLINE): Test with a typedef return value, +# to avoid versions of HP C which don't allow that. +# +# When we upgrade to Autoconf >= 2.53a then we can drop this and rely +# on the standard macro. + +# AC_C_INLINE +# ----------- +# Do nothing if the compiler accepts the inline keyword. +# Otherwise define inline to __inline__ or __inline if one of those work, +# otherwise define inline to be empty. +AC_DEFUN([AC_C_INLINE], +[AC_REQUIRE([AC_PROG_CC_STDC])dnl +AC_CACHE_CHECK([for inline], ac_cv_c_inline, +[ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + AC_COMPILE_IFELSE([AC_LANG_SOURCE( +[#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw int foo () {return 0; } +#endif +])], + [ac_cv_c_inline=$ac_kw; break]) +done +]) +case $ac_cv_c_inline in + inline | yes) ;; + no) AC_DEFINE(inline,, + [Define as `__inline' if that's what the C compiler calls it, + or to nothing if it is not supported.]) ;; + *) AC_DEFINE_UNQUOTED(inline, $ac_cv_c_inline) ;; +esac +])# AC_C_INLINE |