[libbluray-devel] build: simplify checks for phtreads and dlopen.

Diego Elio Pettenò git at videolan.org
Mon Feb 25 07:51:34 CET 2013


libbluray | branch: flameeyes | Diego Elio Pettenò <flameeyes at flameeyes.eu> | Thu Feb 14 18:06:24 2013 -0800| [1673970e02a40a1f87bb38b0bd673b9baa31d63f] | committer: hpi1

build: simplify checks for phtreads and dlopen.

This concentrates the tests, and is more reliable.

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=1673970e02a40a1f87bb38b0bd673b9baa31d63f
---

 configure.ac    |   24 +++++++-----------------
 src/Makefile.am |    2 +-
 2 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6662991..4fa5c38 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,9 +110,6 @@ dnl required headers
 AC_CHECK_HEADERS([stdarg.h sys/types.h dirent.h errno.h libgen.h malloc.h])
 AC_CHECK_HEADERS([stdlib.h mntent.h linux/cdrom.h inttypes.h strings.h])
 AC_CHECK_HEADERS([sys/time.h time.h mntent.h])
-if test "${SYS}" != "mingw32" ; then
-    AC_CHECK_HEADERS(pthread.h,, [AC_MSG_ERROR([pthread.h required])])
-fi
 
 dnl required structures
 AC_STRUCT_DIRENT_D_TYPE
@@ -125,19 +122,13 @@ AC_CHECK_FUNC([snprintf],, [AC_MSG_ERROR($function_not_found)])
 
 dnl required libraries
 dnl pthreads (not on win32)
-if test "${SYS}" != "mingw32" ; then
-    AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"])
-fi
-
-dnl dlopen check
-if test "${SYS}" != "mingw32" ; then
-  AC_CHECK_FUNCS(
-    [dlopen],
-    [DLOPEN_LIBS=""],
-    [AC_CHECK_LIB([dl], [dlopen],
-      [DLOPEN_LIBS="-ldl"],
-      [AC_MSG_ERROR($library_not_found)])])
-fi
+AS_IF([test "${SYS}" != "mingw32"], [
+  AC_CHECK_HEADERS([pthread.h], ,
+    [AC_MSG_ERROR([pthread required])])
+  AC_SEARCH_LIBS([pthread_create], [pthread], ,
+    [AC_MSG_ERROR([pthread required])])
+  AC_SEARCH_LIBS([dlopen], [dl])
+])
 
 dnl check for pkg-config itself so we don't try the m4 macro without pkg-config
 AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
@@ -244,7 +235,6 @@ AC_SUBST(LT_VERSION_INFO)
 
 dnl generate output files
 AC_SUBST(BDJAVA_CFLAGS)
-AC_SUBST(DLOPEN_LIBS)
 AC_CONFIG_FILES([Makefile src/Makefile src/examples/Makefile src/libbluray.pc src/libbluray/bluray-version.h])
 AC_OUTPUT
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 94a4775..3182542 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -96,7 +96,7 @@ libbluray_la_SOURCES=libbluray/bluray.h \
 	util/logging.h
 libbluray_la_HEADERS= libbluray/bluray.h file/filesystem.h util/log_control.h libbluray/keys.h libbluray/decoders/overlay.h libbluray/bdnav/meta_data.h libbluray/bdnav/clpi_data.h libbluray/bluray-version.h
 libbluray_la_LDFLAGS= -version-info $(LIB_VERSION_INFO)
-libbluray_la_LIBADD= $(LIBXML2_LIBS) $(DLOPEN_LIBS) $(FT2_LIBS)
+libbluray_la_LIBADD= $(LIBXML2_LIBS) $(FT2_LIBS)
 
 if USING_BDJAVA
 



More information about the libbluray-devel mailing list