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

Diego Elio Pettenò git at videolan.org
Fri Feb 15 04:07:41 CET 2013


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

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=136a473ebed9b3780e91bbfd7b73c653f2e79854
---

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

diff --git a/configure.ac b/configure.ac
index 0125941..0c3d0bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,9 +102,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
@@ -117,19 +114,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 libxml2 for metadata parser
 AS_IF([test "x$with_libxml2" != "xno"], [
@@ -222,7 +213,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