[vlc-devel] [PATCH] Zip Module - Use the system minizip when available

Christophe Mutricy xtophe at chewa.net
Thu Jan 29 00:17:49 CET 2009


On Wed, Jan 28, 09 at 19:19 +0100, Nicolas Chauvet (kwizart) wrote:
> - Avoid namespace issue when zip.h from minizip is present
>  (renaming zip module zip.h -> to zip_accessdemux.h)
That should be a separated commit

> - Detect minizip presence with pkgconfig
> - Move the zlib.h detection in one place (after pkgconfig macro)
>   minizip in bundled within zlib in some distro
> - Prevent the compilation of libs/unzip if minizip is available
>  (it shound't prevent this directory to be bundled with the sources)
> - Fix the zip_accessdemux.h (old zip.h) presence in the related Modules.am

> diff --git a/Makefile.am b/Makefile.am
>  if HAVE_ZLIB
> +if HAVE_MINIZIP
> +else

if !HAVE_MINIZIP  will be more elegant.

> diff --git a/configure.ac b/configure.ac
>  ])
>  
> -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,24 @@ 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],[-lz])
> +  PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
> +     have_minizip=no
> +     MINIZIP_CFLAGS="-I../../../@top_srcdir@/libs/unzip"
> +     MINIZIP_LIBS="../../../libs/unzip/libunzip.la"
> +     AC_SUBST(MINIZIP_CFLAGS)
> +     AC_SUBST(MINIZIP_LIBS)
> +  ])
> +  AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])

You don't use have_minizip anywhere else. So we should directtly use a
AC_DEFINE([HAVE_MINIZIP]) is the if-true part of PKG_CHECK_MODULES()

-I../../../@top_srcdir@ is very suspicious because on my box it's /
MINIZIP_LIBS="../../../libs/unzip/libunzip.la" is only true for modules
in modules/foo/bar. You'd better use $top_builddir


I don't think the AC_SUBST are needed


>  AC_CHECK_HEADERS(zlib.h, [
>    VLC_ADD_LIBS([mp4 skins2 sap mkv gme],[-lz])

As already said by others we should either use $have_zlib or move all
that inside the AC_CHECK_HEADERS([zlib.h])



-- 
Xtophe



More information about the vlc-devel mailing list