aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-05-05 10:55:08 +0200
committerBjörn Gustavsson <[email protected]>2011-05-11 12:23:58 +0200
commitea7b192ef727ad5dac64df22f3c4a74288608b22 (patch)
tree4cdf580b33a437ab01e9e2eb6b9182c4ae70d385
parentf587cbbb739fc2318d3e2f824d3df271028f9c41 (diff)
downloadotp-ea7b192ef727ad5dac64df22f3c4a74288608b22.tar.gz
otp-ea7b192ef727ad5dac64df22f3c4a74288608b22.tar.bz2
otp-ea7b192ef727ad5dac64df22f3c4a74288608b22.zip
cerl: Fix several incompatibilities with 'erl'
Invoking 'cerl' like 'cerl -smp' would only start the smp emulator if default was to start the non-smp emulator, otherwise 'erlexec' would try to start 'beam.smp.smp'. Furthermore 'cerl -smp disable' would be handled in the same way as 'cerl -smp'.
-rw-r--r--erts/etc/unix/cerl.src46
1 files changed, 37 insertions, 9 deletions
diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src
index e31a95f27e..0b2d6512ea 100644
--- a/erts/etc/unix/cerl.src
+++ b/erts/etc/unix/cerl.src
@@ -62,13 +62,21 @@ cxargs_add() {
done
}
+eeargs=
+eeargs_add() {
+ while [ $# -gt 0 ]; do
+ cargs="$cargs $1"
+ eeargs="$eeargs $1"
+ shift
+ done
+}
+
core=
GDB=
GDBBP=
GDBARGS=
TYPE=
-EMU_TYPE=
debug=
run_valgrind=no
@@ -127,8 +135,26 @@ while [ $# -gt 0 ]; do
;;
"-smp")
shift
- cargs="$cargs -smp"
- EMU_TYPE=.smp
+ if [ $# -le 0 ]; then
+ eeargs_add -smp
+ else
+ case $1 in
+ disable)
+ shift
+ eeargs_add -smpdisable
+ ;;
+ enable)
+ shift
+ eeargs_add -smp
+ ;;
+ *)
+ eeargs_add -smp
+ esac
+ fi
+ ;;
+ "-smpdisable")
+ shift
+ eeargs_add -smpdisable
;;
"-lcnt")
shift
@@ -202,7 +228,9 @@ PATH=$BINDIR:$ROOTDIR/bin:$PATH
EXEC=$BINDIR/erlexec
PROGNAME="$PROGNAME $cargs"
-EMU=$EMU$TYPE$EMU_TYPE
+EMU="$EMU$TYPE"
+EMU_NAME=`$EXEC -emu_name_exit $eeargs`
+
if [ $run_valgrind != yes ]; then
xargs="$xargs -pz $PRELOADED --"
fi
@@ -228,9 +256,9 @@ if [ "x$GDB" = "x" ]; then
valgrind_log=
else
if [ $valmajor -gt 2 -a $valminor -gt 4 ]; then
- valgrind_log="$log_file_prefix$VALGRIND_LOG_DIR/$VALGRIND_LOGFILE_PREFIX$VALGRIND_LOGFILE_INFIX$EMU.log.$$"
+ valgrind_log="$log_file_prefix$VALGRIND_LOG_DIR/$VALGRIND_LOGFILE_PREFIX$VALGRIND_LOGFILE_INFIX$EMU_NAME.log.$$"
else
- valgrind_log="$log_file_prefix$VALGRIND_LOG_DIR/$VALGRIND_LOGFILE_PREFIX$VALGRIND_LOGFILE_INFIX$EMU.log"
+ valgrind_log="$log_file_prefix$VALGRIND_LOG_DIR/$VALGRIND_LOGFILE_PREFIX$VALGRIND_LOGFILE_INFIX$EMU_NAME.log"
fi
fi
if [ "x$VALGRIND_MISC_FLAGS" = "x" ]; then
@@ -243,9 +271,9 @@ if [ "x$GDB" = "x" ]; then
early_beam_args=`echo $beam_args | sed "s|^\(.*-progname\).*$|\1|g"`
late_beam_args=`echo $beam_args | sed "s|^$pre_beam_args.*\(-- -home.*\)$|\1|g"`
- exec valgrind $valgrind_xml $valgrind_log $valgrind_misc_flags $BINDIR/$EMU $emu_xargs $early_beam_args "$PROGNAME" $late_beam_args -pz $PRELOADED
+ exec valgrind $valgrind_xml $valgrind_log $valgrind_misc_flags $BINDIR/$EMU_NAME $emu_xargs $early_beam_args "$PROGNAME" $late_beam_args -pz $PRELOADED
else
- exec $EXEC $xargs ${1+"$@"}
+ exec $EXEC $eeargs $xargs ${1+"$@"}
fi
else
if [ "x$EMACS" = "x" ]; then
@@ -280,5 +308,5 @@ else
(insert-string \"source $ROOTDIR/erts/etc/unix/etp-commands\") \
(comint-send-input)"
# Fire up gdb in emacs...
- exec $EMACS --eval "(progn (gdb \"gdb $GDBARGS$EMU\") $gdbcmd)"
+ exec $EMACS --eval "(progn (gdb \"gdb $GDBARGS$EMU_NAME\") $gdbcmd)"
fi