liblzma: add -ldl to Libs.private to support static linking again
commitc98ccdef182e9b970e3f8945154d39ae576a2272
authorJonathan Nieder <jrnieder@gmail.com>
Sat, 16 Jun 2012 07:44:02 +0000 (16 02:44 -0500)
committerJonathan Nieder <jrnieder@gmail.com>
Sat, 16 Jun 2012 07:44:02 +0000 (16 02:44 -0500)
tree7338aa041441dfab588de63cfd430eb27afffccd
parentd1695d77580c92c8ee003e4721c3c8c98d709812
liblzma: add -ldl to Libs.private to support static linking again

Static linking using the flags suggested by pkg-config fails:

$ gcc -static -o xz_pipe_comp xz_pipe_comp.c \
$(pkg-config --static --cflags --libs liblzma)
/usr/lib/i386-linux-gnu/liblzma.a(liblzma_la-common.o): In function `lzma_strm_init':
(.text+0x32a): undefined reference to `dlopen'

Add -ldl to get that working again.

After this patch, gcc still warns:

Using 'dlopen' in statically linked applications requires at
runtime the shared libraries from the glibc version used for
linking

This particular use of 'dlopen' is not harmful because it is only
meant to check if liblzma.so.2 is already (dynamically) loaded.  It is
also not useful in statically linked applications, but fixing that can
wait for another patch.

Reported-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
configure.ac
src/liblzma/Makefile.am