Skip to content

Commit 713a124

Browse files
author
erikj
committed
8187444: Forest Consolidation: Make build work
Reviewed-by: darcy, ihse Contributed-by: [email protected], [email protected], [email protected], [email protected]
1 parent ba116d5 commit 713a124

File tree

238 files changed

+1499
-2878
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+1499
-2878
lines changed

.hgignore

+3
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ nbproject/private/
88
\.DS_Store
99
\.metadata/
1010
\.recommenders/
11+
test/nashorn/script/external
12+
test/nashorn/lib
13+
NashornProfile.txt

README

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Welcome to OpenJDK!
44
For information about building OpenJDK, including how to fully retrieve all
55
source code, please see either of these:
66

7-
* common/doc/building.html (html version)
8-
* common/doc/building.md (markdown version)
7+
* doc/building.html (html version)
8+
* doc/building.md (markdown version)
99

1010
See http://openjdk.java.net/ for more information about OpenJDK.

bin/idea.sh

+37-17
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
# Shell script for generating an IDEA project from a given list of modules
2626

2727
usage() {
28-
echo "usage: $0 [-h|--help] [-v|--verbose] [-o|--output <path>] [modules]+"
28+
echo "usage: $0 [-h|--help] [-v|--verbose] [-o|--output <path>] [modules]+"
2929
exit 1
3030
}
3131

3232
SCRIPT_DIR=`dirname $0`
3333
PWD=`pwd`
3434
cd $SCRIPT_DIR; SCRIPT_DIR=`pwd`
35-
cd ../../; TOP=`pwd`; cd $PWD
35+
cd ../; TOP=`pwd`; cd $PWD
3636

3737
IDEA_OUTPUT=$TOP/.idea
3838
VERBOSE="false"
@@ -70,8 +70,10 @@ IDEA_MAKE="$TOP/make/idea"
7070
IDEA_TEMPLATE="$IDEA_MAKE/template"
7171
IML_TEMPLATE="$IDEA_TEMPLATE/jdk.iml"
7272
ANT_TEMPLATE="$IDEA_TEMPLATE/ant.xml"
73+
MISC_TEMPLATE="$IDEA_TEMPLATE/misc.xml"
7374
IDEA_IML="$IDEA_OUTPUT/jdk.iml"
7475
IDEA_ANT="$IDEA_OUTPUT/ant.xml"
76+
IDEA_MISC="$IDEA_OUTPUT/misc.xml"
7577

7678
if [ "$VERBOSE" = "true" ] ; then
7779
echo "output dir: $IDEA_OUTPUT"
@@ -120,20 +122,16 @@ addSourceFolder() {
120122
}
121123

122124
### Generate project iml
123-
RELATIVE_BUILD_DIR="`dirname $SPEC | sed -e s@"$TOP/\(.*$\)"@"\1"@`"
124125
rm -f $IDEA_IML
125126
while IFS= read -r line
126127
do
127128
if echo "$line" | egrep "^ .* <sourceFolder.*####" > /dev/null ; then
128-
if [ "$SOURCE_FOLDERS_DONE" = "false" ] ; then
129+
if [ "$SOURCE_FOLDERS_DONE" = "false" ] ; then
129130
SOURCE_FOLDERS_DONE="true"
130131
for root in $MODULE_ROOTS; do
131132
addSourceFolder $root
132133
done
133134
fi
134-
elif echo "$line" | egrep "^ .* <excludeFolder.*####" > /dev/null ; then
135-
ul="`echo "$line" | sed -e s@"\(.*/\)####\(.*\)"@"\1$RELATIVE_BUILD_DIR\2"@`"
136-
printf "%s\n" "$ul" >> $IDEA_IML
137135
else
138136
printf "%s\n" "$line" >> $IDEA_IML
139137
fi
@@ -155,30 +153,52 @@ addBuildDir() {
155153
printf "%s\n" "$mn" >> $IDEA_ANT
156154
}
157155

