Skip to content

Commit d12669a

Browse files
Merge branch 'master' into JDK-8333664
2 parents 7879919 + 601f05e commit d12669a

File tree

53 files changed

+552
-295
lines changed

Some content is hidden

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

53 files changed

+552
-295
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
root = true
22

3+
[*]
4+
charset = utf-8
5+
36
[*.{cpp,hpp,c,h,java,cc,hh,m,mm,S,md,properties,gmk,m4,ac}]
47
trim_trailing_whitespace = true
58

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
* -text
2+
* encoding=utf-8
23
*.java diff=java
34
*.c diff=cpp
45
*.h diff=cpp

doc/building.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,14 @@ <h3 id="special-considerations">Special Considerations</h3>
305305
<li><p>If using <a href="#cygwin">Cygwin</a>, you must make sure the
306306
file permissions and attributes between Windows and Cygwin are
307307
consistent. It is recommended that you follow this procedure:</p>
308+
<li><p>UTF-8 support is needed to compile the JDK. On Unix systems, this
309+
typically means that the <code>C.UTF-8</code> or
310+
<code>en_US.UTF-8</code> locale needs to be available. For Windows
311+
users, please see the section on <a href="#locale-requirements">Locale
312+
Requirements</a> below.</p></li>
313+
<li><p>On Windows, if using <a href="#cygwin">Cygwin</a>, extra care
314+
must be taken to make sure the environment is consistent. It is
315+
recommended that you follow this procedure:</p>
308316
<ul>
309317
<li><p>Create the directory that is going to contain the top directory
310318
of the JDK clone by using the <code>mkdir</code> command in the Cygwin

doc/building.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ on where and how to check out the source code.
8383
for the source code, see below for suggestions on how to keep the build
8484
artifacts on a local disk.
8585

86+
* UTF-8 support is needed to compile the JDK. On Unix systems, this typically
87+
means that the `C.UTF-8` or `en_US.UTF-8` locale needs to be available. For
88+
Windows users, please see the section on [Locale
89+
Requirements](#locale-requirements) below.
90+
8691
* On Windows, extra care must be taken to have a smooth building experience:
8792

8893
* Make sure that all relevant paths have short names. Short names are used by

make/CompileInterimLangtools.gmk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,15 @@ define SetupInterimModule
9595
SRC := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim \
9696
$$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$1) \
9797
$(TOPDIR)/src/$1/share/classes, \
98-
EXCLUDES := sun javax/tools/snippet-files, \
98+
EXCLUDES := sun, \
9999
EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \
100100
$(TOPDIR)/src/$1/share/classes/javax/tools/ToolProvider.java \
101101
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/Main.java \
102102
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/MemoryContext.java \
103103
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/MemoryModuleFinder.java \
104104
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/SourceLauncher.java \
105105
Standard.java, \
106+
EXCLUDE_PATTERNS := -files, \
106107
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java \
107108
$($1.interim_EXTRA_FILES), \
108109
COPY := .gif .png .xml .css .svg .js .js.template .txt .woff .woff2 javax.tools.JavaCompilerTool, \

make/CompileJavaModules.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \
113113
DISABLED_WARNINGS := $(DISABLED_WARNINGS_java), \
114114
EXCLUDES := $(EXCLUDES), \
115115
EXCLUDE_FILES := $(EXCLUDE_FILES), \
116+
EXCLUDE_PATTERNS := -files, \
116117
KEEP_ALL_TRANSLATIONS := $(KEEP_ALL_TRANSLATIONS), \
117118
JAVAC_FLAGS := \
118119
$(DOCLINT) \

make/Docs.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ JAVADOC_DISABLED_DOCLINT_PACKAGES := org.w3c.* javax.smartcardio
9696

9797
# The initial set of options for javadoc
9898
JAVADOC_OPTIONS := -use -keywords -notimestamp \
99-
-serialwarn -encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \
99+
-serialwarn -encoding utf-8 -docencoding utf-8 -breakiterator \
100100
-splitIndex --system none -javafx --expand-requires transitive \
101101
--override-methods=summary --syntax-highlight
102102

103103
# The reference options must stay stable to allow for comparisons across the
104104
# development cycle.
105105
REFERENCE_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
106-
-serialwarn -encoding ISO-8859-1 -breakiterator -splitIndex --system none \
106+
-serialwarn -encoding utf-8 -breakiterator -splitIndex --system none \
107107
-html5 -javafx --expand-requires transitive
108108

109109
# Should we add DRAFT stamps to the generated javadoc?

