configure fails to detect libmagic 5.38 when statically compiled with xz and bzip2 support
I was building mkvtoolnix-44.0.0 on Mac OS 10.14 from tarball today, using configure --enable-optimization --enable-magic
, and configure did not find magic: checking for magic_open in -lmagic... no
.
So I checked config.log and spotted the issue right away:
configure:9840: checking for magic_open in -lmagic
configure:9865: gcc -o conftest -framework CoreFoundation conftest.c -lmagic -lz >&5
undef: _BZ2_bzDecompressInit
undef: _lzma_code
undef: _lzma_auto_decoder
undef: _lzma_end
undef: _BZ2_bzDecompress
undef: _BZ2_bzDecompressEnd
Undefined symbols for architecture x86_64:
"_BZ2_bzDecompressInit", referenced from:
_uncompressbuf in lto.o
"_lzma_code", referenced from:
_uncompressbuf in lto.o
"_lzma_auto_decoder", referenced from:
_uncompressbuf in lto.o
"_lzma_end", referenced from:
_uncompressbuf in lto.o
"_BZ2_bzDecompress", referenced from:
_uncompressbuf in lto.o
"_BZ2_bzDecompressEnd", referenced from:
_uncompressbuf in lto.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:9865: $? = 1
File 5.38 was the first version to offer xz and bzip2 support, and if I had compiled it as a shared library, this wouldn't be an issue, but I didn't, so it did.
I didn't see this issue reported, and it won't be an issue for most people, but I thought I would flag it just in case.