File: matlab.m4

package info (click to toggle)
harp 1.29-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 57,028 kB
  • sloc: xml: 475,954; ansic: 175,442; sh: 4,898; yacc: 2,186; javascript: 1,510; python: 1,148; makefile: 656; lex: 591
file content (59 lines) | stat: -rw-r--r-- 1,414 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# ST_CHECK_MATLAB
# ---------------
# Check for the availability of MATLAB
AC_DEFUN([ST_CHECK_MATLAB],
[AC_ARG_VAR(MATLAB,[The MATLAB root directory. If not specified '/usr/local/matlab' is assumed])
if test "$MATLAB" = "" ; then
  MATLAB=/usr/local/matlab
fi
AC_PATH_PROG(matlab, matlab, no, [$MATLAB/bin])
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS="-I$MATLAB/extern/include $CPPFLAGS"
AC_CHECK_HEADERS(mex.h)
ST_CHECK_MEX_EXTENSION
AC_MSG_CHECKING(for MATLAB installation)
if test $ac_cv_path_matlab = no || test $ac_cv_header_mex_h = no || test "$MEXEXT" = "" ; then
  st_cv_have_matlab=no
  CPPFLAGS=$old_CPPFLAGS
else
  st_cv_have_matlab=yes
fi
AC_MSG_RESULT($st_cv_have_matlab)
])# ST_CHECK_MATLAB


# ST_CHECK_MEX_EXTENSION
# ----------------------
# Determine the extension that is used for MATLAB MEX modules
AC_DEFUN([ST_CHECK_MEX_EXTENSION],
[AC_MSG_CHECKING([for mex extension])
AC_CANONICAL_HOST
case $host in
    x86_64-*-linux-*)
        MEXEXT=.mexa64
        ;;
    i*86-*-linux-*)
        MEXEXT=.mexglx
        ;;
    i386-apple-darwin*)
        MEXEXT=.mexmaci
        ;;
    x86_64-apple-darwin*)
        MEXEXT=.mexmaci64
        ;;
    *-pc-mingw32)
        MEXEXT=.mexw32
        ;;
    *-pc-mingw64)
        MEXEXT=.mexw64
        ;;
    *)
    	MEXEXT=
esac
if test "$MEXEXT" != "" ; then
  AC_MSG_RESULT([$MEXEXT])
else
  AC_MSG_RESULT([not found])
fi 
AC_SUBST(MEXEXT)
])# ST_CHECK_MEX_EXTENSION