From: Todd C. Miller Date: Thu, 29 Mar 2012 14:32:29 +0000 (-0400) Subject: Fix building the builtin zlib from a build dir. X-Git-Tag: SUDO_1_8_5~1^2~96 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8393ec05017c4a1c53d7497d07bafbb73987470d;p=sudo Fix building the builtin zlib from a build dir. When a zlib dir was specified, prepend its include path instead of appending so we get the right zlib headers. --- diff --git a/configure b/configure index a9f7791ce..21e2647ad 100755 --- a/configure +++ b/configure @@ -17963,7 +17963,7 @@ fi *) $as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h - CPPFLAGS="${CPPFLAGS} -I${enable_zlib}/include" + CPPFLAGS="-I${enable_zlib}/include ${CPPFLAGS}" if test X"$with_rpath" = X"yes"; then case "$host" in @@ -17985,7 +17985,7 @@ esac if test X"$enable_zlib" = X"builtin"; then $as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h - CPPFLAGS="${CPPFLAGS}"' -I$(top_srcdir)/zlib' + CPPFLAGS='-I$(top_builddir)/zlib -I$(top_srcdir)/zlib '"${CPPFLAGS}" ZLIB="${ZLIB}"' $(top_builddir)/zlib/libz.la' ZLIB_SRC=zlib ac_config_headers="$ac_config_headers zlib/zconf.h" diff --git a/configure.in b/configure.in index 1673f74d9..8ee0788a1 100644 --- a/configure.in +++ b/configure.in @@ -2436,6 +2436,8 @@ fi dnl dnl Deferred zlib option processing. dnl By default we use the system zlib if it is present. +dnl If a directory was specified for zlib (or we are use sudo's version), +dnl prepend the include dir to make sure we get the right zlib header. dnl case "$enable_zlib" in yes) @@ -2454,14 +2456,14 @@ case "$enable_zlib" in ;; *) AC_DEFINE(HAVE_ZLIB_H) - CPPFLAGS="${CPPFLAGS} -I${enable_zlib}/include" + CPPFLAGS="-I${enable_zlib}/include ${CPPFLAGS}" SUDO_APPEND_LIBPATH(ZLIB, [$enable_zlib/lib]) ZLIB="${ZLIB} -lz" ;; esac if test X"$enable_zlib" = X"builtin"; then AC_DEFINE(HAVE_ZLIB_H) - CPPFLAGS="${CPPFLAGS}"' -I$(top_srcdir)/zlib' + CPPFLAGS='-I$(top_builddir)/zlib -I$(top_srcdir)/zlib '"${CPPFLAGS}" ZLIB="${ZLIB}"' $(top_builddir)/zlib/libz.la' ZLIB_SRC=zlib AC_CONFIG_HEADER([zlib/zconf.h])