Add missing libs to minizip linker command.

Trying to build the minizip utility from contrib/minizip after an
autoreconf -f:

	libtool: link: gcc -g -O2 -o minizip minizip.o
	minizip.o: In function `getFileCrc':
	/tmp/zlib/contrib/minizip/minizip.c:211: undefined reference to `crc32'
	minizip.o: In function `main':
	/tmp/zlib/contrib/minizip/minizip.c:378: undefined reference to `zipOpen64'
	/tmp/zlib/contrib/minizip/minizip.c:451: undefined reference to `zipOpenNewFileInZip3_64'
	/tmp/zlib/contrib/minizip/minizip.c:502: undefined reference to `zipCloseFileInZip'
	/tmp/zlib/contrib/minizip/minizip.c:509: undefined reference to `zipClose'
	/tmp/zlib/contrib/minizip/minizip.c:485: undefined reference to `zipWriteInFileInZip'
	collect2: error: ld returned 1 exit status

The cause: contrib/minizip/Makefile.am does not specify that minizip
needs to be linked to libminizip.  With some linkers (e.g., GNU
binutils without --copy-dt-needed-entries), an indirect dependency
cannot be used to resolve symbols, so link to libz for crc32(), too.
This commit is contained in:
Jonathan Nieder 2012-01-17 14:28:30 -06:00 committed by Mark Adler
parent ad88c19baa
commit 81015585d2

View File

@ -26,3 +26,4 @@ miniunzip_SOURCES = miniunz.c
miniunzip_LDADD = libminizip.la
minizip_SOURCES = minizip.c
minizip_LDADD = libminizip.la -lz