From 3a22524a0a88b4aa14959e087dc86a8e7d0585c8 Mon Sep 17 00:00:00 2001 From: Damien Fouilleul Date: Tue, 31 Jul 2007 13:00:20 +0000 Subject: [PATCH] libtool: prefer -export-dynamic over -export-regex, -export-symbols if compiler already supports symbol visibility (gcc 4.x), this should also deprecate libvlc.sym --- bootstrap | 8 ++++++-- configure.ac | 2 ++ src/Makefile.am | 14 +++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/bootstrap b/bootstrap index 01d0d11fe6..f123d49824 100755 --- a/bootstrap +++ b/bootstrap @@ -224,8 +224,12 @@ include Modules.am LTLIBVLC = -L\$(top_builddir)/src -lvlc AM_LDFLAGS = -rpath '\$(libvlcdir)' -avoid-version \\ - -module -no-undefined -shrext \$(LIBEXT) \\ - -export-symbol-regex ^\$(VLC_ENTRY)\$\$ + -module -no-undefined -shrext \$(LIBEXT) +if HAVE_COMPILER_EXPORT +AM_LDFLAGS += -export-dynamic +else +AM_LDFLAGS += -export-symbol-regex ^\$(VLC_ENTRY)\$\$ +endif AM_LIBADD = \$(LTLIBVLC) all: all-modules diff --git a/configure.ac b/configure.ac index 55377842cb..7df25ebace 100644 --- a/configure.ac +++ b/configure.ac @@ -1058,6 +1058,8 @@ if test "${ac_cv_c_visibility_hidden}" != "no"; then VLC_ADD_CFLAGS([libvlc plugin],[-fvisibility=hidden]) fi +AM_CONDITIONAL(HAVE_COMPILER_EXPORT, [test "$SYS" = "mingw32" -o "${ac_cv_c_visibility_hidden}" != "no"]) + dnl Check for -fvisibility-inlines-hidden (breaks x86_64 linkers) dnl AC_LANG_PUSH(C++) dnl AC_CACHE_CHECK([if \$CXX accepts -fvisibility-inlines-hidden], diff --git a/src/Makefile.am b/src/Makefile.am index cdbe962700..a0e342ae58 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -110,7 +110,13 @@ libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc` libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc` libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags libvlc` libvlc_la_LDFLAGS = $(AM_LDFLAGS) `$(VLC_CONFIG) --libs libvlc` \ - -export-symbols $(srcdir)/libvlc.sym -version-info 1:0:0 + -version-info 1:0:0 +if HAVE_COMPILER_EXPORT +libvlc_la_LDFLAGS += -export-dynamic +else +libvlc_la_LDFLAGS += -export-symbols $(srcdir)/libvlc.sym +endif + libvlc_la_DEPENDENCIES = libvlc.sym libvlc_control_la_SOURCES = $(SOURCES_libvlc_control) @@ -118,6 +124,12 @@ libvlc_control_la_LIBADD = libvlc.la libvlc_control_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc` libvlc_control_la_LDFLAGS = $(AM_LDFLAGS) -export-symbols-regex '^_?(libvlc|mediacontrol)_.*' \ -version-info 0:0:0 +if HAVE_COMPILER_EXPORT +libvlc_control_la_LDFLAGS += -export-dynamic +else +libvlc_control_la_LDFLAGS += -export-symbols-regex '^_?(libvlc|mediacontrol)_.*' +endif + EXTRA_libvlc_la_SOURCES = \ $(SOURCES_libvlc_beos) \