[vlc-devel] commit: ZIP Module - Use the system minizip when available ( Nicolas Chauvet (kwizart) )

git version control git at videolan.org
Wed Feb 11 19:32:03 CET 2009


vlc | branch: master | Nicolas Chauvet (kwizart) <kwizart at gmail.com> | Wed Feb 11 10:46:53 2009 +0100| [005855e07d17af7f3900962bed415c565c562dd3] | committer: Jean-Baptiste Kempf 

ZIP Module - Use the system minizip when available

- Ship the vlc module header zip.h
 (rename isn't needed once the file in ship)
- Detect minizip presence with pkgconfig
- if .pc not available, try to assume presence from unzip.h
- Move the zlib.h detection in one place (after pkgconfig macro)
 minizip in bundled within zlib in some distro
- Adds -lz in module that needs it in one place
- Prevent the compilation of libs/unzip if minizip is available
 (it shound't prevent this directory to be bundled with the sources)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=005855e07d17af7f3900962bed415c565c562dd3
---

 Makefile.am                   |    2 +
 configure.ac                  |   58 ++++++++++++++++++++--------------------
 modules/access/zip/Modules.am |    1 +
 3 files changed, 32 insertions(+), 29 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index b60031d..e3a87d2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,8 +21,10 @@ if HAVE_LIBGCRYPT
 SUBDIRS += libs/srtp
 endif
 if HAVE_ZLIB
+if !HAVE_MINIZIP
 SUBDIRS += libs/unzip
 endif
+endif
 if BUILD_VLC
 SUBDIRS += bin
 endif
diff --git a/configure.ac b/configure.ac
index 4806174..f9dafbc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -550,9 +550,6 @@ AC_CHECK_FUNCS(send,,[
   ])
 ])
 
-AC_CHECK_HEADERS(zlib.h, [
-  VLC_ADD_LIBS([access_http],[-lz])
-])
 
 dnl Check for socklen_t
 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
@@ -877,6 +874,33 @@ AC_ARG_VAR(PKG_CONFIG_PATH,
 	   [Paths where to find .pc not at the default location])
 PKG_PROG_PKG_CONFIG()
 
+dnl
+dnl Check for zlib.h and -lz along with system -lminizip if available
+dnl 
+AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
+AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
+if test "${have_zlib}" = "yes"
+then
+  VLC_ADD_LIBS([access_http gme mp4 skins2 sap mkv unzip zip],[-lz])
+  PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
+    AC_CHECK_HEADERS([unzip.h], [ 
+      have_minizip=yes
+      MINIZIP_LIBS="-lminizip -lz"
+    ], [
+      have_minizip=no
+      MINIZIP_CFLAGS="-I\$(top_builddir)/libs/unzip"
+      MINIZIP_LIBS="\$(top_builddir)/libs/unzip/libunzip.la"
+    ])
+  ])
+  AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
+  VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
+  VLC_ADD_CFLAGS([zip],[$MINIZIP_CFLAGS])
+  VLC_ADD_LIBS([skins2 zip],[$MINIZIP_LIBS])
+  VLC_ADD_PLUGIN([unzip])
+  VLC_ADD_PLUGIN([zip])
+fi
+
+
 dnl Check for hal
 AC_ARG_ENABLE(hal,
   [  --enable-hal            Linux HAL services discovery (default enabled)])
@@ -2977,10 +3001,10 @@ AC_ARG_ENABLE( id3tag,
 [  --disable-id3tag        id3tag metadata reader plugin (default disabled)])
 AS_IF([test "${enable_id3tag}" = "yes"], [
   AC_CHECK_HEADERS(id3tag.h, [
-    AC_CHECK_HEADERS(zlib.h, [
+    if test "${have_zlib}" = "yes"
       VLC_ADD_LIBS([id3tag],[-lid3tag -lz])
       VLC_ADD_PLUGIN([id3tag])
-    ])
+    fi
   ])
 ])
 
@@ -3257,15 +3281,6 @@ if test "${enable_realrtsp}" = "yes"; then
   VLC_ADD_PLUGIN([access_realrtsp])
 fi
 
-dnl
-dnl MP4 module
-dnl
-AC_CHECK_HEADERS(zlib.h, [
-  VLC_ADD_LIBS([mp4 skins2 sap mkv gme],[-lz])
-  VLC_ADD_CPPFLAGS([skins2],[-I../../../@top_srcdir@/libs/unzip])
-  VLC_ADD_LIBS([skins2],[../../../libs/unzip/libunzip.la])
-] )
-
 AC_ARG_ENABLE(libsysfs,
   [  --enable-libsysfs       Get user key from firewire connected iPod via libsysfs (default enabled)])
 
@@ -5412,21 +5427,6 @@ fi
 
 
 dnl
-dnl ZIP files demuxer
-dnl
-AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
-AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
-if test "${have_zlib}" = "yes"
-then
-  VLC_ADD_PLUGIN([unzip])
-  VLC_ADD_LIBS([zip],[-lz])
-  VLC_ADD_PLUGIN([zip])
-  VLC_ADD_CFLAGS([zip],[-I../../../@top_srcdir@/libs/unzip])
-  VLC_ADD_LIBS([zip],[../../../libs/unzip/libunzip.la])
-fi
-
-
-dnl
 dnl  Endianness check
 dnl
 AC_C_BIGENDIAN
diff --git a/modules/access/zip/Modules.am b/modules/access/zip/Modules.am
index 303c29f..b8b1f9a 100644
--- a/modules/access/zip/Modules.am
+++ b/modules/access/zip/Modules.am
@@ -1,5 +1,6 @@
 if HAVE_ZLIB
 SOURCES_zip = \
+	zip.h \
 	zipstream.c \
 	zipaccess.c \
 	$(NULL)




More information about the vlc-devel mailing list