From ff25d2c536d870e726dcf51711bf63ca6808ccd4 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Fri, 9 Aug 2013 14:46:39 +0200 Subject: [PATCH 01/15] Revert "Scilab: add Scilab in makefile check version targets" This reverts commit 66edc244b94d7bf76d658c3477c43d9ed5d4829c. --- Examples/Makefile.in | 8 -------- Makefile.in | 3 +-- configure.ac | 7 +++---- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/Examples/Makefile.in b/Examples/Makefile.in index 0fa90c2cb..55c50ae87 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -1577,7 +1577,6 @@ SCILAB_LIB = @SCILABLIB@ SCILAB = @SCILAB@ SCILABOPT = SCILAB_START_OPT = @SCILABSTARTOPT@ -SCILAB_VERSION = @SCILABVERSION@ # ---------------------------------------------------------------- # Build a C dynamically loadable module @@ -1637,13 +1636,6 @@ scilab_run: scilab_debug: @env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH SCILABPATH=$(srcdir):$$SCILABPATH $(SCILAB) -noatomsautoload -nb -debug -f runme.sci -# ----------------------------------------------------------------- -# Version display -# ----------------------------------------------------------------- - -scilab_version: - echo $(SCILAB_VERSION) - # ----------------------------------------------------------------- # Cleaning the scilab examples # ----------------------------------------------------------------- diff --git a/Makefile.in b/Makefile.in index ed707d0f8..dd84f971d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -149,7 +149,6 @@ check-versions: \ check-uffi-version \ check-cffi-version \ check-r-version \ - check-scilab-version \ check-go-version \ check-d-version @@ -471,7 +470,7 @@ lib-languages = gcj typemaps tcl perl5 python guile java mzscheme ruby php ocaml lib-modules = std -install-lib: +install-lib: @echo "Installing the SWIG library" @$(MKINSTDIRS) $(DESTDIR)$(SWIG_LIB) @for file in $(srcdir)/Lib/*.i $(srcdir)/Lib/*.swg ; do \ diff --git a/configure.ac b/configure.ac index 25df0c37f..62ce75feb 100644 --- a/configure.ac +++ b/configure.ac @@ -1036,9 +1036,9 @@ fi # Get Scilab version AC_MSG_CHECKING(for Scilab version) -SCILABVERSION=`$SCILAB -version|sed -e 's|Scilab version \"\(.*\)\"|\1|g'|head -1` -AC_MSG_RESULT($SCILABVERSION) -SCILAB_MAJOR_VERSION=`echo $SCILABVERSION | cut -d. -f1` +SCILAB_VERSION=`$SCILAB -version|sed -e 's|Scilab version \"\(.*\)\"|\1|g'|head -1` +AC_MSG_RESULT($SCILAB_VERSION) +SCILAB_MAJOR_VERSION=`echo $SCILAB_VERSION | cut -d. -f1` SCILAB_MINOR_VERSION=`echo $SCILAB_VERSION | cut -d. -f2` # Set Scilab startup options depending on version @@ -1059,7 +1059,6 @@ AC_SUBST(SCILABDYNAMICLINKING) AC_SUBST(SCILABLIB) AC_SUBST(SCILABCCFLAGS) AC_SUBST(SCILABSTARTOPT) -AC_SUBST(SCILABVERSION) #---------------------------------------------------------------- # Look for java From 498ca722e53c56082687db1eee673948d838608b Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Fri, 9 Aug 2013 14:54:36 +0200 Subject: [PATCH 02/15] Revert "Scilab: fix debug infos in config.log" This reverts commit 2f910faebbc7b1239397970054f80e3ce44fd3e5. --- configure.ac | 58 ++++++++++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/configure.ac b/configure.ac index 62ce75feb..2527c16b2 100644 --- a/configure.ac +++ b/configure.ac @@ -995,61 +995,57 @@ AC_ARG_WITH(scilabincl,[ --with-scilabincl=path Set location of Scilab include if test x"${SCILABBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Scilab]) SCILAB= - else +# First figure out what the name of Scilab is -# Check Scilab executable -AC_MSG_CHECKING(for Scilab executable) if test "x$SCILABBIN" = xyes; then AC_CHECK_PROGS(SCILAB, scilab) else SCILAB="$SCILABBIN" fi -if test -n "$SCILAB"; then - AC_MSG_RESULT([$SCILAB found]) -else - AC_MSG_RESULT([$SCILAB not found]) -fi -# Check Scilab header files AC_MSG_CHECKING(for Scilab header files) -if test "$SCILABINCDIR" != ""; then - dirs="$SCILABINCDIR" - SCILABEXT="" - for i in $dirs; do - if test -r $i/scilab/api_scilab.h; then - SCILABEXT="$i" - break; +if test -n "$SCILAB"; then + if test "$SCILABINCDIR" != ""; then + dirs="$SCILABINCDIR" + SCILABEXT="" + for i in $dirs; do + if test -r $i/scilab/api_scilab.h; then + SCILABEXT="$i" + break; + fi + if test -r $i/scilab/scilab/api_scilab.h; then + SCILABEXT="$i/scilab" + break; + fi + done + if test "$SCILABEXT" = "" ; then + AC_MSG_RESULT(not found) + else + AC_MSG_RESULT($SCILABEXT) fi - if test -r $i/scilab/scilab/api_scilab.h; then - SCILABEXT="$i/scilab" - break; - fi - done - if test "$SCILABEXT" = "" ; then - AC_MSG_RESULT(not found) - else - AC_MSG_RESULT($SCILABEXT) + + AC_MSG_CHECKING(for Scilab compiler options) + SCILABCCFLAGS="" + AC_MSG_RESULT($SCILABCCFLAGS) fi +else + AC_MSG_RESULT(could not figure out how to run scilab) fi -# Get Scilab version -AC_MSG_CHECKING(for Scilab version) +# Set Scilab startup options depending on version SCILAB_VERSION=`$SCILAB -version|sed -e 's|Scilab version \"\(.*\)\"|\1|g'|head -1` -AC_MSG_RESULT($SCILAB_VERSION) +AC_MSG_RESULT(Found Scilab version $SCILAB_VERSION) SCILAB_MAJOR_VERSION=`echo $SCILAB_VERSION | cut -d. -f1` SCILAB_MINOR_VERSION=`echo $SCILAB_VERSION | cut -d. -f2` -# Set Scilab startup options depending on version -AC_MSG_CHECKING(for Scilab startup options) SCILABSTARTOPT="-nwni -nb" if test "$SCILAB_MAJOR_VERSION" -ge 5 ; then if test "$SCILAB_MINOR_VERSION" -ge 4 ; then SCILABSTARTOPT+=" -noatomsautoload" fi fi -AC_MSG_RESULT($SCILABSTARTOPT) fi From f7c11a88826424c1b6fc39a0746271f79ced9e03 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Fri, 9 Aug 2013 14:55:29 +0200 Subject: [PATCH 03/15] Revert "Scilab: support of Scilab 5.3.3" This reverts commit d6eb7323b6879f76a177733a561e4691e67688ac. --- Examples/Makefile.in | 5 +-- configure.ac | 103 +++++++++++++++++++------------------------ 2 files changed, 47 insertions(+), 61 deletions(-) diff --git a/Examples/Makefile.in b/Examples/Makefile.in index 55c50ae87..b6deb1ae8 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -1576,7 +1576,6 @@ SCILAB_INCLUDE = $(DEFS) @SCILABINCLUDE@ SCILAB_LIB = @SCILABLIB@ SCILAB = @SCILAB@ SCILABOPT = -SCILAB_START_OPT = @SCILABSTARTOPT@ # ---------------------------------------------------------------- # Build a C dynamically loadable module @@ -1597,7 +1596,7 @@ scilab: $(SRCS) fi \ fi @if [ -f builder.sce ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH SCILABPATH=$(srcdir):$$SCILABPATH echo 'exit(1)' |$(SCILAB) $(SCILAB_START_OPT) -f builder.sce; \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH SCILABPATH=$(srcdir):$$SCILABPATH echo 'exit(1)' |$(SCILAB) -nwni -noatomsautoload -nb -f builder.sce; \ fi # ---------------------------------------------------------------- @@ -1619,7 +1618,7 @@ scilab_cpp: $(SRCS) fi \ fi @if [ -f builder.sce ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH SCILABPATH=$(srcdir):$$SCILABPATH echo 'exit(1)' |$(SCILAB) $(SCILAB_START_OPT) -f builder.sce; \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH SCILABPATH=$(srcdir):$$SCILABPATH echo 'exit(1)' |$(SCILAB) -nwni -noatomsautoload -nb -f builder.sce; \ fi # ----------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 2527c16b2..201244734 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,7 @@ AC_LANG_POP([C++]) dnl Look for popen AC_ARG_WITH(popen, AS_HELP_STRING([--without-popen], [Disable popen]), with_popen="$withval") -if test x"${with_popen}" = xno ; then +if test x"${with_popen}" = xno ; then AC_MSG_NOTICE([Disabling popen]) else AC_CHECK_FUNC(popen, AC_DEFINE(HAVE_POPEN, 1, [Define if popen is available]), AC_MSG_NOTICE([Disabling popen])) @@ -69,7 +69,7 @@ AC_MSG_CHECKING([whether to enable PCRE support]) AC_MSG_RESULT([$with_pcre]) dnl To make configuring easier, check for a locally built PCRE using the Tools/pcre-build.sh script -if test x"${with_pcre}" = xyes ; then +if test x"${with_pcre}" = xyes ; then AC_MSG_CHECKING([whether to use local PCRE]) local_pcre_config=no if test -z $PCRE_CONFIG; then @@ -513,7 +513,7 @@ AC_ARG_WITH(tcllib,[ --with-tcllib=path Set location of Tcl library direct TCLLIB="-L$withval"], [TCLLIB=]) # First, check for "--without-tcl" or "--with-tcl=no". -if test x"${TCLPACKAGE}" = xno -o x"${with_alllang}" = xno; then +if test x"${TCLPACKAGE}" = xno -o x"${with_alllang}" = xno; then AC_MSG_NOTICE([Disabling Tcl]) else AC_MSG_CHECKING([for Tcl configuration]) @@ -606,7 +606,7 @@ case $host in esac case $host in -*-*-darwin*) +*-*-darwin*) TCLLDSHARED='$(CC) -dynamiclib -undefined suppress -flat_namespace' TCLCXXSHARED='$(CXX) -dynamiclib -undefined suppress -flat_namespace' ;; @@ -636,7 +636,7 @@ AC_ARG_WITH(python, AS_HELP_STRING([--without-python], [Disable Python]) AS_HELP_STRING([--with-python=path], [Set location of Python executable]),[ PYBIN="$withval"], [PYBIN=yes]) # First, check for "--without-python" or "--with-python=no". -if test x"${PYBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${PYBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Python]) else # First figure out the name of the Python executable @@ -671,10 +671,10 @@ else PYLIBDIR=`($PYTHON -c "import sys; print sys.lib") 2>/dev/null` if test -z "$PYLIBDIR"; then # Fedora patch Python to add sys.lib, for other distros we assume "lib". - PYLIBDIR="lib" + PYLIBDIR="lib" fi AC_MSG_RESULT($PYLIBDIR) - + # Set the include directory AC_MSG_CHECKING(for Python header files) @@ -737,7 +737,7 @@ AC_ARG_WITH(python3, AS_HELP_STRING([--without-python3], [Disable Python 3.x sup AS_HELP_STRING([--with-python3=path], [Set location of Python 3.x executable]),[ PY3BIN="$withval"], [PY3BIN=yes]) # First, check for "--without-python3" or "--with-python3=no". -if test x"${PY3BIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${PY3BIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Python 3.x support]) else for py_ver in 3 3.6 3.5 3.4 3.3 3.2 3.1 3.0; do @@ -760,7 +760,7 @@ else # Note: I could not think of a standard way to get the version string from different versions. # This trick pulls it out of the file location for a standard library file. - + AC_MSG_CHECKING([for Python 3.x version]) # Need to do this hack since autoconf replaces __file__ with the name of the configure file @@ -774,10 +774,10 @@ else PY3LIBDIR=`($PYTHON3 -c "import sys; print(sys.lib)") 2>/dev/null` if test -z "$PY3LIBDIR"; then # some dists don't have sys.lib so the best we can do is assume lib - PY3LIBDIR="lib" + PY3LIBDIR="lib" fi AC_MSG_RESULT($PY3LIBDIR) - + # Set the include directory AC_MSG_CHECKING([for Python 3.x header files]) @@ -828,7 +828,7 @@ AC_ARG_WITH(perl5, AS_HELP_STRING([--without-perl5], [Disable Perl5]) AS_HELP_STRING([--with-perl5=path], [Set location of Perl5 executable]),[ PERLBIN="$withval"], [PERLBIN=yes]) # First, check for "--without-perl5" or "--with-perl5=no". -if test x"${PERLBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${PERLBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Perl5]) PERL= else @@ -932,7 +932,7 @@ AC_ARG_WITH(octave, AS_HELP_STRING([--without-octave], [Disable Octave]) AS_HELP_STRING([--with-octave=path], [Set location of Octave executable]),[OCTAVEBIN="$withval"], [OCTAVEBIN=yes]) # First, check for "--without-octave" or "--with-octave=no". -if test x"${OCTAVEBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${OCTAVEBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Octave]) OCTAVE= @@ -992,10 +992,11 @@ AS_HELP_STRING([--with-scilab=path], [Set location of Scilab executable]),[SCILA AC_ARG_WITH(scilabincl,[ --with-scilabincl=path Set location of Scilab include directory],[SCILABINCDIR="$withval"], [SCILABINCDIR="/usr/include"]) # First, check for "--without-scilab" or "--with-scilab=no". -if test x"${SCILABBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${SCILABBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Scilab]) SCILAB= else + # First figure out what the name of Scilab is if test "x$SCILABBIN" = xyes; then @@ -1031,20 +1032,7 @@ if test -n "$SCILAB"; then AC_MSG_RESULT($SCILABCCFLAGS) fi else - AC_MSG_RESULT(could not figure out how to run scilab) -fi - -# Set Scilab startup options depending on version -SCILAB_VERSION=`$SCILAB -version|sed -e 's|Scilab version \"\(.*\)\"|\1|g'|head -1` -AC_MSG_RESULT(Found Scilab version $SCILAB_VERSION) -SCILAB_MAJOR_VERSION=`echo $SCILAB_VERSION | cut -d. -f1` -SCILAB_MINOR_VERSION=`echo $SCILAB_VERSION | cut -d. -f2` - -SCILABSTARTOPT="-nwni -nb" -if test "$SCILAB_MAJOR_VERSION" -ge 5 ; then - if test "$SCILAB_MINOR_VERSION" -ge 4 ; then - SCILABSTARTOPT+=" -noatomsautoload" - fi + AC_MSG_RESULT(could not figure out how to run scilab) fi fi @@ -1054,7 +1042,6 @@ AC_SUBST(SCILABEEXT) AC_SUBST(SCILABDYNAMICLINKING) AC_SUBST(SCILABLIB) AC_SUBST(SCILABCCFLAGS) -AC_SUBST(SCILABSTARTOPT) #---------------------------------------------------------------- # Look for java @@ -1065,7 +1052,7 @@ AS_HELP_STRING([--with-java=path], [Set location of java executable]),[JAVABIN=" AC_ARG_WITH(javac, [ --with-javac=path Set location of javac executable],[JAVACBIN="$withval"], [JAVACBIN=]) # First, check for "--without-java" or "--with-java=no". -if test x"${JAVABIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${JAVABIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Java]) JAVA= else @@ -1131,7 +1118,7 @@ case $host in JAVADYNAMICLINKING="" JAVACFLAGS="" fi ;; -*-*-darwin*) +*-*-darwin*) JAVADYNAMICLINKING="-dynamiclib -framework JavaVM" JAVACFLAGS="" ;; @@ -1149,7 +1136,7 @@ esac # Java on Mac OS X tweaks case $host in -*-*-darwin*) +*-*-darwin*) JAVASO=".jnilib" JAVALDSHARED='$(CC)' JAVACXXSHARED='$(CXX)' @@ -1181,7 +1168,7 @@ AS_HELP_STRING([--with-gcj=path], [Set location of gcj executable]),[GCJBIN="$wi AC_ARG_WITH(gcjh, [ --with-gcjh=path Set location of gcjh executable],[GCJHBIN="$withval"], [GCJHBIN=]) # First, check for "--without-gcj" or "--with-gcj=no". -if test x"${GCJBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${GCJBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling GCJ]) else if test "x$GCJBIN" = xyes; then @@ -1211,7 +1198,7 @@ AC_ARG_WITH(ant, [ --with-ant=path Set location of ant executable for And AC_ARG_WITH(ndk-build, [ --with-ndk-build=path Set location of Android ndk-build executable],[NDKBUILDBIN="$withval"], [NDKBUILDBIN=]) # First, check for "--without-android" or "--with-android=no". -if test x"${ANDROIDBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${ANDROIDBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Android]) ANDROID= else @@ -1263,7 +1250,7 @@ AC_ARG_WITH(guile-libs,[ --with-guile-libs=ldflags Set ldflags needed to lin GUILE_LIBS="$withval"]) # First, check for "--without-guile" or "--with-guile=no". -if test x"${GUILE}" = xno -o x"${with_alllang}" = xno ; then +if test x"${GUILE}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Guile]) else if test -z "$GUILE_CONFIG" ; then @@ -1320,7 +1307,7 @@ AS_HELP_STRING([--with-mzscheme=path], [Set location of MzScheme executable]),[ AC_ARG_WITH(mzc, AS_HELP_STRING([--with-mzc=path], [Set location of MzScheme's mzc]), [ MZCBIN="$withval"], [MZCBIN=]) # First, check for "--without-mzscheme" or "--with-mzscheme=no". -if test x"${MZSCHEMEBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${MZSCHEMEBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling MzScheme]) MZC= else @@ -1329,13 +1316,13 @@ else else MZSCHEME="$MZSCHEMEBIN" fi - + if test -z "$MZCBIN"; then AC_PATH_PROG(MZC, mzc) fi if test -n "$MZSCHEME"; then - AC_MSG_CHECKING(for MzScheme dynext object) + AC_MSG_CHECKING(for MzScheme dynext object) MZDYNOBJ=`$MZSCHEME --eval '(begin (require dynext/link) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (printf "~a" x)) (expand-for-link-variant (current-standard-link-libraries)))))' 2>/dev/null` if test -f "$MZDYNOBJ"; then : @@ -1363,7 +1350,7 @@ AC_ARG_WITH(ruby, AS_HELP_STRING([--without-ruby], [Disable Ruby]) AS_HELP_STRING([--with-ruby=path], [Set location of Ruby executable]),[ RUBYBIN="$withval"], [RUBYBIN=yes]) # First, check for "--without-ruby" or "--with-ruby=no". -if test x"${RUBYBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${RUBYBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Ruby]) RUBY= else @@ -1422,10 +1409,10 @@ if test -n "$RUBY"; then else # 1.6.x link = "-l" + c[["RUBY_INSTALL_NAME"]] end - + # Get the target Ruby was built for target = c[["target"]] - + if target == "i386-pc-mswin32" # Need to change msvcrt-ruby*.lib to -lmsvcrt-ruby* ext = File.extname(link) @@ -1493,7 +1480,7 @@ AC_ARG_WITH(php, AS_HELP_STRING([--without-php], [Disable PHP]) AS_HELP_STRING([--with-php=path], [Set location of PHP executable]),[ PHPBIN="$withval"], [PHPBIN=yes]) # First, check for "--without-php" or "--with-php=no". -if test x"${PHPBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${PHPBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling PHP]) PHP= else @@ -1514,7 +1501,7 @@ else esac php_version=`$PHPCONFIG --version 2>/dev/null` case $php_version in - 5*) + 5*) PHPINC=`$PHPCONFIG --includes 2>/dev/null` if test -n "$PHPINC"; then AC_MSG_RESULT($PHPINC) @@ -1541,7 +1528,7 @@ AC_ARG_WITH(ocamlfind,[ --with-ocamlfind=path Set location of ocamlfind],[OCA AC_ARG_WITH(ocamlmktop,[ --with-ocamlmktop=path Set location of ocamlmktop executable],[ OCAMLMKTOP="$withval"], [OCAMLMKTOP=]) # First, check for "--without-ocaml" or "--with-ocaml=no". -if test x"${OCAMLBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${OCAMLBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling OCaml]) OCAMLBIN= else @@ -1627,7 +1614,7 @@ AC_ARG_WITH(pike, AS_HELP_STRING([--without-pike], [Disable Pike]) AS_HELP_STRING([--with-pike=path], [Set location of Pike executable]),[PIKEBIN="$withval"], [PIKEBIN=yes]) # First, check for "--without-pike" or "--with-pike=no". -if test x"${PIKEBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${PIKEBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Pike]) PIKEBIN= else @@ -1641,7 +1628,7 @@ fi # Check for pike-config # Priority: configure option, guessed from $PIKE, search from list -AC_ARG_WITH(pike-config, AS_HELP_STRING([--with-pike-config=path], +AC_ARG_WITH(pike-config, AS_HELP_STRING([--with-pike-config=path], [Set location of pike-config script]), [PIKECONFIG="$withval"], [PIKECONFIG=""]) @@ -1652,7 +1639,7 @@ fi # Check for a --with-pikeincl option to configure # Priority: configure option, info from $PIKECONFIG, guessed by pike script -AC_ARG_WITH(pikeincl, AS_HELP_STRING([--with-pikeincl=path], +AC_ARG_WITH(pikeincl, AS_HELP_STRING([--with-pikeincl=path], [Set location of Pike include directory]), [PIKEINCLUDE="-I$withval"], [PIKEINCLUDE=]) @@ -1697,7 +1684,7 @@ AC_ARG_WITH(chicken, AS_HELP_STRING([--without-chicken], [Disable CHICKEN]) AS_HELP_STRING([--with-chicken=path], [Set location of CHICKEN executable]),[ CHICKENBIN="$withval"], [CHICKENBIN=yes]) # First, check for "--without-chicken" or "--with-chicken=no". -if test x"${CHICKENBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${CHICKENBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling CHICKEN]) else @@ -1793,7 +1780,7 @@ AC_ARG_WITH(cil-interpreter, [ --with-cil-interpreter=path Set location of AC_ARG_WITH(csharp-compiler, [ --with-csharp-compiler=path Set location of CSharp compiler],[CSHARPCOMPILERBIN="$withval"], [CSHARPCOMPILERBIN=]) # First, check for "--without-csharp" or "--with-csharp=no". -if test x"${with_csharp}" = xno -o x"${with_alllang}" = xno ; then +if test x"${with_csharp}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling CSharp]) CSHARPCOMPILER= else @@ -1846,7 +1833,7 @@ if test -z "$CSHARPBIN" ; then if test "mcs" = "$CSHARPCOMPILER" || test "gmcs" = "$CSHARPCOMPILER"; then AC_CHECK_PROGS(CSHARPCILINTERPRETER, mono) # Mono JIT CSHARPCILINTERPRETER_FLAGS="--debug" - else + else if test "csc" = "$CSHARPCOMPILER"; then CSHARPPATHSEPARATOR="\\\\" CSHARPCYGPATH_W='cygpath -w' @@ -1921,7 +1908,7 @@ AC_ARG_WITH(lualib,[ --with-lualib=path Set location of Lua library direct LUALIB="$withval"], [LUALIB=]) # First, check for "--without-lua" or "--with-lua=no". -if test x"${LUABIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${LUABIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Lua]) else @@ -1962,8 +1949,8 @@ if test "$LUABIN"; then else LUADYNAMICLOADLIB=`$LUABIN -e '_,_,c=package.loadlib("no_such_lib","") if c~="absent" then print "1" end'` fi - - if test -z "$LUADYNAMICLOADLIB"; then + + if test -z "$LUADYNAMICLOADLIB"; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) @@ -2003,7 +1990,7 @@ fi # look for the library files & set LUALINK accordingly # will clear LUABIN if not present lua_save_LIBS=$LIBS # the code seems to disrupt LIBS, so saving - + if test -n "$LUALIB"; then AC_CHECK_FILE($LUALIB/liblua.a,[LUALINK="-L$LUALIB -llua"],[LUABIN=]) else @@ -2034,7 +2021,7 @@ AC_ARG_WITH(allegrocl, AS_HELP_STRING([--without-allegrocl], [Disable Allegro CL AS_HELP_STRING([--with-allegrocl=path], [Set location of Allegro CL executable (alisp)]),[ ALLEGROCLBIN="$withval"], [ALLEGROCLBIN=yes]) # First, check for "--without-allegrocl" or "--with-allegrocl=no". -if test x"${ALLEGROCLBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${ALLEGROCLBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Allegro CL]) ALLEGROCLBIN= else @@ -2057,7 +2044,7 @@ AC_ARG_WITH(clisp, AS_HELP_STRING([--without-clisp], [Disable CLISP]) AS_HELP_STRING([--with-clisp=path], [Set location of CLISP executable (clisp)]),[ CLISPBIN="$withval"], [CLISPBIN=yes]) # First, check for "--without-clisp" or "--with-clisp=no". -if test x"${CLISPBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${CLISPBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling CLISP]) CLISPBIN= else @@ -2080,7 +2067,7 @@ AC_ARG_WITH(r, AS_HELP_STRING([--without-r], [Disable R]) AS_HELP_STRING([--with-r=path], [Set location of R executable (r)]),[ RBIN="$withval"], [RBIN=yes]) # First, check for "--without-r" or "--with-r=no". -if test x"${RBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${RBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling R]) RBIN= else @@ -2100,7 +2087,7 @@ AC_SUBST(RBIN) AC_ARG_WITH(go, AS_HELP_STRING([--without-go], [Disable Go]) AS_HELP_STRING([--with-go=path], [Set location of Go compiler]),[GOBIN="$withval"], [GOBIN=yes]) -if test x"${GOBIN}" = xno -o x"${with_alllang}" = xno ; then +if test x"${GOBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Go]) GO= GOC= From 3a190fec2ba75ff213aeff7bc17c7d9f8eb6e966 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Mon, 19 Aug 2013 17:40:31 +0200 Subject: [PATCH 04/15] Scilab: check Scilab version & support of Scilab 5.3.3 (program arguments) --- Examples/Makefile.in | 17 +++++++-- Makefile.in | 1 + configure.ac | 91 +++++++++++++++++++++++++++++--------------- 3 files changed, 75 insertions(+), 34 deletions(-) diff --git a/Examples/Makefile.in b/Examples/Makefile.in index b6deb1ae8..48483572b 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -1576,6 +1576,7 @@ SCILAB_INCLUDE = $(DEFS) @SCILABINCLUDE@ SCILAB_LIB = @SCILABLIB@ SCILAB = @SCILAB@ SCILABOPT = +SCILAB_STARTOPT = @SCILABSTARTOPT@ # ---------------------------------------------------------------- # Build a C dynamically loadable module @@ -1596,7 +1597,7 @@ scilab: $(SRCS) fi \ fi @if [ -f builder.sce ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH SCILABPATH=$(srcdir):$$SCILABPATH echo 'exit(1)' |$(SCILAB) -nwni -noatomsautoload -nb -f builder.sce; \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH SCILABPATH=$(srcdir):$$SCILABPATH echo 'exit(1)' |$(SCILAB) $(SCILAB_STARTOPT) -f builder.sce; \ fi # ---------------------------------------------------------------- @@ -1618,7 +1619,7 @@ scilab_cpp: $(SRCS) fi \ fi @if [ -f builder.sce ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH SCILABPATH=$(srcdir):$$SCILABPATH echo 'exit(1)' |$(SCILAB) -nwni -noatomsautoload -nb -f builder.sce; \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH SCILABPATH=$(srcdir):$$SCILABPATH echo 'exit(1)' |$(SCILAB) $(SCILAB_STARTOPT) -f builder.sce; \ fi # ----------------------------------------------------------------- @@ -1626,14 +1627,22 @@ scilab_cpp: $(SRCS) # ----------------------------------------------------------------- scilab_run: - @env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH SCILABPATH=$(srcdir):$$SCILABPATH $(SCILAB) -nwni -noatomsautoload -nb -f runme.sci + @env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH SCILABPATH=$(srcdir):$$SCILABPATH $(SCILAB) $(SCILAB_STARTOPT) -f runme.sci + # ----------------------------------------------------------------- # Debugging a scilab example # ----------------------------------------------------------------- scilab_debug: - @env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH SCILABPATH=$(srcdir):$$SCILABPATH $(SCILAB) -noatomsautoload -nb -debug -f runme.sci + @env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH SCILABPATH=$(srcdir):$$SCILABPATH $(SCILAB) $(SCILAB_STARTOPT) -f runme.sci + +# ----------------------------------------------------------------- +# Scilab version +# ----------------------------------------------------------------- + +scilab_version: + echo `$(SCILAB) -version|head -1|sed -e 's|Scilab version \"\(.*\)\"|\1|g'` # ----------------------------------------------------------------- # Cleaning the scilab examples diff --git a/Makefile.in b/Makefile.in index dd84f971d..6614078f6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -149,6 +149,7 @@ check-versions: \ check-uffi-version \ check-cffi-version \ check-r-version \ + check-scilab-version \ check-go-version \ check-d-version diff --git a/configure.ac b/configure.ac index 201244734..8e1419a36 100644 --- a/configure.ac +++ b/configure.ac @@ -986,7 +986,6 @@ AC_SUBST(OCTAVE_LDFLAGS) SCILABBIN= SCILABDYNAMICLINKING= - AC_ARG_WITH(scilab, AS_HELP_STRING([--without-scilab], [Disable Scilab]) AS_HELP_STRING([--with-scilab=path], [Set location of Scilab executable]),[SCILABBIN="$withval"], [SCILABBIN=yes]) AC_ARG_WITH(scilabincl,[ --with-scilabincl=path Set location of Scilab include directory],[SCILABINCDIR="$withval"], [SCILABINCDIR="/usr/include"]) @@ -995,46 +994,76 @@ AC_ARG_WITH(scilabincl,[ --with-scilabincl=path Set location of Scilab include if test x"${SCILABBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Scilab]) SCILAB= + else -# First figure out what the name of Scilab is - +# Check for Scilab executable if test "x$SCILABBIN" = xyes; then - AC_CHECK_PROGS(SCILAB, scilab) + AC_CHECK_PROGS(SCILAB, scilab) else - SCILAB="$SCILABBIN" + AC_MSG_CHECKING(for scilab) + if test -f "$SCILABBIN"; then + AC_MSG_RESULT($SCILABBIN) + SCILAB="$SCILABBIN" + else + AC_MSG_RESULT(not found) + fi fi -AC_MSG_CHECKING(for Scilab header files) if test -n "$SCILAB"; then - if test "$SCILABINCDIR" != ""; then - dirs="$SCILABINCDIR" - SCILABEXT="" - for i in $dirs; do - if test -r $i/scilab/api_scilab.h; then - SCILABEXT="$i" - break; - fi - if test -r $i/scilab/scilab/api_scilab.h; then - SCILABEXT="$i/scilab" - break; - fi - done - if test "$SCILABEXT" = "" ; then - AC_MSG_RESULT(not found) - else - AC_MSG_RESULT($SCILABEXT) - fi + # Check for Scilab version (needs api_scilab so needs version 5.2 or higher) + SCILAB_FULL_VERSION=`$SCILAB -version|head -1|sed -e 's|Scilab version \"\(.*\)\"|\1|g'` + AC_MSG_NOTICE([Scilab version: $SCILAB_FULL_VERSION]) - AC_MSG_CHECKING(for Scilab compiler options) - SCILABCCFLAGS="" - AC_MSG_RESULT($SCILABCCFLAGS) - fi -else - AC_MSG_RESULT(could not figure out how to run scilab) + AC_MSG_CHECKING(for Scilab version is 5.2 or higher) + SCILAB_MAJOR_VERSION=`echo $SCILAB_FULL_VERSION | cut -d. -f1` + SCILAB_MINOR_VERSION=`echo $SCILAB_FULL_VERSION | cut -d. -f2` + SCILAB_VERSION="$SCILAB_MAJOR_VERSION$SCILAB_MINOR_VERSION" + + if test $SCILAB_VERSION -ge 52; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + + # Set Scilab startup options depending on version + AC_MSG_CHECKING(for Scilab startup options) + SCILABSTARTOPT="-nwni -nb" + if test $SCILAB_VERSION -ge 54; then + SCILABSTARTOPT+=" -noatomsautoload" + fi + AC_MSG_RESULT($SCILABSTARTOPT) fi + +# Check for Scilab header files +AC_MSG_CHECKING(for Scilab header files) +if test "$SCILABINCDIR" != ""; then + dirs="$SCILABINCDIR" + SCILABEXT="" + for i in $dirs; do + if test -r $i/scilab/api_scilab.h; then + SCILABEXT="$i" + break; + fi + if test -r $i/scilab/scilab/api_scilab.h; then + SCILABEXT="$i/scilab" + break; + fi + done + if test "$SCILABEXT" = "" ; then + AC_MSG_RESULT(not found) + else + AC_MSG_RESULT($SCILABEXT) + fi + + AC_MSG_CHECKING(for Scilab compiler options) + SCILABCCFLAGS="" + AC_MSG_RESULT($SCILABCCFLAGS) +fi + + fi AC_SUBST(SCILAB) @@ -1042,6 +1071,8 @@ AC_SUBST(SCILABEEXT) AC_SUBST(SCILABDYNAMICLINKING) AC_SUBST(SCILABLIB) AC_SUBST(SCILABCCFLAGS) +AC_SUBST(SCILABSTARTOPT) + #---------------------------------------------------------------- # Look for java From 0fc9e4d0a4e02d4b7a5953d3cbaca1a729e2c7ca Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Mon, 19 Aug 2013 17:57:56 +0200 Subject: [PATCH 05/15] Scilab: support of Scilab 5.3.3 (api_scilab: Rhs, Lhs, ..) --- Lib/scilab/scichar.swg | 4 ++-- Lib/scilab/sciint.swg | 2 +- Lib/scilab/scimatrixchar.swg | 4 ++-- Lib/scilab/scimatrixdouble.swg | 8 ++++---- Lib/scilab/scimatrixint.swg | 8 ++++---- Lib/scilab/sciprimtypes.swg | 4 ++-- Lib/scilab/sciruntime.swg | 25 +++++++++++++++++++++++-- Lib/scilab/scisequencepointer.swg | 2 +- Source/Modules/scilab.cxx | 21 +++++++++++---------- 9 files changed, 50 insertions(+), 28 deletions(-) diff --git a/Lib/scilab/scichar.swg b/Lib/scilab/scichar.swg index b0ca9d6f0..c402dd891 100644 --- a/Lib/scilab/scichar.swg +++ b/Lib/scilab/scichar.swg @@ -244,12 +244,12 @@ SwigScilabStringFromCharPtrArray(void *_pvApiCtx, int _iVarOut, char **_charPtrA return SWIG_ERROR; } - sciErr = createMatrixOfString(_pvApiCtx, nbInputArgument(pvApiCtx) + _iVarOut, _charPtrArraySize, 1, _charPtrArray); + sciErr = createMatrixOfString(_pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + _iVarOut, _charPtrArraySize, 1, _charPtrArray); if (sciErr.iErr) { printError(&sciErr, 0); return SWIG_ERROR; } - return nbInputArgument(pvApiCtx) + _iVarOut; + return SWIG_NbInputArgument(pvApiCtx) + _iVarOut; } } diff --git a/Lib/scilab/sciint.swg b/Lib/scilab/sciint.swg index 843659dd7..f45fb8524 100644 --- a/Lib/scilab/sciint.swg +++ b/Lib/scilab/sciint.swg @@ -94,7 +94,7 @@ SWIG_From_dec(int)(int _iValue) double dblDoubleValue = (double) _iValue; int iRowsOut = 1; int iColsOut = 1; - int iVarOut = nbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); + int iVarOut = SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); sciErr = createMatrixOfDouble(pvApiCtx, iVarOut, iRowsOut, iColsOut, &dblDoubleValue); if (sciErr.iErr) diff --git a/Lib/scilab/scimatrixchar.swg b/Lib/scilab/scimatrixchar.swg index 0619270fe..bd7ad7b4a 100644 --- a/Lib/scilab/scimatrixchar.swg +++ b/Lib/scilab/scimatrixchar.swg @@ -39,7 +39,7 @@ { if (SwigScilabStringFromCharPtrArray(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2) != SWIG_ERROR) { - AssignOutputVariable(pvApiCtx, outputPosition) = nbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); + SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); } else { @@ -73,7 +73,7 @@ { if (SwigScilabStringFromCharPtrArray(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$1) != SWIG_ERROR) { - AssignOutputVariable(pvApiCtx, outputPosition) = nbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); + SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); } else { diff --git a/Lib/scilab/scimatrixdouble.swg b/Lib/scilab/scimatrixdouble.swg index 585d10e99..c0e917c45 100644 --- a/Lib/scilab/scimatrixdouble.swg +++ b/Lib/scilab/scimatrixdouble.swg @@ -82,7 +82,7 @@ { if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) != SWIG_ERROR) { - AssignOutputVariable(pvApiCtx, outputPosition) = nbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); + SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); } else { @@ -107,7 +107,7 @@ { if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) != SWIG_ERROR) { - AssignOutputVariable(pvApiCtx, outputPosition) = nbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); + SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); } else { @@ -140,7 +140,7 @@ { if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) != SWIG_ERROR) { - AssignOutputVariable(pvApiCtx, outputPosition) = nbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); + SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); } else { @@ -172,7 +172,7 @@ { if (SWIG_SciDouble_FromDoubleArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) != SWIG_ERROR) { - AssignOutputVariable(pvApiCtx, outputPosition) = nbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); + SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); } else { diff --git a/Lib/scilab/scimatrixint.swg b/Lib/scilab/scimatrixint.swg index 11ffa9364..66ac8bc04 100644 --- a/Lib/scilab/scimatrixint.swg +++ b/Lib/scilab/scimatrixint.swg @@ -77,7 +77,7 @@ { if (SWIG_SciInt32_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$3, *$1) != SWIG_ERROR) { - AssignOutputVariable(pvApiCtx, outputPosition) = nbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); + SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); } else { @@ -111,7 +111,7 @@ { if (SWIG_SciInt32_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2, *$3) != SWIG_ERROR) { - AssignOutputVariable(pvApiCtx, outputPosition) = nbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); + SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); } else { @@ -144,7 +144,7 @@ { if (SWIG_SciInt32_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$2, *$1) != SWIG_ERROR) { - AssignOutputVariable(pvApiCtx, outputPosition) = nbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); + SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); } else { @@ -176,7 +176,7 @@ { if (SWIG_SciInt32_FromIntArrayAndSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), 1, *$1, *$2) != SWIG_ERROR) { - AssignOutputVariable(pvApiCtx, outputPosition) = nbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); + SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition()); } else { diff --git a/Lib/scilab/sciprimtypes.swg b/Lib/scilab/sciprimtypes.swg index 1d3dce136..c9f45009f 100644 --- a/Lib/scilab/sciprimtypes.swg +++ b/Lib/scilab/sciprimtypes.swg @@ -38,12 +38,12 @@ SWIGINTERN int SwigScilabInt32FromEnum(void *_pvApiCtx, int _iVarOut, int _enumValue) { int iRet; - iRet = createScalarInteger32(pvApiCtx, nbInputArgument(pvApiCtx) + _iVarOut, _enumValue); + iRet = createScalarInteger32(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + _iVarOut, _enumValue); if (iRet) { return SWIG_ERROR; } - AssignOutputVariable(pvApiCtx, _iVarOut) = nbInputArgument(pvApiCtx) + _iVarOut; + SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + _iVarOut); return SWIG_OK; } } diff --git a/Lib/scilab/sciruntime.swg b/Lib/scilab/sciruntime.swg index ee6c9e792..e8b52b12b 100644 --- a/Lib/scilab/sciruntime.swg +++ b/Lib/scilab/sciruntime.swg @@ -66,7 +66,10 @@ SWIG_Scilab_ErrorMsg(int code, const char *mesg) sciprint(_("SWIG/Scilab Error : %s\n%s"),SWIG_Scilab_ErrorType(code),mesg); } - +#define SCILAB_VERSION_54_OR_HIGHER (SCI_VERSION_MAJOR > 5) || ((SCI_VERSION_MAJOR == 5) && (SCI_VERSION_MINOR >= 4)) +#if !SCILAB_VERSION_54_OR_HIGHER +#include "stack-c.h" +#endif #define SWIG_fail return SWIG_ERROR; #define SWIG_ErrorType(code) SWIG_Scilab_ErrorType(code) @@ -75,6 +78,20 @@ SWIG_Scilab_ErrorMsg(int code, const char *mesg) /* Used for C++ enums */ //#define SWIG_AsVal_int(scilabValue, valuePointer) SWIG_SciDouble_AsInt(pvApiCtx, scilabValue, valuePointer, fname) + +#if SCILAB_VERSION_54_OR_HIGHER +#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) +#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) +#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx) + +#else + +#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckRhs(minInputArgument, maxInputArgument) +#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckLhs(minOutputArgument, maxOutputArgument) +#define SWIG_NbInputArgument(pvApiCtx) Rhs +#endif + + SWIGINTERN int SwigScilabPtrToObject(void *_pvApiCtx, int _iVar, void **_pObjValue, swig_type_info *_descriptor, int _flags, char *_fname) { SciErr sciErr; @@ -214,7 +231,11 @@ SWIG_Scilab_SetOutput(void *_pvApiCtx, SciObject _output) { if (outputPosition < 0 || _output < 0) { return SWIG_ERROR; } - AssignOutputVariable(_pvApiCtx, outputPosition) = _output; + #if SCILAB_VERSION_54_OR_HIGHER + AssignOutputVariable(pvApiCtx, outputPosition) = _output; + #else + LhsVar(outputPosition) = _output; + #endif return SWIG_OK; } diff --git a/Lib/scilab/scisequencepointer.swg b/Lib/scilab/scisequencepointer.swg index 332b5fb7e..26c71bc8a 100644 --- a/Lib/scilab/scisequencepointer.swg +++ b/Lib/scilab/scisequencepointer.swg @@ -49,7 +49,7 @@ SWIG_FromSet_Sequence_dec(ptr)(int _size, long long *_sequence) { SciErr sciErr; int *piListAddr; - int iVarOut = nbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); + int iVarOut = SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition(); sciErr = createList(pvApiCtx, iVarOut, _size, &piListAddr); if (sciErr.iErr) diff --git a/Source/Modules/scilab.cxx b/Source/Modules/scilab.cxx index c290e5b04..7ec5849eb 100644 --- a/Source/Modules/scilab.cxx +++ b/Source/Modules/scilab.cxx @@ -285,9 +285,10 @@ public: int minInputArguments = emit_num_required(functionParamsList); int minOutputArguments = 0; int maxOutputArguments = 0; + /* Insert calls to CheckInputArgument and CheckOutputArgument */ - Printf(wrapper->code, "CheckInputArgument(pvApiCtx, $mininputarguments, $maxinputarguments);\n"); - Printf(wrapper->code, "CheckOutputArgument(pvApiCtx, $minoutputarguments, $maxoutputarguments);\n"); + Printf(wrapper->code, "SWIG_CheckInputArgument(pvApiCtx, $mininputarguments, $maxinputarguments);\n"); + Printf(wrapper->code, "SWIG_CheckOutputArgument(pvApiCtx, $minoutputarguments, $maxoutputarguments);\n"); Printf(wrapper->code, "SWIG_Scilab_SetFname(fname);\n"); for (paramIndex = 0, param = functionParamsList; paramIndex < maxInputArguments; ++paramIndex) { @@ -314,7 +315,7 @@ public: } if (paramIndex >= minInputArguments) { /* Optional input argument management */ - Printf(wrapper->code, "if (Rhs > %d) {\n%s\n}\n", paramIndex, paramTypemap); + Printf(wrapper->code, "if (SWIG_NbInputArgument(pvApiCtx) > %d) {\n%s\n}\n", paramIndex, paramTypemap); } else { Printf(wrapper->code, "%s\n", paramTypemap); } @@ -461,7 +462,7 @@ public: Printv(wrapper->def, "int ", wrapperName, " (char *fname, unsigned long fname_len) {\n", NIL); /* Get the number of the parameters */ - Wrapper_add_local(wrapper, "argc", "int argc = Rhs"); + Wrapper_add_local(wrapper, "argc", "int argc = SWIG_NbInputArgument(pvApiCtx)"); Printf(tmp, "int argv[%d] = {", maxargs); for (int j = 0; j < maxargs; ++j) { Printf(tmp, "%s%d", j ? "," : " ", j + 1); @@ -499,8 +500,8 @@ public: Printv(getFunctionWrapper->def, "int ", getFunctionName, "(char *fname, unsigned long fname_len) {\n", NIL); /* Check the number of input and output */ - Printf(getFunctionWrapper->def, "CheckInputArgument(pvApiCtx, 0, 0);\n"); - Printf(getFunctionWrapper->def, "CheckOutputArgument(pvApiCtx, 1, 1);\n"); + Printf(getFunctionWrapper->def, "SWIG_CheckInputArgument(pvApiCtx, 0, 0);\n"); + Printf(getFunctionWrapper->def, "SWIG_CheckOutputArgument(pvApiCtx, 1, 1);\n"); String *varoutTypemap = Swig_typemap_lookup("varout", node, origVariableName, 0); if (varoutTypemap != NULL) { @@ -526,8 +527,8 @@ public: Printv(setFunctionWrapper->def, "int ", setFunctionName, "(char *fname, unsigned long fname_len) {\n", NIL); /* Check the number of input and output */ - Printf(setFunctionWrapper->def, "CheckInputArgument(pvApiCtx, 1, 1);\n"); - Printf(setFunctionWrapper->def, "CheckOutputArgument(pvApiCtx, 1, 1);\n"); + Printf(setFunctionWrapper->def, "SWIG_CheckInputArgument(pvApiCtx, 1, 1);\n"); + Printf(setFunctionWrapper->def, "SWIG_CheckOutputArgument(pvApiCtx, 1, 1);\n"); String *varinTypemap = Swig_typemap_lookup("varin", node, origVariableName, 0); if (varinTypemap != NULL) { @@ -575,8 +576,8 @@ public: Printv(getFunctionWrapper->def, "int ", getFunctionName, "(char *fname, unsigned long fname_len) {\n", NIL); /* Check the number of input and output */ - Printf(getFunctionWrapper->def, "CheckInputArgument(pvApiCtx, 0, 0);\n"); - Printf(getFunctionWrapper->def, "CheckOutputArgument(pvApiCtx, 1, 1);\n"); + Printf(getFunctionWrapper->def, "SWIG_CheckInputArgument(pvApiCtx, 0, 0);\n"); + Printf(getFunctionWrapper->def, "SWIG_CheckOutputArgument(pvApiCtx, 1, 1);\n"); constantTypemap = Swig_typemap_lookup("constcode", node, nodeName, 0); if (constantTypemap != NULL) { From 62b61b53495512d759c3cbb280780c4d1399b7f4 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Tue, 20 Aug 2013 10:26:08 +0200 Subject: [PATCH 06/15] Scilab: fix examples (no paging which stops tests) --- Examples/scilab/class/runme.sci | 2 +- Examples/scilab/constants/runme.sci | 2 +- Examples/scilab/contract/runme.sci | 2 +- Examples/scilab/enum/runme.sci | 2 +- Examples/scilab/funcptr/runme.sci | 2 +- Examples/scilab/matrix/runme.sci | 4 ++-- Examples/scilab/matrix2/runme.sci | 3 ++- Examples/scilab/pointer/runme.sci | 4 ++-- Examples/scilab/simple/runme.sci | 2 +- Examples/scilab/std_set/runme.sci | 1 + Examples/scilab/std_vector/std_vector/runme.sci | 2 +- .../std_vector/std_vector_as_function_argument/runme.sci | 1 + Examples/scilab/struct/runme.sci | 4 ++-- Examples/scilab/template/runme.sci | 5 +++-- Examples/scilab/variables/runme.sci | 4 +--- 15 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Examples/scilab/class/runme.sci b/Examples/scilab/class/runme.sci index b5ec9e581..4beb64d9e 100644 --- a/Examples/scilab/class/runme.sci +++ b/Examples/scilab/class/runme.sci @@ -1,4 +1,4 @@ -// loader the *.so +lines(0); exec loader.sce; // ----- Object creation ----- diff --git a/Examples/scilab/constants/runme.sci b/Examples/scilab/constants/runme.sci index 6fba167c0..5109f857e 100644 --- a/Examples/scilab/constants/runme.sci +++ b/Examples/scilab/constants/runme.sci @@ -1,4 +1,4 @@ -// loader the *.so +lines(0); exec loader.sce; printf("ICONST = %i (should be 42)\n", ICONST_get()); diff --git a/Examples/scilab/contract/runme.sci b/Examples/scilab/contract/runme.sci index 636ab49e0..b5438d7b1 100644 --- a/Examples/scilab/contract/runme.sci +++ b/Examples/scilab/contract/runme.sci @@ -1,4 +1,4 @@ -// loader the *.so +lines(0); exec loader.sce; // Call our gcd() function diff --git a/Examples/scilab/enum/runme.sci b/Examples/scilab/enum/runme.sci index f63abd076..a5f16f3f8 100644 --- a/Examples/scilab/enum/runme.sci +++ b/Examples/scilab/enum/runme.sci @@ -1,4 +1,4 @@ -// loader the *.so +lines(0); exec loader.sce; // Print out the value of some enums diff --git a/Examples/scilab/funcptr/runme.sci b/Examples/scilab/funcptr/runme.sci index b5ca1f87c..aaedb5304 100644 --- a/Examples/scilab/funcptr/runme.sci +++ b/Examples/scilab/funcptr/runme.sci @@ -1,4 +1,4 @@ -// loader the *.so +lines(0); exec loader.sce; a = 37 diff --git a/Examples/scilab/matrix/runme.sci b/Examples/scilab/matrix/runme.sci index 033da30f5..4558fd3e0 100644 --- a/Examples/scilab/matrix/runme.sci +++ b/Examples/scilab/matrix/runme.sci @@ -1,5 +1,5 @@ -// loader the *.so -exec loader.sce +lines(0); +exec loader.sce; // create a new matrix x = new_matrix(); diff --git a/Examples/scilab/matrix2/runme.sci b/Examples/scilab/matrix2/runme.sci index e1be153b7..4aa7a8358 100644 --- a/Examples/scilab/matrix2/runme.sci +++ b/Examples/scilab/matrix2/runme.sci @@ -1,4 +1,5 @@ -exec loader.sce +lines(0); +exec loader.sce; // Test lib double matrix functions disp("Call lib function getDoubleMatrix()"); diff --git a/Examples/scilab/pointer/runme.sci b/Examples/scilab/pointer/runme.sci index b38823cad..17585bcc6 100644 --- a/Examples/scilab/pointer/runme.sci +++ b/Examples/scilab/pointer/runme.sci @@ -1,5 +1,5 @@ -// loader the *.so -exec loader.sce +lines(0); +exec loader.sce; // First create some objects using the pointer library. printf("Testing the pointer library\n") diff --git a/Examples/scilab/simple/runme.sci b/Examples/scilab/simple/runme.sci index 51cc39c70..6c89785ce 100644 --- a/Examples/scilab/simple/runme.sci +++ b/Examples/scilab/simple/runme.sci @@ -1,4 +1,4 @@ -// loader the *.so +lines(0); exec loader.sce; // Call our gcd() function diff --git a/Examples/scilab/std_set/runme.sci b/Examples/scilab/std_set/runme.sci index 68078a0fb..a2241bee8 100644 --- a/Examples/scilab/std_set/runme.sci +++ b/Examples/scilab/std_set/runme.sci @@ -1,3 +1,4 @@ +lines(0); exec loader.sce; SWIG_Init(); diff --git a/Examples/scilab/std_vector/std_vector/runme.sci b/Examples/scilab/std_vector/std_vector/runme.sci index 67f1a8eb6..a98b176db 100644 --- a/Examples/scilab/std_vector/std_vector/runme.sci +++ b/Examples/scilab/std_vector/std_vector/runme.sci @@ -1,4 +1,4 @@ -// file: runme.sci +lines(0); exec loader.sce; SWIG_Init(); diff --git a/Examples/scilab/std_vector/std_vector_as_function_argument/runme.sci b/Examples/scilab/std_vector/std_vector_as_function_argument/runme.sci index 87535d617..b0b399a68 100644 --- a/Examples/scilab/std_vector/std_vector_as_function_argument/runme.sci +++ b/Examples/scilab/std_vector/std_vector_as_function_argument/runme.sci @@ -1,3 +1,4 @@ +lines(0); exec loader.sce; SWIG_Init(); diff --git a/Examples/scilab/struct/runme.sci b/Examples/scilab/struct/runme.sci index 3340d3ab1..904d118c6 100644 --- a/Examples/scilab/struct/runme.sci +++ b/Examples/scilab/struct/runme.sci @@ -1,5 +1,5 @@ -//loader the *.so -exec loader.sce +lines(0); +exec loader.sce; //create a struct a=new_Bar(); diff --git a/Examples/scilab/template/runme.sci b/Examples/scilab/template/runme.sci index d4d21ae09..6e5515340 100644 --- a/Examples/scilab/template/runme.sci +++ b/Examples/scilab/template/runme.sci @@ -1,3 +1,6 @@ +lines(0); +exec loader.sce; + function printShape(shape, name) printf("\nShape %s position:\n", name); printf(" (x, y) = (%f, %f)\n", ShapeDouble_x_get(shape), ShapeDouble_y_get(shape)) @@ -9,8 +12,6 @@ function printShape(shape, name) printf("\n"); endfunction -exec loader.sce; - printf("Creating some objects:\n"); c = new_CircleDouble(10); s = new_SquareDouble(10); diff --git a/Examples/scilab/variables/runme.sci b/Examples/scilab/variables/runme.sci index c84a17c37..c4451a53d 100644 --- a/Examples/scilab/variables/runme.sci +++ b/Examples/scilab/variables/runme.sci @@ -1,7 +1,5 @@ lines(0); - -//loader the *.so -exec loader.sce +exec loader.sce; // Try to set the values of some global variables ivar_set(42); From 7a0aaa39b3ffd0cfacdf619d1d8dfddae14d39ab Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Tue, 20 Aug 2013 10:26:56 +0200 Subject: [PATCH 07/15] Scilab: add STL list example in check list --- Examples/scilab/check.list | 1 + Examples/scilab/std_list/runme.sci | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Examples/scilab/check.list b/Examples/scilab/check.list index 038e99498..7f5914649 100644 --- a/Examples/scilab/check.list +++ b/Examples/scilab/check.list @@ -8,6 +8,7 @@ matrix matrix2 pointer simple +std_list std_set std_vector/std_vector std_vector/std_vector_as_function_argument diff --git a/Examples/scilab/std_list/runme.sci b/Examples/scilab/std_list/runme.sci index aba132f6b..77a943ccf 100644 --- a/Examples/scilab/std_list/runme.sci +++ b/Examples/scilab/std_list/runme.sci @@ -1,3 +1,4 @@ +lines(0); exec loader.sce; SWIG_Init(); @@ -29,3 +30,5 @@ disp("concat this list with the list of string {''cc'', ''dd'', ''ee'', ''ff''} ss3 = concat_string_list(ss, ss2); disp(ss3); +exit + From 67d4079e1f13adc63da1118d1f833766e3f99a8b Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Wed, 21 Aug 2013 11:11:41 +0200 Subject: [PATCH 08/15] Scilab: fix tests failing in 5.3.3 (conflict with Scilab function Error) --- Examples/test-suite/constructor_exception.i | 6 ++++++ Examples/test-suite/throw_exception.i | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Examples/test-suite/constructor_exception.i b/Examples/test-suite/constructor_exception.i index 4c867c144..8e08904f8 100644 --- a/Examples/test-suite/constructor_exception.i +++ b/Examples/test-suite/constructor_exception.i @@ -1,5 +1,11 @@ %module constructor_exception +#ifdef SWIGSCILAB +%inline %{ +#undef Error +%} +#endif + %inline %{ class Error { }; diff --git a/Examples/test-suite/throw_exception.i b/Examples/test-suite/throw_exception.i index c1ad945fb..d03e49cba 100644 --- a/Examples/test-suite/throw_exception.i +++ b/Examples/test-suite/throw_exception.i @@ -12,6 +12,12 @@ %warnfilter(SWIGWARN_PARSE_KEYWORD) Namespace; #endif +#ifdef SWIGSCILAB +%inline %{ +#undef Error +%} +#endif + // Tests SWIG's automatic exception mechanism %inline %{ From 7655b6df6d81dcdcfd3483bf759a42f3741cb574 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Wed, 21 Aug 2013 14:35:48 +0200 Subject: [PATCH 09/15] Scilab: fix arrays_global test case --- Lib/scilab/scichar.swg | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Lib/scilab/scichar.swg b/Lib/scilab/scichar.swg index c402dd891..96e855929 100644 --- a/Lib/scilab/scichar.swg +++ b/Lib/scilab/scichar.swg @@ -102,10 +102,6 @@ SwigScilabStringToCharPtr(void *_pvApiCtx, int _iVar, char *_pcValue, int _iLeng char* pcTmpValue = NULL; int iRet; - if (_pcValue == NULL) { - return SWIG_ERROR; - } - sciErr = getVarAddressFromPosition(_pvApiCtx, _iVar, &piAddrVar); if (sciErr.iErr) { printError(&sciErr, 0); @@ -117,7 +113,10 @@ SwigScilabStringToCharPtr(void *_pvApiCtx, int _iVar, char *_pcValue, int _iLeng return SWIG_ERROR; } - strncpy(_pcValue, pcTmpValue, _iLength); + if (_pcValue != NULL) { + strncpy(_pcValue, pcTmpValue, _iLength); + } + free(pcTmpValue); return SWIG_OK; From fa166983aadf7e1323d1968a6097b5dedc63e3d8 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Wed, 21 Aug 2013 14:37:35 +0200 Subject: [PATCH 10/15] Scilab: remove unneeded examples from check list --- Examples/scilab/check.list | 2 -- 1 file changed, 2 deletions(-) diff --git a/Examples/scilab/check.list b/Examples/scilab/check.list index 7f5914649..15d6a6a3b 100644 --- a/Examples/scilab/check.list +++ b/Examples/scilab/check.list @@ -8,8 +8,6 @@ matrix matrix2 pointer simple -std_list -std_set std_vector/std_vector std_vector/std_vector_as_function_argument struct From 6201dec4558f6026b2732059f9bbb712a7d6522e Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Thu, 22 Aug 2013 10:49:48 +0200 Subject: [PATCH 11/15] Scilab: use configure cache for test-suite --- Examples/test-suite/scilab/Makefile.in | 3 +++ Examples/test-suite/scilab/test-suite.config.site | 1 + 2 files changed, 4 insertions(+) create mode 100644 Examples/test-suite/scilab/test-suite.config.site diff --git a/Examples/test-suite/scilab/Makefile.in b/Examples/test-suite/scilab/Makefile.in index 6f11d930f..091f21db5 100644 --- a/Examples/test-suite/scilab/Makefile.in +++ b/Examples/test-suite/scilab/Makefile.in @@ -17,6 +17,9 @@ top_builddir = @top_builddir@ include $(srcdir)/../common.mk +CONFIG_SITE=$(CURDIR)/test-suite.config.site +export CONFIG_SITE + # Rules for the different types of tests %.cpptest: $(setup) diff --git a/Examples/test-suite/scilab/test-suite.config.site b/Examples/test-suite/scilab/test-suite.config.site new file mode 100644 index 000000000..00ab59a82 --- /dev/null +++ b/Examples/test-suite/scilab/test-suite.config.site @@ -0,0 +1 @@ +cache_file=/tmp/scilab-test-suite.config.cache \ No newline at end of file From 908c9d1f1422e09e5c1e019e58a15b1ad9e61a1f Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Thu, 22 Aug 2013 14:37:28 +0200 Subject: [PATCH 12/15] Scilab: fix use of configure cache for multicpptest test-suite --- Examples/test-suite/scilab/Makefile.in | 14 +++++++++++++- Examples/test-suite/scilab/test-suite.config.site | 1 - 2 files changed, 13 insertions(+), 2 deletions(-) delete mode 100644 Examples/test-suite/scilab/test-suite.config.site diff --git a/Examples/test-suite/scilab/Makefile.in b/Examples/test-suite/scilab/Makefile.in index 091f21db5..0e9c096c5 100644 --- a/Examples/test-suite/scilab/Makefile.in +++ b/Examples/test-suite/scilab/Makefile.in @@ -17,22 +17,34 @@ top_builddir = @top_builddir@ include $(srcdir)/../common.mk +# configure cache to speed up test run +CONF_CACHE=/tmp/scilab-test-suite.config.cache CONFIG_SITE=$(CURDIR)/test-suite.config.site export CONFIG_SITE +enable_config_cache = \ + echo 'cache_file=$(CONF_CACHE)' > $(CONFIG_SITE) + +# need reset cache before multicpptest +reset_config_cache = \ + rm -f $(CONF_CACHE) + # Rules for the different types of tests %.cpptest: $(setup) + $(enable_config_cache) +$(swig_and_compile_cpp) $(run_testcase) %.ctest: $(setup) + $(enable_config_cache) +$(swig_and_compile_c) $(run_testcase) %.multicpptest: $(setup) + $(reset_config_cache) +$(swig_and_compile_multi_cpp) $(run_testcase) @@ -45,7 +57,7 @@ run_testcase = \ # Clean: remove the generated files %.clean: - @rm -f builder.sce loader.sce cleaner.sce $*_wrap.c $*_wrap.cxx lib$*lib.* + @rm -f builder.sce loader.sce cleaner.sce $*_wrap.c $*_wrap.cxx lib$*lib.* $(CONFIG_SITE) $(CONFIG_CACHE) clean: $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile scilab_clean diff --git a/Examples/test-suite/scilab/test-suite.config.site b/Examples/test-suite/scilab/test-suite.config.site deleted file mode 100644 index 00ab59a82..000000000 --- a/Examples/test-suite/scilab/test-suite.config.site +++ /dev/null @@ -1 +0,0 @@ -cache_file=/tmp/scilab-test-suite.config.cache \ No newline at end of file From 474bdcef91eb46eabf731ec2222a7d285253a2a4 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Thu, 22 Aug 2013 16:10:59 +0200 Subject: [PATCH 13/15] Scilab: configure cache in test run dir --- Examples/test-suite/scilab/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/test-suite/scilab/Makefile.in b/Examples/test-suite/scilab/Makefile.in index 0e9c096c5..2b3fcdd9e 100644 --- a/Examples/test-suite/scilab/Makefile.in +++ b/Examples/test-suite/scilab/Makefile.in @@ -18,7 +18,7 @@ top_builddir = @top_builddir@ include $(srcdir)/../common.mk # configure cache to speed up test run -CONF_CACHE=/tmp/scilab-test-suite.config.cache +CONF_CACHE=$(CURDIR)/test-suite.config.cache CONFIG_SITE=$(CURDIR)/test-suite.config.site export CONFIG_SITE From 2e30637a21efbb6ca65ac48862144f4966b709b2 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Thu, 22 Aug 2013 18:32:34 +0200 Subject: [PATCH 14/15] Scilab: fix clean config cache --- Examples/test-suite/scilab/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/test-suite/scilab/Makefile.in b/Examples/test-suite/scilab/Makefile.in index 2b3fcdd9e..9f17c0721 100644 --- a/Examples/test-suite/scilab/Makefile.in +++ b/Examples/test-suite/scilab/Makefile.in @@ -57,7 +57,7 @@ run_testcase = \ # Clean: remove the generated files %.clean: - @rm -f builder.sce loader.sce cleaner.sce $*_wrap.c $*_wrap.cxx lib$*lib.* $(CONFIG_SITE) $(CONFIG_CACHE) + @rm -f builder.sce loader.sce cleaner.sce $*_wrap.c $*_wrap.cxx lib$*lib.* $(CONFIG_SITE) $(CONF_CACHE) clean: $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile scilab_clean From e1264181a0584f27624dc32e20b5cfb152d3afd5 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Mon, 26 Aug 2013 15:22:58 +0200 Subject: [PATCH 15/15] Scilab: disable configure cache at end of test-suite --- Examples/test-suite/scilab/Makefile.in | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Examples/test-suite/scilab/Makefile.in b/Examples/test-suite/scilab/Makefile.in index 9f17c0721..f7a2f33af 100644 --- a/Examples/test-suite/scilab/Makefile.in +++ b/Examples/test-suite/scilab/Makefile.in @@ -15,8 +15,6 @@ top_builddir = @top_builddir@ # - member_pointer (C++) # - typemap_variables (C++) -include $(srcdir)/../common.mk - # configure cache to speed up test run CONF_CACHE=$(CURDIR)/test-suite.config.cache CONFIG_SITE=$(CURDIR)/test-suite.config.site @@ -25,10 +23,21 @@ export CONFIG_SITE enable_config_cache = \ echo 'cache_file=$(CONF_CACHE)' > $(CONFIG_SITE) +disable_config_cache: + rm -f $(CONF_CACHE) + rm -f $(CONFIG_SITE) + CONFIG_SITE= + # need reset cache before multicpptest reset_config_cache = \ rm -f $(CONF_CACHE) +# disable cache at the end of test-suite +# use trick for this: 'extra test cases' end target +EXTRA_TEST_CASES = disable_config_cache + +include $(srcdir)/../common.mk + # Rules for the different types of tests %.cpptest: $(setup)