Skip to content
Permalink
Browse files

add macro preprocessor for synctex abi selection

  • Loading branch information...
alexandervdm committed Oct 2, 2019
1 parent 08e0473 commit 2c2a873e3161c5578476b9d9d337d00d3802c68e
Showing with 16 additions and 5 deletions.
  1. +12 −5 configure.ac
  2. +4 −0 src/gui/gui-preview.c
@@ -15,6 +15,7 @@ ALL_LINGUAS="ar ca cs da de el es fr hu it nl pl pt pt_BR ro ru sv zh_CN zh_TW"
AC_CONFIG_SRCDIR([src/environment.h])
AC_CONFIG_HEADERS([config.h])
AH_VERBATIM([USE_GTKSPELL], [#undef USE_GTKSPELL])
AH_VERBATIM([USE_SYNCTEX1], [#undef USE_SYNCTEX1])

# Checks for programs.
AC_PROG_CC
@@ -57,18 +58,24 @@ PKG_CHECK_MODULES(poppler, [poppler-glib],,
GUI_CFLAGS="$GUI_CFLAGS $poppler_CFLAGS"
GUI_LIBS="$GUI_LIBS $poppler_LIBS"

PKG_CHECK_MODULES(synctex, [synctex >= 1.16],,
[AC_MSG_ERROR([You need synctex to build $PACKAGE])])
GUI_CFLAGS="$GUI_CFLAGS $synctex_CFLAGS"
GUI_LIBS="$GUI_LIBS $synctex_LIBS"

if test "$spellcheck" = yes; then
PKG_CHECK_MODULES(gtkspell3, [gtkspell3-3.0],,
[AC_MSG_ERROR([You need GtkSpell3 to build $PACKAGE])])
GUI_CFLAGS="$GUI_CFLAGS $gtkspell3_CFLAGS"
GUI_LIBS="$GUI_LIBS $gtkspell3_LIBS"
fi

PKG_CHECK_MODULES(synctex, [synctex >= 1.16],,
[AC_MSG_ERROR([You need synctex to build $PACKAGE])])
GUI_CFLAGS="$GUI_CFLAGS $synctex_CFLAGS"
GUI_LIBS="$GUI_LIBS $synctex_LIBS"

# Set USE_SYNCTEX1 for synctex (< 2.00) compatibility
if $PKG_CONFIG --max-version 1.99 synctex; then
AC_DEFINE(USE_SYNCTEX1)
fi
AC_SUBST(USE_SYNCTEX1)

# Add explicit linking flags
GUI_LIBS="$GUI_LIBS -pthread -lm -lz"
AC_CHECK_LIB(rt, clock_gettime, [
@@ -48,6 +48,10 @@

#include "synctex_parser.h"

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

// compatibility fixes for libsynctex (>=1.16 && <=2.00):
#ifdef USE_SYNCTEX1
typedef synctex_scanner_t synctex_scanner_p;

0 comments on commit 2c2a873

Please sign in to comment.
You can’t perform that action at this time.