Verified Commit c46023ad authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

POSIX shell stylistic improvements

parent d9343b44
......@@ -34,17 +34,15 @@ EXTRA_DIST = \
.dir-locals.el
all-local: preprocessor/src/dynare_m
{ \
if [ -z "`file preprocessor/src/dynare_m | grep x86.64`" ]; then \
ARCH="32"; \
else \
if file preprocessor/src/dynare_m | grep -q x86.64; then \
ARCH="64"; \
else \
ARCH="32"; \
fi; \
mkdir -p $(abs_srcdir)/matlab/preprocessor$$ARCH; \
$(LN_S) -f $(abs_srcdir)/preprocessor/src/dynare_m $(abs_srcdir)/matlab/preprocessor$$ARCH; \
mkdir -p $(abs_srcdir)/julia/preprocessor$$ARCH ; \
$(LN_S) -f $(abs_srcdir)/preprocessor/src/dynare_m $(abs_srcdir)/julia/preprocessor$$ARCH; \
}
mkdir -p $(abs_srcdir)/matlab/preprocessor$$ARCH && \
$(LN_S) -f $(abs_srcdir)/preprocessor/src/dynare_m $(abs_srcdir)/matlab/preprocessor$$ARCH && \
mkdir -p $(abs_srcdir)/julia/preprocessor$$ARCH && \
$(LN_S) -f $(abs_srcdir)/preprocessor/src/dynare_m $(abs_srcdir)/julia/preprocessor$$ARCH
dist-hook:
rm -rf `find $(distdir)/matlab $(distdir)/examples -name *~`
......@@ -61,15 +59,13 @@ install-exec-local:
cp -r matlab $(DESTDIR)$(pkglibdir)
find $(DESTDIR)$(pkglibdir) -name LICENSE.md -delete
rm -rf $(DESTDIR)$(pkglibdir)/matlab/preprocessor*
{ \
if [ -z "`file preprocessor/src/dynare_m | grep x86.64`" ]; then \
ARCH="32"; \
else \
if file preprocessor/src/dynare_m | grep -q x86.64; then \
ARCH="64"; \
else \
ARCH="32"; \
fi; \
mkdir -p $(DESTDIR)$(pkglibdir)/matlab/preprocessor$$ARCH; \
cp preprocessor/src/dynare_m $(DESTDIR)$(pkglibdir)/matlab/preprocessor$$ARCH; \
}
mkdir -p $(DESTDIR)$(pkglibdir)/matlab/preprocessor$$ARCH && \
cp preprocessor/src/dynare_m $(DESTDIR)$(pkglibdir)/matlab/preprocessor$$ARCH
uninstall-local:
rm -f $(DESTDIR)$(bindir)/dynare++
......
......@@ -40,7 +40,7 @@ case ${host_os} in
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.])
if test "x$F77" = "x"; then
if test -z "$F77"; 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
......@@ -69,21 +69,21 @@ AX_CXX11_THREAD
# Check for libmatio, needed by Dynare++
AX_MATIO
AM_CONDITIONAL([HAVE_MATIO], [test "x$has_matio" = "xyes"])
AM_CONDITIONAL([HAVE_MATIO], [test "$has_matio" = yes])
AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex])
AM_CONDITIONAL([HAVE_PDFLATEX], [test "x$PDFLATEX" != "x"])
AM_CONDITIONAL([HAVE_PDFLATEX], [test -n "$PDFLATEX"])
AC_CHECK_PROG([BIBTEX], [bibtex], [bibtex])
AM_CONDITIONAL([HAVE_BIBTEX], [test "x$BIBTEX" != "x"])
AM_CONDITIONAL([HAVE_BIBTEX], [test -n "$BIBTEX"])
AC_CHECK_PROG([SPHINXBUILD], [sphinx-build], [sphinx-build])
AM_CONDITIONAL([HAVE_SPHINXBUILD], [test "x$SPHINXBUILD" != "x"])
AM_CONDITIONAL([HAVE_SPHINXBUILD], [test -n "$SPHINXBUILD"])
if test "x$PDFLATEX" != "x" -a "x$BIBTEX" != "x"; then
if test -n "$PDFLATEX" -a -n "$BIBTEX"; then
AX_LATEX_CLASS([beamer], [ax_latex_have_beamer])
fi
AM_CONDITIONAL([HAVE_BEAMER], [test "x$ax_latex_have_beamer" = "xyes"])
AM_CONDITIONAL([HAVE_BEAMER], [test "$ax_latex_have_beamer" = yes])
AC_PROG_F77
AC_F77_LIBRARY_LDFLAGS
......@@ -95,12 +95,12 @@ case ${host_os} in
;;
esac
if test "x$F77" != "x"; then
if test -n "$F77"; then
AX_BLAS
AX_LAPACK
fi
AM_CONDITIONAL([HAVE_BLAS], [test x"$ax_blas_ok" = "xyes"])
AM_CONDITIONAL([HAVE_LAPACK], [test x"$ax_lapack_ok" = "xyes"])
AM_CONDITIONAL([HAVE_BLAS], [test "$ax_blas_ok" = yes])
AM_CONDITIONAL([HAVE_LAPACK], [test "$ax_lapack_ok" = yes])
AC_CONFIG_FILES([Makefile
VERSION
......@@ -134,36 +134,36 @@ AC_CONFIG_FILES([Makefile
])
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
if test "$enable_matlab" = yes; then
AC_CONFIG_SUBDIRS([mex/build/matlab])
AX_MATLAB
AX_MATLAB_BATCH_OPTIONS
fi
AM_CONDITIONAL([ENABLE_MATLAB], [test "x$enable_matlab" = "xyes"])
AM_CONDITIONAL([HAVE_CMD_LINE_MATLAB], [test "x$ax_enable_matlab" = "xyes" -a "x$have_windows" = "x"])
AM_CONDITIONAL([ENABLE_MATLAB], [test "$enable_matlab" = yes])
AM_CONDITIONAL([HAVE_CMD_LINE_MATLAB], [test "$ax_enable_matlab" = yes -a -z "$have_windows"])
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
if test "$enable_octave" = yes; then
AC_CONFIG_SUBDIRS([mex/build/octave])
AC_CHECK_PROG([OCTAVE], [octave], [octave])
fi
AM_CONDITIONAL([ENABLE_OCTAVE], [test "x$enable_octave" = "xyes"])
AM_CONDITIONAL([HAVE_OCTAVE], [test "x$enable_octave" = "xyes" -a "x$OCTAVE" != "x"])
AM_CONDITIONAL([ENABLE_OCTAVE], [test "$enable_octave" = yes])
AM_CONDITIONAL([HAVE_OCTAVE], [test "$enable_octave" = yes -a -n "$OCTAVE"])
# 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"])
AM_CONDITIONAL([ENABLE_ORG_EXPORT], [test -n "$enable_org_export"])
# Construct final output message
if test "x$ax_blas_ok" = "xyes" -a "x$ax_lapack_ok" = "xyes" -a "x$has_matio" = "xyes"; then
if test "$ax_blas_ok" = yes -a "$ax_lapack_ok" = yes -a "$has_matio" = yes; then
BUILD_DYNAREPLUSPLUS="yes"
else
BUILD_DYNAREPLUSPLUS="no (missing one of: BLAS, LAPACK, MatIO)"
fi
if test "x$PDFLATEX" != "x" -a "x$ax_latex_have_beamer" = "xyes"; then
if test -n "$PDFLATEX" -a "$ax_latex_have_beamer" = yes; then
BUILD_BEAMER_DOC="yes"
else
BUILD_BEAMER_DOC="no (missing one of: pdflatex, beamer)"
......@@ -175,13 +175,13 @@ else
BUILD_OTHER_PDF_DOC="no (missing pdflatex)"
fi
if test "x$enable_org_export" != "x"; then
if test -n "$enable_org_export"; then
BUILD_DYNARE_INTERNAL_DOC="yes"
else
BUILD_DYNARE_INTERNAL_DOC="no (Org export not enabled)"
fi
if test "x$SPHINXBUILD" != "x"; then
if test -n "$SPHINXBUILD"; then
BUILD_DYNARE_HTML_MANUAL="yes"
BUILD_DYNARE_PDF_MANUAL="yes"
else
......@@ -189,13 +189,13 @@ else
BUILD_DYNARE_PDF_MANUAL="no (missing sphinx-build)"
fi
if test "x$OCTAVE" != "x"; then
if test -n "$OCTAVE"; then
TESTSUITE_OCTAVE="yes"
else
TESTSUITE_OCTAVE="no"
fi
if test "x$ax_blas_ok" = "xyes" -a "x$ax_lapack_ok" = "xyes"; then
if test "$ax_blas_ok" = yes -a "$ax_lapack_ok" = yes; then
TESTSUITE_DYNAREPLUSPLUS="yes"
else
TESTSUITE_DYNAREPLUSPLUS="no"
......
......@@ -26,7 +26,7 @@ AC_ARG_WITH(gsl, AC_HELP_STRING([--with-gsl=DIR], [prefix to GSL installation]),
has_gsl=yes
if test "x$gsl_prefix" != "x"; then
if test -n "$gsl_prefix"; then
GSL_CPPFLAGS="-I$withval/include"
GSL_LDFLAGS="-L$withval/lib"
else
......@@ -42,15 +42,15 @@ AC_ARG_WITH(gsl, AC_HELP_STRING([--with-gsl=DIR], [prefix to GSL installation]),
CPPFLAGS="$CPPFLAGS $GSL_CPPFLAGS"
LDFLAGS="$LDFLAGS $GSL_LDFLAGS"
AC_LANG_PUSH(C)
AC_LANG_PUSH(C)
AC_CHECK_HEADER([gsl/gsl_cdf.h], [], [has_gsl=no])
AC_LANG_POP(C)
AC_LANG_POP(C)
AC_CHECK_LIB([m], [cos])
AC_CHECK_LIB([gslcblas], [cblas_dgemm], [LIBS="-lgslcblas $LIBS"], [has_gsl=no])
AC_CHECK_LIB([gsl], [gsl_cdf_ugaussian_P], [LIBS="-lgsl $LIBS"], [has_gsl=no])
if test "x$has_gsl" = "xyes"; then
if test "$has_gsl" = yes; then
GSL_LIBS="$LIBS"
else
GSL_LIBS=""
......
......@@ -24,7 +24,7 @@ AC_ARG_WITH(matio, AC_HELP_STRING([--with-matio=DIR], [prefix to MATIO installat
has_matio=yes
if test "x$matio_prefix" != "x"; then
if test -n "$matio_prefix"; then
CPPFLAGS_MATIO="-I$withval/include"
LDFLAGS_MATIO="-L$withval/lib"
else
......
......@@ -42,7 +42,7 @@ AC_ARG_WITH([matlab], AC_HELP_STRING([--with-matlab=ARG], [check for MATLAB [[ye
# Enable MATLAB and use ARG as the MATLAB prefix.
# ARG must be an existing directory.
ax_enable_matlab=yes
MATLAB=`cd "${withval-/}" > /dev/null 2>&1 && pwd`
MATLAB=$(cd "${withval-/}" > /dev/null 2>&1 && pwd)
if test -z "$MATLAB" ; then
AC_MSG_ERROR([invalid value '$withval' for --with-matlab])
fi
......@@ -50,7 +50,7 @@ AC_ARG_WITH([matlab], AC_HELP_STRING([--with-matlab=ARG], [check for MATLAB [[ye
esac])
AC_CACHE_CHECK([for MATLAB prefix], [ax_cv_matlab],
[if test "${MATLAB+set}" = set ; then
ax_cv_matlab=`cd "${MATLAB-/}" > /dev/null 2>&1 && pwd`
ax_cv_matlab=$(cd "${MATLAB-/}" > /dev/null 2>&1 && pwd)
else
ax_cv_matlab=
IFS=${IFS= } ; ax_ifs=$IFS ; IFS=:
......@@ -59,9 +59,9 @@ else
ax_dir=.
fi
if test -x "$ax_dir/matlab" ; then
ax_dir=`echo "$ax_dir" | sed 's,/bin$,,'`
ax_dir=$(echo "$ax_dir" | sed 's,/bin$,,')
# Directory sanity check.
ax_cv_matlab=`cd "${ax_dir-/}" > /dev/null 2>&1 && pwd`
ax_cv_matlab=$(cd "${ax_dir-/}" > /dev/null 2>&1 && pwd)
if test -n "$ax_cv_matlab" ; then
break
fi
......@@ -76,13 +76,13 @@ if test "$ax_cv_matlab" = "not found" ; then
unset MATLAB
else
# Strip trailing dashes.
MATLAB=`echo "$ax_cv_matlab" | sed 's,/*$,,'`
MATLAB=$(echo "$ax_cv_matlab" | sed 's,/*$,,')
fi
AC_MSG_CHECKING([whether to enable MATLAB support])
if test x$ax_enable_matlab != xno ; then
if test "$ax_enable_matlab" != no; then
if test "${MATLAB+set}" = set && test -d "$MATLAB/extern/include" ; then
ax_enable_matlab=yes
elif test x$ax_enable_matlab = x ; then
elif test -z "$ax_enable_matlab"; then
ax_enable_matlab=no
else
# Fail if MATLAB was explicitly enabled.
......@@ -91,7 +91,7 @@ if test x$ax_enable_matlab != xno ; then
fi
fi
AC_MSG_RESULT([$ax_enable_matlab])
if test x$ax_enable_matlab = xyes ; then
if test "$ax_enable_matlab" = yes; then
AC_DEFINE([HAVE_MATLAB], [1], [Define if you have MATLAB.])
fi
AC_SUBST([MATLAB])
......@@ -104,7 +104,7 @@ AC_DEFUN([AX_REQUIRE_MATLAB],
[dnl
AC_PREREQ([2.50])
AC_REQUIRE([AX_MATLAB])
if test x$ax_enable_matlab = xno ; then
if test "$ax_enable_matlab" = no; then
AC_MSG_ERROR([can not enable MATLAB support])
fi
])
......@@ -116,7 +116,7 @@ AC_DEFUN([AX_MATLAB_CONDITIONAL],
[dnl
AC_PREREQ([2.50])
AC_REQUIRE([AX_MATLAB])
AM_CONDITIONAL([MATLAB], [test x$ax_enable_matlab = xyes])
AM_CONDITIONAL([MATLAB], [test "$ax_enable_matlab" = yes])
])
dnl ax_matlab.m4 ends here
......
......@@ -20,7 +20,7 @@ AC_DEFUN([AX_MATLAB_VERSION],
AC_REQUIRE([AX_MATLAB])
AC_MSG_CHECKING([for MATLAB version])
if test "x$MATLAB_VERSION" != "x"; then
if test -n "$MATLAB_VERSION"; then
case $MATLAB_VERSION in
*2019a | *2019A)
MATLAB_VERSION="9.6"
......
......@@ -86,9 +86,9 @@ fi
# Converts the MATLAB version number into comparable integers with only major and minor version numbers
# For example, 7.4.2 will become 0704
ax_matlab_ver=`echo "$MATLAB_VERSION" | $SED -e 's/\([[0-9]]*\)\.\([[0-9]]*\).*/Z\1ZZ\2Z/' \
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
-e 's/[[^0-9]]//g'`
ax_matlab_ver=$(echo "$MATLAB_VERSION" | $SED -e 's/\([[0-9]]*\)\.\([[0-9]]*\).*/Z\1ZZ\2Z/' \
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
-e 's/[[^0-9]]//g')
MATLAB_DEFS="$MATLAB_DEFS -DMATLAB_VERSION=0x${ax_matlab_ver}"
......@@ -100,27 +100,27 @@ fi
# Allow user to override default Matlab compilation flags
# Github ticket #1121
if test "x$MATLAB_MEX_CPPFLAGS" != "x"; then
if test -n "$MATLAB_MEX_CPPFLAGS"; then
MATLAB_CPPFLAGS="$MATLAB_CPPFLAGS $MATLAB_MEX_CPPFLAGS"
fi
if test "x$MATLAB_MEX_DEFS" != "x"; then
if test -n "$MATLAB_MEX_DEFS"; then
MATLAB_DEFS="$MATLAB_DEFS $MATLAB_MEX_DEFS"
fi
if test "x$MATLAB_MEX_CFLAGS" != "x"; then
if test -n "$MATLAB_MEX_CFLAGS"; then
MATLAB_CFLAGS="$MATLAB_CFLAGS $MATLAB_MEX_CFLAGS"
fi
if test "x$MATLAB_MEX_CXXFLAGS" != "x"; then
if test -n "$MATLAB_MEX_CXXFLAGS"; then
MATLAB_CXXFLAGS="$MATLAB_CXXFLAGS $MATLAB_MEX_CXXFLAGS"
fi
if test "x$MATLAB_MEX_LDFLAGS" != "x"; then
if test -n "$MATLAB_MEX_LDFLAGS"; then
MATLAB_LDFLAGS="$MATLAB_LDFLAGS $MATLAB_MEX_LDFLAGS"
fi
if test "x$MATLAB_MEX_LIBS" != "x"; then
if test -n "$MATLAB_MEX_LIBS"; then
MATLAB_LIBS="$MATLAB_LIBS $MATLAB_MEX_LIBS"
fi
......
......@@ -24,7 +24,7 @@ dnl along with Dynare. If not, see <http://www.gnu.org/licenses/>.
AC_DEFUN([AX_SLICOT],
[
if test "x$1" != "xmatlab" && test "x$1" != "xoctave"; then
if test "$1" != matlab && test "$1" != octave; then
AC_MSG_ERROR([Argument to autoconf slicot macro must be either 'matlab' or 'octave'])
fi
......@@ -32,7 +32,7 @@ AC_DEFUN([AX_SLICOT],
slicot_prefix="$withval", slicot_prefix="")
has_slicot=yes
if test "x$slicot_prefix" != "x"; then
if test -n "$slicot_prefix"; then
LDFLAGS_SLICOT="-L$withval/lib"
else
LDFLAGS_SLICOT=""
......@@ -42,7 +42,7 @@ AC_DEFUN([AX_SLICOT],
AC_F77_FUNC(sb02od)
if test "x$1" = "xmatlab"; then
if test "$1" = matlab; then
LDFLAGS="$MATLAB_LDFLAGS_NOMAP $LDFLAGS_SLICOT"
case ${MATLAB_ARCH} in
......@@ -54,19 +54,19 @@ AC_DEFUN([AX_SLICOT],
;;
esac
if test "$use_64_bit_indexing" = "yes"; then
if test "$use_64_bit_indexing" = yes; then
AC_CHECK_LIB([slicot64_pic], [$sb02od], [LIBADD_SLICOT="-lslicot64_pic"], [has_slicot=no], [$MATLAB_LIBS])
else
AC_CHECK_LIB([slicot_pic], [$sb02od], [LIBADD_SLICOT="-lslicot_pic"], [has_slicot=no], [$MATLAB_LIBS])
fi
else
LDFLAGS="$LDFLAGS `$MKOCTFILE -p LFLAGS` $LDFLAGS_SLICOT"
LDFLAGS="$LDFLAGS $($MKOCTFILE -p LFLAGS) $LDFLAGS_SLICOT"
# Fallback on libslicot_pic if dynamic libslicot not found
AC_CHECK_LIB([slicot], [$sb02od], [LIBADD_SLICOT="-lslicot"],
[
AC_CHECK_LIB([slicot_pic], [$sb02od], [LIBADD_SLICOT="-lslicot_pic"], [has_slicot=no], [`$MKOCTFILE -p BLAS_LIBS` `$MKOCTFILE -p LAPACK_LIBS`])
AC_CHECK_LIB([slicot_pic], [$sb02od], [LIBADD_SLICOT="-lslicot_pic"], [has_slicot=no], [$($MKOCTFILE -p BLAS_LIBS) $($MKOCTFILE -p LAPACK_LIBS)])
],
[`$MKOCTFILE -p BLAS_LIBS` `$MKOCTFILE -p LAPACK_LIBS`])
[$($MKOCTFILE -p BLAS_LIBS) $($MKOCTFILE -p LAPACK_LIBS)])
fi
LDFLAGS="$ac_save_LDFLAGS"
......
......@@ -27,12 +27,12 @@ AC_CANONICAL_HOST
AX_MATLAB
if test "x$ax_enable_matlab" = "xyes"; then
if test "$ax_enable_matlab" = yes; then
AX_MATLAB_VERSION
AX_DOT_MEXEXT
AX_MATLAB_ARCH
if test "x$ax_matlab_version_ok" = "xyes"; then
if test "$ax_matlab_version_ok" = yes; then
AX_MEXOPTS
AX_COMPARE_VERSION([$MATLAB_VERSION], [lt], [7.9], [AC_MSG_ERROR([Your MATLAB is too old, please upgrade to version 7.9 (R2009b) at least.])])
fi
......@@ -83,15 +83,15 @@ AC_CHECK_LIB([dl], [dlopen], [LIBADD_DLOPEN="-ldl"], [])
AC_SUBST([LIBADD_DLOPEN])
# Check for GSL, needed by MS-SBVAR
AX_GSL
AM_CONDITIONAL([HAVE_GSL], [test "x$has_gsl" = "xyes"])
AM_CONDITIONAL([HAVE_GSL], [test "$has_gsl" = yes])
# Check for libmatio, needed by MEX files using Dynare++ code
AX_MATIO
AM_CONDITIONAL([HAVE_MATIO], [test "x$has_matio" = "xyes"])
AM_CONDITIONAL([HAVE_MATIO], [test "$has_matio" = yes])
# Check for libslicot, needed by kalman_steady_state
AX_SLICOT([matlab])
AM_CONDITIONAL([HAVE_SLICOT], [test "x$has_slicot" = "xyes"])
AM_CONDITIONAL([HAVE_SLICOT], [test "$has_slicot" = yes])
# On Windows, we want static linking of the external libraries
case ${host_os} in
......@@ -102,34 +102,34 @@ case ${host_os} in
;;
esac
AM_CONDITIONAL([DO_SOMETHING], [test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes"])
AM_CONDITIONAL([DO_SOMETHING], [test "$ax_enable_matlab" = yes -a "$ax_matlab_version_ok" = yes -a "$ax_mexopts_ok" = yes])
if test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes"; then
if test "$ax_enable_matlab" = yes -a "$ax_matlab_version_ok" = yes -a "$ax_mexopts_ok" = yes; then
BUILD_MEX_MATLAB="yes"
else
BUILD_MEX_MATLAB="no (missing MATLAB, or unknown version, or unknown architecture)"
fi
if test "x$ax_enable_matlab" = "xyes" -a "x$has_matio" = "xyes"; then
if test "$ax_enable_matlab" = yes -a "$has_matio" = yes; then
BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_MATLAB="yes"
else
BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_MATLAB="no (missing MatIO library)"
fi
if test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes" -a "x$has_slicot" = "xyes"; then
if test "$ax_enable_matlab" = yes -a "$ax_matlab_version_ok" = yes -a "$ax_mexopts_ok" = yes -a "$has_slicot" = yes; then
BUILD_KALMAN_STEADY_STATE_MATLAB="yes"
else
BUILD_KALMAN_STEADY_STATE_MATLAB="no (missing SLICOT)"
fi
if test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes" -a "x$has_gsl" = "xyes"; then
if test "$ax_enable_matlab" = yes -a "$ax_matlab_version_ok" = yes -a "$ax_mexopts_ok" = yes -a "$has_gsl" = yes; then
BUILD_MS_SBVAR_MEX_MATLAB="yes"
else
BUILD_MS_SBVAR_MEX_MATLAB="no (missing GSL)"
fi
AC_ARG_ENABLE([openmp], AS_HELP_STRING([--enable-openmp], [use OpenMP for parallelization of some MEX files]), [
if test "x$enable_openmp" = "xyes"; then
if test "$enable_openmp" = yes; then
CPPFLAGS="$CPPFLAGS -DUSE_OMP"
CFLAGS="$CFLAGS -fopenmp"
CXXFLAGS="$CXXFLAGS -fopenmp"
......
......@@ -24,14 +24,14 @@ AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign])
AC_CHECK_PROG([MKOCTFILE], [mkoctfile], [mkoctfile])
if test "x$MKOCTFILE" != "x"; then
CC=`$MKOCTFILE -p CC`
CXX=`$MKOCTFILE -p CXX`
CFLAGS=`$MKOCTFILE -p CFLAGS`
FFLAGS=`$MKOCTFILE -p FFLAGS`
CXXFLAGS=`$MKOCTFILE -p CXXFLAGS`
LDFLAGS="`$MKOCTFILE -p LFLAGS` `$MKOCTFILE -p LDFLAGS`"
OCTAVE_VERSION=`$MKOCTFILE -v 2>&1 | sed 's/mkoctfile, version //'`
if test -n "$MKOCTFILE"; then
CC=$($MKOCTFILE -p CC)
CXX=$($MKOCTFILE -p CXX)
CFLAGS=$($MKOCTFILE -p CFLAGS)
FFLAGS=$($MKOCTFILE -p FFLAGS)
CXXFLAGS=$($MKOCTFILE -p CXXFLAGS)
LDFLAGS="$($MKOCTFILE -p LFLAGS) $($MKOCTFILE -p LDFLAGS)"
OCTAVE_VERSION=$($MKOCTFILE -v 2>&1 | sed 's/mkoctfile, version //')
AX_COMPARE_VERSION([$OCTAVE_VERSION], [lt], [4.2], [AC_MSG_ERROR([Your Octave is too old, please upgrade to version 4.2 at least.])])
fi
......@@ -56,15 +56,15 @@ AC_CHECK_LIB([dl], [dlopen], [LIBADD_DLOPEN="-ldl"], [])
AC_SUBST([LIBADD_DLOPEN])
# Check for GSL, needed by MS-SBVAR
AX_GSL
AM_CONDITIONAL([HAVE_GSL], [test "x$has_gsl" = "xyes"])
AM_CONDITIONAL([HAVE_GSL], [test "$has_gsl" = yes])
# Check for libmatio, needed by MEX files using Dynare++ code, and by ms-sbvar (the latter only under Octave, as an alternative to MATLAB's libmat)
AX_MATIO
AM_CONDITIONAL([HAVE_MATIO], [test "x$has_matio" = "xyes"])
AM_CONDITIONAL([HAVE_MATIO], [test "$has_matio" = yes])
# Check for libslicot, needed by kalman_steady_state
AX_SLICOT([octave])
AM_CONDITIONAL([HAVE_SLICOT], [test "x$has_slicot" = "xyes"])
AM_CONDITIONAL([HAVE_SLICOT], [test "$has_slicot" = yes])
# Check for UMFPACK, needed by bytecode
AC_CHECK_LIB([umfpack], [umfpack_dl_defaults], [LIBADD_UMFPACK="-lumfpack"], [AC_MSG_ERROR([Can't find UMFPACK])])
......@@ -77,27 +77,27 @@ case ${host_os} in
esac
AC_SUBST([LIBADD_UMFPACK])
AM_CONDITIONAL([DO_SOMETHING], [test "x$MKOCTFILE" != "x"])
AM_CONDITIONAL([DO_SOMETHING], [test -n "$MKOCTFILE"])
if test "x$MKOCTFILE" != "x"; then
if test -n "$MKOCTFILE"; then
BUILD_MEX_OCTAVE="yes"
else
BUILD_MEX_OCTAVE="no (missing mkoctfile)"
fi
if test "x$MKOCTFILE" != "x" -a "x$has_matio" = "xyes"; then
if test -n "$MKOCTFILE" -a "$has_matio" = yes; then
BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_OCTAVE="yes"
else
BUILD_GENSYLV_KORDER_DYNSIMUL_MEX_OCTAVE="no (missing MatIO library)"
fi
if test "x$MKOCTFILE" != "x" -a "x$has_slicot" = "xyes"; then
if test -n "$MKOCTFILE" -a "$has_slicot" = yes; then
BUILD_KALMAN_STEADY_STATE_OCTAVE="yes"
else
BUILD_KALMAN_STEADY_STATE_OCTAVE="no (missing SLICOT)"
fi
if test "x$MKOCTFILE" != "x" -a "x$has_gsl" = "xyes" -a "x$has_matio" = "xyes"; then
if test -n "$MKOCTFILE" -a "$has_gsl" = yes -a "$has_matio" = yes; then
BUILD_MS_SBVAR_MEX_OCTAVE="yes"
else
BUILD_MS_SBVAR_MEX_OCTAVE="no (missing GSL or MatIO library)"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment