diff --git a/configure.ac b/configure.ac index 4ae4e6869..4c96748b1 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,15 @@ AC_DEFINE([BOOST_NO_HASH]) AC_CHECK_PROG([PDFTEX], [pdftex], [pdftex]) AM_CONDITIONAL([HAVE_PDFTEX], [test "x$PDFTEX" != "x"]) +if test "x$PDFTEX" != "x"; then + AC_MSG_CHECKING([for eplain]) + AX_TEX_TEST([\input eplain +\end +], [ax_tex_have_eplain]) + AC_MSG_RESULT([$ax_tex_have_eplain]) +fi +AM_CONDITIONAL([HAVE_EPLAIN], [test "x$ax_tex_have_eplain" = "xyes"]) + AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex]) AM_CONDITIONAL([HAVE_PDFLATEX], [test "x$PDFLATEX" != "x"]) @@ -172,10 +181,10 @@ else BUILD_DYNAREPLUSPLUS="no (missing one of: BLAS, LAPACK, POSIX Threads)" fi -if test "x$CWEAVE" != "x" -a x"$PDFTEX" != "x"; then +if test "x$CWEAVE" != "x" -a x"$PDFTEX" != "x" -a "x$ax_tex_have_eplain" = "xyes"; then BUILD_DYNAREPLUSPLUS_SRCDOC="yes" else - BUILD_DYNAREPLUSPLUS_SRCDOC="no (missing one of: cweave, pdftex)" + BUILD_DYNAREPLUSPLUS_SRCDOC="no (missing one of: cweave, pdftex, eplain)" fi if test "x$XSLTPROC" != "x" -a "x$DOCBOOK_XSLT_CURRENT_VERSION" != "xno"; then diff --git a/dynare++/integ/cc/Makefile.am b/dynare++/integ/cc/Makefile.am index 973104c3a..f16017c33 100644 --- a/dynare++/integ/cc/Makefile.am +++ b/dynare++/integ/cc/Makefile.am @@ -43,11 +43,13 @@ dummy.ch: if HAVE_CWEAVE if HAVE_PDFTEX +if HAVE_EPLAIN pdf: main.web $(CWEBSRC) $(CWEAVE) -bhp main.web $(PDFTEX) main mv main.pdf integ.pdf endif endif +endif CLEANFILES = dummy.ch integ.pdf main.idx main.log main.scn main.tex main.toc diff --git a/dynare++/kord/Makefile.am b/dynare++/kord/Makefile.am index 9dc22e7ad..023a2751f 100644 --- a/dynare++/kord/Makefile.am +++ b/dynare++/kord/Makefile.am @@ -81,11 +81,13 @@ dummy.ch: if HAVE_CWEAVE if HAVE_PDFTEX +if HAVE_EPLAIN pdf: main.web $(CWEBSRC) $(CWEAVE) -bhp main.web $(PDFTEX) main mv main.pdf kord.pdf endif endif +endif CLEANFILES = dummy.ch kord.pdf main.idx main.log main.scn main.tex main.toc out.txt diff --git a/dynare++/tl/cc/Makefile.am b/dynare++/tl/cc/Makefile.am index 968e7ca18..d36a1da0e 100644 --- a/dynare++/tl/cc/Makefile.am +++ b/dynare++/tl/cc/Makefile.am @@ -109,11 +109,13 @@ dummy.ch: if HAVE_CWEAVE if HAVE_PDFTEX +if HAVE_EPLAIN pdf: main.web $(CWEBSRC) $(CWEAVE) -bhp main.web $(PDFTEX) main mv main.pdf tl.pdf endif endif +endif CLEANFILES = dummy.ch tl.pdf main.idx main.log main.scn main.tex main.toc diff --git a/m4/ax_tex_test.m4 b/m4/ax_tex_test.m4 new file mode 100644 index 000000000..2ebc39574 --- /dev/null +++ b/m4/ax_tex_test.m4 @@ -0,0 +1,58 @@ +# =========================================================================== +# http://www.nongnu.org/autoconf-archive/ax_latex_test.html +# =========================================================================== +# +# OBSOLETE MACRO +# +# Deprecated because of licensing issues. The Lesser GPL imposes licensing +# restrictions on the generated configure script unless it is augmented +# with an Autoconf Exception clause. +# +# SYNOPSIS +# +# AX_TEX_TEST(FILEDATA,VARIABLETOSET,[NOCLEAN]) +# +# DESCRIPTION +# +# This macros execute the pdftex application with FILEDATA as input and set +# VARIABLETOSET the yes or no depending of the result if NOCLEAN is set, +# the folder used for the test is not delete after testing. +# +# The macro assumes that the variable PDFTEX is set. +# +# Adapted from the macro AX_LATEX_TEST by Sébastien Villemot. +# +# LICENSE +# +# Copyright (c) 2008 Boretti Mathieu +# Copyright (c) 2009 Dynare Team +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or (at +# your option) any later version. +# +# This library is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library. If not, see . + +AC_DEFUN([AX_TEX_TEST],[ +rm -rf conftest.dir/.acltx +AS_MKDIR_P([conftest.dir/.acltx]) +cd conftest.dir/.acltx +m4_ifval([$2],[$2="no"; export $2;]) +cat > conftest.tex << ACLEOF +$1 +ACLEOF +cat conftest.tex | $PDFTEX 2>&1 1>output m4_ifval([$2],[&& $2=yes]) +cd .. +cd .. +sed 's/^/| /' conftest.dir/.acltx/conftest.tex >&5 +echo "$as_me:$LINENO: executing cat conftest.tex | $latex" >&5 +sed 's/^/| /' conftest.dir/.acltx/output >&5 +m4_ifval([$3],,[rm -rf conftest.dir/.acltx]) +])