2 dnl Copyright (C) 2006 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 dnl Test for the 'inline' keyword or equivalent.
8 dnl Define 'inline' to a supported equivalent, or to nothing if not supported,
9 dnl like AC_C_INLINE does. Also, define HAVE_INLINE if 'inline' or an
10 dnl equivalent is effectively supported, i.e. if the compiler is likely to
11 dnl drop unused 'static inline' functions.
14 AC_REQUIRE([AC_C_INLINE])
15 AC_CACHE_CHECK([whether the compiler generally respects inline],
16 [gl_cv_c_inline_effective],
17 [if test $ac_cv_c_inline = no; then
18 gl_cv_c_inline_effective=no
20 dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is
22 AC_EGREP_CPP([bummer], [
26 ], [gl_cv_c_inline_effective=no], [gl_cv_c_inline_effective=yes])
29 if test $gl_cv_c_inline_effective = yes; then
30 AC_DEFINE([HAVE_INLINE], 1,
31 [Define to 1 if the compiler supports one of the keywords
32 'inline', '__inline__', '__inline' and effectively inlines
33 functions marked as such.])