[libdvdnav-devel] [PATCH] Fix pthread check on OS/2

KO Myung-Hun komh78 at gmail.com
Thu Jan 18 05:18:40 CET 2018


pthread check fails due to -no-undefined of LDFLAGS. gcc4 treats
unknown flags as an error unlike gcc3.

Move -no-undefined to libdvdnav_la_LDFLAGS of Makefile.am.
---
 Makefile.am  | 2 +-
 configure.ac | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 89bfd9d..6573d64 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,7 +36,7 @@ libdvdnav_la_SOURCES = \
 
 libdvdnav_la_LDFLAGS = \
 	-version-info $(DVDNAV_LT_CURRENT):$(DVDNAV_LT_REVISION):$(DVDNAV_LT_AGE) \
-	-export-symbols-regex "^dvdnav"
+	-export-symbols-regex "^dvdnav" $(NO_UNDEFINED)
 libdvdnav_la_LIBADD = $(THREAD_LIBS) $(DVDREAD_LIBS)
 
 pkgincludedir = $(includedir)/dvdnav
diff --git a/configure.ac b/configure.ac
index af429b4..a8c9626 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,11 +69,11 @@ AC_PROG_CC
 AC_SYS_LARGEFILE
 AC_C_BIGENDIAN
 
+NO_UNDEFINED=
 AS_CASE([$host],
-  [*mingw32* | *cygwin*], [AC_CHECK_FUNCS(gettimeofday)])
-
-AS_CASE([$host],
-  [*os2*], [LDFLAGS="$LDFLAGS -no-undefined"])
+  [*mingw32* | *cygwin*], [AC_CHECK_FUNCS(gettimeofday)],
+  [*-*-os2*], [NO_UNDEFINED=-no-undefined])
+AC_SUBST(NO_UNDEFINED)
 
 dnl ---------------------------------------------
 dnl threads
-- 
2.13.3



More information about the libdvdnav-devel mailing list