[poppler] Branch 'poppler-0.14' - 8 commits - configure.ac cpp/Makefile.am cpp/tests glib/Makefile.am goo/gfile.cc goo/GooTimer.cc goo/GooTimer.h poppler/GlobalParams.cc poppler/Makefile.am poppler/PDFDoc.cc qt4/demos qt4/src qt4/tests

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Jul 12 15:21:37 PDT 2010


 configure.ac            |   14 +++++++++-----
 cpp/Makefile.am         |    2 +-
 cpp/tests/Makefile.am   |    2 ++
 glib/Makefile.am        |    2 ++
 goo/GooTimer.cc         |    6 +++---
 goo/GooTimer.h          |    4 ++--
 goo/gfile.cc            |    4 ++--
 poppler/GlobalParams.cc |    4 ++--
 poppler/Makefile.am     |    2 +-
 poppler/PDFDoc.cc       |    4 ++--
 qt4/demos/Makefile.am   |    2 ++
 qt4/src/Makefile.am     |    7 +++++--
 qt4/tests/Makefile.am   |    2 ++
 13 files changed, 35 insertions(+), 20 deletions(-)

New commits:
commit 78d7d2128aeed90e4a83955394472507f2ca1b80
Author: Hib Eris <hib at hiberis.nl>
Date:   Sat Jul 3 16:42:04 2010 +0200

    Only define findModifier() when used
    
    Prevents a warning when building with win32 font backend.

diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 473eab7..4657c07 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -1002,6 +1002,7 @@ FILE *GlobalParams::findToUnicodeFile(GooString *name) {
   return NULL;
 }
 
+#if WITH_FONTCONFIGURATION_FONTCONFIG
 static GBool findModifier(const char *name, const char *modifier, const char **start)
 {
   const char *match;
@@ -1020,7 +1021,6 @@ static GBool findModifier(const char *name, const char *modifier, const char **s
   }
 }
 
