diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-08-24 11:37:46 +0000 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-08-24 11:37:46 +0000 |
commit | 98d3f2d41c3637938b4c0c33bde93e9d9d9d905a (patch) | |
tree | 805d4fd83b8f53eee386061f2f9094ac9bdc1b79 | |
parent | c3cd3a1c4660e96208fc5987056fc76d0a7e09e0 (diff) | |
download | libmicrohttpd-98d3f2d41c3637938b4c0c33bde93e9d9d9d905a.tar.gz libmicrohttpd-98d3f2d41c3637938b4c0c33bde93e9d9d9d905a.zip |
configure.ac: improved compiler "inline" keyword detection
-rw-r--r-- | configure.ac | 14 |
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 | ||
103 | AX_CHECK_COMPILE_FLAG([[-Werror=attributes]], | ||
104 | [[errattr_CFLAGS="-Werror=attributes"]], | ||
105 | [[errattr_CFLAGS=""]], [], []) | ||
103 | AC_MSG_CHECKING([[for function inline keywords suppoted by $CC]]) | 106 | AC_MSG_CHECKING([[for function inline keywords suppoted by $CC]]) |
104 | save_CFLAGS="$CFLAGS" | 107 | save_CFLAGS="$CFLAGS" |
105 | AX_APPEND_FLAG([[-Werror=attributes]]) | 108 | CFLAGS="$CFLAGS $errattr_CFLAGS" |
106 | inln_prfx="none" | 109 | inln_prfx="none" |
107 | # Prefer always inline functions | 110 | # Prefer always inline functions |
108 | for inln_prfx_chk in "inline __attribute__((always_inline))" __forceinline inline __inline__ __inline _inline _Inline; do | 111 | for 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( |