Commit d3697a1c authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

* spins: update to match newer upstream version of spins.sh

parent 822312f6
spins (1.1-1) unstable; urgency=low
* Update to the newer upstream version that is now hosted on github.
-- Alexandre Duret-Lutz <adl@lrde.epita.fr> Wed, 22 Jun 2016 15:34:30 +0200
spins (1.0-1) unstable; urgency=low
* Initial release.
......
......@@ -5,11 +5,14 @@
JAR=/usr/share/java/spins.jar
promela_file=
no_compile=0
verbose=0
for option in ${1+"$@"}; do
for option
do
case $option in
-I*) no_compile=1;;
-*);;
-v) verbose=1;;
-*) ;;
*) promela_file=$option;;
esac
done
......@@ -20,11 +23,25 @@ if [ -z "$promela_file" ]; then
fi
promela_name=`basename $promela_file`
output_file="${promela_name}.spins.c"
output_file=${promela_name}.spins.c
rm -f "$output_file"
java -Xms120m -Xmx2048m -cp $JAR spins.Compile ${1+"$@"}
# Total memory in KB
if [ -e /proc/meminfo ]; then
totalMemMB=`awk '/MemTotal:/ { print int($2/1024) }' /proc/meminfo`
else
totalMem=`top -l 1 | grep PhysMem:`
totalMemMB=`echo "$totalMem" | sed "s/PhysMem:[ ]*\([0-9]*\)M.*/\1/"`
if [ "$totalMem" = "$totalMemMB" ]; then
totalMemGB=`echo "$totalMem" | sed "s/PhysMem:[ ]*\([0-9]*\)G.*/\1/"`
totalMemMB=`expr $totalMemGB '*' 1024`
fi
fi
heapMB=`expr $totalMemMB '*' 3 / 4`
commitedMB=`expr $heapMB / 2`
java -Xms${commitedMB}m -Xmx${heapMB}m -Xss64m -cp $JAR spins.Compile ${1+"$@"}
ERROR=$?
if [ $ERROR -ne 0 ]; then
echo "Compilation of $promela_file failed" 1>&2
......@@ -36,12 +53,21 @@ if [ $no_compile -eq 1 ]; then
exit 0
fi
gcc -fPIC -shared -O2 -ggdb $CFLAGS $output_file -o $promela_name.spins
CC="gcc -fPIC -shared -O2 -ggdb $CFLAGS -Wno-unused-variable \
-Wno-parentheses-equality \
-Wno-initializer-overrides \
-Wno-unused-but-set-variable \
-Wno-unknown-warning-option \
$output_file -o $promela_name.spins"
[ $verbose = 1 ] && echo $CC
$CC
ERROR=$?
if [ $ERROR -ne 0 ]; then
echo "Compilation of $output_file failed" 1>&2
exit $ERROR
else
echo "Compiled C model to $promela_name.spins" 1>&2
echo "Compiled C code to PINS library $promela_name.spins" 1>&2
exit 0
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment