Scilab: check Scilab version & support of Scilab 5.3.3 (program arguments)

This commit is contained in:
Simon Marchetto 2013-08-19 17:40:31 +02:00
commit 3a190fec2b
3 changed files with 75 additions and 34 deletions

View file

@ -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

View file

@ -149,6 +149,7 @@ check-versions: \
check-uffi-version \
check-cffi-version \
check-r-version \
check-scilab-version \
check-go-version \
check-d-version

View file

@ -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