source: trunk/cf/rp_lang_matlab.m4 @ 2203

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