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_LIB = @SCILABLIB@
SCILAB = @SCILAB@ SCILAB = @SCILAB@
SCILABOPT = SCILABOPT =
SCILAB_STARTOPT = @SCILABSTARTOPT@
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# Build a C dynamically loadable module # Build a C dynamically loadable module
@ -1596,7 +1597,7 @@ scilab: $(SRCS)
fi \ fi \
fi fi
@if [ -f builder.sce ]; then \ @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 fi
# ---------------------------------------------------------------- # ----------------------------------------------------------------
@ -1618,7 +1619,7 @@ scilab_cpp: $(SRCS)
fi \ fi \
fi fi
@if [ -f builder.sce ]; then \ @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 fi
# ----------------------------------------------------------------- # -----------------------------------------------------------------
@ -1626,14 +1627,22 @@ scilab_cpp: $(SRCS)
# ----------------------------------------------------------------- # -----------------------------------------------------------------
scilab_run: 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 # Debugging a scilab example
# ----------------------------------------------------------------- # -----------------------------------------------------------------
scilab_debug: 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 # Cleaning the scilab examples

View file

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

View file

@ -986,7 +986,6 @@ AC_SUBST(OCTAVE_LDFLAGS)
SCILABBIN= SCILABBIN=
SCILABDYNAMICLINKING= SCILABDYNAMICLINKING=
AC_ARG_WITH(scilab, AS_HELP_STRING([--without-scilab], [Disable Scilab]) 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]) 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"]) AC_ARG_WITH(scilabincl,[ --with-scilabincl=path Set location of Scilab include directory],[SCILABINCDIR="$withval"], [SCILABINCDIR="/usr/include"])
@ -995,20 +994,52 @@ AC_ARG_WITH(scilabincl,[ --with-scilabincl=path Set location of Scilab include
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]) AC_MSG_NOTICE([Disabling Scilab])
SCILAB= SCILAB=
else else
# First figure out what the name of Scilab is # Check for Scilab executable
if test "x$SCILABBIN" = xyes; then if test "x$SCILABBIN" = xyes; then
AC_CHECK_PROGS(SCILAB, scilab) AC_CHECK_PROGS(SCILAB, scilab)
else else
AC_MSG_CHECKING(for scilab)
if test -f "$SCILABBIN"; then
AC_MSG_RESULT($SCILABBIN)
SCILAB="$SCILABBIN" SCILAB="$SCILABBIN"
else
AC_MSG_RESULT(not found)
fi
fi fi
AC_MSG_CHECKING(for Scilab header files)
if test -n "$SCILAB"; then if test -n "$SCILAB"; then
if test "$SCILABINCDIR" != ""; then # 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 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" dirs="$SCILABINCDIR"
SCILABEXT="" SCILABEXT=""
for i in $dirs; do for i in $dirs; do
@ -1030,11 +1061,9 @@ if test -n "$SCILAB"; then
AC_MSG_CHECKING(for Scilab compiler options) AC_MSG_CHECKING(for Scilab compiler options)
SCILABCCFLAGS="" SCILABCCFLAGS=""
AC_MSG_RESULT($SCILABCCFLAGS) AC_MSG_RESULT($SCILABCCFLAGS)
fi
else
AC_MSG_RESULT(could not figure out how to run scilab)
fi fi
fi fi
AC_SUBST(SCILAB) AC_SUBST(SCILAB)
@ -1042,6 +1071,8 @@ AC_SUBST(SCILABEEXT)
AC_SUBST(SCILABDYNAMICLINKING) AC_SUBST(SCILABDYNAMICLINKING)
AC_SUBST(SCILABLIB) AC_SUBST(SCILABLIB)
AC_SUBST(SCILABCCFLAGS) AC_SUBST(SCILABCCFLAGS)
AC_SUBST(SCILABSTARTOPT)
#---------------------------------------------------------------- #----------------------------------------------------------------
# Look for java # Look for java