mirror of
https://github.com/fltk/fltk.git
synced 2026-05-22 15:22:34 +08:00
Use the -fvisibility checks properly; needed to move ac_prog_cc and _cxx up in the file.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10246 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+39
-4
@@ -188,6 +188,10 @@ fi
|
||||
|
||||
AC_ARG_ENABLE(gl, [ --enable-gl turn on OpenGL support [default=yes]])
|
||||
|
||||
dnl Find commands...
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
|
||||
AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [default=no]])
|
||||
if test x$enable_shared = xyes; then
|
||||
PICFLAG=1
|
||||
@@ -255,8 +259,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
|
||||
@@ -357,8 +394,6 @@ case $host_os in
|
||||
esac
|
||||
|
||||
dnl Find commands...
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_PROG_INSTALL
|
||||
case $host_os in
|
||||
osf*)
|
||||
|
||||
Reference in New Issue
Block a user