diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2019-05-11 18:53:25 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2019-05-24 19:30:47 +0100 |
commit | 6489730892ff376d64deb9c5dff09407a58284ee (patch) | |
tree | a21f0653dca48afb9f4eded0fd89917c57c49391 | |
parent | ae7c04e2048f0da858a6a1f806d37ff427bd980a (diff) | |
download | swig-6489730892ff376d64deb9c5dff09407a58284ee.tar.gz |
Fix Octave detection for non-GNU sed on MacOS
-rw-r--r-- | configure.ac | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index 2c9c338da..543274359 100644 --- a/configure.ac +++ b/configure.ac @@ -1058,23 +1058,33 @@ if test -n "$OCTAVE"; then AS_IF([test "x`${OCTAVE} --version 2>/dev/null | sed -n -e '1p' | sed -n -e '/Octave, version/p'`" != x],[ AC_MSG_RESULT([yes]) ],[ - AC_MSG_NOTICE([no, disabling Octave]) + AC_MSG_NOTICE([no]) OCTAVE= ]) fi # Check for required Octave helper program "mkoctfile" if test -n "$OCTAVE"; then - AC_MSG_CHECKING([for mkoctfile]) - mkoctfile=["`echo $OCTAVE | sed -e 's|[a-z][a-z-]*$|mkoctfile|;t;s|[a-z][a-z-]*\(-[0-9][0-9.+]*\)$|mkoctfile\1|;t'`"] - AC_MSG_RESULT([${mkoctfile}]) - AC_MSG_CHECKING([if ${mkoctfile} works]) - AS_IF([test "x`${mkoctfile} --version 2>/dev/null | sed -n -e '1p' | sed -n -e '/mkoctfile, version/p'`" != x],[ + AC_MSG_CHECKING([for mkoctfile]) + version_suffix=["`echo $OCTAVE | sed -e 's|.*\(-[0-9][0-9.]*\)$|\1|'`"] + case $version_suffix in + -*) ;; + *) version_suffix="" ;; + esac + octave_directory=`dirname $OCTAVE` + if test "$octave_directory" = "." ; then + mkoctfile="mkoctfile${version_suffix}" + else + mkoctfile="${octave_directory}/mkoctfile${version_suffix}" + fi + AC_MSG_RESULT([${mkoctfile}]) + AC_MSG_CHECKING([if ${mkoctfile} works]) + AS_IF([test "x`${mkoctfile} --version 2>/dev/null | sed -n -e '1p' | sed -n -e '/mkoctfile, version/p'`" != x],[ AC_MSG_RESULT([yes]) - ],[ - AC_MSG_NOTICE([no, disabling Octave]) + ],[ + AC_MSG_RESULT([no]) OCTAVE= - ]) + ]) fi # Check for Octave preprocessor/compiler/linker flags |