Skip to content
Snippets Groups Projects

GNU/Octave utils

Merged Reinhard Resch requested to merge octave-utils into develop
5 files
+ 295
184
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 48
4
@@ -205,6 +205,7 @@ OL_ARG_ENABLE(mbc,[ --enable-mbc enable MBC - multibody communicatio
OL_ARG_ENABLE(netcdf,[ --enable-netcdf enable NetCDF based binary output],auto,[auto yes no legacy netcdf4])dnl
OL_ARG_ENABLE(python,[ --enable-python enable Python support],no)dnl
OL_ARG_ENABLE(octave,[ --enable-octave enable Octave support],no)dnl
OL_ARG_ENABLE(octave_utils,[ --enable-octave-utils enable Octave utility functions],no)dnl
AC_ARG_WITH(mkoctfile,[ --with-mkoctfile=exec-path Octave build tool mkoctfile],[
ol_with_mkoctfile_exec="$withval"
],[ol_with_mkoctfile_exec=mkoctfile])
@@ -798,7 +799,8 @@ dnl
dnl Enable Octave support <http://www.octave.org/>
dnl
use_octave=no
if test "$ol_enable_octave" != no ; then
use_octave_utils=no
if test "$ol_enable_octave" != no || test "$ol_enable_octave_utils" != no ; then
have_mkoctfile=no
AC_MSG_CHECKING(for mkoctfile)
$ol_with_mkoctfile_exec --help > /dev/null 2>&1
@@ -808,9 +810,9 @@ if test "$ol_enable_octave" != no ; then
have_mkoctfile=yes
OCTAVE_MKOCTFILE=$ol_with_mkoctfile_exec
dnl On Windows systems the output from mkoctfile contains backslashes which cause build failures!
try_OCTAVE_LIBS="`$ol_with_mkoctfile_exec -p OCTAVE_LIBS` `$ol_with_mkoctfile_exec -p LDFLAGS | sed 's/\\\\/\//g'` -L`$ol_with_mkoctfile_exec -p OCTLIBDIR | sed 's/\\\\/\//g'`"
try_OCTAVE_INCLUDE="`$ol_with_mkoctfile_exec -p INCFLAGS | sed 's/\\\\/\//g'`"
export LD_LIBRARY_PATH="`$ol_with_mkoctfile_exec -p OCTLIBDIR | sed 's/\\\\/\//g'`:${LD_LIBRARY_PATH}"
try_OCTAVE_LIBS="`$ol_with_mkoctfile_exec -p OCTAVE_LIBS` `$ol_with_mkoctfile_exec -p LDFLAGS | sed 's/-IC\:/-I\/c/g;s/-LC\:/-L\/c/g;s/\\\\/\//g'` -L`$ol_with_mkoctfile_exec -p OCTLIBDIR | sed 's/-IC\:/-I\/c/g;s/-LC\:/-L\/c/g;s/\\\\/\//g'`"
try_OCTAVE_INCLUDE="`$ol_with_mkoctfile_exec -p INCFLAGS | sed 's/-IC\:/-I\/c/g;s/-LC\:/-L\/c/g;s/\\\\/\//g'`"
export LD_LIBRARY_PATH="`$ol_with_mkoctfile_exec -p OCTLIBDIR`:${LD_LIBRARY_PATH}"
else
AC_MSG_RESULT([no])
try_OCTAVE_LIBS="-loctinterp -loctave -lcruft"
@@ -825,6 +827,9 @@ if test "$ol_enable_octave" != no ; then
#include <octave/oct.h>
])
AC_CHECK_HEADER(octave/toplev.h,[have_octave_toplev_h=yes],[have_octave_toplev_h=no],[
#include <octave/oct.h>
])
AC_CHECK_HEADER(octave/interpreter.h,[have_octave_interpreter_h=yes],[have_octave_interpreter_h=no],[
#include <octave/oct.h>
])
AC_CHECK_HEADER(octave/octave.h,[have_octave_octave_h=yes],[have_octave_octave_h=no],[
@@ -834,6 +839,9 @@ if test "$ol_enable_octave" != no ; then
AC_LANG_C
link_octave="no"
have_clean_up_and_exit="no"
have_do_octave_atexit="no"
if test "$have_octave_oct_h" = "yes" \
-a "$have_octave_parse_h" = "yes" \
-a "$have_octave_toplev_h" = "yes" \
@@ -879,6 +887,35 @@ if test "$ol_enable_octave" != no ; then
OCTAVE_LIBS="$try_LIBS"
fi
if test "$have_octave_oct_h" = "yes" \
-a "$have_octave_parse_h" = "yes" \
-a "$have_octave_interpreter_h" = "yes" \
-a "$have_octave_octave_h" = "yes" \
-a "$have_mkoctfile" = "yes" ; \
then
OCTAVE_INCLUDE="$try_OCTAVE_INCLUDE"
save_CPPFLAGS="$CPPFLAGS"
save_LIBS="$LIBS"
try_LIBS="$try_OCTAVE_LIBS"
LIBS="$try_LIBS $LIBS"
CPPFLAGS="$CPPFLAGS $OCTAVE_INCLUDE"
AC_LANG_CPLUSPLUS
AC_TRY_LINK([
#include <octave/oct.h>
#include <octave/parse.h>
#include <octave/interpreter.h>
#include <octave/octave.h>
],[
octave::interpreter interpreter;
int status = interpreter.execute();
octave_value_list out = octave::feval ("cos", octave_value(0.), 1);
],[link_octave="yes"])
AC_LANG_C
LIBS="$save_LIBS"
CPPFLAGS="$save_CPPFLAGS"
OCTAVE_LIBS="$try_LIBS"
fi
if test "$link_octave" = yes ; then
if test "$have_do_octave_atexit" = yes; then
AC_DEFINE(HAVE_DO_OCTAVE_ATEXIT, 1, [define if do_octave_atexit can be used])
@@ -893,6 +930,12 @@ if test "$ol_enable_octave" != no ; then
AC_MSG_ERROR([octave support not available])
fi
fi
if test "$have_octave_oct_h" = "yes" -a "$have_mkoctfile" = "yes"; then
use_octave_utils="yes"
else
AC_MSG_ERROR([octave utils support not available])
fi
fi
if test "$ol_enable_autodiff" != no || test "$ol_enable_sparse_autodiff" != no; then
@@ -3711,6 +3754,7 @@ AM_CONDITIONAL(USE_METIS,[test "$ol_link_metis" = yes])
AM_CONDITIONAL(NEW_METIS_INTERFACE,[test "$new_metis_interface" = yes])
AM_CONDITIONAL(USE_NETCDF4,[test "$have_libnetcdf4" = yes])
AM_CONDITIONAL(USE_OCTAVE,[test "$use_octave" = yes])
AM_CONDITIONAL(USE_OCTAVE_UTILS,[test "$use_octave_utils" = yes])
AM_CONDITIONAL(USE_PYTHON,[test "$use_python" = yes])
AM_CONDITIONAL(USE_RTAI,[test "$use_rtai" = yes])
AM_CONDITIONAL(USE_SCHUR,[test "$use_schur" = yes])
Loading