ref: 4c9a007251ca2589d34e3de607ae2835b54acf48
parent: 4d108fc37a37e9f851340ada51ff301cf2b5a315
author: Jean-Marc Valin <[email protected]>
date: Tue Dec 23 04:53:36 EST 2008
Test whether the compiler supports -fvisibility=hidden
--- a/configure.ac
+++ b/configure.ac
@@ -113,9 +113,18 @@
AC_DEFINE([ENABLE_ASSERTIONS], , [Assertions])
fi])
+saved_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fvisibility=hidden"
+AC_MSG_CHECKING([if ${CXX} supports -fvisibility=hidden])
+AC_COMPILE_IFELSE([char foo;],
+ [ AC_MSG_RESULT([yes])
+ SYMBOL_VISIBILITY="-fvisibility=hidden" ],
+ AC_MSG_RESULT([no]))
+CFLAGS="$saved_CFLAGS $SYMBOL_VISIBILITY"
+AC_SUBST(SYMBOL_VISIBILITY)
+
if test $ac_cv_c_compiler_gnu = yes ; then
- CFLAGS="$CFLAGS -fvisibility=hidden -W -Wstrict-prototypes -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wno-parentheses -Wno-unused-parameter -Wno-sign-compare"
- #CFLAGS="$CFLAGS -fvisibility=hidden -W -Wstrict-prototypes -Wmissing-prototypes -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wno-parentheses"
+ CFLAGS="$CFLAGS -W -Wstrict-prototypes -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wno-parentheses -Wno-unused-parameter -Wno-sign-compare"
fi
AC_C99_FUNC_LRINTF