summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2008-01-26 14:03:43 +0000
committerDaniel Drake <dsd@gentoo.org>2008-01-26 14:03:43 +0000
commit37b7f9a112eb1441d352467f661205b8872d0553 (patch)
tree464ad6fda3f10e9f33bfa22e0aed17d36f3b8aab /configure.ac
parente3a09ca0b9cb6f46d54a0130f678c6097240a2bd (diff)
downloadlibusb-37b7f9a112eb1441d352467f661205b8872d0553.tar.gz
Only use -fgnu89-inline when supported
J F pointed out that this option only works on gcc 4.3 and newer.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac8
1 files changed, 7 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 191f8e9..660ca2a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,8 +40,14 @@ AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build],
[build_examples='no'])
AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"])
+# Restore gnu89 inline semantics on gcc 4.3 and newer
+saved_cflags="$CFLAGS"
+CFLAGS="$CFLAGS -fgnu89-inline"
+AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), inline_cflags="-fgnu89-inline", inline_cflags="")
+CFLAGS="$saved_cflags"
+
AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility])
-AM_CFLAGS="-std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow"
+AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow"
AC_SUBST(AM_CFLAGS)
AC_CONFIG_FILES([libusb-1.0.pc] [Makefile] [libusb/Makefile] [examples/Makefile])