dnl dnl Filename : matlab.m4 dnl Description : Autoconf macro for MATLAB configuration dnl Author(s) : Mike Hucka dnl Created : 2004-08-02 dnl Revision : $Id: matlab.m4 8909 2009-01-19 07:16:58Z mhucka $ dnl $HeadURL: https://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml/config/matlab.m4 $ dnl dnl */ AC_DEFUN([CONFIG_PROG_MATLAB], [ AC_ARG_WITH([matlab], AC_HELP_STRING([--with-matlab=PREFIX], [Generate MATLAB interface library [[default=no]]]), [with_matlab=$withval], [with_matlab=no]) if test $with_matlab != no; then if test $with_matlab != yes; then dnl Remove needless trailing slashes because it can confuse tests later. with_matlab=`echo $with_matlab | sed -e 's,\(.*\)/$,\1,g'` AC_PATH_PROG([MEX], [mex], [no], [$with_matlab/bin]) AC_PATH_PROG([MATLAB], [matlab], [no], [$with_matlab/bin]) else AC_PATH_PROG([MEX], [mex]) AC_PATH_PROG([MATLAB], [matlab]) fi if test -z "$MATLAB" -o "$MATLAB" = "no"; then AC_MSG_ERROR([Could not find 'matlab' executable for MATLAB.]) elif test -z "$MEX" -o "$MEX" = "no"; then AC_MSG_ERROR([Could not find 'mex' executable for MATLAB.]) fi dnl The mex extension really should be obtained using matlab's dnl "mexext", but it lives in the matlab directory and there's no way dnl to know a priori where that is. After all, users may only have dnl provided --with-matlab during configuration, without telling us the dnl matlab installation directory. case $host in *86-*-darwin*) MEXEXT="mexmaci" ;; *powerpc-*-darwin*) MEXEXT="mexmac" ;; *cygwin*) MEXEXT="dll" ;; *x86_64*) MEXEXT="mexa64" ;; dnl Default is x86. *) MEXEXT="mexglx" ;; esac AC_DEFINE([USE_MATLAB], 1, [Define to 1 to use Matlab]) AC_SUBST(USE_MATLAB, 1) AC_SUBST(MATLAB_CPPFLAGS) AC_SUBST(MATLAB_LDFLAGS) AC_SUBST(MATLAB_LIBS) AC_SUBST(MEX_FLAGS) AC_SUBST(MEXEXT) fi dnl We record the USE_XXX flag, for later testing in Makefiles. LIBSBML_OPTIONS="$LIBSBML_OPTIONS USE_MATLAB" ])