From 07b372828b7b4b1337331ff16ebdab1482609e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 15 Jan 2008 16:49:29 +0100 Subject: Check if the linker supports --gc-sections, and if so use it for the plugins. This way the unused parts of internal copies of libraries can be get rid of by the linker. --- configure.ac | 3 +++ misc/Makefile.common | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 926620303..cdb196f79 100644 --- a/configure.ac +++ b/configure.ac @@ -480,6 +480,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int a; memset(&a, [warnflags="$warnflags -Wpointer-arith" AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) +CC_CHECK_LDFLAGS([-Wl,--gc-sections], [GCSECTIONS="-Wl,--gc-sections"]) +AC_SUBST([GCSECTIONS]) + dnl FreeBSD (et al.) does not complete linking for shared objects when pthreads dnl are requested, as different implementations are present; to avoid problems dnl use -Wl,-z,defs only for those platforms not behaving this way. diff --git a/misc/Makefile.common b/misc/Makefile.common index edafcea4b..447b558e2 100644 --- a/misc/Makefile.common +++ b/misc/Makefile.common @@ -3,7 +3,7 @@ XINE_LIB = $(top_builddir)/src/xine-engine/libxine.la xineincludedir = $(includedir)/xine xineplugdir = $(XINE_PLUGINDIR) -xineplug_ldflags = $(NOUNDEF) -avoid-version -module +xineplug_ldflags = $(NOUNDEF) $(GCSECTIONS) -avoid-version -module xinepostdir = $(XINE_PLUGINDIR)/post vidixdir = $(XINE_PLUGINDIR)/vidix -- cgit v1.2.3