summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/epub/epub-document.c2
-rw-r--r--configure.ac20
2 files changed, 21 insertions, 1 deletions
diff --git a/backend/epub/epub-document.c b/backend/epub/epub-document.c
index b63f91cb..224ab4b8 100644
--- a/backend/epub/epub-document.c
+++ b/backend/epub/epub-document.c
@@ -1683,7 +1683,7 @@ static void
epub_document_add_mathJax(gchar* containeruri,gchar* documentdir)
{
gchar *containerfilename= g_filename_from_uri(containeruri,NULL,NULL);
- GString *mathjaxdir = g_string_new("/usr/share/javascript/mathjax");
+ GString *mathjaxdir = g_string_new(MATHJAX_DIRECTORY);
gchar *mathjaxref = g_filename_to_uri(mathjaxdir->str,NULL,NULL);
gchar *nodedata = g_strdup_printf("%s/MathJax.js?config=TeX-AMS-MML_SVG",mathjaxref);
diff --git a/configure.ac b/configure.ac
index 65d1c05d..7add952b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -642,6 +642,25 @@ if test "x$enable_epub" = "xyes"; then
fi
fi
+AC_ARG_WITH([mathjax-directory],
+ [AS_HELP_STRING([--with-mathjax-directory=DIRECTORY],
+ [Specify the directory containing MathJax.js])],
+ [],[with_mathjax_directory=check])
+AC_MSG_CHECKING([for the MathJax directory])
+mathjax_default_dir=/usr/share/javascript/mathjax
+AS_IF([test x$have_webkit = xyes -a "x$with_mathjax_directory" = xcheck],
+ [for dir in "$mathjax_default_dir" /usr/share/mathjax; do
+ if test -f "$dir/MathJax.js"; then
+ with_mathjax_directory="$dir"
+ break
+ fi
+ done])
+AS_IF([test "x$with_mathjax_directory" = xcheck],
+ [AC_MSG_RESULT([not found, falling back to $mathjax_default_dir])
+ with_mathjax_directory="$mathjax_default_dir"],
+ [AC_MSG_RESULT([$with_mathjax_directory])])
+AC_DEFINE_UNQUOTED([MATHJAX_DIRECTORY], ["$with_mathjax_directory"], [Directory where to look up MathJax.js])
+
AM_CONDITIONAL(ENABLE_EPUB, test x$have_webkit = xyes)
dnl ================== End of EPUB checks ===================================================
@@ -791,6 +810,7 @@ Configure summary:
GObj. Introspection.: $enable_introspection
Use NLS.............: ${USE_NLS}
Tests...............: $enable_tests
+ MathJax.............: $with_mathjax_directory
PDF Backend.........: $enable_pdf
Synctex enabled.....: $enable_synctex