summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-08-22 10:28:28 +0200
committerraveit65 <[email protected]>2019-08-29 12:00:35 +0200
commitf1c1bbd843ab9ec47aa56782901d749bf895068f (patch)
tree409ecb698ff5ba045b2747ded2852d3089095ed5
parent4bc59d4a716b3ab271bb15adf4b9b5dd6961a4a2 (diff)
downloadatril-f1c1bbd843ab9ec47aa56782901d749bf895068f.tar.bz2
atril-f1c1bbd843ab9ec47aa56782901d749bf895068f.tar.xz
build: Use synctex system library if available
based on https://gitlab.gnome.org/GNOME/evince/commit/9edaca5b7b35bbbeeecfaf8d9291a4c092d8be91
-rw-r--r--configure.ac16
-rw-r--r--cut-n-paste/Makefile.am6
-rw-r--r--libdocument/Makefile.am4
3 files changed, 23 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index b388290d..7054244d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,6 +88,7 @@ GTK_REQUIRED=3.22.0
WEBKIT_REQUIRED=2.4.3
LIBSECRET_REQUIRED=0.5
LIBXML_REQUIRED=2.5.0
+SYNCTEX_REQUIRED=1.21
AC_SUBST([GLIB_REQUIRED])
AC_SUBST([GTK_REQUIRED])
@@ -358,6 +359,19 @@ AC_SUBST([GIRTYPELIBDIR])
AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
+dnl ================== libsynctex ===========================================
+
+PKG_CHECK_MODULES(SYNCTEX, [synctex >= $SYNCTEX_REQUIRED], has_synctex=system, has_synctex=internal)
+
+dnl not found? use internal code copy.
+if test "x$has_synctex" = "xinternal"; then
+ SYNCTEX_LIBS="\$(top_builddir)/cut-n-paste/synctex/libsynctex.la"
+ SYNCTEX_CFLAGS="-I\$(top_srcdir)/cut-n-paste/synctex"
+fi
+AC_SUBST(SYNCTEX_LIBS)
+AC_SUBST(SYNCTEX_CFLAGS)
+AM_CONDITIONAL(USE_INTERNAL_SYNCTEX, test x$has_synctex = xinternal)
+
dnl ================== portability checks ===========================================
dnl for backtrace()
@@ -773,4 +787,6 @@ Configure summary:
Comics Backend......: $enable_comics
XPS Backend.........: $enable_xps
ePub Backend........: $have_webkit
+
+ SyncTeX.............: $has_synctex
"
diff --git a/cut-n-paste/Makefile.am b/cut-n-paste/Makefile.am
index b765ee9a..bc7cd25b 100644
--- a/cut-n-paste/Makefile.am
+++ b/cut-n-paste/Makefile.am
@@ -1,3 +1,7 @@
-SUBDIRS = zoom-control toolbar-editor smclient synctex
+SUBDIRS = zoom-control toolbar-editor smclient
+
+if USE_INTERNAL_SYNCTEX
+SUBDIRS += synctex
+endif
-include $(top_srcdir)/git.mk
diff --git a/libdocument/Makefile.am b/libdocument/Makefile.am
index c3e1259e..f527f0a4 100644
--- a/libdocument/Makefile.am
+++ b/libdocument/Makefile.am
@@ -102,7 +102,7 @@ libatrildocument_la_CPPFLAGS = \
libatrildocument_la_CFLAGS = \
$(LIBDOCUMENT_CFLAGS) \
- -I$(top_srcdir)/cut-n-paste/synctex \
+ $(SYNCTEX_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED) \
$(AM_CFLAGS)
@@ -116,7 +116,7 @@ libatrildocument_la_LDFLAGS = \
libatrildocument_la_LIBADD = \
$(LIBDOCUMENT_LIBS) \
$(GMODULE_LIBS) \
- $(top_builddir)/cut-n-paste/synctex/libsynctex.la \
+ $(SYNCTEX_LIBS) \
$(ZLIB_LIBS)