ref: d5e7f7fe3e90ad87b6b60cf7193c6bcfd1e33904
parent: 46d6b40803cb7a68ceb06b2f71db8cf3f384c2ee
author: Chris Liddell <[email protected]>
date: Tue May 7 11:34:00 EDT 2013
Bug 691555: two jbig2dec patches for libpng14 Cygwin/MinGW from [email protected] Adding "-lpng -lz" to LIBS causes everything to be linked against them, whether or not they need them. Only the jbig2dec executable uses libpng; libjbig2dec does not, so this causes a needless dependency on libpng and zlib. Instead, define a separate PNG_LIBS variable and use it in jpeg2dec_LDADD. libtool requires the -no-undefined flag on PE platforms (Cygwin/MinGW) in order to make a shared library due to the unique requirements of DLLs. No cluster differences.
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,7 +8,7 @@
CFLAGS = @CFLAGS@ $(XCFLAGS)
-libjbig2dec_la_LDFLAGS = -version-info @JBIG2DEC_LT_CURRENT@:@JBIG2DEC_LT_REVISION@:@JBIG2DEC_LT_AGE@
+libjbig2dec_la_LDFLAGS = -version-info @JBIG2DEC_LT_CURRENT@:@JBIG2DEC_LT_REVISION@:@JBIG2DEC_LT_AGE@ -no-undefined
libjbig2dec_la_SOURCES = jbig2.c \
jbig2_arith.c jbig2_arith_int.c jbig2_arith_iaid.c jbig2_huffman.c \
jbig2_segment.c jbig2_page.c \
@@ -29,7 +29,7 @@
jbig2dec_SOURCES = jbig2dec.c sha1.c sha1.h \
jbig2.h jbig2_image.h getopt.h \
os_types.h config_types.h config_win32.h
-jbig2dec_LDADD = libjbig2dec.la @LIBOBJS@
+jbig2dec_LDADD = libjbig2dec.la @LIBOBJS@ $(PNG_LIBS)
dist_man_MANS = jbig2dec.1
--- a/configure.ac
+++ b/configure.ac
@@ -48,7 +48,7 @@
AC_CHECK_LIB([png], [png_create_write_struct], [
AC_CHECK_LIB([z], [deflate], [
AC_DEFINE(HAVE_LIBPNG, 1, [Define if libpng is available (-lpng)])
- LIBS="-lpng -lz $LIBS"
+ PNG_LIBS="-lpng -lz"
AC_LIBOBJ([jbig2_image_png])
have_libpng="yes"
])
@@ -59,6 +59,7 @@
CFLAGS="$save_cflags"
LDFLAGS="$save_ldflags"
fi
+AC_SUBST(PNG_LIBS)
# Checks for header files.
AC_HEADER_STDC