cannam@125
|
1 dnl Evaluate an expression in octave
|
cannam@125
|
2 dnl
|
cannam@125
|
3 dnl OCTAVE_EVAL(expr,var) -> var=expr
|
cannam@125
|
4 dnl
|
cannam@125
|
5 dnl Stolen from octave-forge
|
cannam@125
|
6
|
cannam@125
|
7 AC_DEFUN([OCTAVE_EVAL],
|
cannam@125
|
8 [
|
cannam@125
|
9 AC_MSG_CHECKING([for $1 in $OCTAVE])
|
cannam@125
|
10 $2=`TERM=;$OCTAVE -qfH --eval "disp($1)"`
|
cannam@125
|
11 AC_MSG_RESULT($$2)
|
cannam@125
|
12 AC_SUBST($2)
|
cannam@125
|
13 ]) # OCTAVE_EVAL
|
cannam@125
|
14
|
cannam@125
|
15 dnl @synopsis AC_OCTAVE_VERSION
|
cannam@125
|
16 dnl
|
cannam@125
|
17 dnl Find the version of Octave.
|
cannam@125
|
18 dnl @version 1.0 Aug 23 2007
|
cannam@125
|
19 dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
cannam@125
|
20 dnl
|
cannam@125
|
21 dnl Permission to use, copy, modify, distribute, and sell this file for any
|
cannam@125
|
22 dnl purpose is hereby granted without fee, provided that the above copyright
|
cannam@125
|
23 dnl and this permission notice appear in all copies. No representations are
|
cannam@125
|
24 dnl made about the suitability of this software for any purpose. It is
|
cannam@125
|
25 dnl provided "as is" without express or implied warranty.
|
cannam@125
|
26 dnl
|
cannam@125
|
27
|
cannam@125
|
28 AC_DEFUN([AC_OCTAVE_VERSION],
|
cannam@125
|
29 [
|
cannam@125
|
30
|
cannam@125
|
31 AC_ARG_WITH(octave,
|
cannam@125
|
32 AC_HELP_STRING([--with-octave], [choose the octave version]),
|
cannam@125
|
33 [ with_octave=$withval ])
|
cannam@125
|
34
|
cannam@125
|
35 test -z "$with_octave" && with_octave=octave
|
cannam@125
|
36
|
cannam@125
|
37 AC_CHECK_PROG(HAVE_OCTAVE,$with_octave,yes,no)
|
cannam@125
|
38
|
cannam@125
|
39 if test "x$ac_cv_prog_HAVE_OCTAVE" = "xyes" ; then
|
cannam@125
|
40 OCTAVE=$with_octave
|
cannam@125
|
41 OCTAVE_EVAL(OCTAVE_VERSION,OCTAVE_VERSION)
|
cannam@125
|
42 fi
|
cannam@125
|
43
|
cannam@125
|
44 AC_SUBST(OCTAVE)
|
cannam@125
|
45 AC_SUBST(OCTAVE_VERSION)
|
cannam@125
|
46
|
cannam@125
|
47 ])# AC_OCTAVE_VERSION
|
cannam@125
|
48
|
cannam@125
|
49 dnl @synopsis AC_OCTAVE_CONFIG_VERSION
|
cannam@125
|
50 dnl
|
cannam@125
|
51 dnl Find the version of Octave.
|
cannam@125
|
52 dnl @version 1.0 Aug 23 2007
|
cannam@125
|
53 dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
cannam@125
|
54 dnl
|
cannam@125
|
55 dnl Permission to use, copy, modify, distribute, and sell this file for any
|
cannam@125
|
56 dnl purpose is hereby granted without fee, provided that the above copyright
|
cannam@125
|
57 dnl and this permission notice appear in all copies. No representations are
|
cannam@125
|
58 dnl made about the suitability of this software for any purpose. It is
|
cannam@125
|
59 dnl provided "as is" without express or implied warranty.
|
cannam@125
|
60 dnl
|
cannam@125
|
61
|
cannam@125
|
62 AC_DEFUN([AC_OCTAVE_CONFIG_VERSION],
|
cannam@125
|
63 [
|
cannam@125
|
64
|
cannam@125
|
65 AC_ARG_WITH(octave-config,
|
cannam@125
|
66 AC_HELP_STRING([--with-octave-config], [choose the octave-config version]),
|
cannam@125
|
67 [ with_octave_config=$withval ])
|
cannam@125
|
68
|
cannam@125
|
69 test -z "$with_octave_config" && with_octave_config=octave-config
|
cannam@125
|
70
|
cannam@125
|
71 AC_CHECK_PROG(HAVE_OCTAVE_CONFIG,$with_octave_config,yes,no)
|
cannam@125
|
72
|
cannam@125
|
73 if test "x$ac_cv_prog_HAVE_OCTAVE_CONFIG" = "xyes" ; then
|
cannam@125
|
74 OCTAVE_CONFIG=$with_octave_config
|
cannam@125
|
75 AC_MSG_CHECKING([for version of $OCTAVE_CONFIG])
|
cannam@125
|
76 OCTAVE_CONFIG_VERSION=`$OCTAVE_CONFIG --version`
|
cannam@125
|
77 AC_MSG_RESULT($OCTAVE_CONFIG_VERSION)
|
cannam@125
|
78 fi
|
cannam@125
|
79
|
cannam@125
|
80 AC_SUBST(OCTAVE_CONFIG)
|
cannam@125
|
81 AC_SUBST(OCTAVE_CONFIG_VERSION)
|
cannam@125
|
82
|
cannam@125
|
83 ])# AC_OCTAVE_CONFIG_VERSION
|
cannam@125
|
84
|
cannam@125
|
85 dnl @synopsis AC_OCTAVE_BUILD
|
cannam@125
|
86 dnl
|
cannam@125
|
87 dnl Check programs and headers required for building octave plugins.
|
cannam@125
|
88 dnl @version 1.0 Aug 23 2007
|
cannam@125
|
89 dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
cannam@125
|
90 dnl
|
cannam@125
|
91 dnl Permission to use, copy, modify, distribute, and sell this file for any
|
cannam@125
|
92 dnl purpose is hereby granted without fee, provided that the above copyright
|
cannam@125
|
93 dnl and this permission notice appear in all copies. No representations are
|
cannam@125
|
94 dnl made about the suitability of this software for any purpose. It is
|
cannam@125
|
95 dnl provided "as is" without express or implied warranty.
|
cannam@125
|
96
|
cannam@125
|
97
|
cannam@125
|
98 AC_DEFUN([AC_OCTAVE_BUILD],
|
cannam@125
|
99 [
|
cannam@125
|
100
|
cannam@125
|
101 dnl Default to no.
|
cannam@125
|
102 OCTAVE_BUILD=no
|
cannam@125
|
103
|
cannam@125
|
104 AC_OCTAVE_VERSION
|
cannam@125
|
105 OCTAVE_MKOCTFILE_VERSION
|
cannam@125
|
106 AC_OCTAVE_CONFIG_VERSION
|
cannam@125
|
107
|
cannam@125
|
108 prog_concat="$ac_cv_prog_HAVE_OCTAVE$ac_cv_prog_HAVE_OCTAVE_CONFIG$ac_cv_prog_HAVE_MKOCTFILE"
|
cannam@125
|
109
|
cannam@125
|
110 if test "x$prog_concat" = "xyesyesyes" ; then
|
cannam@125
|
111 if test "x$OCTAVE_VERSION" != "x$MKOCTFILE_VERSION" ; then
|
cannam@125
|
112 AC_MSG_WARN([** Mismatch between versions of octave and mkoctfile. **])
|
cannam@125
|
113 AC_MSG_WARN([** Octave libsndfile modules will not be built. **])
|
cannam@125
|
114 elif test "x$OCTAVE_VERSION" != "x$OCTAVE_CONFIG_VERSION" ; then
|
cannam@125
|
115 AC_MSG_WARN([** Mismatch between versions of octave and octave-config. **])
|
cannam@125
|
116 AC_MSG_WARN([** Octave libsndfile modules will not be built. **])
|
cannam@125
|
117 else
|
cannam@125
|
118 case "$MKOCTFILE_VERSION" in
|
cannam@125
|
119 2.*)
|
cannam@125
|
120 AC_MSG_WARN([Octave version 2.X is not supported.])
|
cannam@125
|
121 ;;
|
cannam@125
|
122 3.*)
|
cannam@125
|
123 OCTAVE_DEST_ODIR=`$OCTAVE_CONFIG --oct-site-dir | sed 's%^/usr%${prefix}%'`
|
cannam@125
|
124 OCTAVE_DEST_MDIR=`$OCTAVE_CONFIG --m-site-dir | sed 's%^/usr%${prefix}%'`
|
cannam@125
|
125
|
cannam@125
|
126 OCTAVE_BUILD=yes
|
cannam@125
|
127 ;;
|
cannam@125
|
128 *)
|
cannam@125
|
129 AC_MSG_WARN([Octave version $MKOCTFILE_VERSION is not supported.])
|
cannam@125
|
130 ;;
|
cannam@125
|
131 esac
|
cannam@125
|
132 fi
|
cannam@125
|
133 AC_MSG_RESULT([building octave libsndfile module... $OCTAVE_BUILD])
|
cannam@125
|
134 fi
|
cannam@125
|
135
|
cannam@125
|
136 AC_SUBST(OCTAVE_DEST_ODIR)
|
cannam@125
|
137 AC_SUBST(OCTAVE_DEST_MDIR)
|
cannam@125
|
138
|
cannam@125
|
139 AC_SUBST(MKOCTFILE)
|
cannam@125
|
140
|
cannam@125
|
141 AM_CONDITIONAL(BUILD_OCTAVE_MOD, test "x$OCTAVE_BUILD" = xyes)
|
cannam@125
|
142
|
cannam@125
|
143 ])# AC_OCTAVE_BUILD
|