158-
JTREG_HOME=" <property name=\"jtreg.home\" value=\"####\" />"
159-
160-
addJtregHome() {
161-
DIR=`dirname $SPEC`
162-
mn="`echo "$JTREG_HOME" | sed -e s@"\(.*\)####\(.*\)"@"\1$JT_HOME\2"@`"
163-
printf "%s\n" "$mn" >> $IDEA_ANT
164-
}
165-
166156
### Generate ant.xml
167157

168158
rm -f $IDEA_ANT
169159
while IFS= read -r line
170160
do
171161
if echo "$line" | egrep "^ .* <property name=\"module.name\"" > /dev/null ; then
172162
addModuleName
173-
elif echo "$line" | egrep "^ .* <property name=\"jtreg.home\"" > /dev/null ; then
174-
addJtregHome
175163
elif echo "$line" | egrep "^ .* <property name=\"build.target.dir\"" > /dev/null ; then
176164
addBuildDir
177165
else
178166
printf "%s\n" "$line" >> $IDEA_ANT
179167
fi
180168
done < "$ANT_TEMPLATE"
181169

170+
### Generate misc.xml
171+
172+
rm -f $IDEA_MISC
173+
174+
JTREG_HOME=" <path>####</path>"
175+
176+
IMAGES_DIR=" <jre alt=\"true\" value=\"####\" />"
177+
178+
addImagesDir() {
179+
DIR=`dirname $SPEC`/images/jdk
180+
mn="`echo "$IMAGES_DIR" | sed -e s@"\(.*\)####\(.*\)"@"\1$DIR\2"@`"
181+
printf "%s\n" "$mn" >> $IDEA_MISC
182+
}
183+
184+
addJtregHome() {
185+
DIR=`dirname $SPEC`
186+
mn="`echo "$JTREG_HOME" | sed -e s@"\(.*\)####\(.*\)"@"\1$JT_HOME\2"@`"
187+
printf "%s\n" "$mn" >> $IDEA_MISC
188+
}
189+
190+
rm -f $MISC_ANT
191+
while IFS= read -r line
192+
do
193+
if echo "$line" | egrep "^ .*<path>jtreg_home</path>" > /dev/null ; then
194+
addJtregHome
195+
elif echo "$line" | egrep "^ .*<jre alt=\"true\" value=\"images_jdk\"" > /dev/null ; then
196+
addImagesDir
197+
else
198+
printf "%s\n" "$line" >> $IDEA_MISC
199+
fi
200+
done < "$MISC_TEMPLATE"
201+
182202
### Compile the custom Logger
183203

184204
CLASSES=$IDEA_OUTPUT/classes

bin/jib.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ setup_url() {
4242
jib_revision="2.0-SNAPSHOT"
4343
jib_ext="jib.sh.gz"
4444

45-
closed_script="${mydir}/../../closed/conf/jib-install.conf"
45+
closed_script="${mydir}/../../../closed/conf/jib-install.conf"
4646
if [ -f "${closed_script}" ]; then
4747
source "${closed_script}"
4848
fi

bin/unshuffle_list.txt

+180-1,476
Large diffs are not rendered by default.

bin/unshuffle_patch.sh

+86-51
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
#
3-
# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
44
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
#
66
# This code is free software; you can redistribute it and/or modify it
@@ -25,14 +25,17 @@
2525
# Script for updating a patch file as per the shuffled/unshuffled source location.
2626

2727
usage() {
28-
echo "Usage: $0 [-h|--help] [-v|--verbose] <repo> <input_patch> <output_patch>"
29-
echo "where:"
30-
echo " <repo> is one of: corba, jaxp, jaxws, jdk, langtools, nashorn"
31-
echo " [Note: patches from other repos do not need updating]"
32-
echo " <input_patch> is the input patch file, that needs shuffling/unshuffling"
33-
echo " <output_patch> is the updated patch file "
34-
echo " "
35-
exit 1
28+
echo "Usage: $0 [-h|--help] [-v|--verbose] [-to9|-to10] [-r <repo>] <input_patch> <output_patch>"
29+
echo "where:"
30+
echo " -to9 create patches appropriate for a JDK 9 source tree"
31+
echo " When going to 9, the output patches will be suffixed with the"
32+
echo " repo name"
33+
echo " -to10 create patches appropriate for a JDK 10 source tree"
34+
echo " -r <repo> specify repo for source patch, set to 'top' for top repo"
35+
echo " <input_patch> is the input patch file, that needs shuffling/unshuffling"
36+
echo " <output_patch> is the updated patch file "
37+
echo " "
38+
exit 1
3639
}
3740

3841
SCRIPT_DIR=`dirname $0`
@@ -55,40 +58,65 @@ do
5558
vflag="true"
5659
;;
5760

61+
-r)
62+
repo="$2"
63+
shift
64+
;;
65+
66+
-to9)
67+
shuffle_to=9
68+
;;
69+
70+
-to10)
71+
shuffle_to=10
72+
;;
73+
5874
-*) # bad option
5975
usage
6076
;;
6177

