summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowitz@users.sourceforge.net>2012-10-24 02:07:56 -0500
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-12-14 10:06:52 -0800
commit4dd267a98790f4404b7607d9362d4346f55f49fb (patch)
treee284ee0c46e91436f6bbc48082bf86873dd93b96
parent62bc54e6995618b7134f5cbe3a4290e41a4cb44a (diff)
Fix linking with -Wl,--no-undefined on Linux
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@users.sourceforge.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--configure.ac6
-rw-r--r--wrapper/Makefile.am2
2 files changed, 7 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index ea2de2f..74183a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,12 @@ PKG_CHECK_MODULES(XVMC, [x11 >= 1.6] 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