2009-07-06 19:01:12 +02:00
dnl Process this file with autoconf to produce a configure script.
2018-02-16 16:09:46 +01:00
dnl Copyright (C) 2009-2018 Dynare Team
2009-07-06 19:01:12 +02:00
dnl
dnl This file is part of Dynare.
dnl
dnl Dynare is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation, either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl Dynare is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with Dynare. If not, see <http://www.gnu.org/licenses/>.
2009-04-23 17:52:00 +02:00
2012-06-05 16:15:37 +02:00
AC_PREREQ([2.62])
2017-05-19 18:54:32 +02:00
AC_INIT([dynare], [4.6-unstable])
2018-02-16 16:09:46 +01:00
AC_CONFIG_SRCDIR([preprocessor/src/DynareMain.cc])
2013-09-09 14:50:32 +02:00
AM_INIT_AUTOMAKE([1.11 -Wall -Wno-portability foreign no-dist-gzip dist-xz tar-pax])
2009-04-23 17:52:00 +02:00
2018-02-16 16:09:46 +01:00
AC_CONFIG_SUBDIRS([preprocessor])
2009-09-21 11:45:23 +02:00
AC_PROG_CC
2009-04-23 17:52:00 +02:00
AC_PROG_CXX
2009-11-05 13:12:55 +01:00
AC_CANONICAL_HOST
case ${host_os} in
*mingw32*)
2010-08-18 18:55:45 +02:00
# On mingw32, we don't want dynamic libgcc
# Note that static-libstdc++ is only supported since GCC 4.5 (but generates no error on older versions)
2012-02-24 16:40:58 +01:00
LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++ -static-libgfortran"
2011-05-04 16:28:13 +02:00
have_windows="yes"
2009-11-05 13:12:55 +01:00
;;
2010-01-08 13:15:16 +01:00
*cygwin*)
2010-08-18 16:21:23 +02:00
AC_MSG_WARN([You are compiling for the Cygwin target. This means that the preprocessor will])
AC_MSG_WARN([not run from MATLAB unless you add the Cygwin DLL to the path.])
AC_MSG_WARN([This is probably not what you want. Consider using a MinGW cross-compiler.])
2010-01-08 13:15:16 +01:00
if test "x$F77" = "x"; then
# On Cygwin 1.7, g77 comes has version 3, and is not compatible with default gcc/g++ which has version 4
# And by default, the AC_PROG_F77 will pick up g77 if it is present (even if gfortran is also here)
F77=gfortran
fi
2011-05-04 16:28:13 +02:00
have_windows="yes"
2010-01-08 13:15:16 +01:00
;;
2009-11-05 13:12:55 +01:00
esac
2009-04-23 17:52:00 +02:00
# Use C++ for testing headers
AC_LANG([C++])
2011-01-13 19:05:58 +01:00
CXXFLAGS="$CXXFLAGS -Wall -Wno-parentheses"
2009-04-23 17:52:00 +02:00
2011-01-20 21:13:32 +01:00
# If default 'ar' is not available, try to find one with a host prefix (see ticket #145)
AC_CHECK_PROGS([AR], [ar ${host_alias}-ar])
2009-09-09 18:47:43 +02:00
AC_PROG_RANLIB
2012-09-28 17:21:25 +02:00
AM_PROG_AR
2009-09-17 14:06:44 +02:00
2009-10-02 19:22:19 +02:00
AX_PROG_LN_S
2009-09-17 14:06:44 +02:00
2009-09-17 10:14:44 +02:00
AC_PROG_MKDIR_P
2009-09-09 18:47:43 +02:00
2011-01-18 22:26:36 +01:00
# We need 1.36 because of unordered_{set,hash} used by Dynare++
2014-03-03 11:13:27 +01:00
AX_BOOST_BASE([1.36], [], [AC_MSG_ERROR([Can't find Boost >= 1.36])])
2009-09-16 15:08:02 +02:00
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
2009-04-23 17:52:00 +02:00
AC_CHECK_HEADERS([boost/graph/adjacency_list.hpp], [], [AC_MSG_ERROR([Can't find Boost Graph Library])])
2010-10-25 18:21:11 +02:00
AC_CHECK_HEADERS([boost/algorithm/string/trim.hpp], [], [AC_MSG_ERROR([Can't find Boost String Library])])
AC_CHECK_HEADERS([boost/algorithm/string/split.hpp], [], [AC_MSG_ERROR([Can't find Boost String Library])])
AC_CHECK_HEADERS([boost/lexical_cast.hpp], [], [AC_MSG_ERROR([Can't find Boost Lexical Cast Header])])
2009-09-16 15:08:02 +02:00
CPPFLAGS="$CPPFLAGS_SAVED"
2009-04-23 17:52:00 +02:00
# Don't use deprecated hash structures
2009-10-02 12:29:54 +02:00
AC_DEFINE([BOOST_NO_HASH], [], [Don't use deprecated STL hash structures])
2009-04-23 17:52:00 +02:00
2012-08-23 18:30:27 +02:00
# Check for libmatio, needed by Dynare++
2012-09-18 17:14:02 +02:00
AX_MATIO
AM_CONDITIONAL([HAVE_MATIO], [test "x$has_matio" = "xyes"])
2012-08-23 18:30:27 +02:00
2011-03-17 17:54:00 +01:00
AC_CHECK_PROG([MAKEINFO], [makeinfo], [makeinfo])
2009-09-11 19:34:15 +02:00
AC_CHECK_PROG([PDFTEX], [pdftex], [pdftex])
AM_CONDITIONAL([HAVE_PDFTEX], [test "x$PDFTEX" != "x"])
2009-10-02 12:29:54 +02:00
AC_CHECK_PROG([PDFETEX], [pdfetex], [pdfetex])
AM_CONDITIONAL([HAVE_PDFETEX], [test "x$PDFETEX" != "x"])
2009-09-18 11:28:30 +02:00
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"])
2009-04-27 15:37:50 +02:00
AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex])
2009-09-10 11:50:58 +02:00
AM_CONDITIONAL([HAVE_PDFLATEX], [test "x$PDFLATEX" != "x"])
2009-04-27 15:37:50 +02:00
AC_CHECK_PROG([BIBTEX], [bibtex], [bibtex])
2009-09-10 11:50:58 +02:00
AM_CONDITIONAL([HAVE_BIBTEX], [test "x$BIBTEX" != "x"])
2011-03-17 17:54:00 +01:00
AC_CHECK_PROG([LATEX2HTML], [latex2html], [latex2html])
AM_CONDITIONAL([HAVE_LATEX2HTML], [test "x$LATEX2HTML" != "x"])
2009-09-18 11:55:21 +02:00
if test "x$PDFLATEX" != "x" -a "x$BIBTEX" != "x"; then
2009-09-21 12:30:04 +02:00
AX_LATEX_CLASS([beamer], [ax_latex_have_beamer])
2009-09-18 11:55:21 +02:00
fi
2009-09-21 12:30:04 +02:00
AM_CONDITIONAL([HAVE_BEAMER], [test "x$ax_latex_have_beamer" = "xyes"])
2009-09-18 11:55:21 +02:00
2009-09-11 19:34:15 +02:00
AC_CHECK_PROG([CTANGLE], [ctangle], [ctangle])
AM_CONDITIONAL([HAVE_CTANGLE], [test "x$CTANGLE" != "x"])
2009-09-17 17:05:25 +02:00
if test "x$CTANGLE" = "x"; then
unset CTANGLE # AM_MISSING_PROG needs an unset variable: an empty variable won't do
AM_MISSING_PROG([CTANGLE], [ctangle])
fi
2009-09-11 19:34:15 +02:00
AC_CHECK_PROG([CWEAVE], [cweave], [cweave])
AM_CONDITIONAL([HAVE_CWEAVE], [test "x$CWEAVE" != "x"])
2009-09-21 11:45:23 +02:00
AC_PROG_F77
2012-02-24 17:35:54 +01:00
AC_F77_LIBRARY_LDFLAGS
case ${host_os} in
*mingw32*)
2013-04-23 12:07:13 +02:00
# Hack to get static linking of libgfortran on MinGW
# (-static-libgfortran doesn't act on gcc/g++)
2012-02-24 17:35:54 +01:00
FLIBS=`echo $FLIBS | sed 's/-lgfortran/-Wl,-Bstatic -lgfortran -Wl,-Bdynamic/'`
;;
2013-04-23 12:07:13 +02:00
*darwin*)
# * OS X doesn't need to link against the Fortran libraries because
# everything is contained within the vecLib framework.
FLIBS=''
;;
2012-02-24 17:35:54 +01:00
esac
2009-09-21 11:45:23 +02:00
if test "x$F77" != "x"; then
AX_BLAS
AX_LAPACK
fi
2009-09-11 19:34:15 +02:00
AM_CONDITIONAL([HAVE_BLAS], [test x"$ax_blas_ok" = "xyes"])
AM_CONDITIONAL([HAVE_LAPACK], [test x"$ax_lapack_ok" = "xyes"])
2014-03-10 17:25:39 +01:00
case ${host_os} in
*mingw32*)
# Ensure that -lpthread is statically linked under MinGW
PTHREAD_LIBS="-Wl,-Bstatic -lpthread -Wl,-Bdynamic"
;;
esac
2009-09-11 19:34:15 +02:00
AX_PTHREAD
2009-07-06 19:01:12 +02:00
2009-06-08 18:43:24 +02:00
AC_CONFIG_FILES([Makefile
2017-05-29 14:30:33 +02:00
VERSION
2009-06-08 18:43:24 +02:00
doc/Makefile
2010-10-29 12:48:07 +02:00
doc/parallel/Makefile
2010-11-12 09:57:25 +01:00
doc/internals/Makefile
2011-03-17 15:48:31 +01:00
doc/gsa/Makefile
2014-04-29 17:56:45 +02:00
doc/dseries-and-reporting/Makefile
2009-06-11 16:58:43 +02:00
tests/Makefile
2009-06-08 18:43:24 +02:00
matlab/dynare_version.m
2009-09-09 18:47:43 +02:00
windows/dynare-version.nsi
2009-09-11 19:34:15 +02:00
dynare++/Makefile
dynare++/parser/cc/Makefile
dynare++/sylv/Makefile
dynare++/sylv/cc/Makefile
dynare++/sylv/testing/Makefile
dynare++/tl/Makefile
dynare++/tl/cc/Makefile
dynare++/tl/testing/Makefile
dynare++/doc/Makefile
dynare++/utils/cc/Makefile
dynare++/integ/Makefile
dynare++/integ/cc/Makefile
dynare++/integ/src/Makefile
dynare++/integ/testing/Makefile
dynare++/kord/Makefile
dynare++/src/Makefile
2010-02-13 09:52:43 +01:00
mex/sources/Makefile
2009-09-09 18:47:43 +02:00
])
2009-04-23 17:52:00 +02:00
2009-11-02 14:44:45 +01:00
AC_ARG_ENABLE([matlab], AS_HELP_STRING([--disable-matlab], [disable compilation of MEX files for MATLAB]), [], [enable_matlab=yes])
if test "x$enable_matlab" = "xyes"; then
AC_CONFIG_SUBDIRS([mex/build/matlab])
2011-05-04 16:28:13 +02:00
AX_MATLAB
2009-11-02 14:44:45 +01:00
fi
AM_CONDITIONAL([ENABLE_MATLAB], [test "x$enable_matlab" = "xyes"])
2011-05-05 16:24:52 +02:00
AM_CONDITIONAL([HAVE_CMD_LINE_MATLAB], [test "x$ax_enable_matlab" = "xyes" -a "x$have_windows" = "x"])
2009-11-02 14:44:45 +01:00
AC_ARG_ENABLE([octave], AS_HELP_STRING([--disable-octave], [disable compilation of MEX files for Octave]), [], [enable_octave=yes])
if test "x$enable_octave" = "xyes"; then
AC_CONFIG_SUBDIRS([mex/build/octave])
2013-06-13 10:58:24 +02:00
AC_CHECK_PROG([OCTAVE], [octave], [octave])
2009-11-02 14:44:45 +01:00
fi
AM_CONDITIONAL([ENABLE_OCTAVE], [test "x$enable_octave" = "xyes"])
2013-06-14 10:07:31 +02:00
AM_CONDITIONAL([HAVE_OCTAVE], [test "x$enable_octave" = "xyes" -a "x$OCTAVE" != "x"])
2009-10-02 19:22:19 +02:00
2010-11-15 12:43:55 +01:00
# Enable exporting of Org files
# The clean way would be to test for Emacs, Org-mode, latex, dvipng...
AC_ARG_ENABLE([org-export], AS_HELP_STRING([--enable-org-export], [enable exporting of Org files (requires Emacs, org-mode and other external programs)]))
AM_CONDITIONAL([ENABLE_ORG_EXPORT], [test "x$enable_org_export" != "x"])
2009-09-15 18:50:23 +02:00
# Construct final output message
2012-09-18 17:14:02 +02:00
if test "x$ax_blas_ok" = "xyes" -a "x$ax_lapack_ok" = "xyes" -a "x$has_matio" = "xyes"; then
2009-10-02 19:22:19 +02:00
if test x"$ax_pthread_ok" = "xyes"; then
BUILD_DYNAREPLUSPLUS="yes"
else
BUILD_DYNAREPLUSPLUS="yes (without POSIX threads)"
fi
2009-09-15 18:50:23 +02:00
else
2012-08-23 18:30:27 +02:00
BUILD_DYNAREPLUSPLUS="no (missing one of: BLAS, LAPACK, MatIO)"
2009-09-15 18:50:23 +02:00
fi
2009-09-18 11:28:30 +02:00
if test "x$CWEAVE" != "x" -a x"$PDFTEX" != "x" -a "x$ax_tex_have_eplain" = "xyes"; then
2009-09-15 18:50:23 +02:00
BUILD_DYNAREPLUSPLUS_SRCDOC="yes"
else
2009-09-18 11:28:30 +02:00
BUILD_DYNAREPLUSPLUS_SRCDOC="no (missing one of: cweave, pdftex, eplain)"
2009-09-15 18:50:23 +02:00
fi
2009-09-21 12:30:04 +02:00
if test "x$PDFLATEX" != "x" -a "x$ax_latex_have_beamer" = "xyes"; then
BUILD_BEAMER_DOC="yes"
else
BUILD_BEAMER_DOC="no (missing one of: pdflatex, beamer)"
fi
2009-09-15 18:50:23 +02:00
if test "x$PDFLATEX" != "x"; then
BUILD_OTHER_PDF_DOC="yes"
else
BUILD_OTHER_PDF_DOC="no (missing pdflatex)"
fi
2010-11-15 12:43:55 +01:00
if test "x$enable_org_export" != "x"; then
BUILD_DYNARE_INTERNAL_DOC="yes"
else
BUILD_DYNARE_INTERNAL_DOC="no (Org export not enabled)"
fi
2011-03-17 17:54:00 +01:00
if test "x$MAKEINFO" != "x"; then
2011-02-14 14:45:18 +01:00
BUILD_DYNARE_INFO="yes"
2017-06-28 16:55:56 +02:00
if test "x$LATEX2HTML" != "x"; then
2011-03-17 17:54:00 +01:00
BUILD_DYNARE_HTML_MANUAL="yes"
else
2017-06-28 16:55:56 +02:00
BUILD_DYNARE_HTML_MANUAL="yes (but with ugly math formulas, missing latex2html)"
2011-03-17 17:54:00 +01:00
fi
BUILD_DYNARE_PDF_MANUAL="yes"
2011-02-14 14:45:18 +01:00
else
2011-03-17 17:54:00 +01:00
BUILD_DYNARE_INFO="no (missing makeinfo)"
BUILD_DYNARE_HTML_MANUAL="no (missing makeinfo)"
BUILD_DYNARE_PDF_MANUAL="no (missing makeinfo)"
2011-02-14 14:45:18 +01:00
fi
2009-09-15 18:50:23 +02:00
if test "x$OCTAVE" != "x"; then
TESTSUITE_OCTAVE="yes"
else
TESTSUITE_OCTAVE="no"
fi
2010-08-24 19:25:31 +02:00
if test "x$ax_blas_ok" = "xyes" -a "x$ax_lapack_ok" = "xyes"; then
2009-09-15 18:50:23 +02:00
TESTSUITE_DYNAREPLUSPLUS="yes"
else
2009-09-16 19:04:52 +02:00
TESTSUITE_DYNAREPLUSPLUS="no"
2009-09-15 18:50:23 +02:00
fi
AC_MSG_NOTICE([
Dynare is now configured for building the following components...
Binaries (with "make"):
Dynare++: $BUILD_DYNAREPLUSPLUS
PDF documentation (with "make pdf"):
Dynare reference manual: $BUILD_DYNARE_PDF_MANUAL
Dynare++ developer documentation: $BUILD_DYNAREPLUSPLUS_SRCDOC
2009-09-21 12:30:04 +02:00
Beamer presentations: $BUILD_BEAMER_DOC
2009-09-15 18:50:23 +02:00
Various other documents: $BUILD_OTHER_PDF_DOC
HTML documentation (with "make html"):
Dynare reference manual: $BUILD_DYNARE_HTML_MANUAL
2010-11-15 12:43:55 +01:00
Dynare internal doc: $BUILD_DYNARE_INTERNAL_DOC
2009-09-15 18:50:23 +02:00
2011-02-14 14:45:18 +01:00
Info documentation (with "make info"): $BUILD_DYNARE_INFO
2009-09-15 18:50:23 +02:00
Testsuites (run with "make check"):
Dynare for Octave: $TESTSUITE_OCTAVE
Dynare++: $TESTSUITE_DYNAREPLUSPLUS
])
2009-04-23 17:52:00 +02:00
AC_OUTPUT