-#if WITH_FONTCONFIGURATION_FONTCONFIG
 static FcPattern *buildFcPattern(GfxFont *font)
 {
   int weight = -1,
commit bd2cd510f03f49ca913852ed77f9b4877b406e3a
Author: Hib Eris <hib at hiberis.nl>
Date:   Fri Jul 2 10:53:20 2010 +0200

    Fix compile warnings on auto imports for mingw compiler

diff --git a/cpp/Makefile.am b/cpp/Makefile.am
index d8891db..dda683a 100644
--- a/cpp/Makefile.am
+++ b/cpp/Makefile.am
@@ -42,4 +42,4 @@ libpoppler_cpp_la_LIBADD = 			\
 	$(top_builddir)/poppler/libpoppler.la	\
 	$(LIBICONV)
 
-libpoppler_cpp_la_LDFLAGS = -version-info 1:0:1 @create_shared_lib@
+libpoppler_cpp_la_LDFLAGS = -version-info 1:0:1 @create_shared_lib@ @auto_import_flags@
diff --git a/cpp/tests/Makefile.am b/cpp/tests/Makefile.am
index d2544a5..5066889 100644
--- a/cpp/tests/Makefile.am
+++ b/cpp/tests/Makefile.am
@@ -1,3 +1,5 @@
+AM_LDFLAGS = @auto_import_flags@
+
 INCLUDES =					\
 	-I$(top_srcdir)				\
 	-I$(top_srcdir)/utils			\
diff --git a/glib/Makefile.am b/glib/Makefile.am
index 2b0fadd..32ce952 100644
--- a/glib/Makefile.am
+++ b/glib/Makefile.am
@@ -1,3 +1,5 @@
+AM_LDFLAGS = @auto_import_flags@
+
 SUBDIRS = . reference demo
 INCLUDES =					\
 	-DG_LOG_DOMAIN=\"Poppler\"		\
diff --git a/poppler/Makefile.am b/poppler/Makefile.am
index 5f8f7fb..5da63f0 100644
--- a/poppler/Makefile.am
+++ b/poppler/Makefile.am
@@ -176,7 +176,7 @@ libpoppler_la_LIBADD =				\
 	$(PTHREAD_LIBS)				\
 	$(win32_libs)
 
-libpoppler_la_LDFLAGS = -version-info 6:0:0 @create_shared_lib@
+libpoppler_la_LDFLAGS = -version-info 6:0:0 @create_shared_lib@ @auto_import_flags@
 
 if ENABLE_XPDF_HEADERS
 
diff --git a/qt4/demos/Makefile.am b/qt4/demos/Makefile.am
index c3f636c..50486b8 100644
--- a/qt4/demos/Makefile.am
+++ b/qt4/demos/Makefile.am
@@ -1,3 +1,5 @@
+AM_LDFLAGS = @auto_import_flags@
+
 INCLUDES =					\
 	-I$(top_srcdir)				\
 	-I$(top_srcdir)/poppler			\
diff --git a/qt4/src/Makefile.am b/qt4/src/Makefile.am
index 5c921bb..47a2606 100644
--- a/qt4/src/Makefile.am
+++ b/qt4/src/Makefile.am
@@ -60,7 +60,7 @@ libpoppler_qt4_la_LIBADD = 			\
 	$(FONTCONFIG_LIBS)				\
 	$(POPPLER_QT4_LIBS)
 
-libpoppler_qt4_la_LDFLAGS = -version-info 6:0:3 @create_shared_lib@
+libpoppler_qt4_la_LDFLAGS = -version-info 6:0:3 @create_shared_lib@ @auto_import_flags@
 
 # This rule lets GNU make create any *.moc from the equivalent *.h
 .h.moc:
diff --git a/qt4/tests/Makefile.am b/qt4/tests/Makefile.am
index 763b177..7bc16d7 100644
--- a/qt4/tests/Makefile.am
+++ b/qt4/tests/Makefile.am
@@ -1,3 +1,5 @@
+AM_LDFLAGS = @auto_import_flags@
+
 INCLUDES =					\
 	-I$(top_srcdir)				\
 	-I$(top_srcdir)/poppler			\
commit 3c579b8acc3e43efe6096022a4d26e02b61c6557
Author: Hib Eris <hib at hiberis.nl>
Date:   Fri Jul 2 10:51:24 2010 +0200

    Check for declaration of gettimeofday()
    
    The function gettimeofday() is not declared in ansi mode with the
    mingw compiler, even though the function exists. Therefore, configure must
    not only check with AC_CHECK_FUNC, but also with AC_CHECK_DECL.
    
    Also, the checks must run in a C++ context because that is where
    gettimeofday() is used.

diff --git a/configure.ac b/configure.ac
index 7946d5d..467da43 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,9 +29,6 @@ if test "x$GXX" = "xyes"; then
   CXXFLAGS="$CXXFLAGS -ansi"
 fi
 AC_PROG_INSTALL
-AC_CHECK_FUNC(gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Defines if gettimeofday is available on your system]))
-AC_CHECK_FUNC(localtime_r, AC_DEFINE(HAVE_LOCALTIME_R, 1, [Defines if localtime_r is available on your system]))
-AC_CHECK_FUNC(gmtime_r, AC_DEFINE(HAVE_GMTIME_R, 1, [Defines if gmtime_r is available on your system]))
 
 dnl ##### Check for pkgconfig
 PKG_PROG_PKG_CONFIG
@@ -120,6 +117,10 @@ dnl ##### bit stricter (requiring function prototypes in include files).
 dnl ##### (99% of xpdf is written in C++.)
 AC_LANG_CPLUSPLUS
 
