diff options
| author | Lauri Kasanen <cand@gmx.com> | 2014-08-22 19:44:27 +0000 |
|---|---|---|
| committer | Lauri Kasanen <cand@gmx.com> | 2014-08-22 19:44:27 +0000 |
| commit | 95ba2900f3bc550ad98165e964f5d09b91c05d4f (patch) | |
| tree | 4bc54e2d2bef4a1ef30563d88610cf8224caca0f | |
| parent | 7944cc9a5757cce30c6d71838f9bf20ab27d09fb (diff) | |
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
| -rw-r--r-- | configure.in | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/configure.in b/configure.in index 822478679..631d1e4b6 100644 --- a/configure.in +++ b/configure.in @@ -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*) |
