[PATCH:libfontenc] Fail configure if zlib.h & -lz not found

Julien Cristau jcristau at debian.org
Sat Nov 20 08:46:38 PST 2010


On Sat, Nov 20, 2010 at 08:22:09 -0800, Dan Nicholson wrote:

> On Fri, Nov 19, 2010 at 10:04 PM, Alan Coopersmith
> <alan.coopersmith at oracle.com> wrote:
> > Fixes https://bugs.freedesktop.org/show_bug.cgi?id=31595
> >
> > Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> > ---
> >  configure.ac |    6 ++++--
> >  1 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index fb0b1af..9419909 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -48,8 +48,10 @@ XORG_FONT_MACROS_VERSION(1.1)
> >  XORG_FONTSUBDIR([ENCODINGSDIR], [encodingsdir], [encodings])
> >
> >  # zlib
> > -
> > -AC_CHECK_LIB(z, gzclose)
> > +AC_CHECK_HEADER([zlib.h], [],
> > +                AC_MSG_FAILURE([zlib.h is required to compile libfontenc]))
> > +AC_CHECK_LIB(z, gzclose, [],
> > +             AC_MSG_FAILURE([zlib is required to compile libfontenc]))
> >
> >  # Check for dependencies
> >  PKG_CHECK_MODULES(FONTENC, xproto)
> 
> I think this breaks zlib linking. Normally if you use AC_CHECK_LIB
> with no third argument, it appends -l$1 to LIBS, and all objects get
> linked against $LIBS. Now since you're suppressing the default action
> by passing a third argument, I think you may not get -lz in $LIBS. Can
> you check?
> 
Just tested, and from what I can tell passing an empty $3 is the same as
not passing it, so this still defines HAVE_LIBZ and sets LIBS="-lz".

Cheers,
Julien


More information about the xorg-devel mailing list