[vlc-devel] [PATCH 1/2] configure.ac: use pkg-config for zlib

Alexandre Janniaux ajanni at videolabs.io
Fri Sep 27 11:29:21 CEST 2019


Hi,

The issue it is solving is this:

```
# contrib/src/zlib/rules.mak
PKGS += zlib
ifeq ($(call need_pkg,"zlib"),)
PKGS_FOUND += zlib
endif
```

If pkg-config finds a zlib pc file, it won't build the contrib.
If the pc file was refering to a non-sysroot or default look up path,
it won't be able to link.

I would prefer that we provide a .pc file for targets that are not
compliant with this. If you still want to use the platform zlib, you
can still provide a meta contrib package, like a contrib/src/zlib-msys
which adds a PKGS_FOUND += zlib if enabled and install the correct .pc
file to the package installation. What do you think ?

Regards,
--
Alexandre Janniaux
Videolabs

On Fri, Sep 27, 2019 at 08:23:31AM +0200, Steve Lhomme wrote:
> It would be nice but I'm not sure it has a pkg-config file in the oldest
> distros we support (and what about macOS ?).
>
> The good side is that we could require a recent version when we know old
> ones are too broken.
>
> On 2019-09-26 16:08, Alexandre Janniaux wrote:
> > ---
> >   configure.ac | 15 +++++++++------
> >   1 file changed, 9 insertions(+), 6 deletions(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index 210b4ca5371..1a9d30c14ca 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -933,13 +933,16 @@ AS_IF([test -n "${PKG_CONFIG}" ],[
> >   dnl
> >   dnl Check for zlib.h and -lz 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([sap],[-lz])
> > -fi
> > +have_zlib = "no"
> > +PKG_CHECK_MODULES(ZLIB, [zlib], [
> > +  VLC_ADD_CFLAGS([sap],[${ZLIB_CFLAGS}])
> > +  VLC_ADD_LIBS([sap],[${ZLIB_LIBS}])
> > +  have_zlib = "yes"
> > +], [
> > +    AC_MSG_WARN(["ZLIB not found: ${ZLIB_PKG_ERRORS}"])
> > +])
> > +AM_CONDITIONAL([HAVE_ZLIB], [ test "${have_zlib}" = "yes" ])
> >   dnl
> >   dnl Domain name i18n support via GNU libidn
> > --
> > 2.23.0
> >
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
> >
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list