rsync compilation may find the system zlib before the included one
Mojca Miklavec
mojca at macports.org
Sat Jun 14 07:21:40 MDT 2014
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
More information about the rsync
mailing list