configure.ac: fix calls to mkoctfile for Octave configuration

- As of Octave 5.1.0, mkoctfile no longer works with 'env -'
  (no environment), so need to pass at least PATH and
  LD_LIBRARY_PATH for it to work.
- Still need to clear environment so that it doesn't override
  mkoctfile defined variables, e.g. CXXFLAGS.
This commit is contained in:
Karl Wette 2020-04-30 23:40:12 +10:00
commit e0d85fc939

View file

@ -1079,6 +1079,7 @@ if test -n "$OCTAVE"; then
fi
AC_MSG_RESULT([${mkoctfile}])
AC_MSG_CHECKING([if ${mkoctfile} works])
mkoctfile="env - PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH ${mkoctfile}"
AS_IF([test "x`${mkoctfile} --version 2>/dev/null | sed -n -e '1p' | sed -n -e '/mkoctfile, version/p'`" != x],[
AC_MSG_RESULT([yes])
],[
@ -1093,7 +1094,7 @@ if test -n "$OCTAVE"; then
AC_MSG_CHECKING([for Octave preprocessor flags])
OCTAVE_CPPFLAGS=
for var in CPPFLAGS INCFLAGS ALL_CXXFLAGS; do
for flag in `env - ${mkoctfile} -p ${var}`; do
for flag in `${mkoctfile} -p ${var}`; do
case ${flag} in
-D*|-I*) OCTAVE_CPPFLAGS="${OCTAVE_CPPFLAGS} ${flag}";;
*) ;;
@ -1105,7 +1106,7 @@ if test -n "$OCTAVE"; then
AC_MSG_CHECKING([for Octave compiler flags])
OCTAVE_CXXFLAGS=
for var in CXX ALL_CXXFLAGS; do
for flag in `env - ${mkoctfile} -p ${var}`; do
for flag in `${mkoctfile} -p ${var}`; do
case ${flag} in
-std=*|-g*|-W*) OCTAVE_CXXFLAGS="${OCTAVE_CXXFLAGS} ${flag}";;
*) ;;
@ -1125,10 +1126,10 @@ if test -n "$OCTAVE"; then
AC_MSG_CHECKING([for Octave linker flags])
OCTAVE_LDFLAGS=
for var in OCTLIBDIR; do
OCTAVE_LDFLAGS="${OCTAVE_LDFLAGS} "-L`env - ${mkoctfile} -p ${var}`
OCTAVE_LDFLAGS="${OCTAVE_LDFLAGS} "-L`${mkoctfile} -p ${var}`
done
for var in RDYNAMIC_FLAG RLD_FLAG OCTAVE_LIBS LIBS; do
OCTAVE_LDFLAGS="${OCTAVE_LDFLAGS} "`env - ${mkoctfile} -p ${var}`
OCTAVE_LDFLAGS="${OCTAVE_LDFLAGS} "`${mkoctfile} -p ${var}`
done
AC_MSG_RESULT([$OCTAVE_LDFLAGS])