[Zlib-devel] [PATCH] Out-of-srcdir builds, -Werror resistance
Daniel Richard G.
oss at teragram.com
Tue Jul 24 15:46:40 EDT 2012
On Tue, 24 Jul 2012, Mark Adler wrote:
>> and then builds which set -Iblah appropriately would also do
>> -DZLIB_INCPATH_SET. Would this work for you, as a way of catering to
>> both out-of-source-tree and command-line builds?
>
> I suppose, but it seems awfully messy.
Oh, I agree. Being able to drive the build manually is an unusual
constraint; something's gotta give.
(The construct is needed in only five source files, anyway.)
> How about instead for an out-of-srcdir build the makefile deletes
> zconf.h from the srcdir? I'm fine with that, since make distclean will
> put it back.
The source directory has to be presumed read-only. It could be mounted on
a read-only NFS export, for example. (GNU Automake explicitly checks this
in "make distcheck", using Unix permissions.) I see that CMakeLists.txt
has basically been doing this, so it would fail in that case.
A revised patch against git master is attached. Differences from the
previous one:
* Removed bogus "include_directories(${CMAKE_CURRENT_SOURCE_DIR})" from
CMakeLists.txt for MSVC builds. I don't know why this was here, but it
was screwing up the #include path (and I double-checked this using
Visual Studio).
* Removed no-longer-needed $srcdir/zconf.h rename from CMakeLists.txt
* Added zlib.h copy and -DZLIB_INCPATH_SET to CMakeLists.txt
* Added -DZLIB_INCPATH_SET to Makefile.in
* Added "#ifdef ZLIB_INCPATH_SET" construct to compress.c, gzguts.h,
uncompr.c, zutil.h and win32/zlib1.rc.
--Daniel
--
Daniel Richard G. || danielg at teragram.com || Software Developer
Teragram Linguistic Technologies (a division of SAS)
http://www.teragram.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zlib-build-3.patch
Type: text/x-diff
Size: 9089 bytes
Desc: Revised patch against zlib git master
URL: <http://madler.net/pipermail/zlib-devel_madler.net/attachments/20120724/9e61c78f/attachment.bin>
More information about the Zlib-devel
mailing list