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
include ../../mkoctfile.am
include ../mex.am
include ../../gensylv.am
include ../../matlabmex.am
include ../mex.am
include ../../korderpert.am
CPPFLAGS += -DMEXEXT=\"$(MEXEXT)\"
include ../../matlabmex.am
include ../mex.am
include ../../kronecker.am
EXEEXT = $(MEXEXT)
CPPFLAGS += $(MATLAB_CPPFLAGS)
CPPFLAGS += -I$(top_srcdir)/../../sources
DEFS += $(MATLAB_DEFS)
DEFS += -DMATLAB_MEX_FILE
LDFLAGS += $(MATLAB_LDFLAGS)
LIBS += $(MATLAB_LIBS)
all-local:
cd $(top_srcdir)/../../$(DYNARE_MEXDIR) && \
for p in $(PROGRAMS); do \
$(LN_S) -f $(abs_srcdir)/$$p $$p; \
done
clean-local:
cd $(top_srcdir)/../../$(DYNARE_MEXDIR) && rm -f $(PROGRAMS)
include ../../matlabmex.am
include ../mex.am
include ../../mjdgges.am
EXEEXT = $(MEXEXT)
CPPFLAGS = $(MATLAB_CPPFLAGS)
CPPFLAGS += -I$(top_srcdir)/mex/sources
DEFS = $(MATLAB_DEFS)
DEFS += -DMATLAB_MEX_FILE
CC = $(MATLAB_CC)
CFLAGS = $(MATLAB_CFLAGS)
CXX = $(MATLAB_CXX)
CXXFLAGS = $(MATLAB_CXXFLAGS)
LDFLAGS = $(MATLAB_LDFLAGS)
LIBS = $(MATLAB_LIBS)
all-local:
cd $(top_srcdir)/mex/$(DYNARE_MEXDIR) && \
for p in $(PROGRAMS); do \
$(LN_S) -f $(abs_srcdir)/$$p $$p; \
done
clean-local:
cd $(top_srcdir)/mex/$(DYNARE_MEXDIR) && rm -f $(PROGRAMS)
vpath %.c $(top_srcdir)/mex/sources/mjdgges
vpath %.c $(top_srcdir)/../../sources/mjdgges
noinst_PROGRAMS = mjdgges
......
ACLOCAL_AMFLAGS = -I ../../../m4
if DO_SOMETHING
SUBDIRS = mjdgges gensylv kronecker bytecode korderpert
endif
include ../../mkoctfile.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])
AC_CHECK_PROG([MKOCTFILE], [mkoctfile], [mkoctfile])
if test "x$MKOCTFILE" != "x"; then
CC=`$MKOCTFILE -p CC`
CXX=`$MKOCTFILE -p CXX`
CFLAGS=`$MKOCTFILE -p CFLAGS`
CXXFLAGS=`$MKOCTFILE -p 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$MKOCTFILE" != "x"])
if test "x$MKOCTFILE" != "x"; then
if test x"$ax_pthread_ok" = "xyes"; then
BUILD_MEX_OCTAVE="yes"
else
BUILD_MEX_OCTAVE="yes (without POSIX threads)"
fi
else
BUILD_MEX_OCTAVE="no (missing mkoctfile)"
fi
AC_MSG_NOTICE([
Dynare is now configured for building the following components...
Binaries (with "make"):
MEX files for Octave: $BUILD_MEX_OCTAVE
])
AC_CONFIG_FILES([Makefile
mjdgges/Makefile
kronecker/Makefile
gensylv/Makefile
bytecode/Makefile
korderpert/Makefile])
AC_OUTPUT
include ../../matlabmex.am
include ../mex.am
include ../../gensylv.am
include ../../mkoctfile.am
include ../mex.am
include ../../korderpert.am
CPPFLAGS += -DMEXEXT=\"mex\"
include ../../mkoctfile.am
include ../mex.am
include ../../kronecker.am
EXEEXT = .mex
CPPFLAGS = $(shell $(MKOCTFILE) -p CPPFLAGS)
CPPFLAGS += -I$(top_srcdir)/mex/sources
CPPFLAGS += $(shell $(MKOCTFILE) -p CPPFLAGS)
CPPFLAGS += $(shell $(MKOCTFILE) -p INCFLAGS)
CPPFLAGS += -I$(top_srcdir)/../../sources
DEFS = -DOCTAVE_MEX_FILE
DEFS += -DOCTAVE_MEX_FILE
CC = $(shell $(MKOCTFILE) -p CC)
CFLAGS = $(shell $(MKOCTFILE) -p CPICFLAG)
CFLAGS += $(shell $(MKOCTFILE) -p ALL_CFLAGS)
CFLAGS += $(shell $(MKOCTFILE) -p CPICFLAG)
CXX = $(shell $(MKOCTFILE) -p CXX)
CXXFLAGS = $(shell $(MKOCTFILE) -p CXXPICFLAG)
CXXFLAGS += $(shell $(MKOCTFILE) -p ALL_CXXFLAGS)
CXXFLAGS += $(shell $(MKOCTFILE) -p CXXPICFLAG)
LDFLAGS = $(shell $(MKOCTFILE) -p DL_LDFLAGS)
LDFLAGS += $(shell $(MKOCTFILE) -p DL_LDFLAGS)
LDFLAGS += $(shell $(MKOCTFILE) -p LFLAGS)
LDFLAGS += $(shell $(MKOCTFILE) -p LDFLAGS)
LIBS = $(shell $(MKOCTFILE) -p OCTAVE_LIBS)
LIBS += $(shell $(MKOCTFILE) -p OCTAVE_LIBS)
LIBS += $(shell $(MKOCTFILE) -p BLAS_LIBS)
LIBS += $(shell $(MKOCTFILE) -p FFTW_LIBS)
LIBS += $(shell $(MKOCTFILE) -p LIBS)
......@@ -25,10 +22,10 @@ LIBS += $(shell $(MKOCTFILE) -p FLIBS)
LIBS += $(shell $(MKOCTFILE) -p CXXLIBS) # Only used for Octave/MinGW
all-local:
cd $(top_srcdir)/mex/octave && \
cd $(top_srcdir)/../../octave && \
for p in $(PROGRAMS); do \
$(LN_S) -f $(abs_srcdir)/$$p $$p; \
done
clean-local:
cd $(top_srcdir)/mex/octave && rm -f $(PROGRAMS)
cd $(top_srcdir)/../../octave && rm -f $(PROGRAMS)
include ../../mkoctfile.am
include ../mex.am
include ../../mjdgges.am
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