]> granicus.if.org Git - sudo/commitdiff
Fix building the builtin zlib from a build dir.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 29 Mar 2012 14:32:29 +0000 (10:32 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 29 Mar 2012 14:32:29 +0000 (10:32 -0400)
When a zlib dir was specified, prepend its include path instead of
appending so we get the right zlib headers.

configure
configure.in

index a9f7791cecbfc1c09c890b29aa6cc9033c664157..21e2647ad58793fd664e6d8e28d2f73c844124fc 100755 (executable)
--- 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"
index 1673f74d9292bfa358bdcdf682faf4364a3d0917..8ee0788a1da96ef99cf3b5abd55ff32d361e426e 100644 (file)
@@ -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])