summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-09-08 20:34:07 -0400
committerKristian Høgsberg <krh@bitplanet.net>2010-09-08 20:45:07 -0400
commit7b34fcc4874671dc92413fa1a091eafac4191cee (patch)
treec215874b28888ee0d253f7fc8a4c9ef82524d686 /configure.ac
parent7fc882643ce1c57fb8f60d8c5edd761eff404749 (diff)
configure: Enable -fvisibility=hidden for g++ as well
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac7
1 files changed, 7 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index a7ee0f5763..bf8feb6352 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,6 +155,13 @@ fi
if test "x$GXX" = xyes; then
CXXFLAGS="$CXXFLAGS -Wall"
+ # Enable -fvisibility=hidden if using a gcc that supports it
+ save_CXXFLAGS="$CXXFLAGS"
+ AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
+ CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
+ [CXXFLAGS="$save_CXXFLAGS" ; AC_MSG_RESULT([no])]);
+
# Work around aliasing bugs - developers should comment this out
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
fi