1 | AC_DEFUN([RP_LANG_MATLAB],[ |
---|
2 | with_matlab="yes" |
---|
3 | AC_ARG_WITH( |
---|
4 | [matlab], |
---|
5 | [AS_HELP_STRING([--with-matlab[=DIR]], |
---|
6 | [location of matlab and mex compiler @<:@default=yes@:>@])], |
---|
7 | [], |
---|
8 | [with_matlab=yes]) |
---|
9 | |
---|
10 | MCC="" |
---|
11 | MEX="" |
---|
12 | MEX_ARCH="" |
---|
13 | MEXEXT="" |
---|
14 | MATLAB= |
---|
15 | if test "$with_matlab" != "no" ; then |
---|
16 | if test "$with_matlab" = "yes" ; then |
---|
17 | AC_PATH_PROG(MATLAB, matlab) |
---|
18 | else |
---|
19 | AC_PATH_PROG(MATLAB, matlab, [], [${with_matlab}/bin:${with_matlab}]) |
---|
20 | fi |
---|
21 | fi |
---|
22 | |
---|
23 | if 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]) |
---|
43 | fi |
---|
44 | ]) |
---|