+AC_CHECK_DECL(gettimeofday, [AC_CHECK_FUNC(gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Defines if gettimeofday is available on your system]))],[],[#include <sys/time.h>])
+AC_CHECK_FUNC(localtime_r, AC_DEFINE(HAVE_LOCALTIME_R, 1, [Defines if localtime_r is available on your system]))
+AC_CHECK_FUNC(gmtime_r, AC_DEFINE(HAVE_GMTIME_R, 1, [Defines if gmtime_r is available on your system]))
+
 dnl ##### Check for extra libraries needed by X.  (LynxOS needs this.)
 AC_CHECK_FUNC(gethostbyname)
 if test $ac_cv_func_gethostbyname = no; then
commit 04f5500d5cb472b4fd6d5ee74d47136cf01533a8
Author: Hib Eris <hib at hiberis.nl>
Date:   Wed Jun 30 15:06:44 2010 +0200

    Set -ansi compiler flag early in configure.ac
    
    The -ansi compiler flag does not enable warnings, but turns of certain
    features of GCC. To force feature tests to use this flag, it should be
    set early in configure.ac
    
    This is important for the mingw compiler where header files refrain
    from declaring certain function (e.g. gettimeofday()) when the -ansi
    flag is set.

diff --git a/configure.ac b/configure.ac
index 22767f1..7946d5d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,9 @@ AC_PROG_CC_STDC
 #  CXX="gcc"
 #fi
 AC_PROG_CXX
+if test "x$GXX" = "xyes"; then
+  CXXFLAGS="$CXXFLAGS -ansi"
+fi
 AC_PROG_INSTALL
 AC_CHECK_FUNC(gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Defines if gettimeofday is available on your system]))
 AC_CHECK_FUNC(localtime_r, AC_DEFINE(HAVE_LOCALTIME_R, 1, [Defines if localtime_r is available on your system]))
@@ -596,8 +599,8 @@ if test "x$GCC" != xyes; then
 fi
 case "$enable_compile_warnings" in
   no)	;;
-  yes)	CXXFLAGS="-Wall -Wno-write-strings -Woverloaded-virtual -Wnon-virtual-dtor -ansi $CXXFLAGS" ;;
-  kde)	CXXFLAGS="-Wnon-virtual-dtor -Wno-long-long -Wundef -ansi \
+  yes)	CXXFLAGS="-Wall -Wno-write-strings -Woverloaded-virtual -Wnon-virtual-dtor $CXXFLAGS" ;;
+  kde)	CXXFLAGS="-Wnon-virtual-dtor -Wno-long-long -Wundef \
 		-D_XOPEN_SOURCE=600 -D_BSD_SOURCE -Wcast-align \
 		-Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith \
 		-Wwrite-strings -O2 -Wformat-security \
commit a36f08f9b14853c52ba01441a2e3ac42a9d6c356
Author: Hib Eris <hib at hiberis.nl>
Date:   Fri Jul 2 14:45:15 2010 +0200

    Use MAX_PATH instead of _MAX_PATH everywhere
    
    _MAX_PATH is compiler specific and not availble with the mingw compiler
    in ansi mode. MAX_PATH is in the Windows api and thus always available
    when windows.h is included.

