changeset 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 c6e93e7dcfba
children 668fcb0f68ef
files Makefile.am m4/ax_octave.m4
diffstat 2 files changed, 19 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Sun Apr 02 15:29:34 2017 -0700
+++ b/Makefile.am	Sun Apr 02 16:24:02 2017 -0700
@@ -153,4 +153,6 @@
 	@echo ""
 
 check-local: $(M_FILES) $(TST_FILES)
-	octave-cli --path="$(abs_builddir)" --path="$(abs_srcdir)" __py_tests__.m $(M_FILES) $(TST_FILES)
+	$(OCTAVE) --no-gui-libs --no-history --no-window-system --norc \
+		  --path="$(abs_builddir)" --path="$(abs_srcdir)" \
+		  __py_tests__.m $(M_FILES) $(TST_FILES)
--- a/m4/ax_octave.m4	Sun Apr 02 15:29:34 2017 -0700
+++ b/m4/ax_octave.m4	Sun Apr 02 16:24:02 2017 -0700
@@ -79,17 +79,27 @@
 	OCTAVE_LIBRARYDIR=
 
 	AC_ARG_VAR([MKOCTFILE], [mkoctfile command])
+	AC_ARG_VAR([OCTAVE], [octave command])
 	AC_ARG_VAR([OCTAVE_CONFIG], [octave-config command])
+	AC_ARG_VAR([OCTAVE_VERSION], [the full version of Octave to use])
+
+	AS_IF([test -n "$OCTAVE_VERSION"],
+	      [ax_octave_suffix="-$OCTAVE_VERSION"],
+	      [ax_octave_suffix=""])
 
 	AC_ARG_WITH([octave],
 		    AS_HELP_STRING([--with-octave],
 				   [specify root directory of Octave installation]))
-	AS_IF([test -z "$MKOCTFILE" && test -f "$with_octave/bin/mkoctfile"],
-	      [MKOCTFILE="$with_octave/bin/mkoctfile"])
-	AS_IF([test -z "$OCTAVE_CONFIG" && test -f "$with_octave/bin/octave-config"],
-	      [OCTAVE_CONFIG="$with_octave/bin/octave-config"])
-
-        AC_CHECK_TOOLS([MKOCTFILE], [mkoctfile])
+	AS_IF([test -n "$with_octave"],
+	      [AS_IF([test -z "$MKOCTFILE" && test -f "$with_octave/bin/mkoctfile$ax_octave_suffix"],
+		     [MKOCTFILE="$with_octave/bin/mkoctfile$ax_octave_suffix"])
+	       AS_IF([test -z "$OCTAVE" && test -f "$with_octave/bin/octave$ax_octave_suffix"],
+		     [OCTAVE="$with_octave/bin/octave$ax_octave_suffix"])
+	       AS_IF([test -z "$OCTAVE_CONFIG" && test -f "$with_octave/bin/octave-config$ax_octave_suffix"],
+		     [OCTAVE_CONFIG="$with_octave/bin/octave-config$ax_octave_suffix"])],
+	      [AC_CHECK_TOOLS([MKOCTFILE], [mkoctfile$ax_octave_suffix])
+               AC_CHECK_TOOLS([OCTAVE], [octave$ax_octave_suffix])
+               AC_CHECK_TOOLS([OCTAVE_CONFIG], [octave-config$ax_octave_suffix])])
 
 	ax_octave_config="[$]$1"
 	ax_octave_ok=