[poppler] 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:18:52 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 8a6697f89625106f3c373dbc7b4dc521e22502f7
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 b1fdb87a4ebb5079c731256cce1870de8c54c65d
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 0b6e7c0..86dbf4d 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 9e577110134eb1e093e697b7504efca759000086
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 49f5cd3..6aa8635 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 58c8430ac584f3ba5e97aceb148e6287bfc45f95
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 b34f1c9..49f5cd3 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]))
@@ -601,8 +604,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 e3663a855a9c86f0a3988a7a50fa40d37d0ea069
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 7227c407d23a37f5d95e6c01cb7411be2f82ca85
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 34e727e011529be312313a1f4d4fa1ba9c545888
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 1bc2f4501ea4e56ca99ae4d94d6cf34cf33c2c7a
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