Blame m4/inline.m4

Packit Service fdd496
# inline.m4 serial 4
Packit Service fdd496
dnl Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc.
Packit Service fdd496
dnl This file is free software; the Free Software Foundation
Packit Service fdd496
dnl gives unlimited permission to copy and/or distribute it,
Packit Service fdd496
dnl with or without modifications, as long as this notice is preserved.
Packit Service fdd496
Packit Service fdd496
dnl Test for the 'inline' keyword or equivalent.
Packit Service fdd496
dnl Define 'inline' to a supported equivalent, or to nothing if not supported,
Packit Service fdd496
dnl like AC_C_INLINE does.  Also, define HAVE_INLINE if 'inline' or an
Packit Service fdd496
dnl equivalent is effectively supported, i.e. if the compiler is likely to
Packit Service fdd496
dnl drop unused 'static inline' functions.
Packit Service fdd496
AC_DEFUN([gl_INLINE],
Packit Service fdd496
[
Packit Service fdd496
  AC_REQUIRE([AC_C_INLINE])
Packit Service fdd496
  AC_CACHE_CHECK([whether the compiler generally respects inline],
Packit Service fdd496
    [gl_cv_c_inline_effective],
Packit Service fdd496
    [if test $ac_cv_c_inline = no; then
Packit Service fdd496
       gl_cv_c_inline_effective=no
Packit Service fdd496
     else
Packit Service fdd496
       dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is
Packit Service fdd496
       dnl specified.
Packit Service fdd496
       dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result
Packit Service fdd496
       dnl depends on optimization flags, which can be in CFLAGS.
Packit Service fdd496
       dnl (AC_EGREP_CPP looks only at the CPPFLAGS.)
Packit Service fdd496
       AC_COMPILE_IFELSE(
Packit Service fdd496
         [AC_LANG_PROGRAM([[]],
Packit Service fdd496
           [[#ifdef __NO_INLINE__
Packit Service fdd496
               #error "inline is not effective"
Packit Service fdd496
             #endif]])],
Packit Service fdd496
         [gl_cv_c_inline_effective=yes],
Packit Service fdd496
         [gl_cv_c_inline_effective=no])
Packit Service fdd496
     fi
Packit Service fdd496
    ])
Packit Service fdd496
  if test $gl_cv_c_inline_effective = yes; then
Packit Service fdd496
    AC_DEFINE([HAVE_INLINE], [1],
Packit Service fdd496
      [Define to 1 if the compiler supports one of the keywords
Packit Service fdd496
       'inline', '__inline__', '__inline' and effectively inlines
Packit Service fdd496
       functions marked as such.])
Packit Service fdd496
  fi
Packit Service fdd496
])