[poppler] 3 commits - configure.ac cpp/Makefile.am

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Apr 17 11:23:51 PDT 2012


 configure.ac    |   13 ++++++++++---
 cpp/Makefile.am |   22 +++++++++++++++++++++-
 2 files changed, 31 insertions(+), 4 deletions(-)

New commits:
commit bcbe9497a4fa50b41852abd538ad139c7b6693e5
Author: suzuki toshiya <mpsuzuki at hiroshima-u.ac.jp>
Date:   Tue Apr 17 20:21:58 2012 +0200

    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.

diff --git a/cpp/Makefile.am b/cpp/Makefile.am
index 6d4954b..f381e58 100644
--- a/cpp/Makefile.am
+++ b/cpp/Makefile.am
@@ -1,7 +1,27 @@
 INCLUDES =					\
 	-I$(top_srcdir)				\
 	-I$(top_srcdir)/goo			\
-	-I$(top_srcdir)/poppler
+	-I$(top_srcdir)/poppler			\
+	$(libjpeg_includes)			\
+	$(libtiff_includes)			\
+	$(libjpeg2000_includes)			\
+	$(libpng_includes)
+
+if BUILD_LIBJPEG
+libjpeg_includes = $(LIBJPEG_CFLAGS)
+endif
+
+if BUILD_LIBTIFF
+libtiff_includes = $(LIBTIFF_CFLAGS)
+endif
+
+if BUILD_LIBOPENJPEG
+libjpeg2000_includes = $(LIBOPENJPEG_CFLAGS)
+endif
+
+if BUILD_LIBPNG
+libpng_includes = $(LIBPNG_CFLAGS)
+endif
 
 SUBDIRS = . tests
 
commit 44c9df8277877ee1021317a3b6c253f80310f826
Author: suzuki toshiya <mpsuzuki at hiroshima-u.ac.jp>
Date:   Tue Apr 17 20:21:00 2012 +0200

    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.

diff --git a/configure.ac b/configure.ac
index 2e3be7c..71cd3b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -396,8 +396,6 @@ fi
 AM_CONDITIONAL(BUILD_LIBPNG, test x$enable_libpng = xyes)
 
 dnl Check for freetype headers
-FREETYPE_LIBS=
-FREETYPE_CFLAGS=
 
 PKG_CHECK_MODULES(FREETYPE, freetype2,
                   [freetype_pkgconfig=yes], [freetype_pkgconfig=no])
@@ -408,6 +406,9 @@ if test "x$freetype_pkgconfig" = "xyes"; then
 
 else
 
+  FREETYPE_LIBS=
+  FREETYPE_CFLAGS=
+
   AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
   if test "x$FREETYPE_CONFIG" != "xno" ; then
 
commit 9e0f0368e543df46b40cbd7bed6fdc1abf846e7d
Author: suzuki toshiya <mpsuzuki at hiroshima-u.ac.jp>
Date:   Tue Apr 17 20:19:41 2012 +0200

    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.

diff --git a/configure.ac b/configure.ac
index d7f7f86..2e3be7c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,13 @@ if test "x$GXX" = "xyes"; then
     cygwin* | mingw*)
     ;;
     *)
-      CXXFLAGS="$CXXFLAGS -ansi"
+      case "${CXXFLAGS}" in
+      *-std=*)
+        ;;
+      *)
+        CXXFLAGS="$CXXFLAGS -ansi"
+        ;;
+      esac
     ;;
   esac
 fi


More information about the poppler mailing list