From e29072a8ce5877c00792471de0b21ce40a74b940 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 3 Jun 2011 12:39:14 -0700 Subject: [PATCH] configure: test for zlib only w/--enable-experimental Only builds with --enable-experimental require zlib currently. A base install of mingw will not include the development headers and library. libwebp itself will now build in such environments. Additionally, remove -lz from **/Makefile.am, -lz will be added to LIBS by AC_CHECK_LIB when necessary. Change-Id: Iae8319cdf00162ecb7ed44661c02f40beb34f155 --- configure.ac | 7 ++++++- examples/Makefile.am | 4 ++-- src/Makefile.am | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 5cb27a22..ca338410 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,12 @@ AC_SUBST([pkgconfigdir]) dnl === Check libz is present -AC_CHECK_LIB(z, gzsetparams, [AC_CHECK_HEADER(zlib.h,,)], [AC_MSG_ERROR(zlib library not found)]) +if test "$enable_experimental" = "yes"; then + AC_CHECK_HEADER(zlib.h, + AC_CHECK_LIB(z, gzsetparams,,AC_MSG_ERROR(zlib library not found)), + AC_MSG_ERROR(zlib not available - no zlib.h) + ) +fi dnl === check for PNG support === diff --git a/examples/Makefile.am b/examples/Makefile.am index 6d26fc86..30f09fd2 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -4,8 +4,8 @@ bin_PROGRAMS = dwebp cwebp dwebp_SOURCES = dwebp.c stopwatch.h dwebp_CPPFLAGS = $(AM_CPPFLAGS) $(PNG_INCLUDES) $(JPEG_INCLUDES) $(USE_EXPERIMENTAL_CODE) -dwebp_LDADD = ../src/libwebp.la $(PNG_LIBS) $(JPEG_LIBS) -lz +dwebp_LDADD = ../src/libwebp.la $(PNG_LIBS) $(JPEG_LIBS) cwebp_SOURCES = cwebp.c stopwatch.h cwebp_CPPFLAGS = $(AM_CPPFLAGS) $(PNG_INCLUDES) $(JPEG_INCLUDES) $(USE_EXPERIMENTAL_CODE) -cwebp_LDADD = ../src/libwebp.la $(PNG_LIBS) $(JPEG_LIBS) -lz +cwebp_LDADD = ../src/libwebp.la $(PNG_LIBS) $(JPEG_LIBS) diff --git a/src/Makefile.am b/src/Makefile.am index 4bbe7189..d408e318 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,7 +6,7 @@ lib_LTLIBRARIES = libwebp.la libwebp_la_SOURCES = libwebp_la_LIBADD = dec/libwebpdecode.la \ enc/libwebpencode.la -libwebp_la_LDFLAGS = -version-info 0:0:0 -lz +libwebp_la_LDFLAGS = -version-info 0:0:0 libwebpinclude_HEADERS = webp/types.h webp/decode.h webp/decode_vp8.h \ webp/encode.h libwebpincludedir = $(includedir)/webp