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
This commit is contained in:
James Zern 2011-06-03 12:39:14 -07:00
parent b2b0090b4c
commit e29072a8ce
3 changed files with 9 additions and 4 deletions

View File

@ -10,7 +10,12 @@ AC_SUBST([pkgconfigdir])
dnl === Check libz is present 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 === dnl === check for PNG support ===

View File

@ -4,8 +4,8 @@ bin_PROGRAMS = dwebp cwebp
dwebp_SOURCES = dwebp.c stopwatch.h dwebp_SOURCES = dwebp.c stopwatch.h
dwebp_CPPFLAGS = $(AM_CPPFLAGS) $(PNG_INCLUDES) $(JPEG_INCLUDES) $(USE_EXPERIMENTAL_CODE) 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_SOURCES = cwebp.c stopwatch.h
cwebp_CPPFLAGS = $(AM_CPPFLAGS) $(PNG_INCLUDES) $(JPEG_INCLUDES) $(USE_EXPERIMENTAL_CODE) 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)

View File

@ -6,7 +6,7 @@ lib_LTLIBRARIES = libwebp.la
libwebp_la_SOURCES = libwebp_la_SOURCES =
libwebp_la_LIBADD = dec/libwebpdecode.la \ libwebp_la_LIBADD = dec/libwebpdecode.la \
enc/libwebpencode.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 \ libwebpinclude_HEADERS = webp/types.h webp/decode.h webp/decode_vp8.h \
webp/encode.h webp/encode.h
libwebpincludedir = $(includedir)/webp libwebpincludedir = $(includedir)/webp