62-
* ) # non option
78+
* ) # non option
6379
break
6480
;;
6581
esac
6682
shift
6783
done
6884

6985
# Make sure we have the right number of arguments
70-
if [ ! $# -eq 3 ] ; then
86+
if [ ! $# -eq 2 ] ; then
7187
echo "ERROR: Invalid number of arguments." >&2
7288
usage
7389
fi
7490

7591
# Check the given repo
76-
repos="corba jaxp jaxws jdk langtools nashorn"
77-
repo="$1"
92+
repos="top corba jaxp jaxws jdk langtools nashorn hotspot"
7893
found="false"
79-
for r in $repos ; do
80-
if [ $repo = "$r" ] ; then
81-
found="true"
82-
break;
94+
if [ -n "$repo" ]; then
95+
for r in $repos ; do
96+
if [ $repo = "$r" ] ; then
97+
found="true"
98+
break;
99+
fi
100+
done
101+
if [ $found = "false" ] ; then
102+
echo "ERROR: Unknown repo: $repo. Should be one of [$repos]." >&2
103+
usage
83104
fi
84-
done
85-
if [ $found = "false" ] ; then
86-
echo "ERROR: Unknown repo: $repo. Should be one of [$repos]." >&2
87-
usage
105+
fi
106+
107+
if [ "$shuffle_to" != "9" -a "$shuffle_to" != "10" ]; then
108+
echo "ERROR: Must pick either -to9 or -to10"
109+
exit 1
110+
fi
111+
112+
# When going to 10, a repo must be specified for the source patch
113+
if [ "$shuffle_to" = "10" -a -z "$repo" ]; then
114+
echo "ERROR: Must specify src repo for JDK 9 patch"
115+
exit 1
88116
fi
89117

90118
# Check given input/output files
91-
input="$2"
119+
input="$1"
92120
if [ "x$input" = "x-" ] ; then
93121
input="/dev/stdin"
94122
fi
@@ -98,18 +126,26 @@ if [ ! -f $input -a "x$input" != "x/dev/stdin" ] ; then
98126
exit 1
99127
fi
100128

101-
output="$3"
129+
output="$2"
102130
if [ "x$output" = "x-" ] ; then
103131
output="/dev/stdout"
104132
fi
133+
base_output="$output"
105134

106-
if [ -f $output -a "x$output" != "x/dev/stdout" ] ; then
107-
echo "ERROR: Output patch already exists: $output" >&2
108-
exit 1
135+
if [ "$shuffle_to" = "10" ]; then
136+
if [ -f $output -a "x$output" != "x/dev/stdout" ] ; then
137+
echo "ERROR: Output patch already exists: $output" >&2
138+
exit 1
139+
fi
140+
else
141+
for r in $repos; do
142+
if [ -f "$output.$r" ]; then
143+
echo "ERROR: Output patch already exists: $output.$r" >&2
144+
exit 1
145+
fi
146+
done
109147
fi
110148

111-
what="" ## shuffle or unshuffle
112-
113149
verbose() {
114150
if [ ${vflag} = "true" ] ; then
115151
echo "$@" >&2
@@ -135,30 +171,17 @@ unshuffle() {
135171
fi
136172
verbose "Extracted path: \"$path\""
137173

138-
# Only source can be shuffled, or unshuffled
139-
if ! echo "$path" | egrep '^src/.*' > /dev/null ; then
140-
verbose "Not a src path, skipping."
141-
echo "$line" >> $output
142-
return
143-
fi
144-
145-
# Shuffle or unshuffle?
146-
if [ "${what}" = "" ] ; then
147-
if echo "$path" | egrep '^src/java\..*|^src/jdk\..*' > /dev/null ; then
148-
what="unshuffle"
149-
else
150-
what="shuffle"
151-
fi
152-
verbose "Shuffle or unshuffle: $what"
153-
fi
154-
155174
# Find the most specific matches in the shuffle list
156175
matches=
157-
matchpath="$repo"/"$path"/x
176+
if [ -n "$repo" -a "$repo" != "top" ]; then
177+
matchpath="$repo"/"$path"/x
178+
else
179+
matchpath="$path"/x
180+
fi
158181
while [ "$matchpath" != "" ] ; do
159182
matchpath="`echo $matchpath | sed s@'\(.*\)/.*$'@'\1'@`"
160183

161-
if [ "${what}" = "shuffle" ] ; then
184+
if [ "$shuffle_to" = "10" ] ; then
162185
pattern=": $matchpath$"
163186
else
164187
pattern="^$matchpath :"
@@ -177,12 +200,24 @@ unshuffle() {
177200

178201
# Rewrite the line, if we have a match
179202
if ! [ "x${matches}" = "x" ] ; then
180-
shuffled="`echo "$matches" | sed -e s@' : .*'@@g -e s@'^[a-z]*\/'@@`"
181-
unshuffled="`echo "$matches" | sed -e s@'.* : '@@g -e s@'^[a-z]*\/'@@`"
182-
if [ "${what}" = "shuffle" ] ; then
203+
shuffled="${matches%% : *}"
204+
unshuffled="${matches#* : }"
205+
patch_suffix_9=""
206+
for r in $repos; do
207+
if [ "$unshuffled" != "${unshuffled#$r}" ]; then
208+
unshuffled="${unshuffled#$r\/}"
209+
patch_suffix_9=".$r"
210+
fi
211+
done
212+
verbose "shuffled: $shuffled"
213+
verbose "unshuffled: $unshuffled"
214+
verbose "patch_suffix_9: $patch_suffix_9"
215+
if [ "$shuffle_to" = "10" ] ; then
183216
newline="`echo "$line" | sed -e s@"$unshuffled"@"$shuffled"@g`"
184217
else
185218
newline="`echo "$line" | sed -e s@"$shuffled"@"$unshuffled"@g`"
219+
output=$base_output$patch_suffix_9
220+
verbose "Writing to $output"
186221
fi
187222
verbose "Rewriting to \"$newline\""
188223
echo "$newline" >> $output

configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ this_script_dir=`cd $this_script_dir > /dev/null && pwd`
3232
# Delegate to wrapper, forcing wrapper to believe $0 is this script by using -c.
3333
# This trick is needed to get autoconf to co-operate properly.
3434
# The ${-:+-$-} construction passes on bash options.
35-
bash ${-:+-$-} -c ". $this_script_dir/common/autoconf/configure" $this_script_dir/configure CHECKME $this_script_dir "$@"
35+
bash ${-:+-$-} -c ". $this_script_dir/make/autoconf/configure" $this_script_dir/configure CHECKME $this_script_dir "$@"

0 commit comments

Comments
 (0)