aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-08-24 11:37:46 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-08-24 11:37:46 +0000
commit98d3f2d41c3637938b4c0c33bde93e9d9d9d905a (patch)
tree805d4fd83b8f53eee386061f2f9094ac9bdc1b79
parentc3cd3a1c4660e96208fc5987056fc76d0a7e09e0 (diff)
downloadlibmicrohttpd-98d3f2d41c3637938b4c0c33bde93e9d9d9d905a.tar.gz
libmicrohttpd-98d3f2d41c3637938b4c0c33bde93e9d9d9d905a.zip
configure.ac: improved compiler "inline" keyword detection
-rw-r--r--configure.ac14
1 files changed, 12 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 6b62694d..af1ebf07 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,13 +100,23 @@ AC_CHECK_TYPE([_Bool],
100 ]]) 100 ]])
101 ]) 101 ])
102 102
103AX_CHECK_COMPILE_FLAG([[-Werror=attributes]],
104 [[errattr_CFLAGS="-Werror=attributes"]],
105 [[errattr_CFLAGS=""]], [], [])
103AC_MSG_CHECKING([[for function inline keywords suppoted by $CC]]) 106AC_MSG_CHECKING([[for function inline keywords suppoted by $CC]])
104save_CFLAGS="$CFLAGS" 107save_CFLAGS="$CFLAGS"
105AX_APPEND_FLAG([[-Werror=attributes]]) 108CFLAGS="$CFLAGS $errattr_CFLAGS"
106inln_prfx="none" 109inln_prfx="none"
107# Prefer always inline functions 110# Prefer always inline functions
108for inln_prfx_chk in "inline __attribute__((always_inline))" __forceinline inline __inline__ __inline _inline _Inline; do 111for inln_prfx_chk in InlineWithAttr __forceinline inline __inline__ __inline _inline _Inline; do
109 # Try to link to avoid "symbol undefined" problems at build time 112 # Try to link to avoid "symbol undefined" problems at build time
113 AS_IF([[test "x$inln_prfx_chk" = "xInlineWithAttr"]],
114 [
115 AS_IF([[test "x$errattr_CFLAGS" = "x"]],
116 [[ # Skip test with attribute as negative result can't be detected
117 inln_prfx_chk="__forceinline" # use next value
118 ]],[[inln_prfx_chk="inline __attribute__((always_inline))"]])
119 ])
110 AC_LINK_IFELSE( 120 AC_LINK_IFELSE(
111 [ 121 [
112 AC_LANG_PROGRAM( 122 AC_LANG_PROGRAM(