Added libtool support to JBIG2DEC
"carlo\.bramix" <[email protected]> Fri, 19 Mar 2010 00:54:11 +0100
| Newsgroups | gmane.comp.printing.ghostscript.jbig2dec.devel |
|---|---|
| Message-ID | <[email protected]> |
--_=__=_XaM3_.1268956451.2A.204546.42.2055.52.42.007.1486563522
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Hello,
I would like to propose the inclusion of some fixes in jbig2dec build scr=
ipts.
I upgraded those jbig2dec scripts for using libtool: this action has impr=
oved greatly the portability of the library and now I'm able to build sha=
red library versions on mingw+msys, cygwin and linux (tested coLinux with=
Debian 5.0 distribution).
I also discovered that jbig2dec was not able to detect libpng: previously=
that library was tested by checking png_check_sig() but now this functio=
n has been deprecated and removed.
In my patch I'm using pkgconfig for retrieving correct cflags and library=
options of libpng: in this manner all previous code around libpng detect=
ion has been obsoleted and it has been removed.
It also seems to me that there was a bug because png module was not inclu=
ded in the building of the library.
I hope you could find it useful.
Sincerely,
Carlo Bramini.
--_=__=_XaM3_.1268956451.2A.204546.42.2055.52.42.007.1486563522
Content-Type: text/plain;
name="=?iso-8859-1?Q?jbig2dec.txt?="
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="=?iso-8859-1?Q?jbig2dec.txt?="
diff -r -u jbig2dec-0.10-old/Makefile.am jbig2dec-0.10-new/Makefile.am=0A=
--- jbig2dec-0.10-old/Makefile.am 2009-05-29 04:37:34 +0000=0A+++ jbig2de=
c-0.10-new/Makefile.am 2010-03-18 20:40:48 +0000=0A@@ -3,10 +3,10 @@=0A #=
require automake 1.7=0A AUTOMAKE_OPTIONS =3D foreign 1.7 dist-bzip2 dist=
-zip -Wall=0A =0A-lib_LIBRARIES =3D libjbig2dec.a=0A+lib_LTLIBRARIES =3D =
libjbig2dec.la=0A include_HEADERS =3D jbig2.h=0A =0A-libjbig2dec_a_SOURCE=
S =3D jbig2.c \=0A+libjbig2dec_la_SOURCES =3D jbig2.c \=0A jbig2_arith.c=
jbig2_arith_int.c jbig2_arith_iaid.c jbig2_huffman.c \=0A jbig2_segment=
.c jbig2_page.c \=0A jbig2_symbol_dict.c jbig2_text.c \=0A@@ -19,6 +19,1=
3 @@=0A jbig2_huffman.h jbig2_hufftab.h jbig2_mmr.h \=0A jbig2_generic.=
h jbig2_symbol_dict.h jbig2_text.h \=0A jbig2_metadata.c jbig2_metadata.=
h=0A+libjbig2dec_la_CFLAGS =3D $(LIBPNG_CFLAGS)=0A+libjbig2dec_la_LDFLAGS=
=3D $(LTLDFLAGS)=0A+libjbig2dec_la_LIBADD =3D $(LIBPNG_LIBS)=0A+=0A+if H=
AVE_LIBPNG=0A+libjbig2dec_la_SOURCES +=3D jbig2_image_png.c=0A+endif=0A =0A=
bin_PROGRAMS =3D jbig2dec=0A noinst_PROGRAMS =3D test_sha1 test_huffman =
test_arith=0A@@ -26,7 +33,7 @@=0A jbig2dec_SOURCES =3D jbig2dec.c sha1.c =
sha1.h \=0A jbig2.h jbig2_image.h getopt.h \=0A os_types.h config_types=
.h config_win32.h=0A-jbig2dec_LDADD =3D libjbig2dec.a @LIBOBJS@=0A+jbig2d=
ec_LDADD =3D libjbig2dec.la @LIBOBJS@=0A =0A EXTRA_DIST =3D test_jbig2dec=
.py msvc.mak LICENSE CHANGES=0A =0A@@ -39,9 +46,9 @@=0A =0A test_arith_SO=
URCES =3D jbig2_arith.c=0A test_arith_CFLAGS =3D -DTEST=0A-test_arith_LDA=
DD =3D libjbig2dec.a=0A+test_arith_LDADD =3D libjbig2dec.la=0A =0A test_h=
uffman_SOURCES =3D jbig2_huffman.c=0A test_huffman_CFLAGS =3D -DTEST=0A-t=
est_huffman_LDADD =3D libjbig2dec.a=0A+test_huffman_LDADD =3D libjbig2dec=
.la=0A =0Adiff -r -u jbig2dec-0.10-old/configure.ac jbig2dec-0.10-new/con=
figure.ac=0A--- jbig2dec-0.10-old/configure.ac 2009-05-29 04:39:28 +0000=0A=
+++ jbig2dec-0.10-new/configure.ac 2010-03-18 20:41:10 +0000=0A@@ -7,11 +=
7,29 @@=0A AM_INIT_AUTOMAKE([-Wall])=0A AM_CONFIG_HEADER(config.h)=0A =0A=
+AC_CANONICAL_HOST=0A+AC_CANONICAL_TARGET=0A+=0A # Checks for programs.=0A=
AC_PROG_CC=0A AM_PROG_CC_C_O=0A AC_PROG_RANLIB=0A =0A+# Starts libtool=0A=
+AC_LIBTOOL_WIN32_DLL=0A+AC_PROG_LIBTOOL=0A+=0A+case ${target} in=0A+*min=
gw* | *cygwin*)=0A+ LTLDFLAGS=3D"-no-undefined -export-dynamic"=0A+ =
;;=0A+*)=0A+ LTLDFLAGS=3D""=0A+ ;;=0A+esac=0A+=0A+AC_SUBST(LTLDFLA=
GS)=0A+=0A # platform specific compiler flags=0A if test "x$GCC" =3D xyes=
; then=0A CFLAGS=3D"$CFLAGS -Wall"=0A@@ -20,35 +38,25 @@=0A # Checks fo=
r libraries.=0A dnl by default we want png support if possible=0A AC_ARG_=
WITH([libpng], =0A- AC_HELP_STRING([--with-libpng[=3Dprefix]],=0A+ AC_H=
ELP_STRING([--with-libpng],=0A [include support for png output (if li=
bpng is available)]),=0A- [ac_cv_want_libpng=3D"$withval"], [ac_cv_want_=
libpng=3D"yes"])=0A-save_cflags=3D"$CFLAGS"=0A-save_ldflags=3D"$LDFLAGS"=0A=
+ [ac_cv_want_libpng=3D"no"], [ac_cv_want_libpng=3D"yes"])=0A+=0A have_l=
ibpng=3D"no"=0A-if test "x$ac_cv_want_libpng" !=3D "xno"; then=0A- if te=
st "x$ac_cv_want_libpng" !=3D "xyes"; then=0A- dnl if it's not yes or =
no, treat as a prefix=0A- CFLAGS=3D"$CFLAGS -I$ac_cv_want_libpng/inclu=
de"=0A- LDFLAGS=3D"$LDFLAGS -L$ac_cv_want_libpng/lib"=0A- fi=0A+if te=
st "x$ac_cv_want_libpng" =3D "xyes"; then=0A dnl libpng requires pow() =
which may be in libm=0A AC_SEARCH_LIBS([pow], [m])=0A- AC_CHECK_LIB([p=
ng], [png_check_sig], [=0A- AC_CHECK_LIB([z], [deflate], [=0A- AC=
_DEFINE(HAVE_LIBPNG, 1, [Define if libpng is available (-lpng)])=0A- =
LIBS=3D"-lpng -lz $LIBS"=0A- AC_LIBOBJ([jbig2_image_png])=0A- =
have_libpng=3D"yes"=0A- ])=0A- ])=0A-fi=0A-dnl restore (possibly chan=
ged) flags if we didn't find working libpng=0A-if test "x$have_libpng" !=3D=
"xyes"; then=0A- CFLAGS=3D"$save_cflags"=0A- LDFLAGS=3D"$save_ldflags"=
=0A+ PKG_CHECK_MODULES(LIBPNG, libpng,=0A+ [have_libp=
ng=3D"yes"],=0A+ [have_libpng=3D"no"])=0A+=0A+ if tes=
t "x$have_libpng" =3D "xyes"; then=0A+ AC_DEFINE(HAVE_LIBPNG, 1, [Defi=
ne if libpng is available])=0A+ fi=0A fi=0A =0A+AM_CONDITIONAL(HAVE_LIBP=
NG, test "x$have_libpng" =3D "xyes")=0A+=0A # Checks for header files.=0A=
AC_HEADER_STDC=0A AC_CHECK_HEADERS([libintl.h stddef.h unistd.h strings.=
h])=0A
--_=__=_XaM3_.1268956451.2A.204546.42.2055.52.42.007.1486563522
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
jbig2-dev mailing list
[email protected]
http://ghostscript.com/cgi-bin/mailman/listinfo/jbig2-dev
--_=__=_XaM3_.1268956451.2A.204546.42.2055.52.42.007.1486563522--