[DVDnav-discuss] libdvdread uses internal dlfcn on W32, unconditionally

LRN lrn1986 at gmail.com
Fri Apr 13 18:13:25 CEST 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On W32 libdvdread unconditionally uses msvc/contrib/dlfcn.c
While this allows libdvdread to be compiled out of the box, it
prevents it from linking to any other dlfcn implementation. Namely -
to dlfcn-win32 [1] (which is somewhat more POSIX-compliant).

The attached patch is very simplistic (i.e. it unconditionally
requires a working libdl somewhere), but it works for me. For trunk i
would suggest re-writing it like this:
check for dlopen in -lc
  if that fails, check for dlopen in -ld
    if that fails AND host is mingw, modify CFLAGS to use internal dlfcn

Note that LDFLAGS modification should go AFTER (!) all AC_CHECK_LIB
calls, because -no-undefined is no longer valid as a compiler option.

[1] http://code.google.com/p/dlfcn-win32/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPiFCkAAoJEOs4Jb6SI2Cwl1YH/0T2WtJHelUGJr4ne6BN+dAz
fvRfThLqmWIg0c+KrMN7UYlKOiDBWraLXbzUTvmjnZGM3w0GrUIT1qSniYKog+f+
AEfa9b75dfSSpT1R1xBmr1YT9ka3CtRtbiA5pjCHNyNr/IcMOQGEn8pXEzJ7vXn7
Uo5IeqWaG2JfjJYFXouKgTAT/L4P9Uvhab2S+SBFyhYG7OHi1DbmelWvhIkBT6lB
QWE69RprcIH4dueq9l2IMvkWqhqvI580S6r3RbxZIFyYESamuxRCgxdCpBdPbYPs
+KU2EjqJdmohoS+Xp274l0aia2sBrvgYsC37MkyYawi2UhPtv2EnW6lIUIHczSU=
=VUR/
-----END PGP SIGNATURE-----
-------------- next part --------------
--- libdvdread-4.2.0/configure.ac.orig	2012-04-13 19:55:31 +0400
+++ libdvdread-4.2.0/configure.ac	2012-04-13 19:55:45 +0400
@@ -139,8 +139,13 @@
 dnl ---------------------------------------------
 case $host in
   *mingw32*)
-    CFLAGS="-idirafter \$(top_srcdir)/msvc/include $CFLAGS"
+    AC_CHECK_LIB(c, dlopen,
+                 DYNAMIC_LD_LIBS="",
+                 AC_CHECK_LIB(dl, dlopen,
+                              DYNAMIC_LD_LIBS="-ldl",
+                              AC_MSG_ERROR(dynamic linker needed)))
+    AC_SUBST(DYNAMIC_LD_LIBS)
     LDFLAGS="-no-undefined $LDFLAGS"
     ;;
   *cygwin*)
     LDFLAGS="-no-undefined $LDFLAGS"


More information about the DVDnav-discuss mailing list