# HG changeset patch # User Mike Miller # Date 1491175442 25200 # Node ID 132fec49e438f257a68f856ae6cfc19e6df71911 # Parent c6e93e7dcfbad65bc1ee3c56232bf05468d56fd2 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. diff -r c6e93e7dcfba -r 132fec49e438 Makefile.am --- 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) diff -r c6e93e7dcfba -r 132fec49e438 m4/ax_octave.m4 --- 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=