|
1 | 1 | # Macros to detect C compiler features
|
2 |
| -# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.9 2003/10/25 15:32:11 petere Exp $ |
| 2 | +# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.10 2003/11/01 20:48:51 petere Exp $ |
3 | 3 |
|
4 | 4 |
|
5 | 5 | # PGAC_C_SIGNED
|
@@ -149,3 +149,43 @@ CFLAGS=$pgac_save_CFLAGS
|
149 | 149 | if test "$ac_env_CFLAGS_set" != set; then
|
150 | 150 | CFLAGS="$CFLAGS $pgac_cv_prog_cc_no_strict_aliasing"
|
151 | 151 | fi])# PGAC_PROG_CC_NO_STRICT_ALIASING
|
| 152 | + |
| 153 | + |
| 154 | +# The below backpatches the following Autoconf change: |
| 155 | +# |
| 156 | +# 2002-03-28 Kevin Ryde <user42@zip.com.au> |
| 157 | +# |
| 158 | +# * lib/autoconf/c.m4 (AC_C_INLINE): Test with a typedef return value, |
| 159 | +# to avoid versions of HP C which don't allow that. |
| 160 | +# |
| 161 | +# When we upgrade to Autoconf >= 2.53a then we can drop this and rely |
| 162 | +# on the standard macro. |
| 163 | + |
| 164 | +# AC_C_INLINE |
| 165 | +# ----------- |
| 166 | +# Do nothing if the compiler accepts the inline keyword. |
| 167 | +# Otherwise define inline to __inline__ or __inline if one of those work, |
| 168 | +# otherwise define inline to be empty. |
| 169 | +AC_DEFUN([AC_C_INLINE], |
| 170 | +[AC_REQUIRE([AC_PROG_CC_STDC])dnl |
| 171 | +AC_CACHE_CHECK([for inline], ac_cv_c_inline, |
| 172 | +[ac_cv_c_inline=no |
| 173 | +for ac_kw in inline __inline__ __inline; do |
| 174 | + AC_COMPILE_IFELSE([AC_LANG_SOURCE( |
| 175 | +[#ifndef __cplusplus |
| 176 | +typedef int foo_t; |
| 177 | +static $ac_kw foo_t static_foo () {return 0; } |
| 178 | +$ac_kw int foo () {return 0; } |
| 179 | +#endif |
| 180 | +])], |
| 181 | + [ac_cv_c_inline=$ac_kw; break]) |
| 182 | +done |
| 183 | +]) |
| 184 | +case $ac_cv_c_inline in |
| 185 | + inline | yes) ;; |
| 186 | + no) AC_DEFINE(inline,, |
| 187 | + [Define as `__inline' if that's what the C compiler calls it, |
| 188 | + or to nothing if it is not supported.]) ;; |
| 189 | + *) AC_DEFINE_UNQUOTED(inline, $ac_cv_c_inline) ;; |
| 190 | +esac |
| 191 | +])# AC_C_INLINE |
0 commit comments