[poppler] a few CFLAGS/LIBS improvement for configure.ac

Albert Astals Cid aacid at kde.org
Tue Apr 17 11:24:17 PDT 2012


El Dimarts, 17 d'abril de 2012, a les 20:34:02, suzuki toshiya va escriure:
> Hi,
> 
> In these 2 weeks, Jon and I were working to compile poppler for QNX
> (not by genuine SDK, but) by gcc-based SDK for BlackBerry Playbook.
> 
> Because QNX is expected to be POSIX compliant operating system,
> most process is almost same with the cross building for Unix systems.
> However, some libc functions standardized in recent POSIX:2004,
> ISO C99 are disabled by default. Some CFLAGS are expected, but
> current configure of poppler refuses or overwrites the CFLAGS passed
> by environmental variables. So here I propose small 3 patches to prevent
> it. Please consider the application to 0.20. I'm sorry for posting
> the explanations longer than the patches.

Commited, thanks a lot for the long descriptions, make everything much easier 
:-)

Albert

> 
> Regards,
> mpsuzuki
> 
> 1) Do not append "-ansi" to CXXFLAG, if "-std=XXX" is already specified.
> 
> SplashOutputDev.cc uses isfinite() function (defined by math.h).
> isfinite() was standardized in C99, and imported to C++0x in later.
> 
> In QNX header file system, isfinite() is disabled by default,
> the definition of __STDC_VERSION__ > 199901 is required to enable it.
> In the case of GCC, "-std=c99" (for C) or "-std=gnu++0x" (for C++)
> is expected.
> 
> But, current configure of poppler appends "-ansi" flag for CXXFLAGS,
> if the compiler is known to be GNU. "-ansi" is C89 or C++98, so isfinite()
> is unavailable. I propose a patch NOT to "-ansi" flag, if CXXFLAGS
> includes "-std=XXX" already.
> 
> 2) Do not clear FREETYPE_CFLAGS, FREETYPE_LIBS before PKG_CHECK_MODULES()
> 
> Although configure --help says as if environmental variables
> FREETYPE_CFLAGS and FREETYPE_LIBS will overwrite the values obtained
> by pkg-config. But it is not. These help messages are automatically given
> by pkg-config macro (so I guess no poppler developer designed so
> intentionally).
> 
> In current configure, FREETYPE_CFLAGS, FREETYPE_LIBS are cleared before
> PKG_CONFIG_MODULES(), like:
> 
> 	dnl Check for freetype headers
> 	FREETYPE_LIBS=
> 	FREETYPE_CFLAGS=
> 
> 	PKG_CHECK_MODULES(FREETYPE, freetype2,
>         	          [freetype_pkgconfig=yes], [freetype_pkgconfig=no])
> 
> 	if test "x$freetype_pkgconfig" = "xyes"; then
> 
> 	  AC_DEFINE(HAVE_FREETYPE_H, 1, [Have FreeType2 include files])
> 
> 	else
> 
> 	  AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
> 	[...]
> 
> Checking the history why these values are cleared, it seems that
> the initial revision of poppler did not use pkg-config to detect
> FREETYPE_CFLAGS, _LIBS. At that time, only freetype-config is used.
> In later, when PKG_CHECK_MODULES is introduced, it was accidentally
> introduced AFTER the clearning of FREETYPE_CFLAGS,_LIBS. As a result,
> the inconsistency between "configure --help" and what configure does
> really. I propose to move the clearance of FREETYPE_CFLAGS,_LIBS
> just before AC_PATH_PROG, to make PKG_CHECK_MODULES catch the environmental
> values.
> 
> 3) Copying graphics library CFLAGS to cpp frontend Makefile.am.
> 
> Because poppler-image.cpp includes PNGWriter.h, JpegWriter.h, TiffWriter.h,
> CFLAGS to include libpng, libjpeg and libtiff headers are expected.


More information about the poppler mailing list