author | serb |
Fri, 18 Apr 2014 20:10:39 +0400 | |
changeset 24521 | 97047c850d31 |
parent 23010 | 6dadb192ad81 |
child 25859 | 3317bb8137f4 |
permissions | -rw-r--r-- |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
1 |
# |
23010
6dadb192ad81
8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents:
22989
diff
changeset
|
2 |
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
4 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
10 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
15 |
# accompanied this code). |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
16 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
20 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
23 |
# questions. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
24 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
25 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
26 |
# Scan for all locale resources and extract for which locales there exists |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
27 |
# resources. Then put this meta information about exiting (supported?) locales |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
28 |
# into LocaleDataMetaInfo.java |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
29 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
30 |
# First go look for all locale files |
20547 | 31 |
LOCALE_FILES := $(shell $(FIND) $(JDK_TOPDIR)/src/share/classes \ |
32 |
-name "FormatData_*.java" -o -name "FormatData_*.properties" -o \ |
|
33 |
-name "CollationData_*.java" -o -name "CollationData_*.properties" -o \ |
|
34 |
-name "TimeZoneNames_*.java" -o -name "TimeZoneNames_*.properties" -o \ |
|
35 |
-name "LocaleNames_*.java" -o -name "LocaleNames_*.properties" -o \ |
|
36 |
-name "CurrencyNames_*.java" -o -name "CurrencyNames_*.properties" -o \ |
|
37 |
-name "CalendarData_*.java" -o -name "CalendarData_*.properties") |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
38 |
|
20547 | 39 |
# Then translate the locale files into for example: FormatData_sv |
40 |
LOCALE_RESOURCES := $(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES))))) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
41 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
42 |
# Include the list of resources found during the previous compile. |
14231 | 43 |
-include $(JDK_OUTPUTDIR)/gensrc/_the.locale_resources |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
44 |
|
20547 | 45 |
MISSING_RESOURCES := $(filter-out $(LOCALE_RESOURCES), $(PREV_LOCALE_RESOURCES)) |
46 |
NEW_RESOURCES := $(filter-out $(PREV_LOCALE_RESOURCES), $(LOCALE_RESOURCES)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
47 |
|
20547 | 48 |
ifneq (, $(MISSING_RESOURCES)$(NEW_RESOURCES)) |
49 |
# There is a difference in the number of supported resources. Trigger a regeneration. |
|
50 |
$(shell $(RM) $(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
51 |
endif |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
52 |
|
19837
6f1c611fb72c
8024332: sun/util/resources/en split between rt.jar and localedata.jar
naoto
parents:
14427
diff
changeset
|
53 |
# The EN locales |
20547 | 54 |
EN_LOCALES := en% |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
55 |
|
22627
93f110be9439
8030696: Norwegian locales nb_NO and nn_NO should be available locales
naoto
parents:
21805
diff
changeset
|
56 |
# Locales that don't have any resource files should be included here. |
93f110be9439
8030696: Norwegian locales nb_NO and nn_NO should be available locales
naoto
parents:
21805
diff
changeset
|
57 |
ALL_NON_EN_LOCALES := ja-JP-JP nb-NO nn-NO th-TH-TH |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
58 |
|
20547 | 59 |
SED_ARGS := -e 's|$(HASH)warn This file is preprocessed before being compiled|// -- This file was mechanically generated: Do not edit! -- //|g' |
13583 | 60 |
|
61 |
# This macro creates a sed expression that substitues for example: |
|
19837
6f1c611fb72c
8024332: sun/util/resources/en split between rt.jar and localedata.jar
naoto
parents:
14427
diff
changeset
|
62 |
# #FormatData_ENLocales# with: en% locales. |
13583 | 63 |
define CaptureLocale |
20547 | 64 |
$1_LOCALES := $$(subst _,-,$$(filter-out $1, $$(subst $1_,,$$(filter $1_%, $(LOCALE_RESOURCES))))) |
65 |
$1_EN_LOCALES := $$(filter $(EN_LOCALES), $$($1_LOCALES)) |
|
66 |
$1_NON_EN_LOCALES := $$(filter-out $(EN_LOCALES), $$($1_LOCALES)) |
|
13583 | 67 |
|
22989
2d6804cfdc0e
8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents:
22627
diff
changeset
|
68 |
# Special handling for Chinese locales to include implicit scripts |
2d6804cfdc0e
8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents:
22627
diff
changeset
|
69 |
$1_NON_EN_LOCALES := $$(subst zh-CN,zh-CN$$(SPACE)zh-Hans-CN, $$($1_NON_EN_LOCALES)) |
2d6804cfdc0e
8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents:
22627
diff
changeset
|
70 |
$1_NON_EN_LOCALES := $$(subst zh-SG,zh-SG$$(SPACE)zh-Hans-SG, $$($1_NON_EN_LOCALES)) |
2d6804cfdc0e
8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents:
22627
diff
changeset
|
71 |
$1_NON_EN_LOCALES := $$(subst zh-HK,zh-HK$$(SPACE)zh-Hant-HK, $$($1_NON_EN_LOCALES)) |
2d6804cfdc0e
8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents:
22627
diff
changeset
|
72 |
$1_NON_EN_LOCALES := $$(subst zh-MO,zh-MO$$(SPACE)zh-Hant-MO, $$($1_NON_EN_LOCALES)) |
2d6804cfdc0e
8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents:
22627
diff
changeset
|
73 |
$1_NON_EN_LOCALES := $$(subst zh-TW,zh-TW$$(SPACE)zh-Hant-TW, $$($1_NON_EN_LOCALES)) |
2d6804cfdc0e
8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents:
22627
diff
changeset
|
74 |
|
20547 | 75 |
ALL_EN_LOCALES += $$($1_EN_LOCALES) |
76 |
ALL_NON_EN_LOCALES += $$($1_NON_EN_LOCALES) |
|
13583 | 77 |
|
20547 | 78 |
# Don't sed in a space if there are no locales. |
79 |
SED_ARGS += -e 's/$$(HASH)$1_ENLocales$$(HASH)/$$(if $$($1_EN_LOCALES),$$(SPACE)$$($1_EN_LOCALES),)/g' |
|
80 |
SED_ARGS += -e 's/$$(HASH)$1_NonENLocales$$(HASH)/$$(if $$($1_NON_EN_LOCALES),$$(SPACE)$$($1_NON_EN_LOCALES),)/g' |
|
13583 | 81 |
endef |
82 |
||
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
83 |
#sun.text.resources.FormatData |
13583 | 84 |
$(eval $(call CaptureLocale,FormatData)) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
85 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
86 |
#sun.text.resources.CollationData |
13583 | 87 |
$(eval $(call CaptureLocale,CollationData)) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
88 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
89 |
#sun.util.resources.TimeZoneNames |
13583 | 90 |
$(eval $(call CaptureLocale,TimeZoneNames)) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
91 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
92 |
#sun.util.resources.LocaleNames |
13583 | 93 |
$(eval $(call CaptureLocale,LocaleNames)) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
94 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
95 |
#sun.util.resources.CurrencyNames |
13583 | 96 |
$(eval $(call CaptureLocale,CurrencyNames)) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
97 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
98 |
#sun.util.resources.CalendarData |
13583 | 99 |
$(eval $(call CaptureLocale,CalendarData)) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
100 |
|
20547 | 101 |
SED_ARGS += -e 's/$(HASH)AvailableLocales_ENLocales$(HASH)/$(sort $(ALL_EN_LOCALES))/g' |
102 |
SED_ARGS += -e 's/$(HASH)AvailableLocales_NonENLocales$(HASH)/$(sort $(ALL_NON_EN_LOCALES))/g' |
|
13583 | 103 |
|
14231 | 104 |
$(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java: \ |
20547 | 105 |
$(JDK_TOPDIR)/src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template |
12892 | 106 |
$(MKDIR) -p $(@D) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
107 |
$(ECHO) Creating sun/util/LocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources. |
14231 | 108 |
$(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" > $(JDK_OUTPUTDIR)/gensrc/_the.locale_resources |
13583 | 109 |
$(SED) $(SED_ARGS) $< > $@ |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
110 |
|
20547 | 111 |
GENSRC_LOCALEDATAMETAINFO := $(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java |
12892 | 112 |
|
113 |
### |
|
114 |
||
14231 | 115 |
GENSRC_CRBC_DST := $(JDK_OUTPUTDIR)/gensrc/sun/util/CoreResourceBundleControl.java |
21805 | 116 |
GENSRC_CRBC_CMD := $(JDK_TOPDIR)/make/scripts/localelist.sh |
12892 | 117 |
|
118 |
JRE_NONEXIST_LOCALES := en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh |
|
119 |
||
20547 | 120 |
$(GENSRC_CRBC_DST): $(JDK_TOPDIR)/src/share/classes/sun/util/CoreResourceBundleControl-XLocales.java.template \ |
121 |
$(GENSRC_CRBC_CMD) |
|
12892 | 122 |
$(MKDIR) -p $(@D) |
20547 | 123 |
NAWK="$(NAWK)" SED="$(SED)" $(SH) $(GENSRC_CRBC_CMD) "$(JRE_NONEXIST_LOCALES)" $< $@ |
12892 | 124 |
|
125 |
GENSRC_LOCALEDATAMETAINFO += $(GENSRC_CRBC_DST) |
|
126 |
||
127 |
### |