From: Hans Kristian Rosbach Date: Thu, 7 May 2015 07:36:20 +0000 (+0200) Subject: Revert "Don't delete SRCDIR/zconf.h when building out of tree" X-Git-Tag: 1.9.9-b1~864 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5119ebb4d01729f78e737e1de3e165229aea9828;p=thirdparty%2Fzlib-ng.git Revert "Don't delete SRCDIR/zconf.h when building out of tree" This reverts commit ff7c02c8a7492ce3f3ab997c26ca737fac57f5d3. --- diff --git a/configure b/configure index ab1683c6a..1f9aaea26 100755 --- 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 bd49761f3..4a4beaf14 100644 --- 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 diff --git a/zconf.h.cmakein b/zconf.h.cmakein index 6f70f7533..92d461d07 100644 --- a/zconf.h.cmakein +++ b/zconf.h.cmakein @@ -5,8 +5,6 @@ /* @(#) $Id$ */ -#error "Error: unprepared zconf.h included. Build system broken." - #ifndef ZCONF_H #define ZCONF_H #cmakedefine Z_PREFIX diff --git a/zconf.h.in b/zconf.h.in index bd49761f3..4a4beaf14 100644 --- a/zconf.h.in +++ b/zconf.h.in @@ -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 b9672efaa..5488524ff 100644 --- a/zlib.h +++ b/zlib.h @@ -31,7 +31,7 @@ #ifndef ZLIB_H #define ZLIB_H -#include +#include "zconf.h" #ifdef __cplusplus extern "C" {