Check for compiler support of -fvisibility and -fvisibility-inlines-hidden

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10243 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Lauri Kasanen 2014-08-22 11:33:36 +00:00
parent ee118334be
commit 1af2035e91

View File

@ -255,8 +255,41 @@ if test x$enable_shared = xyes; then
IMGDSONAME="libfltk_images.so.$FL_API_VERSION"
CAIRODSONAME="libfltk_cairo.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
OPTIM="$OPTIM -fvisibility=hidden"
CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
# See if the compiler supports -fvisibility...
AC_CACHE_CHECK([if the compiler supports -fvisibility],
ac_cv_cxx_fvisibility, [
OLDCXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE(,,
ac_cv_cxx_fvisibility=yes,
ac_cv_cxx_fvisibility=no)
CXXFLAGS="$OLDCXXFLAGS"
AC_LANG_RESTORE
])
if test x"$ac_cv_cxx_fvisibility" = xyes; then
OPTIM="$OPTIM -fvisibility=hidden"
fi
# See if the compiler supports -fvisibility-inlines-hidden...
AC_CACHE_CHECK([if the compiler supports -fvisibility-inlines-hidden],
ac_cv_cxx_fvisibility_inlines, [
OLDCXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE(,,
ac_cv_cxx_fvisibility_inlines=yes,
ac_cv_cxx_fvisibility_inlines=no)
CXXFLAGS="$OLDCXXFLAGS"
AC_LANG_RESTORE
])
if test x"$ac_cv_cxx_fvisibility_inlines" = xyes; then
CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
fi
if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/usr/lib64"; then
DSOLINK="-Wl,-rpath,$libdir"
fi