source: trunk/cf/rpLangMatlab.m4 @ 2209

Last change on this file since 2209 was 2209, checked in by gah, 10 years ago
File size: 1.2 KB
Line 
1AC_DEFUN([RP_LANG_MATLAB],[
2rp_with_matlab="yes"
3AC_ARG_WITH(
4    [matlab],
5    [AS_HELP_STRING([--with-matlab[=DIR]],
6        [location of matlab and mex compiler @<:@default=yes@:>@])],
7    [rp_with_matlab=$withval],
8    [rp_with_matlab=yes])
9
10MCC=""
11MEX=""
12MEX_ARCH=""
13MEXEXT=""
14MATLAB=
15if test "$rp_with_matlab" != "no" ; then
16  if test "$rp_with_matlab" = "yes" ; then
17    AC_PATH_PROG(MATLAB, matlab)
18  else
19    AC_PATH_PROG(MATLAB, matlab, [], [${rp_with_matlab}/bin:${rp_with_matlab}])
20  fi
21fi
22
23if test "x$MATLAB" != "x" ; then
24  # Found matlab.  May be a symlink to the real binary.  Run "matlab -e"
25  # to tell where matlab is installed.
26
27  matlab_bindir=`${MATLAB} -e | grep "MATLAB=" | sed s/MATLAB=//`/bin
28
29  # Now see if we can find "mex" or "mexext" there.
30  AC_PATH_PROG(MEX, mex, [], [${matlab_bindir}])
31  AC_PATH_PROG(MEXEXT, mexext, [], [${matlab_bindir}])
32
33  # Run "mexext" to get the expected module extension for this platform.
34  AC_MSG_CHECKING([for mex extension])
35  if test "x$MEXEXT" != "x" ; then
36    MEXEXT=`$MEXEXT`
37  else
38    MEXEXT="mexglx"
39  fi
40  AC_MSG_RESULT([$MEXEXT])
41  AC_PATH_PROG(MCC, mcc, [], [${matlab_bindir}])
42  AC_MSG_CHECKING([for mcc extension])
43fi
44])
Note: See TracBrowser for help on using the repository browser.