annotate make/aix/makefiles/adjust-mflags.sh @ 18408:2c3666f44855

Truffle: initial commit of object API implementation
author Andreas Woess <andreas.woess@jku.at>
date Tue, 18 Nov 2014 23:19:43 +0100
parents b83f7d608548
children 131c59b5e66a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14414
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
1 #! /bin/sh
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
2 #
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
3 # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
5 #
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
6 # This code is free software; you can redistribute it and/or modify it
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
7 # under the terms of the GNU General Public License version 2 only, as
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
8 # published by the Free Software Foundation.
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
9 #
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
10 # This code is distributed in the hope that it will be useful, but WITHOUT
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
13 # version 2 for more details (a copy is included in the LICENSE file that
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
14 # accompanied this code).
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
15 #
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
16 # You should have received a copy of the GNU General Public License version
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
17 # 2 along with this work; if not, write to the Free Software Foundation,
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
19 #
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
21 # or visit www.oracle.com if you need additional information or have any
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
22 # questions.
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
23 #
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
24 #
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
25
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
26 # This script is used only from top.make.
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
27 # The macro $(MFLAGS-adjusted) calls this script to
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
28 # adjust the "-j" arguments to take into account
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
29 # the HOTSPOT_BUILD_JOBS variable. The default
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
30 # handling of the "-j" argument by gnumake does
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
31 # not meet our needs, so we must adjust it ourselves.
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
32
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
33 # This argument adjustment applies to two recursive
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
34 # calls to "$(MAKE) $(MFLAGS-adjusted)" in top.make.
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
35 # One invokes adlc.make, and the other invokes vm.make.
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
36 # The adjustment propagates the desired concurrency
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
37 # level down to the sub-make (of the adlc or vm).
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
38 # The default behavior of gnumake is to run all
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
39 # sub-makes without concurrency ("-j1").
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
40
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
41 # Also, we use a make variable rather than an explicit
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
42 # "-j<N>" argument to control this setting, so that
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
43 # the concurrency setting (which must be tuned separately
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
44 # for each MP system) can be set via an environment variable.
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
45 # The recommended setting is 1.5x to 2x the number of available
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
46 # CPUs on the MP system, which is large enough to keep the CPUs
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
47 # busy (even though some jobs may be I/O bound) but not too large,
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
48 # we may presume, to overflow the system's swap space.
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
49
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
50 set -eu
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
51
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
52 default_build_jobs=4
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
53
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
54 case $# in
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
55 [12]) true;;
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
56 *) >&2 echo "Usage: $0 ${MFLAGS} ${HOTSPOT_BUILD_JOBS}"; exit 2;;
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
57 esac
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
58
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
59 MFLAGS=$1
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
60 HOTSPOT_BUILD_JOBS=${2-}
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
61
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
62 # Normalize any -jN argument to the form " -j${HBJ}"
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
63 MFLAGS=`
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
64 echo "$MFLAGS" \
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
65 | sed '
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
66 s/^-/ -/
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
67 s/ -\([^ ][^ ]*\)j/ -\1 -j/
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
68 s/ -j[0-9][0-9]*/ -j/
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
69 s/ -j\([^ ]\)/ -j -\1/
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
70 s/ -j/ -j'${HOTSPOT_BUILD_JOBS:-${default_build_jobs}}'/
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
71 ' `
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
72
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
73 case ${HOTSPOT_BUILD_JOBS} in \
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
74
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
75 '') case ${MFLAGS} in
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
76 *\ -j*)
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
77 >&2 echo "# Note: -jN is ineffective for setting parallelism in this makefile."
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
78 >&2 echo "# please set HOTSPOT_BUILD_JOBS=${default_build_jobs} in the command line or environment."
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
79 esac;;
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
80
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
81 ?*) case ${MFLAGS} in
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
82 *\ -j*) true;;
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
83 *) MFLAGS="-j${HOTSPOT_BUILD_JOBS} ${MFLAGS}";;
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
84 esac;;
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
85 esac
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
86
b83f7d608548 8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
simonis
parents:
diff changeset
87 echo "${MFLAGS}"