2009-07-06 19:01:12 +02:00
dnl Process this file with autoconf to produce a configure script.
2019-04-16 14:30:37 +02:00
dnl Copyright © 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
2019-01-16 15:20:12 +01:00
AX_CXX_COMPILE_STDCXX_14
2009-04-23 17:52:00 +02:00
2009-11-05 13:12:55 +01:00
AC_CANONICAL_HOST
case ${host_os} in
*mingw32*)
2018-11-06 12:17:56 +01:00
# On Windows, we want Dynare++ to be statically linked
AM_LDFLAGS="-static"
AC_SUBST([AM_LDFLAGS])
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.])
2019-03-25 16:14:36 +01:00
if test -z "$F77"; then
2010-01-08 13:15:16 +01:00
# 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
;;
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++])
2019-04-23 12:58:38 +02:00
AM_CXXFLAGS="-Wall -Wno-parentheses -Wold-style-cast"
2018-11-06 12:17:56 +01:00
AC_SUBST([AM_CXXFLAGS])
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
2019-01-28 18:39:42 +01:00
AX_CXX11_THREAD
2019-04-17 18:52:12 +02:00
AM_PROG_LEX
AC_CHECK_PROG([YACC], [bison], [bison])
if test -z "$YACC"; then
unset YACC # AM_MISSING_PROG needs an unset variable: an empty variable won't do
AM_MISSING_PROG([YACC], [bison])
fi
2012-08-23 18:30:27 +02:00
# Check for libmatio, needed by Dynare++
2012-09-18 17:14:02 +02:00
AX_MATIO
2019-03-25 16:14:36 +01:00
AM_CONDITIONAL([HAVE_MATIO], [test "$has_matio" = yes])
2012-08-23 18:30:27 +02:00
2009-04-27 15:37:50 +02:00
AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex])
2019-03-25 16:14:36 +01:00
AM_CONDITIONAL([HAVE_PDFLATEX], [test -n "$PDFLATEX"])
2009-09-10 11:50:58 +02:00
2009-04-27 15:37:50 +02:00
AC_CHECK_PROG([BIBTEX], [bibtex], [bibtex])
2019-03-25 16:14:36 +01:00
AM_CONDITIONAL([HAVE_BIBTEX], [test -n "$BIBTEX"])
2009-09-10 11:50:58 +02:00
2019-02-21 16:58:18 +01:00
AC_CHECK_PROG([SPHINXBUILD], [sphinx-build], [sphinx-build])
2019-03-25 16:14:36 +01:00
AM_CONDITIONAL([HAVE_SPHINXBUILD], [test -n "$SPHINXBUILD"])
2011-03-17 17:54:00 +01:00
2019-03-25 16:14:36 +01:00
if test -n "$PDFLATEX" -a -n "$BIBTEX"; 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
2019-03-25 16:14:36 +01:00
AM_CONDITIONAL([HAVE_BEAMER], [test "$ax_latex_have_beamer" = yes])
2009-09-18 11:55:21 +02:00
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
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
2019-03-25 16:14:36 +01:00
if test -n "$F77"; then
2009-09-21 11:45:23 +02:00
AX_BLAS
AX_LAPACK
fi
2019-03-25 16:14:36 +01:00
AM_CONDITIONAL([HAVE_BLAS], [test "$ax_blas_ok" = yes])
AM_CONDITIONAL([HAVE_LAPACK], [test "$ax_lapack_ok" = yes])
2009-09-11 19:34:15 +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
2019-02-21 16:58:18 +01:00
doc/manual/Makefile
doc/manual/utils/version.py
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])
2019-03-25 16:14:36 +01:00
if test "$enable_matlab" = yes; then
2009-11-02 14:44:45 +01:00
AC_CONFIG_SUBDIRS([mex/build/matlab])
2011-05-04 16:28:13 +02:00
AX_MATLAB
2019-03-22 15:44:29 +01:00
AX_MATLAB_BATCH_OPTIONS
2009-11-02 14:44:45 +01:00
fi
2019-03-25 16:14:36 +01:00
AM_CONDITIONAL([ENABLE_MATLAB], [test "$enable_matlab" = yes])
2019-03-25 16:23:53 +01:00
AM_CONDITIONAL([HAVE_MATLAB], [test "$ax_enable_matlab" = yes])
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])
2019-03-25 16:14:36 +01:00
if test "$enable_octave" = yes; then
2009-11-02 14:44:45 +01:00
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
2019-03-25 16:14:36 +01:00
AM_CONDITIONAL([ENABLE_OCTAVE], [test "$enable_octave" = yes])
AM_CONDITIONAL([HAVE_OCTAVE], [test "$enable_octave" = yes -a -n "$OCTAVE"])
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)]))
2019-03-25 16:14:36 +01:00
AM_CONDITIONAL([ENABLE_ORG_EXPORT], [test -n "$enable_org_export"])
2010-11-15 12:43:55 +01:00
2009-09-15 18:50:23 +02:00
# Construct final output message
2019-03-25 16:14:36 +01:00
if test "$ax_blas_ok" = yes -a "$ax_lapack_ok" = yes -a "$has_matio" = yes; then
2019-01-28 18:39:42 +01:00
BUILD_DYNAREPLUSPLUS="yes"
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
2019-03-25 16:14:36 +01:00
if test -n "$PDFLATEX" -a "$ax_latex_have_beamer" = yes; then
2009-09-21 12:30:04 +02:00
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
2019-03-25 16:14:36 +01:00
if test -n "$enable_org_export"; then
2010-11-15 12:43:55 +01:00
BUILD_DYNARE_INTERNAL_DOC="yes"
else
BUILD_DYNARE_INTERNAL_DOC="no (Org export not enabled)"
fi
2019-03-25 16:14:36 +01:00
if test -n "$SPHINXBUILD"; then
2019-02-21 16:58:18 +01:00
BUILD_DYNARE_HTML_MANUAL="yes"
2011-03-17 17:54:00 +01:00
BUILD_DYNARE_PDF_MANUAL="yes"
2011-02-14 14:45:18 +01:00
else
2019-02-21 16:58:18 +01:00
BUILD_DYNARE_HTML_MANUAL="no (missing sphinx-build)"
BUILD_DYNARE_PDF_MANUAL="no (missing sphinx-build)"
2011-02-14 14:45:18 +01:00
fi
2019-03-25 16:14:36 +01:00
if test -n "$OCTAVE"; then
2009-09-15 18:50:23 +02:00
TESTSUITE_OCTAVE="yes"
else
TESTSUITE_OCTAVE="no"
fi
2019-03-25 16:14:36 +01:00
if test "$ax_blas_ok" = yes -a "$ax_lapack_ok" = yes; 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
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
Testsuites (run with "make check"):
Dynare for Octave: $TESTSUITE_OCTAVE
Dynare++: $TESTSUITE_DYNAREPLUSPLUS
])
2009-04-23 17:52:00 +02:00
AC_OUTPUT