make/PreInit.gmk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,19 +161,19 @@ ifneq ($(SKIP_SPEC), true)
161161
( cd $(TOPDIR) && \
162162
$(foreach spec, $(SPECS), \
163163
$(MAKE) $(MAKE_INIT_ARGS) -j 1 -f $(TOPDIR)/make/Init.gmk \
164-
SPEC=$(spec) $(MAKE_INIT_MAIN_TARGET_ARGS) \
165-
main && \
164+
SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
165+
$(MAKE_INIT_MAIN_TARGET_ARGS) main && \
166166
$(if $(and $(COMPARE_BUILD), $(PARALLEL_TARGETS)), \
167167
$(MAKE) $(MAKE_INIT_ARGS) -f $(TOPDIR)/make/Init.gmk \
168-
SPEC=$(spec) \
168+
SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
169169
COMPARE_BUILD="$(COMPARE_BUILD)" \
170170
pre-compare-build && \
171171
$(MAKE) $(MAKE_INIT_ARGS) -j 1 -f $(TOPDIR)/make/Init.gmk \
172-
SPEC=$(spec) $(MAKE_INIT_MAIN_TARGET_ARGS) \
172+
SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
173173
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" \
174-
main && \
174+
$(MAKE_INIT_MAIN_TARGET_ARGS) main && \
175175
$(MAKE) $(MAKE_INIT_ARGS) -f $(TOPDIR)/make/Init.gmk \
176-
SPEC=$(spec) \
176+
SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
177177
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" \
178178
post-compare-build && \
179179
) \

make/PreInitSupport.gmk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,14 @@ endef
250250
# Param 1: FORCE = force generation of main-targets.gmk or LAZY = do not force.
251251
# Param 2: The SPEC file to use.
252252
define DefineMainTargets
253+
SPEC_FILE := $(strip $2)
253254

254255
# We will start by making sure the main-targets.gmk file is removed, if
255256
# make has not been restarted. By the -include, we will trigger the
256257
# rule for generating the file (which is never there since we removed it),
257258
# thus generating it fresh, and make will restart, incrementing the restart
258259
# count.
259-
main_targets_file := $$(dir $(strip $2))make-support/main-targets.gmk
260+
main_targets_file := $$(dir $$(SPEC_FILE))make-support/main-targets.gmk
260261

261262
ifeq ($$(MAKE_RESTARTS), )
262263
# Only do this if make has not been restarted, and if we do not force it.
@@ -268,10 +269,10 @@ define DefineMainTargets
268269
$$(main_targets_file):
269270
@( cd $$(TOPDIR) && \
270271
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(TOPDIR)/make/GenerateFindTests.gmk \
271-
-I $$(TOPDIR)/make/common SPEC=$(strip $2) )
272+
-I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR))
272273
@( cd $$(TOPDIR) && \
273274
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(TOPDIR)/make/Main.gmk \
274-
-I $$(TOPDIR)/make/common SPEC=$(strip $2) NO_RECIPES=true \
275+
-I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR) NO_RECIPES=true \
275276
$$(MAKE_LOG_VARS) \
276277
create-main-targets-include )
277278

make/autoconf/basic.m4

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,33 @@ AC_DEFUN_ONCE([BASIC_SETUP_BUILD_ENV],
134134
)
135135
AC_SUBST(BUILD_ENV)
136136
137+
AC_MSG_CHECKING([for locale to use])
137138
if test "x$LOCALE" != x; then
138139
# Check if we actually have C.UTF-8; if so, use it
139140
if $LOCALE -a | $GREP -q -E "^C\.(utf8|UTF-8)$"; then
140141
LOCALE_USED=C.UTF-8
142+
AC_MSG_RESULT([C.UTF-8 (recommended)])
143+
elif $LOCALE -a | $GREP -q -E "^en_US\.(utf8|UTF-8)$"; then
144+
LOCALE_USED=en_US.UTF-8
145+
AC_MSG_RESULT([en_US.UTF-8 (acceptable fallback)])
141146
else
142-
AC_MSG_WARN([C.UTF-8 locale not found, using C locale])
143-
LOCALE_USED=C
147+
# As a fallback, check if users locale is UTF-8. USER_LOCALE was saved
148+
# by the wrapper configure script before autconf messed up LC_ALL.
149+
if $ECHO $USER_LOCALE | $GREP -q -E "\.(utf8|UTF-8)$"; then
150+
LOCALE_USED=$USER_LOCALE
151+
AC_MSG_RESULT([$USER_LOCALE (untested fallback)])
152+
AC_MSG_WARN([Could not find C.UTF-8 or en_US.UTF-8 locale. This is not supported, and the build might fail unexpectedly.])
153+
else
154+
AC_MSG_RESULT([no UTF-8 locale found])
155+
AC_MSG_WARN([No UTF-8 locale found. This is not supported. Proceeding with the C locale, but the build might fail unexpectedly.])
156+
LOCALE_USED=C
157+
fi
158+
AC_MSG_NOTICE([The recommended locale is C.UTF-8, but en_US.UTF-8 is also accepted.])
144159
fi
145160
else
146-
AC_MSG_WARN([locale command not not found, using C locale])
147-
LOCALE_USED=C
161+
LOCALE_USED=C.UTF-8
162+
AC_MSG_RESULT([C.UTF-8 (default)])
163+
AC_MSG_WARN([locale command not not found, using C.UTF-8 locale])
148164
fi
149165
150166
export LC_ALL=$LOCALE_USED

0 commit comments

Comments
 (0)