1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
|
diff --git a/config/Makefile.in b/config/Makefile.in
--- config/Makefile.in
+++ config/Makefile.in
@@ -97,16 +97,17 @@ export:: $(export-preqs)
-DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \
-DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \
-DMOZ_NATIVE_BZ2=$(MOZ_NATIVE_BZ2) \
-DMOZ_NATIVE_ZLIB=$(MOZ_NATIVE_ZLIB) \
-DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \
-DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \
-DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
-DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
+ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
$(INSTALL) system_wrappers $(DIST)
GARBAGE_DIRS += system_wrappers
endif
ifdef WRAP_STL_INCLUDES
ifdef GNU_CXX
diff --git a/config/system-headers b/config/system-headers
--- config/system-headers
+++ config/system-headers
@@ -1125,8 +1125,19 @@ gst/video/video.h
sys/msg.h
sys/ipc.h
sys/thr.h
sys/user.h
kvm.h
spawn.h
err.h
xlocale.h
+#if MOZ_NATIVE_ICU==1
+unicode/locid.h
+unicode/numsys.h
+unicode/ucal.h
+unicode/ucol.h
+unicode/udat.h
+unicode/udatpg.h
+unicode/uenum.h
+unicode/unum.h
+unicode/ustring.h
+#endif
diff --git a/configure.in b/configure.in
--- configure.in
+++ configure.in
@@ -4134,16 +4134,32 @@ if test -n "$MOZ_NATIVE_FFI"; then
PKG_CHECK_MODULES(MOZ_FFI, libffi > 3.0.9)
else
PKG_CHECK_MODULES(MOZ_FFI, libffi >= 3.0.9)
fi
MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_FFI_LIBS"
fi
dnl ========================================================
+dnl system icu support
+dnl ========================================================
+MOZ_NATIVE_ICU=
+MOZ_ARG_WITH_BOOL(system-icu,
+[ --with-system-icu
+ Use system icu (located with pkgconfig)],
+ MOZ_NATIVE_ICU=1)
+
+if test -n "$MOZ_NATIVE_ICU"; then
+ PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1)
+ MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_ICU_LIBS"
+fi
+
+AC_SUBST(MOZ_NATIVE_ICU)
+
+dnl ========================================================
dnl Java SDK support
dnl ========================================================
JAVA_BIN_PATH=
MOZ_ARG_WITH_STRING(java-bin-path,
[ --with-java-bin-path=dir
Location of Java binaries (java, javac, jar)],
JAVA_BIN_PATH=$withval)
diff --git a/js/src/Makefile.in b/js/src/Makefile.in
--- js/src/Makefile.in.orig 2013-10-22 08:19:02.000000000 +0200
+++ js/src/Makefile.in 2013-10-29 10:11:58.272605098 +0100
@@ -237,10 +237,14 @@
# ICU headers need to be available whether we build with the complete
# Internationalization API or not - ICU stubs rely on them.
+ifdef MOZ_NATIVE_ICU
+LOCAL_INCLUDES += $(MOZ_ICU_CFLAGS)
+else
LOCAL_INCLUDES += \
-I$(topsrcdir)/../../intl/icu/source/common \
-I$(topsrcdir)/../../intl/icu/source/i18n \
$(NULL)
+endif
ifdef ENABLE_INTL_API
@@ -260,6 +264,7 @@
ICU_MAKE = $(MAKE)
endif
+ifndef MOZ_NATIVE_ICU
# - Build ICU as part of the "export" target, so things get built
# in the right order.
# - ICU requires GNU make according to its readme.html. pymake can't be used
@@ -276,6 +281,7 @@
$(call SUBMAKE,$@,intl/icu)
endif
+endif
#
# END ECMAScript Internationalization API
@@ -413,7 +419,11 @@
DEFINES += -DUSE_ZLIB
endif
-SHARED_LIBRARY_LIBS += $(ICU_LIBS)
+ifdef MOZ_NATIVE_ICU
+EXTRA_DSO_LDOPTS += $(MOZ_ICU_LIBS)
+else
+SHARED_LIBRARY_LIBS += $(MOZ_ICU_LIBS)
+endif
# Prevent floating point errors caused by VC++ optimizations
ifdef _MSC_VER
diff --git a/js/src/config/Makefile.in b/js/src/config/Makefile.in
--- js/src/config/Makefile.in
+++ js/src/config/Makefile.in
@@ -54,16 +54,17 @@ include $(topsrcdir)/config/rules.mk
HOST_CFLAGS += -DUNICODE -D_UNICODE
ifdef WRAP_SYSTEM_INCLUDES
export:: \
$(call mkdir_deps,system_wrappers_js) \
$(NULL)
$(PYTHON) $(srcdir)/Preprocessor.py $(DEFINES) $(ACDEFINES) \
+ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
$(srcdir)/system-headers | $(PERL) $(srcdir)/make-system-wrappers.pl system_wrappers_js
$(INSTALL) system_wrappers_js $(DIST)
GARBAGE_DIRS += system_wrappers_js
endif
GARBAGE += $(srcdir)/*.pyc *.pyc
diff --git a/js/src/config/system-headers b/js/src/config/system-headers
--- js/src/config/system-headers
+++ js/src/config/system-headers
@@ -1125,8 +1125,19 @@ gst/video/video.h
sys/msg.h
sys/ipc.h
sys/thr.h
sys/user.h
kvm.h
spawn.h
err.h
xlocale.h
+#if MOZ_NATIVE_ICU==1
+unicode/locid.h
+unicode/numsys.h
+unicode/ucal.h
+unicode/ucol.h
+unicode/udat.h
+unicode/udatpg.h
+unicode/uenum.h
+unicode/unum.h
+unicode/ustring.h
+#endif
diff --git a/js/src/configure.in b/js/src/configure.in
--- js/src/configure.in
+++ js/src/configure.in
@@ -4406,59 +4406,68 @@ if test "$ACCESSIBILITY" -a "$MOZ_ENABLE
AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
fi
dnl ========================================================
dnl ECMAScript Internationalization API Support (uses ICU)
dnl ========================================================
+ICU_LIB_NAMES=
+MOZ_NATIVE_ICU=
+MOZ_ARG_WITH_BOOL(system-icu,
+[ --with-system-icu
+ Use system icu (located with pkgconfig)],
+ MOZ_NATIVE_ICU=1)
+
+if test -n "$MOZ_NATIVE_ICU"; then
+ PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1)
+fi
if test -n "$JS_STANDALONE"; then
ENABLE_INTL_API=1
fi
MOZ_ARG_ENABLE_BOOL(intl-api,
[ --enable-intl-api Enable ECMAScript Internationalization API (default=yes for standalone JS)],
ENABLE_INTL_API=1,
ENABLE_INTL_API= )
dnl Settings for the implementation of the ECMAScript Internationalization API
if test -n "$ENABLE_INTL_API"; then
AC_DEFINE(ENABLE_INTL_API)
- # We build ICU as a static library.
- AC_DEFINE(U_STATIC_IMPLEMENTATION)
-
- case "$OS_TARGET" in
- WINNT)
- ICU_LIB_NAMES="icuin icuuc icudt"
- ;;
- Darwin|Linux)
- ICU_LIB_NAMES="icui18n icuuc icudata"
- ;;
- *)
- AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform])
- esac
-
- ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/lib)'
-else
- ICU_LIB_NAMES=
- ICU_LIBS=
+
+ if test -z "$MOZ_NATIVE_ICU"; then
+ case "$OS_TARGET" in
+ WINNT)
+ ICU_LIB_NAMES="icuin icuuc icudt"
+ ;;
+ Darwin|Linux)
+ ICU_LIB_NAMES="icui18n icuuc icudata"
+ ;;
+ *)
+ AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform])
+ esac
+ MOZ_ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/lib)'
+ fi
fi
AC_SUBST(ENABLE_INTL_API)
AC_SUBST(ICU_LIB_NAMES)
-AC_SUBST(ICU_LIBS)
-
-dnl Source files that use ICU should have control over which parts of the ICU
-dnl namespace they want to use.
-AC_DEFINE(U_USING_ICU_NAMESPACE,0)
-
+AC_SUBST(MOZ_ICU_LIBS)
+AC_SUBST(MOZ_NATIVE_ICU)
dnl Settings for ICU
-if test -n "$ENABLE_INTL_API" ; then
+if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then
+ dnl We build ICU as a static library.
+ AC_DEFINE(U_STATIC_IMPLEMENTATION)
+
+ dnl Source files that use ICU should have control over which parts of the ICU
+ dnl namespace they want to use.
+ AC_DEFINE(U_USING_ICU_NAMESPACE,0)
+
# Set ICU compile options
ICU_CPPFLAGS=""
# don't use icu namespace automatically in client code
ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_USING_ICU_NAMESPACE=0"
# don't include obsolete header files
ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
# remove chunks of the library that we don't need (yet)
ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_LEGACY_CONVERSION"
diff --git a/js/src/gdb/Makefile.in b/js/src/gdb/Makefile.in
--- js/src/gdb/Makefile.in
+++ js/src/gdb/Makefile.in
@@ -14,16 +14,20 @@ include $(DEPTH)/config/autoconf.mk
# Building against js_static requires that we declare mfbt sybols "exported"
# on its behalf.
DEFINES += -DEXPORT_JS_API -DIMPL_MFBT
LIBS = $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(NSPR_LIBS) $(MOZ_ZLIB_LIBS)
LOCAL_INCLUDES += -I$(topsrcdir) -I..
+ifdef MOZ_NATIVE_ICU
+EXTRA_LIBS += $(MOZ_ICU_LIBS)
+endif
+
EXTRA_LIBS += $(MOZ_FFI_LIBS)
# Place a GDB Python auto-load file next to the gdb-tests executable, both
# in the build directory and in the dist/bin directory.
PP_TARGETS += GDB_AUTOLOAD
GDB_AUTOLOAD := gdb-tests-gdb.py.in
GDB_AUTOLOAD_FLAGS := -Dtopsrcdir=$(abspath $(topsrcdir))
diff --git a/js/src/jsapi-tests/Makefile.in b/js/src/jsapi-tests/Makefile.in
--- js/src/jsapi-tests/Makefile.in
+++ js/src/jsapi-tests/Makefile.in
@@ -15,16 +15,20 @@ DEFINES += -DEXPORT_JS_API
# Building against js_static requires that we declare mfbt sybols "exported"
# on its behalf.
DEFINES += -DIMPL_MFBT
LIBS = $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(NSPR_LIBS) $(MOZ_ZLIB_LIBS)
LOCAL_INCLUDES += -I$(topsrcdir) -I..
+ifdef MOZ_NATIVE_ICU
+EXTRA_LIBS += $(MOZ_ICU_LIBS)
+endif
+
EXTRA_LIBS += $(MOZ_FFI_LIBS)
ifdef QEMU_EXE
MOZ_POST_PROGRAM_COMMAND = $(topsrcdir)/build/qemu-wrap --qemu $(QEMU_EXE) --libdir $(CROSS_LIB)
endif
# Place a GDB Python auto-load file next to the jsapi-tests executable in
# the build directory.
diff --git a/js/src/shell/Makefile.in b/js/src/shell/Makefile.in
--- js/src/shell/Makefile.in
+++ js/src/shell/Makefile.in
@@ -22,16 +22,19 @@ DEFINES += -DEXPORT_JS_API
# Building against js_static requires that we declare mfbt sybols "exported"
# on its behalf.
DEFINES += -DIMPL_MFBT
LIBS = $(NSPR_LIBS) $(EDITLINE_LIBS) $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(MOZ_ZLIB_LIBS)
ifdef MOZ_NATIVE_FFI
EXTRA_LIBS += $(MOZ_FFI_LIBS)
endif
+ifdef MOZ_NATIVE_ICU
+EXTRA_LIBS += $(MOZ_ICU_LIBS)
+endif
LOCAL_INCLUDES += -I$(topsrcdir) -I..
ifeq ($(OS_ARCH),Darwin)
ifeq ($(TARGET_CPU),x86_64)
DARWIN_EXE_LDFLAGS += -pagezero_size 10000 -image_base 100000000
endif
endif
|