Commit 343e0b3c authored by sebastien's avatar sebastien
Browse files

Build system: refactored the build system for MEX files, using two...

Build system: refactored the build system for MEX files, using two sub-packages with their own configure scripts


git-svn-id: https://www.dynare.org/svn/dynare/trunk@3019 ac1d8469-bf42-47a9-8791-bf33cf982152
parent bbc7e776
......@@ -2,14 +2,12 @@ SUBDIRS = preprocessor doc tests
if HAVE_BLAS
if HAVE_LAPACK
if HAVE_PTHREAD
SUBDIRS += dynare++
endif
endif
endif
# MEX must be built after dynare++ (because of kordepert)
SUBDIRS += mex/build
SUBDIRS += mex/build/octave mex/build/matlab
ACLOCAL_AMFLAGS = -I m4
......
......@@ -25,8 +25,6 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC
AC_PROG_CXX
AC_CANONICAL_HOST
# Use C++ for testing headers
AC_LANG([C++])
......@@ -34,12 +32,7 @@ CXXFLAGS="$CXXFLAGS -Wall"
AC_PROG_RANLIB
AC_PROG_LN_S
case ${host_os} in
*cygwin*)
LN_S="cp -p" # Cygwin symbolic links are not understood by MATLAB
;;
esac
AX_PROG_LN_S
AC_PROG_MKDIR_P
......@@ -61,10 +54,6 @@ CPPFLAGS="$CPPFLAGS_SAVED"
# Don't use deprecated hash structures
AC_DEFINE([BOOST_NO_HASH], [], [Don't use deprecated STL hash structures])
# Check for dlopen(), needed by korderpert DLL
AC_CHECK_LIB([dl], [dlopen], [LIBADD_DLOPEN="-ldl"], [])
AC_SUBST([LIBADD_DLOPEN])
AC_CHECK_PROG([PDFTEX], [pdftex], [pdftex])
AM_CONDITIONAL([HAVE_PDFTEX], [test "x$PDFTEX" != "x"])
......@@ -122,9 +111,6 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$DOXYGEN" != "x"])
AC_CHECK_PROG([OCTAVE], [octave], [octave])
AM_CONDITIONAL([HAVE_OCTAVE], [test "x$OCTAVE" != "x"])
AC_CHECK_PROG([MKOCTFILE], [mkoctfile], [mkoctfile])
AM_CONDITIONAL([HAVE_MKOCTFILE], [test "x$MKOCTFILE" != "x"])
AC_CHECK_PROG([CTANGLE], [ctangle], [ctangle])
AM_CONDITIONAL([HAVE_CTANGLE], [test "x$CTANGLE" != "x"])
if test "x$CTANGLE" = "x"; then
......@@ -144,29 +130,6 @@ AM_CONDITIONAL([HAVE_BLAS], [test x"$ax_blas_ok" = "xyes"])
AM_CONDITIONAL([HAVE_LAPACK], [test x"$ax_lapack_ok" = "xyes"])
AX_PTHREAD
AM_CONDITIONAL([HAVE_PTHREAD], [test x"$ax_pthread_ok" = "xyes"])
AX_MATLAB
if test "x$ax_enable_matlab" = "xyes"; then
AX_DOT_MEXEXT
AX_MATLAB_ARCH
AX_MATLAB_VERSION
if test "x$ax_matlab_version_ok" = "xyes"; then
AX_MEXOPTS
# Determine subdirectory of mex/ to be used for storing MATLAB MEX binaries
AX_COMPARE_VERSION([$MATLAB_VERSION], [le], [7.4], [DYNARE_MEXDIR="2007a"], [
DYNARE_MEXDIR="2007b"
if test ${MATLAB_ARCH%64} != ${MATLAB_ARCH}; then
AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.8], [DYNARE_MEXDIR="2009a-64bit"])
fi])
AC_SUBST([DYNARE_MEXDIR])
fi
fi
AM_CONDITIONAL([HAVE_MEXOPTS], [test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes" ])
AC_CONFIG_FILES([Makefile
preprocessor/macro/Makefile
......@@ -194,28 +157,22 @@ AC_CONFIG_FILES([Makefile
dynare++/integ/testing/Makefile
dynare++/kord/Makefile
dynare++/src/Makefile
mex/build/Makefile
mex/build/mjdgges/octave/Makefile
mex/build/mjdgges/matlab/Makefile
mex/build/kronecker/octave/Makefile
mex/build/kronecker/matlab/Makefile
mex/build/gensylv/octave/Makefile
mex/build/gensylv/matlab/Makefile
mex/build/bytecode/octave/Makefile
mex/build/bytecode/matlab/Makefile
mex/build/korderpert/octave/Makefile
mex/build/korderpert/matlab/Makefile
mex/build/korderpert/tests/Makefile
])
AC_CONFIG_SUBDIRS([mex/build/matlab mex/build/octave])
# Construct final output message
BUILD_PREPROCESSOR="yes"
if test "x$ax_blas_ok" = "xyes" -a "x$ax_lapack_ok" = "xyes" -a "x$ax_pthread_ok" = "xyes"; then
BUILD_DYNAREPLUSPLUS="yes"
if test "x$ax_blas_ok" = "xyes" -a "x$ax_lapack_ok" = "xyes"; then
if test x"$ax_pthread_ok" = "xyes"; then
BUILD_DYNAREPLUSPLUS="yes"
else
BUILD_DYNAREPLUSPLUS="yes (without POSIX threads)"
fi
else
BUILD_DYNAREPLUSPLUS="no (missing one of: BLAS, LAPACK, POSIX Threads)"
BUILD_DYNAREPLUSPLUS="no (missing one of: BLAS, LAPACK)"
fi
if test "x$CWEAVE" != "x" -a x"$PDFTEX" != "x" -a "x$ax_tex_have_eplain" = "xyes"; then
......@@ -260,18 +217,6 @@ else
BUILD_DYNARE_PREPROC_DOC="no (missing doxygen)"
fi
if test "x$MKOCTFILE" != "x"; then
BUILD_MEX_OCTAVE="yes"
else
BUILD_MEX_OCTAVE="no (missing mkoctfile)"
fi
if test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes"; then
BUILD_MEX_MATLAB="yes"
else
BUILD_MEX_MATLAB="no (missing MATLAB, or unknown version, or unknown architecture)"
fi
if test "x$OCTAVE" != "x"; then
TESTSUITE_OCTAVE="yes"
else
......@@ -290,8 +235,6 @@ Dynare is now configured for building the following components...
Binaries (with "make"):
Dynare preprocessor: $BUILD_PREPROCESSOR
MEX files for Octave: $BUILD_MEX_OCTAVE
MEX files for MATLAB: $BUILD_MEX_MATLAB
Dynare++: $BUILD_DYNAREPLUSPLUS
PDF documentation (with "make pdf"):
......
......@@ -25,7 +25,7 @@ GENERATED_FILES = \
noinst_LIBRARIES = libinteg.a
libinteg_a_SOURCES = $(CWEBSRC) $(GENERATED_FILES) precalc_quadrature.dat
libinteg_a_CPPFLAGS = -I../../sylv/cc -I../../tl/cc -I$(top_srcdir)/mex/sources -DPOSIX_THREADS
libinteg_a_CPPFLAGS = -I../../sylv/cc -I../../tl/cc -I$(top_srcdir)/mex/sources
libinteg_a_CXXFLAGS = $(PTHREAD_CFLAGS)
BUILT_SOURCES = $(GENERATED_FILES)
......
noinst_PROGRAMS = quadrature-points
quadrature_points_SOURCES = quadrature-points.cpp
quadrature_points_CPPFLAGS = -I../.. -I../../sylv/cc -I../../integ/cc -I../../tl/cc -DPOSIX_THREADS
quadrature_points_CPPFLAGS = -I../.. -I../../sylv/cc -I../../integ/cc -I../../tl/cc
quadrature_points_CXXFLAGS = $(PTHREAD_CFLAGS)
quadrature_points_LDADD = ../cc/libinteg.a ../../tl/cc/libtl.a ../../parser/cc/libparser.a ../../sylv/cc/libsylv.a ../../utils/cc/libutils.a $(LAPACK_LIBS) $(BLAS_LIBS) $(LIBS) $(FLIBS) $(PTHREAD_LIBS)
check_PROGRAMS = tests
tests_SOURCES = tests.cpp
tests_CPPFLAGS = -I../cc -I../../tl/cc -I../../sylv/cc -I$(top_srcdir)/mex/sources -DPOSIX_THREADS
tests_CPPFLAGS = -I../cc -I../../tl/cc -I../../sylv/cc -I$(top_srcdir)/mex/sources
tests_CXXFLAGS = $(PTHREAD_CFLAGS)
tests_LDADD = ../../tl/cc/libtl.a ../../sylv/cc/libsylv.a ../cc/libinteg.a $(LAPACK_LIBS) $(BLAS_LIBS) $(LIBS) $(FLIBS) $(PTHREAD_LIBS)
......
......@@ -53,7 +53,7 @@ GENERATED_FILES = \
noinst_LIBRARIES = libkord.a
libkord_a_SOURCES = $(CWEBSRC) $(GENERATED_FILES)
libkord_a_CPPFLAGS = -I../sylv/cc -I../tl/cc -I../integ/cc -I$(top_srcdir)/mex/sources -DPOSIX_THREADS
libkord_a_CPPFLAGS = -I../sylv/cc -I../tl/cc -I../integ/cc -I$(top_srcdir)/mex/sources
libkord_a_CXXFLAGS = $(PTHREAD_CFLAGS)
BUILT_SOURCES = $(GENERATED_FILES)
......@@ -63,7 +63,7 @@ EXTRA_DIST = main.web dummy.ch
check_PROGRAMS = tests
tests_SOURCES = tests.cpp
tests_CPPFLAGS = -I../sylv/cc -I../tl/cc -I../integ/cc
tests_CPPFLAGS = -I../sylv/cc -I../tl/cc -I../integ/cc -I$(top_srcdir)/mex/sources
tests_CXXFLAGS = $(PTHREAD_CFLAGS)
tests_LDADD = libkord.a ../tl/cc/libtl.a ../sylv/cc/libsylv.a $(LAPACK_LIBS) $(BLAS_LIBS) $(LIBS) $(FLIBS) $(PTHREAD_LIBS)
......
......@@ -21,7 +21,7 @@ dynare___SOURCES = \
nlsolve.h \
$(GENERATED_FILES)
dynare___CPPFLAGS = -I../sylv/cc -I../tl/cc -I../kord -I../integ/cc -I.. -I$(top_srcdir)/mex/sources -DDYNVERSION=\"$(PACKAGE_VERSION)\" -DPOSIX_THREADS
dynare___CPPFLAGS = -I../sylv/cc -I../tl/cc -I../kord -I../integ/cc -I.. -I$(top_srcdir)/mex/sources -DDYNVERSION=\"$(PACKAGE_VERSION)\"
dynare___LDADD = ../kord/libkord.a ../integ/cc/libinteg.a ../tl/cc/libtl.a ../parser/cc/libparser.a ../utils/cc/libutils.a ../sylv/cc/libsylv.a $(noinst_LIBRARIES) $(LAPACK_LIBS) $(BLAS_LIBS) $(LIBS) $(FLIBS) $(PTHREAD_LIBS)
dynare___CXXFLAGS = $(PTHREAD_CFLAGS)
......
......@@ -91,7 +91,7 @@ GENERATED_FILES = \
noinst_LIBRARIES = libtl.a
libtl_a_SOURCES = $(CWEBSRC) $(GENERATED_FILES)
libtl_a_CPPFLAGS = -I../../sylv/cc -DPOSIX_THREADS
libtl_a_CPPFLAGS = -I../../sylv/cc
libtl_a_CXXFLAGS = $(PTHREAD_CFLAGS)
BUILT_SOURCES = $(GENERATED_FILES)
......
check_PROGRAMS = tests
tests_SOURCES = factory.cpp factory.h monoms.cpp monoms.h tests.cpp
tests_CPPFLAGS = -I../cc -I../../sylv/cc -DPOSIX_THREADS
tests_CPPFLAGS = -I../cc -I../../sylv/cc
tests_CXXFLAGS = $(PTHREAD_CFLAGS)
tests_LDADD = ../cc/libtl.a ../../sylv/cc/libsylv.a $(LAPACK_LIBS) $(BLAS_LIBS) $(LIBS) $(FLIBS) $(PTHREAD_LIBS)
......
......@@ -26,8 +26,6 @@ AC_REQUIRE([AC_PROG_SED])
AC_MSG_CHECKING([for options to compile MEX for MATLAB])
MATLAB_CPPFLAGS="-I$MATLAB/extern/include"
MATLAB_CC="$CC"
MATLAB_CXX="$CXX"
case ${MATLAB_ARCH} in
glnx86 | glnxa64)
......@@ -52,7 +50,7 @@ case ${MATLAB_ARCH} in
MATLAB_CFLAGS="-fexceptions -g -O2"
MATLAB_CXXFLAGS="-g -O2"
LIBLOC="$MATLAB/extern/lib/${MATLAB_ARCH}/microsoft"
MATLAB_LDFLAGS="-shared \$(top_srcdir)/mex/build/mex.def"
MATLAB_LDFLAGS="-shared \$(top_srcdir)/mex.def"
MATLAB_LIBS="$LIBLOC/libmex.lib $LIBLOC/libmx.lib $LIBLOC/libmwlapack.lib -lstdc++"
# Starting from MATLAB 7.5, BLAS and LAPACK are in distinct libraries
AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.5], [MATLAB_LIBS="${MATLAB_LIBS} $LIBLOC/libmwblas.lib"])
......@@ -66,7 +64,6 @@ case ${MATLAB_ARCH} in
ax_mexopts_ok="yes"
;;
maci | maci64)
MATLAB_CC="gcc-4.0"
SDKROOT='/Developer/SDKs/MacOSX10.5.sdk'
MACOSX_DEPLOYMENT_TARGET='10.5'
if test "${MATLAB_ARCH}" = "maci"; then
......@@ -76,9 +73,8 @@ case ${MATLAB_ARCH} in
fi
MATLAB_DEFS="$MATLAB_DEFS -DNDEBUG"
MATLAB_CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -fexceptions -O2"
MATLAB_LDFLAGS="-L$MATLAB/bin/${MATLAB_ARCH} -Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle -Wl,-exported_symbols_list,\$(top_srcdir)/mex/build/mexFunction-MacOSX.map"
MATLAB_LDFLAGS="-L$MATLAB/bin/${MATLAB_ARCH} -Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle -Wl,-exported_symbols_list,\$(top_srcdir)/mexFunction-MacOSX.map"
MATLAB_LIBS="-lmx -lmex -lmat -lstdc++ -lmwlapack"
MATLAB_CXX="g++-4.0"
MATLAB_CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -O2"
# Starting from MATLAB 7.5, BLAS and LAPACK are in distinct libraries
AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.5], [MATLAB_LIBS="${MATLAB_LIBS} -lmwblas"])
......@@ -105,9 +101,7 @@ fi
AC_SUBST([MATLAB_CPPFLAGS])
AC_SUBST([MATLAB_DEFS])
AC_SUBST([MATLAB_CC])
AC_SUBST([MATLAB_CFLAGS])
AC_SUBST([MATLAB_CXX])
AC_SUBST([MATLAB_CXXFLAGS])
AC_SUBST([MATLAB_LDFLAGS])
AC_SUBST([MATLAB_LIBS])
......
dnl Copyright (C) 2009 Dynare Team
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/>.
AC_DEFUN([AX_PROG_LN_S],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_LN_S])
case ${host_os} in
*cygwin*)
LN_S="cp -p" # Cygwin symbolic links are not understood by MATLAB
;;
esac
])
SUBDIRS =
if HAVE_MKOCTFILE
SUBDIRS += mjdgges/octave kronecker/octave gensylv/octave bytecode/octave
endif
if HAVE_MEXOPTS
SUBDIRS += mjdgges/matlab kronecker/matlab gensylv/matlab bytecode/matlab
endif
if HAVE_BLAS
if HAVE_LAPACK
if HAVE_PTHREAD
if HAVE_MEXOPTS
SUBDIRS += korderpert/matlab korderpert/tests
endif
if HAVE_MKOCTFILE
SUBDIRS += korderpert/octave
endif
endif
endif
endif
EXTRA_DIST = mex.def mexFunction-MacOSX.map
vpath %.cc $(top_srcdir)/mex/sources/bytecode
vpath %.hh $(top_srcdir)/mex/sources/bytecode
vpath %.cc $(top_srcdir)/../../sources/bytecode
vpath %.hh $(top_srcdir)/../../sources/bytecode
noinst_PROGRAMS = bytecode
# bytecode_CPPFLAGS interacts badly with VPATH
CPPFLAGS += -I$(top_srcdir)/mex/sources/bytecode -I$(top_srcdir)/preprocessor
CPPFLAGS += -I$(top_srcdir)/../../sources/bytecode -I$(top_srcdir)/../../../preprocessor
nodist_bytecode_SOURCES = \
bytecode.cc \
......
vpath %.cpp $(top_srcdir)/dynare++/sylv/cc $(top_srcdir)/dynare++/sylv/matlab
vpath %.h $(top_srcdir)/dynare++/sylv/cc
vpath %.cpp $(top_srcdir)/../../../dynare++/sylv/cc $(top_srcdir)/../../../dynare++/sylv/matlab
vpath %.h $(top_srcdir)/../../../dynare++/sylv/cc
noinst_PROGRAMS = gensylv
# Can't use gensylv_CPPFLAGS, because it interacts badly with VPATH
CPPFLAGS += -I$(top_srcdir)/dynare++/sylv/cc -I$(top_srcdir)/mex/sources
CPPFLAGS += -I$(top_srcdir)/../../../dynare++/sylv/cc -I$(top_srcdir)/../../sources
nodist_gensylv_SOURCES = \
gensylv.cpp \
......
vpath %.cpp $(top_srcdir)/mex/sources/korderpert $(top_srcdir)/dynare++/sylv/cc $(top_srcdir)/dynare++/tl/cc $(top_srcdir)/dynare++/kord $(top_srcdir)/dynare++/integ/cc $(top_srcdir)/dynare++/src
vpath %.cpp $(top_srcdir)/../../sources/korderpert $(top_srcdir)/../../../dynare++/sylv/cc $(top_srcdir)/../../../dynare++/tl/cc $(top_srcdir)/../../../dynare++/kord $(top_srcdir)/../../../dynare++/integ/cc $(top_srcdir)/../../../dynare++/src
noinst_PROGRAMS = korderpert
# Can't use korderpert_CPPFLAGS, because it interacts badly with VPATH
CPPFLAGS += -I$(top_srcdir)/dynare++/src -I$(top_srcdir)/dynare++/kord -I$(top_srcdir)/dynare++/tl/cc -I$(top_srcdir)/dynare++/utils/cc -I$(top_srcdir)/dynare++/sylv/cc -I$(top_srcdir)/dynare++/integ/cc -I$(top_srcdir)/mex/sources
# For Dynare++ thread implementation in tensor library
DEFS += -DPOSIX_THREADS
CPPFLAGS += -I$(top_srcdir)/../../../dynare++/src -I$(top_srcdir)/../../../dynare++/kord -I$(top_srcdir)/../../../dynare++/tl/cc -I$(top_srcdir)/../../../dynare++/utils/cc -I$(top_srcdir)/../../../dynare++/sylv/cc -I$(top_srcdir)/../../../dynare++/integ/cc -I$(top_srcdir)/../../sources
CXXFLAGS += $(PTHREAD_CFLAGS)
......@@ -86,6 +83,3 @@ nodist_korderpert_SOURCES = \
$(SYLV_SRCS) \
$(INTEG_SRCS) \
nlsolve.cpp
noinst_LIBRARIES = libkorderpert.a
nodist_libkorderpert_a_SOURCES = $(nodist_korderpert_SOURCES)
vpath %.cpp $(top_srcdir)/mex/sources/korderpert/tests
check_PROGRAMS = k_order_test_main
CPPFLAGS += -I$(top_srcdir)/dynare++/src -I$(top_srcdir)/dynare++/kord -I$(top_srcdir)/dynare++/tl/cc -I$(top_srcdir)/dynare++/utils/cc -I$(top_srcdir)/dynare++/sylv/cc -I$(MATLAB)/extern/include -I$(top_srcdir)/mex/sources/korderpert -I$(top_srcdir)/mex/sources
CPPFLAGS += $(MATLAB_CPPFLAGS)
DEFS += -DPOSIX_THREADS -DMATLAB_MEX_FILE $(MATLAB_DEFS)
CXXFLAGS += $(PTHREAD_CFLAGS)
LDFLAGS += $(subst -shared,,$(MATLAB_LDFLAGS))
LDFLAGS += -Wl,-rpath,$(MATLAB)/bin/$(MATLAB_ARCH)
nodist_k_order_test_main_SOURCES = k_order_test_main.cpp
k_order_test_main_LDADD = ../matlab/libkorderpert.a $(MATLAB_LIBS) $(PTHREAD_LIBS) $(LIBADD_DLOPEN)
vpath %.cc $(top_srcdir)/mex/sources/kronecker
vpath %.cc $(top_srcdir)/../../sources/kronecker
noinst_PROGRAMS = sparse_hessian_times_B_kronecker_C A_times_B_kronecker_C
......
ACLOCAL_AMFLAGS = -I ../../../m4
if DO_SOMETHING
SUBDIRS = mjdgges gensylv kronecker bytecode korderpert
endif
EXTRA_DIST = mex.def mexFunction-MacOSX.map
include ../../matlabmex.am
include ../mex.am
include ../../bytecode.am
dnl Process this file with autoconf to produce a configure script.
dnl Copyright (C) 2009 Dynare Team
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/>.
AC_PREREQ([2.61])
AC_INIT([dynare], [4.1-unstable])
AC_CONFIG_SRCDIR([configure.ac])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AX_MATLAB
if test "x$ax_enable_matlab" = "xyes"; then
AX_DOT_MEXEXT
AX_MATLAB_ARCH
AX_MATLAB_VERSION
if test "x$ax_matlab_version_ok" = "xyes"; then
AX_MEXOPTS
# Determine subdirectory of mex/ to be used for storing MATLAB MEX binaries
AX_COMPARE_VERSION([$MATLAB_VERSION], [le], [7.4], [DYNARE_MEXDIR="2007a"], [
DYNARE_MEXDIR="2007b"
if test ${MATLAB_ARCH%64} != ${MATLAB_ARCH}; then
AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.8], [DYNARE_MEXDIR="2009a-64bit"])
fi])
AC_SUBST([DYNARE_MEXDIR])
fi
CFLAGS="$MATLAB_CFLAGS"
CXXFLAGS="$MATLAB_CXXFLAGS"
fi
AC_PROG_CC
AC_PROG_CXX
AX_PROG_LN_S
AX_PTHREAD
# Check for dlopen(), needed by korderpert DLL
AC_CHECK_LIB([dl], [dlopen], [LIBADD_DLOPEN="-ldl"], [])
AC_SUBST([LIBADD_DLOPEN])
AM_CONDITIONAL([DO_SOMETHING], [test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes"])
AC_CONFIG_FILES([Makefile
mjdgges/Makefile
kronecker/Makefile
gensylv/Makefile
bytecode/Makefile
korderpert/Makefile])
if test "x$ax_enable_matlab" = "xyes" -a "x$ax_matlab_version_ok" = "xyes" -a "x$ax_mexopts_ok" = "xyes"; then
if test x"$ax_pthread_ok" = "xyes"; then
BUILD_MEX_MATLAB="yes"
else
BUILD_MEX_MATLAB="yes (without POSIX threads)"
fi
else
BUILD_MEX_MATLAB="no (missing MATLAB, or unknown version, or unknown architecture)"
fi
AC_MSG_NOTICE([
Dynare is now configured for building the following components...
Binaries (with "make"):
MEX files for MATLAB: $BUILD_MEX_MATLAB
])
AC_OUTPUT
Markdown is supported
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