configure: Don't use -rdynamic with the LLVM toolchain
authorMartin Willi <martin@revosec.ch>
Thu, 8 May 2014 14:28:50 +0000 (16:28 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Jun 2014 13:53:13 +0000 (15:53 +0200)
configure.ac

index 6701777..6e83614 100644 (file)
@@ -750,7 +750,6 @@ AC_COMPILE_IFELSE(
        [
                AC_MSG_RESULT([no])
                openssl_lib=crypto
-               AC_SUBST(PLUGIN_CFLAGS, [-rdynamic])
        ]
 )
 AC_SUBST(OPENSSL_LIB, [-l$openssl_lib])
@@ -767,6 +766,26 @@ AC_COMPILE_IFELSE(
        [AC_MSG_RESULT([no]); AC_MSG_ERROR([__attribute__((packed)) does not work])]
 )
 
+AC_MSG_CHECKING([clang])
+AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+               [], [[
+                #ifndef __clang__
+                # error not using LLVM clang
+                #endif
+               ]])],
+       [
+               AC_MSG_RESULT([yes])
+       ],
+       [
+               AC_MSG_RESULT([no])
+               # GCC, but not MinGW requires -rdynamic for plugins
+               if test x$windows != xtrue; then
+                       AC_SUBST(PLUGIN_CFLAGS, [-rdynamic])
+               fi
+       ]
+)
+
 if test x$printf_hooks = xvstr; then
        AC_CHECK_LIB([vstr],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])],[])
        AC_DEFINE([USE_VSTR], [], [use Vstr string library for printf hooks])