[PATCH libXvMC] Fix linking with -Wl,--no-undefined on Linux

Yaakov (Cygwin/X) yselkowitz at users.sourceforge.net
Wed Oct 24 00:07:56 PDT 2012


From: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>

libXvMCW uses dlopen and friends, therefore it must be linked against
libdl on systems where it exists as a separate library.

Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
---
 configure.ac        |    6 ++++++
 wrapper/Makefile.am |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index ae7d08b..6c34fc8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,12 @@ PKG_CHECK_MODULES(XVMC, x11 xext xv xextproto videoproto)
 # Checks for library functions.
 AC_CHECK_FUNCS([shmat])
 
+# Check to see if dlopen is in default libraries (like Solaris, which
+# has it in libc), or if libdl is needed to get it.
+AC_CHECK_FUNC([dlopen], [],
+	AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
+AC_SUBST(DLOPEN_LIBS)
+
 # Allow checking code with lint, sparse, etc.
 XORG_WITH_LINT
 LINT_FLAGS="${LINT_FLAGS} ${XVMC_CFLAGS}"
diff --git a/wrapper/Makefile.am b/wrapper/Makefile.am
index b3a1c21..fbe8cf7 100644
--- a/wrapper/Makefile.am
+++ b/wrapper/Makefile.am
@@ -10,7 +10,7 @@ AM_CPPFLAGS = 					\
 AM_CFLAGS = $(CWARNFLAGS) $(XVMC_CFLAGS)
 
 libXvMCW_la_SOURCES = XvMCWrapper.c
-libXvMCW_la_LIBADD = $(XVMC_LIBS)
+libXvMCW_la_LIBADD = $(XVMC_LIBS) $(DLOPEN_LIBS)
 libXvMCW_la_LDFLAGS = -version-number 1:0:0 -no-undefined
 
 if LINT
-- 
1.7.9



More information about the xorg-devel mailing list