diff --git a/goo/gfile.cc b/goo/gfile.cc
index e875630..ff23aae 100644
--- a/goo/gfile.cc
+++ b/goo/gfile.cc
@@ -376,11 +376,11 @@ GooString *makePathAbsolute(GooString *path) {
 
 #elif defined(_WIN32)
   //---------- Win32 ----------
-  char buf[_MAX_PATH];
+  char buf[MAX_PATH];
   char *fp;
 
   buf[0] = '\0';
-  if (!GetFullPathName(path->getCString(), _MAX_PATH, buf, &fp)) {
+  if (!GetFullPathName(path->getCString(), MAX_PATH, buf, &fp)) {
     path->clear();
     return path;
   }
diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 293d7f3..473eab7 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -172,7 +172,7 @@ DllMain (HINSTANCE hinstDLL,
 static char *
 get_poppler_datadir (void)
 {
-  static char retval[_MAX_PATH];
+  static char retval[MAX_PATH];
   static int beenhere = 0;
 
   unsigned char *p;
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index b650480..ade5fe4 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -131,7 +131,7 @@ PDFDoc::PDFDoc(GooString *fileNameA, GooString *ownerPassword,
 PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, GooString *ownerPassword,
 	       GooString *userPassword, void *guiDataA) {
   OSVERSIONINFO version;
-  wchar_t fileName2[_MAX_PATH + 1];
+  wchar_t fileName2[MAX_PATH + 1];
   Object obj;
   int i;
 
@@ -146,7 +146,7 @@ PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, GooString *ownerPassword,
   }
 
   // zero-terminate the file name string
-  for (i = 0; i < fileNameLen && i < _MAX_PATH; ++i) {
+  for (i = 0; i < fileNameLen && i < MAX_PATH; ++i) {
     fileName2[i] = fileNameA[i];
   }
   fileName2[i] = 0;
commit 2c17d03a09e7488cda2fc73d933331211833bbca
Author: Hib Eris <hib at hiberis.nl>
Date:   Wed Jun 30 16:15:06 2010 +0200

    Check for _WIN32 instead of _MSC_VER

diff --git a/goo/GooTimer.cc b/goo/GooTimer.cc
index 769fd63..0f4ccfe 100644
--- a/goo/GooTimer.cc
+++ b/goo/GooTimer.cc
@@ -32,7 +32,7 @@ GooTimer::GooTimer() {
 void GooTimer::start() {
 #ifdef HAVE_GETTIMEOFDAY
   gettimeofday(&start_time, NULL);
-#elif defined(_MSC_VER)
+#elif defined(_WIN32)
   QueryPerformanceCounter(&start_time);
 #endif
   active = true;
@@ -41,7 +41,7 @@ void GooTimer::start() {
 void GooTimer::stop() {
 #ifdef HAVE_GETTIMEOFDAY
   gettimeofday(&end_time, NULL);
-#elif defined(_MSC_VER)
+#elif defined(_WIN32)
   QueryPerformanceCounter(&end_time);
 #endif
   active = false;
@@ -70,7 +70,7 @@ double GooTimer::getElapsed()
 
   return total;
 }
-#elif defined(_MSC_VER)
+#elif defined(_WIN32)
 double GooTimer::getElapsed()
 {
   LARGE_INTEGER   freq;
diff --git a/goo/GooTimer.h b/goo/GooTimer.h
index f03413c..864bf68 100755
--- a/goo/GooTimer.h
+++ b/goo/GooTimer.h
@@ -22,7 +22,7 @@
 #include <sys/time.h>
 #endif
 
-#ifdef _MSC_VER
+#ifdef _WIN32
 #include <windows.h>
 #endif
 
@@ -44,7 +44,7 @@ private:
 #ifdef HAVE_GETTIMEOFDAY
   struct timeval start_time;
   struct timeval end_time;
-#elif defined(_MSC_VER)
+#elif defined(_WIN32)
   LARGE_INTEGER start_time;
   LARGE_INTEGER end_time;
 #endif
commit 4159564c0dd6aadfef533f5b7d3305d11d7bfa83
Author: Hib Eris <hib at hiberis.nl>
Date:   Tue Jun 29 16:43:31 2010 +0200

    Fix cross compiling for Windows with autotools
    
    When cross compiling for Windows with autotools, libtool creates
    libpoppler_qt4_la-poppler-optcontent.lo instead of
    poppler-optcontent.lo. Thus, explicitly using poppler-optcontent.lo to
    create poppler-optcontent.moc does not work well.

diff --git a/qt4/src/Makefile.am b/qt4/src/Makefile.am
index 087c693..5c921bb 100644
--- a/qt4/src/Makefile.am
+++ b/qt4/src/Makefile.am
@@ -66,7 +66,7 @@ libpoppler_qt4_la_LDFLAGS = -version-info 6:0:3 @create_shared_lib@
 .h.moc:
 	$(AM_V_GEN) $(MOCQT4) -i $< -o $@
 
-poppler-optcontent.lo: poppler-optcontent.moc
+BUILT_SOURCES = poppler-optcontent.moc
 
 clean-generic:
 	rm -f *.moc
commit 67c231778181fbce8e988e2b9c8ac889f5ebd86c
Author: Hib Eris <hib at hiberis.nl>
Date:   Tue Jun 29 15:34:22 2010 +0200

    define poppler_qt4_EXPORTS when building with autotools
    
    Lets you build the qt4 bindings for Windows with automake/autoconf.

diff --git a/qt4/src/Makefile.am b/qt4/src/Makefile.am
index a2eda77..087c693 100644
--- a/qt4/src/Makefile.am
+++ b/qt4/src/Makefile.am
@@ -51,6 +51,9 @@ libpoppler_qt4_la_SOURCES =			\
 	poppler-private.h			\
 	poppler-page-transition-private.h
 
+libpoppler_qt4_la_CXXFLAGS = 			\
+	-Dpoppler_qt4_EXPORTS
+
 libpoppler_qt4_la_LIBADD = 			\
 	$(top_builddir)/poppler/libpoppler.la	\
 	$(top_builddir)/poppler/libpoppler-arthur.la	\


More information about the poppler mailing list