Mercurial > gnulib
changeset 27324:63e36f87e7a9
Use a command that uses $CC $CFLAGS, not $CPP, to test whether inline is
effective. From Jim.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 10 Nov 2006 14:37:40 +0000 |
parents | 80fd2720deb6 |
children | 3b09d2d0517a |
files | ChangeLog m4/inline.m4 |
diffstat | 2 files changed, 17 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Fri Nov 10 11:00:52 2006 +0000 +++ b/ChangeLog Fri Nov 10 14:37:40 2006 +0000 @@ -1,3 +1,9 @@ +2006-11-10 Jim Meyering <jim@meyering.net> + + * m4/inline.m4 (gl_INLINE): Check with the compiler, not cpp, so that + relevant options in CFLAGS (like -O, -fno-inline) are taken into + account. + 2006-11-10 Jim Meyering <jim@meyering.net> * modules/inline: New file/module.
--- a/m4/inline.m4 Fri Nov 10 11:00:52 2006 +0000 +++ b/m4/inline.m4 Fri Nov 10 14:37:40 2006 +0000 @@ -1,4 +1,4 @@ -# inline.m4 serial 2 +# inline.m4 serial 3 dnl Copyright (C) 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -19,11 +19,16 @@ else dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is dnl specified. - AC_EGREP_CPP([bummer], [ - #ifdef __NO_INLINE__ - bummer - #endif - ], [gl_cv_c_inline_effective=no], [gl_cv_c_inline_effective=yes]) + dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result + dnl depends on optimization flags, which can be in CFLAGS. + dnl (AC_EGREP_CPP looks only at the CPPFLAGS.) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], + [[#ifdef __NO_INLINE__ + #error "inline is not effective" + #endif]])], + [gl_cv_c_inline_effective=yes], + [gl_cv_c_inline_effective=no]) fi ]) if test $gl_cv_c_inline_effective = yes; then