configure: Use pkg-config to check for zlib.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-06-04 12:28:50 +02:00
parent 15619c773e
commit 7ac6cdfa00
6 changed files with 60 additions and 15 deletions

55
configure vendored
View File

@ -672,6 +672,7 @@ PULSE_LIBS
PULSE_CFLAGS
GETTEXTPO_LIBS
Z_LIBS
Z_CFLAGS
FREETYPE_LIBS
FREETYPE_CFLAGS
LCMS2_LIBS
@ -1837,6 +1838,8 @@ LCMS2_CFLAGS
LCMS2_LIBS
FREETYPE_CFLAGS
FREETYPE_LIBS
Z_CFLAGS
Z_LIBS
PULSE_CFLAGS
PULSE_LIBS
GSTREAMER_CFLAGS
@ -2618,6 +2621,8 @@ Some influential environment variables:
C compiler flags for freetype2, overriding pkg-config
FREETYPE_LIBS
Linker flags for freetype2, overriding pkg-config
Z_CFLAGS C compiler flags for libz, overriding pkg-config
Z_LIBS Linker flags for libz, overriding pkg-config
PULSE_CFLAGS
C compiler flags for libpulse, overriding pkg-config
PULSE_LIBS Linker flags for libpulse, overriding pkg-config
@ -4162,7 +4167,7 @@ fi
# Check whether --with-zlib was given.
if test "${with_zlib+set}" = set; then :
withval=$with_zlib; if test "x$withval" = "xno"; then ac_cv_header_zlib_h=no; fi
withval=$with_zlib;
fi
@ -7479,8 +7484,7 @@ for ac_header in \
unistd.h \
utime.h \
valgrind/memcheck.h \
valgrind/valgrind.h \
zlib.h
valgrind/valgrind.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@ -14263,15 +14267,39 @@ done
LIBS="$ac_wine_check_funcs_save_LIBS"
if test "$ac_cv_header_zlib_h" = "yes"
if test "x$with_zlib" != "xno"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5
if ${Z_CFLAGS:+false} :; then :
if ${PKG_CONFIG+:} false; then :
Z_CFLAGS=`$PKG_CONFIG --cflags libz 2>/dev/null`
fi
fi
if ${Z_LIBS:+false} :; then :
if ${PKG_CONFIG+:} false; then :
Z_LIBS=`$PKG_CONFIG --libs libz 2>/dev/null`
fi
fi
Z_LIBS=${Z_LIBS:-"-lz"}
$as_echo "$as_me:${as_lineno-$LINENO}: libz cflags: $Z_CFLAGS" >&5
$as_echo "$as_me:${as_lineno-$LINENO}: libz libs: $Z_LIBS" >&5
ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $Z_CFLAGS"
for ac_header in zlib.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
if test "x$ac_cv_header_zlib_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_ZLIB_H 1
_ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5
$as_echo_n "checking for inflate in -lz... " >&6; }
if ${ac_cv_lib_z_inflate+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
LIBS="-lz $Z_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -14305,10 +14333,20 @@ if test "x$ac_cv_lib_z_inflate" = xyes; then :
$as_echo "#define HAVE_ZLIB 1" >>confdefs.h
Z_LIBS="-lz"
else
Z_LIBS=""
fi
else
Z_LIBS=""
fi
done
CPPFLAGS=$ac_save_CPPFLAGS
test -z "$Z_CFLAGS" || Z_CFLAGS=`echo " $Z_CFLAGS" | sed 's/ -I\([^/]\)/ -I\$(top_builddir)\/\1/g'`
test -z "$Z_LIBS" || Z_LIBS=`echo " $Z_LIBS" | sed 's/ -L\([^/]\)/ -L\$(top_builddir)\/\1/g'`
fi
if test "x$Z_LIBS" = "x"; then :
case "x$with_zlib" in
@ -19636,6 +19674,7 @@ LCMS2_CFLAGS = $LCMS2_CFLAGS
LCMS2_LIBS = $LCMS2_LIBS
FREETYPE_CFLAGS = $FREETYPE_CFLAGS
FREETYPE_LIBS = $FREETYPE_LIBS
Z_CFLAGS = $Z_CFLAGS
Z_LIBS = $Z_LIBS
GETTEXTPO_LIBS = $GETTEXTPO_LIBS
PULSE_CFLAGS = $PULSE_CFLAGS

View File

@ -109,8 +109,7 @@ AC_ARG_WITH(xshm, AS_HELP_STRING([--without-xshm],[do not use XShm (shared
AC_ARG_WITH(xslt, AS_HELP_STRING([--without-xslt],[do not use XSLT]))
AC_ARG_WITH(xxf86vm, AS_HELP_STRING([--without-xxf86vm],[do not use XFree video mode extension]),
[if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_xf86vmode_h=no; ac_cv_header_X11_extensions_xf86vmproto_h=no; fi])
AC_ARG_WITH(zlib, AS_HELP_STRING([--without-zlib],[do not use Zlib (data compression)]),
[if test "x$withval" = "xno"; then ac_cv_header_zlib_h=no; fi])
AC_ARG_WITH(zlib, AS_HELP_STRING([--without-zlib],[do not use Zlib (data compression)]))
AC_ARG_WITH(wine-tools,AS_HELP_STRING([--with-wine-tools=DIR],[use Wine tools from directory DIR]))
AC_ARG_WITH(wine64, AS_HELP_STRING([--with-wine64=DIR],[use the 64-bit Wine in DIR for a Wow64 build]))
@ -544,8 +543,7 @@ AC_CHECK_HEADERS(\
unistd.h \
utime.h \
valgrind/memcheck.h \
valgrind/valgrind.h \
zlib.h
valgrind/valgrind.h
)
WINE_HEADER_MAJOR()
AC_HEADER_STAT()
@ -1570,10 +1568,14 @@ WINE_CHECK_LIB_FUNCS(\
[$PTHREAD_LIBS])
dnl **** Check for zlib ****
if test "$ac_cv_header_zlib_h" = "yes"
if test "x$with_zlib" != "xno"
then
AC_CHECK_LIB(z,inflate,[AC_DEFINE(HAVE_ZLIB,1,[Define to 1 if you have the `z' library (-lz).])
AC_SUBST(Z_LIBS,"-lz")])
WINE_PACKAGE_FLAGS(Z,[libz],[-lz],,,
[AC_CHECK_HEADERS(zlib.h,
[AC_CHECK_LIB(z,inflate,
[AC_DEFINE(HAVE_ZLIB,1,[Define to 1 if you have the `z' library (-lz).])],
[Z_LIBS=""],[$Z_LIBS])],
[Z_LIBS=""])])
fi
WINE_NOTICE_WITH(zlib,[test "x$Z_LIBS" = "x"],[libz ${notice_platform}development files not found, data compression won't be supported.])

View File

@ -1,5 +1,6 @@
MODULE = cabinet.dll
IMPORTLIB = cabinet
EXTRAINCL = $(Z_CFLAGS)
EXTRALIBS = $(Z_LIBS)
C_SRCS = \

View File

@ -2,6 +2,7 @@ MODULE = dbghelp.dll
IMPORTLIB = dbghelp
EXTRADEFS = -D_IMAGEHLP_SOURCE_
DELAYIMPORTS = version
EXTRAINCL = $(Z_CFLAGS)
EXTRALIBS = $(Z_LIBS) $(CORESERVICES_LIBS) $(COREFOUNDATION_LIBS)
C_SRCS = \

View File

@ -1,5 +1,6 @@
MODULE = opcservices.dll
IMPORTS = uuid ole32 advapi32 urlmon xmllite oleaut32
EXTRAINCL = $(Z_CFLAGS)
EXTRALIBS = $(Z_LIBS)
C_SRCS = \

View File

@ -3,6 +3,7 @@ MODULE = wininet.dll
IMPORTLIB = wininet
IMPORTS = mpr shlwapi shell32 user32 ws2_32 advapi32
DELAYIMPORTS = secur32 crypt32 cryptui
EXTRAINCL = $(Z_CFLAGS)
EXTRALIBS = $(CORESERVICES_LIBS) $(Z_LIBS)
C_SRCS = \