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