summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-07-15 15:46:02 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-07-15 15:46:02 +0000
commite4042723eabd6f9efb9b68034395b7d0ea999b82 (patch)
tree4e6d6da912c4eacb83aad667d10f7827643f53f9 /Build/source/texk/web2c
parente8b6183a1df246ebab704b4bc737a10fe08051da (diff)
LuaTeX: Distinguish poppler >= 0.25 or <= 0.24
git-svn-id: svn://tug.org/texlive/trunk@34619 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r--Build/source/texk/web2c/ChangeLog5
-rw-r--r--Build/source/texk/web2c/Makefile.in10
-rw-r--r--Build/source/texk/web2c/c-auto.in3
-rwxr-xr-xBuild/source/texk/web2c/configure51
-rw-r--r--Build/source/texk/web2c/configure.ac18
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog7
-rw-r--r--Build/source/texk/web2c/luatexdir/am/libluatex.am5
-rw-r--r--Build/source/texk/web2c/luatexdir/fake/StructTreeRoot.h16
-rw-r--r--Build/source/texk/web2c/luatexdir/image/epdf.h4
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lepdflib.cc18
10 files changed, 100 insertions, 37 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index 52d18d79f08..46b9d4379cc 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,3 +1,8 @@
+2014-07-15 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * configure.ac: Check for StructTreeRoot.h> (poppler 0.25 or
+ better) and define HAVE_STRUCTTREEROOT_H if found.
+
2014-07-09 Peter Breitenlohner <peb@mppmu.mpg.de>
* ac/web2c.ac: Drop configure option --disable-omfonts.
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in
index 9b7b5e96ded..63307afd279 100644
--- a/Build/source/texk/web2c/Makefile.in
+++ b/Build/source/texk/web2c/Makefile.in
@@ -2184,9 +2184,8 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \
luatexdir/luafontloader/fontforge/INSTALL \
luatexdir/luafontloader/fontforge/LICENSE \
luatexdir/luafontloader/fontforge/VERSION \
- luatexdir/fake/StructTreeRoot.h $(dist_libluatex_sources) \
- $(libluatex_web) luatexdir/ChangeLog luatexdir/NEWS \
- luatexdir/font/subfont.txt $(luatex_sources) \
+ $(dist_libluatex_sources) $(libluatex_web) luatexdir/ChangeLog \
+ luatexdir/NEWS luatexdir/font/subfont.txt $(luatex_sources) \
luatexdir/getluatexsvnversion.sh $(luatex_tests) \
$(luajittex_tests) luatexdir/tests/luaimage.tex tests/1-4.jpg \
tests/B.pdf tests/basic.tex tests/lily-ledger-broken.png \
@@ -3015,10 +3014,9 @@ libluatex_a_preflags = $(AM_CPPFLAGS) $(ZLIB_INCLUDES) \
$(LIBPNG_INCLUDES) $(POPPLER_INCLUDES) -I$(srcdir)/libmd5 \
-DpdfTeX -I$(srcdir)/luatexdir \
-DSYNCTEX_ENGINE_H='<synctex-luatex.h>' -I$(srcdir)/synctexdir
-libluatex_a_CPPFLAGS = $(libluatex_a_preflags) $(LUA_INCLUDES) \
- -I$(srcdir)/luatexdir/fake
+libluatex_a_CPPFLAGS = $(libluatex_a_preflags) $(LUA_INCLUDES)
libluajittex_a_CPPFLAGS = $(libluatex_a_preflags) $(LUAJIT_INCLUDES) \
- $(LUAJIT_DEFINES) -DLuajitTeX -I$(srcdir)/luatexdir/fake
+ $(LUAJIT_DEFINES) -DLuajitTeX
libluatex_a_CXXFLAGS = # $(WARNING_CXXFLAGS)
libluajittex_a_CXXFLAGS = # $(WARNING_CXXFLAGS)
dist_libluatex_a_SOURCES = \
diff --git a/Build/source/texk/web2c/c-auto.in b/Build/source/texk/web2c/c-auto.in
index 5c02f3bd4f3..e3aaa8857e1 100644
--- a/Build/source/texk/web2c/c-auto.in
+++ b/Build/source/texk/web2c/c-auto.in
@@ -186,6 +186,9 @@
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
+/* Define to 1 if you have the <StructTreeRoot.h> header file. */
+#undef HAVE_STRUCTTREEROOT_H
+
/* Define to 1 if `st_mtim' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_MTIM
diff --git a/Build/source/texk/web2c/configure b/Build/source/texk/web2c/configure
index 7c08b276ced..d725ddae395 100755
--- a/Build/source/texk/web2c/configure
+++ b/Build/source/texk/web2c/configure
@@ -23741,6 +23741,57 @@ _ACEOF
+# Check of poppler 0.25 or better
+eval CPPFLAGS=\"$POPPLER_INCLUDES \$CPPFLAGS\"
+eval LIBS=\"$POPPLER_LIBS \$LIBS\"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for StructTreeRoot.h (poppler 0.25 or better)" >&5
+$as_echo_n "checking for StructTreeRoot.h (poppler 0.25 or better)... " >&6; }
+if ${kpse_cv_have_StructTreeRoot_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ac_link="./libtool --mode=link --tag=CXX $ac_link"
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+#include <StructTreeRoot.h>
+int
+main ()
+{
+PDFDoc *doc;
+ Dict *dict;
+ StructTreeRoot root(doc, dict);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ kpse_cv_have_StructTreeRoot_h=yes
+else
+ kpse_cv_have_StructTreeRoot_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_link="./libtool --mode=link --tag=CC $ac_link"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kpse_cv_have_StructTreeRoot_h" >&5
+$as_echo "$kpse_cv_have_StructTreeRoot_h" >&6; }
+if test "x$kpse_cv_have_StructTreeRoot_h" = xyes; then
+
+$as_echo "#define HAVE_STRUCTTREEROOT_H 1" >>confdefs.h
+
+fi
CPPFLAGS=$kpse_save_CPPFLAGS
LIBS=$kpse_save_LIBS
diff --git a/Build/source/texk/web2c/configure.ac b/Build/source/texk/web2c/configure.ac
index 4e81dba929c..d65475db817 100644
--- a/Build/source/texk/web2c/configure.ac
+++ b/Build/source/texk/web2c/configure.ac
@@ -287,6 +287,24 @@ KPSE_ADD_FLAGS([kpathsea])
AC_CHECK_SIZEOF([off_t], , AC_INCLUDES_DEFAULT
[#include <kpathsea/config.h>])
+# Check of poppler 0.25 or better
+KPSE_ADD_FLAGS([poppler])
+AC_CACHE_CHECK([for StructTreeRoot.h (poppler 0.25 or better)],
+ [kpse_cv_have_StructTreeRoot_h],
+ [dnl
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
+#include <StructTreeRoot.h>]],
+ [[PDFDoc *doc;
+ Dict *dict;
+ StructTreeRoot root(doc, dict);]])],
+ [kpse_cv_have_StructTreeRoot_h=yes],
+ [kpse_cv_have_StructTreeRoot_h=no])
+AC_LANG_POP([C++])])
+if test "x$kpse_cv_have_StructTreeRoot_h" = xyes; then
+ AC_DEFINE([HAVE_STRUCTTREEROOT_H], 1,
+ [Define to 1 if you have the <StructTreeRoot.h> header file.])
+fi
KPSE_RESTORE_FLAGS
dnl Write output here, instead of putting a zillion -D's on the command line.
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index 23de211ca29..d35f4f96f21 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,10 @@
+2014-07-15 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * image/epdf.h, lua/lepdflib.cc: Use code for poppler >= 0.25
+ with <StructTreeRoot.h> or code for poppler <= 0.24 without.
+ * fake/StructTreeRoot.h (removed): Obsolete.
+ * am/libluatex.am: Adapted.
+
2014-07-12 Peter Breitenlohner <peb@mppmu.mpg.de>
* luasocket/src/wsocket.h: Avoid redefinition of _WIN32_WINNT.
diff --git a/Build/source/texk/web2c/luatexdir/am/libluatex.am b/Build/source/texk/web2c/luatexdir/am/libluatex.am
index d758f883adc..5be74fddb30 100644
--- a/Build/source/texk/web2c/luatexdir/am/libluatex.am
+++ b/Build/source/texk/web2c/luatexdir/am/libluatex.am
@@ -28,11 +28,6 @@ libluajittex_a_CPPFLAGS += -DLuajitTeX
libluatex_a_CXXFLAGS = # $(WARNING_CXXFLAGS)
libluajittex_a_CXXFLAGS = # $(WARNING_CXXFLAGS)
-## compatibility between poppler versions <=0.24.4 and >=0.25.0
-libluatex_a_CPPFLAGS += -I$(srcdir)/luatexdir/fake
-libluajittex_a_CPPFLAGS += -I$(srcdir)/luatexdir/fake
-EXTRA_DIST += luatexdir/fake/StructTreeRoot.h
-
dist_libluatex_a_SOURCES = \
luatexdir/lua/lstrlibext.c
nodist_libluatex_a_SOURCES = \
diff --git a/Build/source/texk/web2c/luatexdir/fake/StructTreeRoot.h b/Build/source/texk/web2c/luatexdir/fake/StructTreeRoot.h
deleted file mode 100644
index a491a40f3dd..00000000000
--- a/Build/source/texk/web2c/luatexdir/fake/StructTreeRoot.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// fake/StructRootTree.h: compatibility between poppler versions
-//
-// Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org>
-// You may freely use, modify and/or distribute this file.
-
-// poppler 0.25.0 and later have a header <StructRootTree.h> and declare
-// StructRootTree *Catalog::getStructRootTree()
-// whereas poppler 0.24.4 and before have no such header and declare
-// Object *Catalog::getStructRootTree().
-
-// We always #include <StructRootTree.h> from image/epdf.h and for
-// poppler 0.24.4 this file defines GETSTRUCTTREEROOT_RETURNS_OBJECT
-// used in lua/lepdflib.cc to distinguish the different versions.
-
-#define GETSTRUCTTREEROOT_RETURNS_OBJECT 1
-
diff --git a/Build/source/texk/web2c/luatexdir/image/epdf.h b/Build/source/texk/web2c/luatexdir/image/epdf.h
index 798984c9633..8f806cd005f 100644
--- a/Build/source/texk/web2c/luatexdir/image/epdf.h
+++ b/Build/source/texk/web2c/luatexdir/image/epdf.h
@@ -48,7 +48,9 @@ extern "C" {
# include <Dict.h>
# include <XRef.h>
# include <Catalog.h>
-# include <StructTreeRoot.h>
+# ifdef HAVE_STRUCTTREEROOT_H
+# include <StructTreeRoot.h>
+# endif
# include <Link.h>
# include <Page.h>
# include <GfxFont.h>
diff --git a/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc b/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc
index f83a2acf00b..5b4a512a195 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc
+++ b/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc
@@ -575,10 +575,10 @@ static int m_Catalog_getPageRef(lua_State * L)
m_poppler_get_GOOSTRING(Catalog, getBaseURI);
m_poppler_get_GOOSTRING(Catalog, readMetadata);
-#ifdef GETSTRUCTTREEROOT_RETURNS_OBJECT
-m_poppler_get_poppler(Catalog, Object, getStructTreeRoot);
-#else
+#ifdef HAVE_STRUCTTREEROOT_H
m_poppler_get_poppler(Catalog, StructTreeRoot, getStructTreeRoot);
+#else
+m_poppler_get_poppler(Catalog, Object, getStructTreeRoot);
#endif
static int m_Catalog_findPage(lua_State * L)
@@ -2152,10 +2152,10 @@ static int m_PDFDoc_readMetadata(lua_State * L)
static int m_PDFDoc_getStructTreeRoot(lua_State * L)
{
-#ifdef GETSTRUCTTREEROOT_RETURNS_OBJECT
- Object *obj;
-#else
+#ifdef HAVE_STRUCTTREEROOT_H
StructTreeRoot *obj;
+#else
+ Object *obj;
#endif
udstruct *uin, *uout;
uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
@@ -2163,10 +2163,10 @@ static int m_PDFDoc_getStructTreeRoot(lua_State * L)
pdfdoc_changed_error(L);
if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
obj = ((PdfDocument *) uin->d)->doc->getStructTreeRoot();
-#ifdef GETSTRUCTTREEROOT_RETURNS_OBJECT
- uout = new_Object_userdata(L);
-#else
+#ifdef HAVE_STRUCTTREEROOT_H
uout = new_StructTreeRoot_userdata(L);
+#else
+ uout = new_Object_userdata(L);
#endif
uout->d = obj;
uout->pc = uin->pc;