[poppler] minor fix for CFLAGS about PNG headers

Albert Astals Cid aacid at kde.org
Wed Mar 28 11:25:06 PDT 2012


El Dijous, 29 de març de 2012, a les 02:12:35, suzuki toshiya va escriure:
> Dear Albert,
> 
> Sorry for slow activity for this issue (emulation of pkg-config's
> XXX_CFLAGS and XXX_LIBS environments). During the cross building
> test with MinGW, I found a few related issues and I made more
> patches. I attached them, and the description is following.
> 
> 1) reflectUSER_INCLUDESinlibjpegm4.diff
> 
> m4/libjpeg.m4 uses USER_INCLUDES and USER_LDFLAGS in it, but
> USER_INCLUDES is not reflected when jpeglib.h is searched.
> this patch modifies m4/libjpeg.m4 to reflect USER_INCLUDES
> when jpeglib.h is searched.
> 
> 2) handleEnvCFLAGSandLIBSforJPEGandTIFF.diff
> 
> evaluate pkg-config-like environmental variables like LIBJPEG_CFLAGS,
> LIBJPEG_LIBS, LIBTIFF_CFLAGS and LIBTIFF_LIBS in configuration.
> 
> 3) reflectJPEG+TIFF+PNGflags.diff
> 
> update Makefile.am to reflect LIBJPEG_CFLAGS, LIBTIFF_CFLAGS,
> LIBPNG_CFLAGS for related sources.
> 
> 4) checkJPEGvsWin32.diff
> 
> In libjpeg6b, there is a type definition conflict issue in jmorecfg.h.
> jmorecfg.h typedefs INT16 as short, INT32 as long. The latter conflict
> with basetsd.h of Microsoft Windows SDK or MinGW that typedefs INT32
> as int. basetsd.h is included by windows.h, so, if the users work with
> ANSI C features only, the conflict does not appear, it would be the
> background why such fundamental error has been preserved.
> Anyway, jmorecfg.h designer was aware about the conflict with X11 headers
> (Xmd.h defines INT16, INT32, etc), so if we pretend as if Xmd.h were
> included (by defining XMD_H), this issue can be bypassed. Attached patch
> checks the conflict, then, if there is a conflict, tries XMD_H trick, and
> uses it if it works. If jmorecfg.h or basetsd.h was manually fixed to
> prevent this issue, this trick is not used.
> 
> 5) fix-use_glib.diff
> 
> this is quite small fix. In poppler's configure, basically the shell
> variables are not enclosed, and not quoted, aslike
> 	if test x$use_glib = x; then
> This syntax make the test command confused when use_glib is multi-word
> value, as, "no (required cairo output)". In such case, test cannot know
> how to evaluate the token "no" "(required" "cairo", so some "syntax error"
> messages are given. Thus, quoting of the variable would be safer.

All pushed.

Albert

> 
> Regards,
> mpsuzuki
> 
> Albert Astals Cid wrote:
> > El Divendres, 23 de març de 2012, a les 15:36:55,
> > mpsuzuki at hiroshima-u.ac.jp> 
> > va escriure:
> >> Hi,
> > 
> > Hi
> > 
> >> During the cross build for MinGW environment, I found
> >> that small minor fixes for PNG headers.
> >> 
> >> If PNG library is available, goo/PNGWriter.h includes
> >> it (goo/Makefile.am appropriately reflect LIBPNG_CFLAGS).
> >> But when SplashBitmap.cc (including PNGWriter.h) is
> >> being compiled, LIBPNG_CFLAGS is not considered.
> >> Thus, when PNG library is installed in irregular directory,
> >> SplashBitmap.cc cannot be proprocessed correctly.
> >> LIBPNG_CFLAGS should be added to INCLUDES by fixing
> >> splash/Makefile.am.
> >> 
> >> Exactly same problem (PNGWriter.h) is found in
> >> HtmlOutputDev.cc compilation, so utils/Makefile.am
> >> should be improved.
> >> 
> >> I guess similar things are expected for JPEG and TIFF
> >> libraries, but now LIBJPEG_CFLAGS, LIBTIFF_CFLAGS are
> >> not handled by configure. Should I prepare some hooks
> >> for them?
> > 
> > Please, and also could you send the patches you sent here as attachment
> > insteaf of inline, makes much easier to apply them and make sure there was
> > no whitespace problem.
> > 
> > Cheers,
> > 
> >   Albert
> >> 
> >> diff --git a/splash/Makefile.am b/splash/Makefile.am
> >> index 914b308..afd31df 100644
> >> --- a/splash/Makefile.am
> >> +++ b/splash/Makefile.am
> >> @@ -3,6 +3,10 @@ INCLUDES =					\
> >> 
> >>  	-I$(top_srcdir)/goo			\
> >>  	$(FREETYPE_CFLAGS)
> >> 
> >> +if BUILD_LIBPNG
> >> +INCLUDES += $(LIBPNG_CFLAGS)
> >> +endif
> >> +
> >> 
> >>  noinst_LTLIBRARIES = libsplash.la
> >>  
> >>  if ENABLE_XPDF_HEADERS
> >> 
> >> diff --git a/utils/Makefile.am b/utils/Makefile.am
> >> index c0105d9..ad845c1 100644
> >> --- a/utils/Makefile.am
> >> +++ b/utils/Makefile.am
> >> @@ -117,6 +117,12 @@ pdftohtml_SOURCES =				\
> >> 
> >>  	HtmlUtils.h				\
> >>  	$(common)
> >> 
> >> +# HtmlOutputDev uses goo/PNGWriter.h that may depend on libpng header
> >> +pdftohtml_CXXFLAGS = $(AM_CXXFLAGS)
> >> +if BUILD_LIBPNG
> >> +pdftohtml_CXXFLAGS += $(LIBPNG_CFLAGS)
> >> +endif
> >> +
> >> 
> >>  pdfseparate_SOURCES =				\
> >>  
> >>  	pdfseparate.cc				\
> >>  	$(common)
> >> 
> >> _______________________________________________
> >> poppler mailing list
> >> poppler at lists.freedesktop.org
> >> http://lists.freedesktop.org/mailman/listinfo/poppler
> > 
> > _______________________________________________
> > poppler mailing list
> > poppler at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/poppler


More information about the poppler mailing list