annotate mxtool/mx @ 21157:31a1589aecdf

Make Truffle respect -XX:+DebugNonSafepoints
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Wed, 29 Apr 2015 18:09:41 -0700
parents 194041c3fdab
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3723
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 #!/bin/bash
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 #
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 # ----------------------------------------------------------------------------------------------------
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 #
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 # Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 #
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 # This code is free software; you can redistribute it and/or modify it
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 # under the terms of the GNU General Public License version 2 only, as
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 # published by the Free Software Foundation.
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 #
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 # This code is distributed in the hope that it will be useful, but WITHOUT
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 # version 2 for more details (a copy is included in the LICENSE file that
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 # accompanied this code).
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 #
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 # You should have received a copy of the GNU General Public License version
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 # 2 along with this work; if not, write to the Free Software Foundation,
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 #
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23 # or visit www.oracle.com if you need additional information or have any
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24 # questions.
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
25 #
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
26 # ----------------------------------------------------------------------------------------------------
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
27
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
28 dir=`/bin/pwd`
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
29
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
30 # Resolve location of this script so that mx.py can be found in the same directory
18406
194041c3fdab improve path resolving in mx.sh so that it can be run from outside the repo root
Andreas Woess <andreas.woess@jku.at>
parents: 17093
diff changeset
31 source="${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}"
194041c3fdab improve path resolving in mx.sh so that it can be run from outside the repo root
Andreas Woess <andreas.woess@jku.at>
parents: 17093
diff changeset
32 while [ -h "$source" ]; do
194041c3fdab improve path resolving in mx.sh so that it can be run from outside the repo root
Andreas Woess <andreas.woess@jku.at>
parents: 17093
diff changeset
33 dir="$(cd -P "$(dirname "$source")" && pwd)"
194041c3fdab improve path resolving in mx.sh so that it can be run from outside the repo root
Andreas Woess <andreas.woess@jku.at>
parents: 17093
diff changeset
34 source="$(readlink "$source")"
194041c3fdab improve path resolving in mx.sh so that it can be run from outside the repo root
Andreas Woess <andreas.woess@jku.at>
parents: 17093
diff changeset
35 [[ $source != /* ]] && source="$dir/$source"
194041c3fdab improve path resolving in mx.sh so that it can be run from outside the repo root
Andreas Woess <andreas.woess@jku.at>
parents: 17093
diff changeset
36 done
194041c3fdab improve path resolving in mx.sh so that it can be run from outside the repo root
Andreas Woess <andreas.woess@jku.at>
parents: 17093
diff changeset
37 dir="$(cd -P "$(dirname "$source")" && pwd)"
3723
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
38
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
39 if [ ! -f "$dir/mx.py" ]; then
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
40 echo "Cannot find mx.py in $dir"
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
41 exit 1
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
42 fi
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
43
8460
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
44 # Not all systems (e.g. Mac OS X) have 'python2' on the path.
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
45 type python2.7 >/dev/null 2>&1
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
46 if [ $? -eq 0 ]; then
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
47 python_exe=python2.7
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
48 else
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
49 type python2 > /dev/null 2>&1
9830
98918f518640 fixed bash syntax error
Doug Simon <doug.simon@oracle.com>
parents: 8460
diff changeset
50 if [ $? -eq 0 ]; then
8460
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
51 python_exe=python2
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
52 else
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
53 python_exe=python
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
54 fi
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
55 fi
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
56
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
57 $python_exe <<END
3723
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
58 import sys
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
59 major, minor, micro, _, _ = sys.version_info
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
60 if major != 2 or minor != 7:
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
61 raise SystemExit('The mx.py script requires Python 2.7, not {0}.{1}.{2}'.format(major, minor, micro))
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
62 END
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
63 if [ $? -eq 0 ]; then
8460
a607682f7ba6 mx.sh should select python2.7 python2 or python depending on what is available.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4186
diff changeset
64 exec $python_exe -u "$dir/mx.py" "$@"
3723
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
65 fi
6c5f528c7aac Added a copy of the mxtool to repo.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
66
4167
3e749481e445 Trivial change to test gate.
Doug Simon <doug.simon@oracle.com>
parents: 3723
diff changeset
67 #end of file