[vlc-commits] Mark other symbols as hidden

Rémi Denis-Courmont git at videolan.org
Sat May 7 18:41:57 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat May  7 19:38:42 2011 +0300| [9887eeccca78880aab56ac1c0bfe28d8716646bc] | committer: Rémi Denis-Courmont

Mark other symbols as hidden

Unfortunately, libtool is yet incapable of doing marking symbols as
hidden (not exported) at compilation time.  So lets do it manually.
According to the GCC documentation, this allow some compile-time
optimizations depending on the platform.
This was already done by Damien earlier (and removed during the
plugin headers cleanup).

The check is disabled on Windows, as the compiler accepts the flag,
but generates lots of warnings during compilation.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9887eeccca78880aab56ac1c0bfe28d8716646bc
---

 configure.ac |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index c851043..2f436af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1036,6 +1036,23 @@ AS_IF([test "${enable_coverage}" != "no"], [
   LDFLAGS_save="${LDFLAGS}"
 ])
 
+AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"], [
+  AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
+                 [ac_cv_c_visibility_hidden], [
+    CFLAGS="${CFLAGS_save} -ffast-math"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
+      ac_cv_c_visibility_hidden=yes
+    ], [
+      ac_cv_c_visibility_hidden=no
+    ])
+  ])
+  AS_IF([test "${ac_cv_c_visibility_hidden}" != "no"], [
+    CFLAGS="${CFLAGS} -fvisibility=hidden"
+    CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
+    OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
+  ])
+])
+
 VLC_SAVE_FLAGS
 
 dnl



More information about the vlc-commits mailing list