annotate m4/ax_octave.m4 @ 385:132fec49e438

build: support user selection of Octave version or prefix or both * m4/ax_octave.m4: Add OCTAVE and OCTAVE_VERSION input variables. Test for Octave programs with optional suffix derived from OCTAVE_VERSION. * Makefile.am (check-local): Use configured $(OCTAVE) interpreter. Add options to avoid unnecessary initialization.
author Mike Miller <mtmiller@octave.org>
date Sun, 02 Apr 2017 16:24:02 -0700
parents 30a305837ae6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
1 # ===========================================================================
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
2 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
3 # ===========================================================================
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
4 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
5 # SYNOPSIS
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
6 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
7 # AX_OCTAVE([OCTAVE_CONFIG], [ACTION_IF_FOUND], [ACTION_IF_NOT_FOUND])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
8 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
9 # DESCRIPTION
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
10 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
11 # This macro does a Octave development environment check.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
12 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
13 # It accepts one optional argument, OCTAVE_CONFIG. This is the full
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
14 # path the the octave-config used to find out the environment.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
15 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
16 # If OCTAVE_CONFIG is not set, or empty, a octave-config executable
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
17 # is searched for using AC_PATH_TOOL. If the executable is not
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
18 # found, or does not return results, the Octave interpreter will be
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
19 # used instead.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
20 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
21 # As a final check, a simple test program is compiled and linked
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
22 # against the found Octave installation. If the check is
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
23 # successful, ACTION_IF_FOUND is executed, otherwise
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
24 # ACTION_IF_NOT_FOUND.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
25 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
26 # AX_OCTAVE substitutes OCTAVE_CPPFLAGS, OCTAVE_LDFLAGS and
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
27 # OCTAVE_LIBS, along with the optional OCTAVE_LIBRARYDIR and
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
28 # OCTAVE_INCLUDEDIR.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
29 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
30 # Typical usage:
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
31 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
32 # AX_OCTAVE([], [], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
33 # AC_MSG_ERROR([[Octave required but not available]])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
34 # ])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
35 # LIBS="$LIBS $OCTAVE_LIBS"
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
36 # CPPFLAGS="$CPPFLAGS $OCTAVE_CPPFLAGS"
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
37 # LDFLAGS="$LDFLAGS $OCTAVE_LDFLAGS"
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
38 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
39 # LAST MODIFICATION
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
40 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
41 # 2009-05-04
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
42 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
43 # COPYING
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
44 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
45 # Copyright (c) 2009 David Grundberg
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
46 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
47 # This program is free software; you can redistribute it and/or modify it
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
48 # under the terms of the GNU General Public License as published by the
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
49 # Free Software Foundation; either version 2 of the License, or (at your
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
50 # option) any later version.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
51 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
52 # This program is distributed in the hope that it will be useful, but
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
53 # WITHOUT ANY WARRANTY; without even the implied warranty of
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
54 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
55 # Public License for more details.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
56 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
57 # You should have received a copy of the GNU General Public License along
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
58 # with this program. If not, see <http://www.gnu.org/licenses/>.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
59 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
60 # As a special exception, the respective Autoconf Macro's copyright owner
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
61 # gives unlimited permission to copy, distribute and modify the configure
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
62 # scripts that are the output of Autoconf when processing the Macro. You
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
63 # need not follow the terms of the GNU General Public License when using
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
64 # or distributing such scripts, even though portions of the text of the
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
65 # Macro appear in them. The GNU General Public License (GPL) does govern
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
66 # all other use of the material that constitutes the Autoconf Macro.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
67 #
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
68 # This special exception to the GPL applies to versions of the Autoconf
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
69 # Macro released by the Autoconf Macro Archive. When you make and
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
70 # distribute a modified version of the Autoconf Macro, you may extend this
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
71 # special exception to the GPL to apply to your modified version as well.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
72
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
73 AC_DEFUN([AX_OCTAVE],[
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
74 # These are the variables AX_OCTAVE uses
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
75 OCTAVE_LDFLAGS=
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
76 OCTAVE_LIBS=
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
77 OCTAVE_CPPFLAGS=
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
78 OCTAVE_INCLUDEDIR=
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
79 OCTAVE_LIBRARYDIR=
186
277b1e172123 build: Add --with-octave option to select Octave prefix (fixes issue #1)
Mike Miller <mtmiller@octave.org>
parents: 167
diff changeset
80
277b1e172123 build: Add --with-octave option to select Octave prefix (fixes issue #1)
Mike Miller <mtmiller@octave.org>
parents: 167
diff changeset
81 AC_ARG_VAR([MKOCTFILE], [mkoctfile command])
385
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
82 AC_ARG_VAR([OCTAVE], [octave command])
186
277b1e172123 build: Add --with-octave option to select Octave prefix (fixes issue #1)
Mike Miller <mtmiller@octave.org>
parents: 167
diff changeset
83 AC_ARG_VAR([OCTAVE_CONFIG], [octave-config command])
385
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
84 AC_ARG_VAR([OCTAVE_VERSION], [the full version of Octave to use])
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
85
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
86 AS_IF([test -n "$OCTAVE_VERSION"],
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
87 [ax_octave_suffix="-$OCTAVE_VERSION"],
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
88 [ax_octave_suffix=""])
186
277b1e172123 build: Add --with-octave option to select Octave prefix (fixes issue #1)
Mike Miller <mtmiller@octave.org>
parents: 167
diff changeset
89
277b1e172123 build: Add --with-octave option to select Octave prefix (fixes issue #1)
Mike Miller <mtmiller@octave.org>
parents: 167
diff changeset
90 AC_ARG_WITH([octave],
277b1e172123 build: Add --with-octave option to select Octave prefix (fixes issue #1)
Mike Miller <mtmiller@octave.org>
parents: 167
diff changeset
91 AS_HELP_STRING([--with-octave],
277b1e172123 build: Add --with-octave option to select Octave prefix (fixes issue #1)
Mike Miller <mtmiller@octave.org>
parents: 167
diff changeset
92 [specify root directory of Octave installation]))
385
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
93 AS_IF([test -n "$with_octave"],
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
94 [AS_IF([test -z "$MKOCTFILE" && test -f "$with_octave/bin/mkoctfile$ax_octave_suffix"],
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
95 [MKOCTFILE="$with_octave/bin/mkoctfile$ax_octave_suffix"])
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
96 AS_IF([test -z "$OCTAVE" && test -f "$with_octave/bin/octave$ax_octave_suffix"],
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
97 [OCTAVE="$with_octave/bin/octave$ax_octave_suffix"])
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
98 AS_IF([test -z "$OCTAVE_CONFIG" && test -f "$with_octave/bin/octave-config$ax_octave_suffix"],
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
99 [OCTAVE_CONFIG="$with_octave/bin/octave-config$ax_octave_suffix"])],
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
100 [AC_CHECK_TOOLS([MKOCTFILE], [mkoctfile$ax_octave_suffix])
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
101 AC_CHECK_TOOLS([OCTAVE], [octave$ax_octave_suffix])
132fec49e438 build: support user selection of Octave version or prefix or both
Mike Miller <mtmiller@octave.org>
parents: 187
diff changeset
102 AC_CHECK_TOOLS([OCTAVE_CONFIG], [octave-config$ax_octave_suffix])])
186
277b1e172123 build: Add --with-octave option to select Octave prefix (fixes issue #1)
Mike Miller <mtmiller@octave.org>
parents: 167
diff changeset
103
83
8145ecfecfb9 Configuration changes. Detect numpy in ./configure.
David Grundberg <c04dgg@cs.umu.se>
parents: 29
diff changeset
104 ax_octave_config="[$]$1"
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
105 ax_octave_ok=
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
106
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
107 AC_MSG_CHECKING([for octave-config filename])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
108 AS_IF([test -z "$ax_octave_config"], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
109 AC_MSG_RESULT([determined from path])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
110 AC_PATH_TOOL([ax_octave_config], [octave-config], [])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
111 AS_IF([test -z "$ax_octave_config"], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
112 AC_MSG_WARN([Could not find octave-config.])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
113 ], [])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
114 ], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
115 AC_MSG_RESULT([specified $ax_octave_config])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
116 ])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
117
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
118 AS_IF([test -n "$ax_octave_config"], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
119 AC_MSG_CHECKING([for Octave library path])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
120 OCTAVE_LIBRARYDIR=`$ax_octave_config -p OCTLIBDIR`
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
121 AC_MSG_RESULT([$OCTAVE_LIBRARYDIR])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
122
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
123 AC_MSG_CHECKING([for Octave include path])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
124 OCTAVE_INCLUDEDIR=`$ax_octave_config -p OCTINCLUDEDIR`
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
125 AC_MSG_RESULT([$OCTAVE_INCLUDEDIR])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
126 ])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
127
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
128 AS_IF([[test -z "$OCTAVE_LIBRARYDIR" -o -z "$OCTAVE_INCLUDEDIR"]], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
129 AC_MSG_WARN([[
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
130 ========================================================================
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
131 Octave library or include path not found using octave-config, trying
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
132 Octave interpreter.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
133
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
134 This could be a sign that the Octave development package is missing.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
135 ========================================================================]])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
136
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
137 OCTAVE_LIBRARYDIR=
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
138 OCTAVE_INCLUDEDIR=
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
139
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
140 AC_MSG_NOTICE([[checking for Octave interpreter]])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
141 AC_PATH_TOOL([ax_octave_interpreter], [octave], [])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
142 AS_IF([test -z "$ax_octave_interpreter"], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
143 AC_MSG_WARN([Could not find Octave interpreter.])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
144 ], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
145 AC_MSG_CHECKING([for Octave library path (alt)])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
146 OCTAVE_LIBRARYDIR=`$ax_octave_interpreter -q --eval "printf(octave_config_info.octlibdir)"`
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
147 AC_MSG_RESULT([$OCTAVE_LIBRARYDIR])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
148
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
149 AC_MSG_CHECKING([for Octave include path (alt)])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
150 OCTAVE_INCLUDEDIR=`$ax_octave_interpreter -q --eval "printf(octave_config_info.octincludedir)"`
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
151 AC_MSG_RESULT([$OCTAVE_INCLUDEDIR])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
152 ])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
153
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
154 AS_IF([[test -z "$OCTAVE_LIBRARYDIR" -o -z "$OCTAVE_INCLUDEDIR"]], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
155 ax_octave_ok=no
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
156 ])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
157 ])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
158
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
159 AS_IF([test -z "$ax_octave_ok"], [
96
66bd40c8d36e Make Pytave compile against Octave 3.3+. Fix configuration bugs.
David Grundberg <individ@acc.umu.se>
parents: 83
diff changeset
160 if test -f "$OCTAVE_INCLUDEDIR/oct.h" ; then
167
f31a5f5b5269 maint: remove workarounds and comments on old Octave versions
Mike Miller <mtmiller@octave.org>
parents: 156
diff changeset
161 OCTAVE_INCLUDEDIR=`AS_DIRNAME(["$OCTAVE_INCLUDEDIR"])`
96
66bd40c8d36e Make Pytave compile against Octave 3.3+. Fix configuration bugs.
David Grundberg <individ@acc.umu.se>
parents: 83
diff changeset
162 fi
66bd40c8d36e Make Pytave compile against Octave 3.3+. Fix configuration bugs.
David Grundberg <individ@acc.umu.se>
parents: 83
diff changeset
163
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
164 OCTAVE_LDFLAGS="-L$OCTAVE_LIBRARYDIR"
104
6450086b1934 build: Fix values used for OCTAVE_CPPFLAGS and OCTAVE_LIBS
Mike Miller <mtmiller@octave.org>
parents: 96
diff changeset
165 OCTAVE_LIBS="-loctinterp -loctave"
6450086b1934 build: Fix values used for OCTAVE_CPPFLAGS and OCTAVE_LIBS
Mike Miller <mtmiller@octave.org>
parents: 96
diff changeset
166 OCTAVE_CPPFLAGS="-I$OCTAVE_INCLUDEDIR -I$OCTAVE_INCLUDEDIR/octave"
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
167
96
66bd40c8d36e Make Pytave compile against Octave 3.3+. Fix configuration bugs.
David Grundberg <individ@acc.umu.se>
parents: 83
diff changeset
168 AC_CACHE_CHECK([whether linking to Octave works], [ax_octave_cv_lib_octave],
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
169 [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
170 ax_octave_cv_lib_octave=no
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
171
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
172 AC_LANG_PUSH([C++])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
173
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
174 ax_octave_old_ldflags="$LDFLAGS"
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
175 ax_octave_old_cppflags="$CPPFLAGS"
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
176 ax_octave_old_libs="$LIBS"
96
66bd40c8d36e Make Pytave compile against Octave 3.3+. Fix configuration bugs.
David Grundberg <individ@acc.umu.se>
parents: 83
diff changeset
177
66bd40c8d36e Make Pytave compile against Octave 3.3+. Fix configuration bugs.
David Grundberg <individ@acc.umu.se>
parents: 83
diff changeset
178 LDFLAGS="$OCTAVE_LDFLAGS $ax_octave_old_ldflags"
66bd40c8d36e Make Pytave compile against Octave 3.3+. Fix configuration bugs.
David Grundberg <individ@acc.umu.se>
parents: 83
diff changeset
179 CPPFLAGS="$OCTAVE_CPPFLAGS $ax_octave_old_cppflags"
66bd40c8d36e Make Pytave compile against Octave 3.3+. Fix configuration bugs.
David Grundberg <individ@acc.umu.se>
parents: 83
diff changeset
180 LIBS="$OCTAVE_LIBS $ax_octave_old_libs"
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
181
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
182 AC_LANG_ASSERT(C++)
156
3af7523b395a build: Properly quote AC_LANG_PROGRAM body to silence m4 warnings
Mike Miller <mtmiller@octave.org>
parents: 115
diff changeset
183 AC_LINK_IFELSE([AC_LANG_PROGRAM(
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
184 [[#include <octave/oct.h>
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
185 #include <octave/Matrix.h> ]],
156
3af7523b395a build: Properly quote AC_LANG_PROGRAM body to silence m4 warnings
Mike Miller <mtmiller@octave.org>
parents: 115
diff changeset
186 [[MatrixType()]])],
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
187 [ax_octave_cv_lib_octave=yes],
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
188 [ax_octave_cv_lib_octave=no])
96
66bd40c8d36e Make Pytave compile against Octave 3.3+. Fix configuration bugs.
David Grundberg <individ@acc.umu.se>
parents: 83
diff changeset
189
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
190 LDFLAGS="$ax_octave_old_ldflags"
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
191 CPPFLAGS="$ax_octave_old_cppflags"
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
192 LIBS="$ax_octave_old_libs"
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
193
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
194 AC_LANG_POP([C++])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
195 ])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
196 AS_IF([test "x$ax_octave_cv_lib_octave" != "xyes"], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
197 ax_octave_ok=no
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
198 ])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
199 ])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
200
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
201 AS_IF([test -n "$ax_octave_ok"], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
202 OCTAVE_LDFLAGS=
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
203 OCTAVE_LIBS=
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
204 OCTAVE_CPPFLAGS=
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
205 OCTAVE_INCLUDEDIR=
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
206 OCTAVE_LIBRARYDIR=
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
207
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
208 AC_MSG_WARN([[
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
209 ========================================================================
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
210 Can not link with Octave.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
211
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
212 Make sure the Octave development package is installed.
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
213 ========================================================================]])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
214 ])
187
30a305837ae6 config.h: Define macros to Octave directories (fixes issue #4)
Mike Miller <mtmiller@octave.org>
parents: 186
diff changeset
215 AS_IF([test -z "$ax_octave_ok"], [
30a305837ae6 config.h: Define macros to Octave directories (fixes issue #4)
Mike Miller <mtmiller@octave.org>
parents: 186
diff changeset
216 AC_DEFINE([HAVE_OCTAVE], [1], [Define to 1 if you have Octave.])
30a305837ae6 config.h: Define macros to Octave directories (fixes issue #4)
Mike Miller <mtmiller@octave.org>
parents: 186
diff changeset
217 AC_DEFINE_UNQUOTED([OCTAVE_INCLUDEDIR], ["$OCTAVE_INCLUDEDIR"],
30a305837ae6 config.h: Define macros to Octave directories (fixes issue #4)
Mike Miller <mtmiller@octave.org>
parents: 186
diff changeset
218 [Octave include directory.])
30a305837ae6 config.h: Define macros to Octave directories (fixes issue #4)
Mike Miller <mtmiller@octave.org>
parents: 186
diff changeset
219 AC_DEFINE_UNQUOTED([OCTAVE_LIBRARYDIR], ["$OCTAVE_LIBRARYDIR"],
30a305837ae6 config.h: Define macros to Octave directories (fixes issue #4)
Mike Miller <mtmiller@octave.org>
parents: 186
diff changeset
220 [Octave library directory.])
30a305837ae6 config.h: Define macros to Octave directories (fixes issue #4)
Mike Miller <mtmiller@octave.org>
parents: 186
diff changeset
221 ])
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
222
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
223 AC_SUBST([OCTAVE_LDFLAGS])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
224 AC_SUBST([OCTAVE_CPPFLAGS])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
225 AC_SUBST([OCTAVE_LIBS])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
226 AC_SUBST([OCTAVE_INCLUDEDIR])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
227 AC_SUBST([OCTAVE_LIBRARYDIR])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
228
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
229 # Execute ACTION_IF_FOUND or ACTION_IF_NOT_FOUND
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
230 if test -z "$ax_octave_ok" ; then
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
231 m4_ifvaln([$2],[$2],[:])dnl
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
232 m4_ifvaln([$3],[else $3])dnl
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
233 fi
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
234
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents:
diff changeset
235 ])