Mojca Miklavec
2014-Jun-14 13:21 UTC
rsync compilation may find the system zlib before the included one
Hi, I'm trying to compile rsync 3.1.1pre2 on OS X with CFLAGS=-I/opt/local/include. The consequence of this is that rsync fails to build: /usr/bin/clang -I. -I. -pipe -Os -I/opt/local/include -arch x86_64 -DHAVE_CONFIG_H -Wall -W -I./zlib -I/opt/local/include -c token.c -o token.o token.c:420:26: error: use of undeclared identifier 'Z_INSERT_ONLY' r = deflate(&tx_strm, Z_INSERT_ONLY); ^ 1 error generated. The problem is that Z_INSERT_ONLY is only present in the built-in zlib, but rsync only sees the external zlib due to "-I/opt/local/include" coming in front of -I./zlib when calling the compiler. I need to do more test, but I believe that the following line from configure.ac: CFLAGS="$CFLAGS -I$srcdir/zlib" should better be CFLAGS="-I$srcdir/zlib $CFLAGS" just in case. I'm aware that using CFLAGS="-I/some/path/include" might not always be the best practice, but the configuration makes sure that "-I." comes first, while it doesn't make sure that the zlib include comes in front of the rest of the flags. Mojca
Wayne Davison
2014-Jun-14 16:51 UTC
rsync compilation may find the system zlib before the included one
On Sat, Jun 14, 2014 at 6:21 AM, Mojca Miklavec <mojca at macports.org> wrote:> but the configuration makes sure that "-I." comes first, while it doesn't > make sure that the zlib include comes in front of the rest of the flags. >True. I moved both -Ipopt and -Izlib early in the CFLAGS in configure. Thanks for testing! ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20140614/7e95856e/attachment.html>