Skip to content

Commit b77ca22

Browse files
committed
build: use AX_CHECK_COMPILE_FLAG to test for -fvisibility=hidden
1 parent 6bbafb9 commit b77ca22

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

configure.ac

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ AC_LANG([C++])
1414

1515
AC_PATH_PROG(CCACHE,ccache)
1616

17-
saved_CXXFLAGS="$CXXFLAGS"
18-
CXXFLAGS="-fvisibility=hidden $CXXFLAGS"
19-
AC_MSG_CHECKING([if ${CXX} supports -fvisibility=hidden])
20-
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],
21-
[ AC_MSG_RESULT([yes]) ],
22-
[ AC_MSG_RESULT([no])
23-
CXXFLAGS="$saved_CXXFLAGS"
24-
])
25-
2617
AC_ARG_ENABLE([ccache],
2718
[AS_HELP_STRING([--disable-ccache],
2819
[do not use ccache for building (default is to use if found)])],
@@ -111,6 +102,8 @@ case $host in
111102
esac
112103

113104
AX_CHECK_COMPILE_FLAG([-Wall],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"],,[[$CXXFLAG_WERROR]])
105+
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[CXXFLAGS="$CXXFLAGS -fvisibility=hidden"],[],[$CXXFLAG_WERROR])
106+
114107
## Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
115108
## unknown options if any other warning is produced. Test the -Wfoo case, and
116109
## set the -Wno-foo case if it works.

0 commit comments

Comments
 (0)