]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Revert "Don't delete SRCDIR/zconf.h when building out of tree"
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Thu, 7 May 2015 07:36:20 +0000 (09:36 +0200)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Thu, 7 May 2015 07:36:20 +0000 (09:36 +0200)
This reverts commit ff7c02c8a7492ce3f3ab997c26ca737fac57f5d3.

configure
zconf.h
zconf.h.cmakein
zconf.h.in
zlib.h

index ab1683c6ab2a61b470b5cbd8205ab953d9637556..1f9aaea2634103fbc87c7c46f873ab4416613cea 100755 (executable)
--- a/configure
+++ b/configure
@@ -421,6 +421,9 @@ else
   echo "Checking for strerror... No." | tee -a configure.log
 fi
 
+# We need to remove zconf.h from source directory if building outside of it
+if [ "$SRCDIR" != "$BUILDDIR" ]; then rm -f $SRCDIR/zconf.h; fi
+
 # copy clean zconf.h for subsequent edits
 cp -p $SRCDIR/zconf.h.in zconf.h
 
@@ -462,10 +465,6 @@ if test $zprefix -eq 1; then
   echo "Using z_ prefix on all symbols." | tee -a configure.log
 fi
 
-# take out the error path that makes sure an out of tree build doesn't touch the source tree's zconf.h
-sed < zconf.h 's/#error.*//' > zconf.temp.h
-mv zconf.temp.h zconf.h
-
 # if --solo compilation was requested, save that in zconf.h and remove gz stuff from object lists
 if test $solo -eq 1; then
   sed '/#define ZCONF_H/a\
@@ -743,7 +742,7 @@ sed < $SRCDIR/Makefile.in "
 mkdir -p $ARCHDIR
 
 ARCHINCLUDES="-I$SRCDIR/$ARCHDIR -I$SRCDIR"
-if [ "$SRCDIR" != "$BUILDDIR" ]; then ARCHINCLUDES="-I$BUILDDIR ${ARCHINCLUDES}"; fi
+if [ "$SRCDIR" != "$BUILDDIR" ]; then ARCHINCLUDES="${ARCHINCLUDES} -I$BUILDDIR"; fi
 
 sed < $SRCDIR/$ARCHDIR/Makefile.in "
 /^CC *=/s#=.*#=$CC#
diff --git a/zconf.h b/zconf.h
index bd49761f35c1e757e223f8af9f0439e8d2508366..4a4beaf14fe904f2246e5a32d73575f04552ae5b 100644 (file)
--- a/zconf.h
+++ b/zconf.h
@@ -5,8 +5,6 @@
 
 /* @(#) $Id$ */
 
-#error "Error: unprepared zconf.h included. Build system broken."
-
 #ifndef ZCONF_H
 #define ZCONF_H
 
index 6f70f75334f210f274d8b333356154671ecfd18f..92d461d079e6f9015f6fdd2ddfa9a9868d9765ea 100644 (file)
@@ -5,8 +5,6 @@
 
 /* @(#) $Id$ */
 
-#error "Error: unprepared zconf.h included. Build system broken."
-
 #ifndef ZCONF_H
 #define ZCONF_H
 #cmakedefine Z_PREFIX
index bd49761f35c1e757e223f8af9f0439e8d2508366..4a4beaf14fe904f2246e5a32d73575f04552ae5b 100644 (file)
@@ -5,8 +5,6 @@
 
 /* @(#) $Id$ */
 
-#error "Error: unprepared zconf.h included. Build system broken."
-
 #ifndef ZCONF_H
 #define ZCONF_H
 
diff --git a/zlib.h b/zlib.h
index b9672efaa9fe68f60a347f9a60aedef3f4b60162..5488524ff1e09a98f81d4818d62bc0e9afa5e8ec 100644 (file)
--- a/zlib.h
+++ b/zlib.h
@@ -31,7 +31,7 @@
 #ifndef ZLIB_H
 #define ZLIB_H
 
-#include <zconf.h>
+#include "zconf.h"
 
 #ifdef __cplusplus
 extern "C" {