@@ -31,6 +31,16 @@ valid_arm_float_abi = ('soft', 'softfp', 'hard')
31
31
valid_mips_arch = ('loongson' , 'r1' , 'r2' , 'r6' , 'rx' )
32
32
valid_mips_fpu = ('fp32' , 'fp64' , 'fpxx' )
33
33
valid_mips_float_abi = ('soft' , 'hard' )
34
+ valid_intl_modes = ('none' , 'small-icu' , 'full-icu' , 'system-icu' )
35
+
36
+ # create option groups
37
+ shared_optgroup = optparse .OptionGroup (parser , "Shared libraries" ,
38
+ "Flags that allows you to control whether you want to build against "
39
+ "built-in dependencies or its shared representations. If necessary, "
40
+ "provide multiple libraries with comma." )
41
+ intl_optgroup = optparse .OptionGroup (parser , "Internationalization" ,
42
+ "Flags that lets you enable i18n features in io.js as well as which "
43
+ "library you want to build against." )
34
44
35
45
# Options should be in alphabetical order but keep --prefix at the top,
36
46
# that's arguably the one people will be looking for most.
@@ -78,90 +88,92 @@ parser.add_option("--openssl-no-asm",
78
88
dest = "openssl_no_asm" ,
79
89
help = "Do not build optimized assembly for OpenSSL" )
80
90
81
- parser .add_option ('--shared-http-parser' ,
91
+ shared_optgroup .add_option ('--shared-http-parser' ,
82
92
action = 'store_true' ,
83
93
dest = 'shared_http_parser' ,
84
94
help = 'link to a shared http_parser DLL instead of static linking' )
85
95
86
- parser .add_option ('--shared-http-parser-includes' ,
96
+ shared_optgroup .add_option ('--shared-http-parser-includes' ,
87
97
action = 'store' ,
88
98
dest = 'shared_http_parser_includes' ,
89
99
help = 'directory containing http_parser header files' )
90
100
91
- parser .add_option ('--shared-http-parser-libname' ,
101
+ shared_optgroup .add_option ('--shared-http-parser-libname' ,
92
102
action = 'store' ,
93
103
dest = 'shared_http_parser_libname' ,
94
104
default = 'http_parser' ,
95
105
help = 'alternative lib name to link to [default: %default]' )
96
106
97
- parser .add_option ('--shared-http-parser-libpath' ,
107
+ shared_optgroup .add_option ('--shared-http-parser-libpath' ,
98
108
action = 'store' ,
99
109
dest = 'shared_http_parser_libpath' ,
100
110
help = 'a directory to search for the shared http_parser DLL' )
101
111
102
- parser .add_option ('--shared-libuv' ,
112
+ shared_optgroup .add_option ('--shared-libuv' ,
103
113
action = 'store_true' ,
104
114
dest = 'shared_libuv' ,
105
115
help = 'link to a shared libuv DLL instead of static linking' )
106
116
107
- parser .add_option ('--shared-libuv-includes' ,
117
+ shared_optgroup .add_option ('--shared-libuv-includes' ,
108
118
action = 'store' ,
109
119
dest = 'shared_libuv_includes' ,
110
120
help = 'directory containing libuv header files' )
111
121
112
- parser .add_option ('--shared-libuv-libname' ,
122
+ shared_optgroup .add_option ('--shared-libuv-libname' ,
113
123
action = 'store' ,
114
124
dest = 'shared_libuv_libname' ,
115
125
default = 'uv' ,
116
126
help = 'alternative lib name to link to [default: %default]' )
117
127
118
- parser .add_option ('--shared-libuv-libpath' ,
128
+ shared_optgroup .add_option ('--shared-libuv-libpath' ,
119
129
action = 'store' ,
120
130
dest = 'shared_libuv_libpath' ,
121
131
help = 'a directory to search for the shared libuv DLL' )
122
132
123
- parser .add_option ('--shared-openssl' ,
133
+ shared_optgroup .add_option ('--shared-openssl' ,
124
134
action = 'store_true' ,
125
135
dest = 'shared_openssl' ,
126
136
help = 'link to a shared OpenSSl DLL instead of static linking' )
127
137
128
- parser .add_option ('--shared-openssl-includes' ,
138
+ shared_optgroup .add_option ('--shared-openssl-includes' ,
129
139
action = 'store' ,
130
140
dest = 'shared_openssl_includes' ,
131
141
help = 'directory containing OpenSSL header files' )
132
142
133
- parser .add_option ('--shared-openssl-libname' ,
143
+ shared_optgroup .add_option ('--shared-openssl-libname' ,
134
144
action = 'store' ,
135
145
dest = 'shared_openssl_libname' ,
136
146
default = 'crypto,ssl' ,
137
147
help = 'alternative lib name to link to [default: %default]' )
138
148
139
- parser .add_option ('--shared-openssl-libpath' ,
149
+ shared_optgroup .add_option ('--shared-openssl-libpath' ,
140
150
action = 'store' ,
141
151
dest = 'shared_openssl_libpath' ,
142
152
help = 'a directory to search for the shared OpenSSL DLLs' )
143
153
144
- parser .add_option ('--shared-zlib' ,
154
+ shared_optgroup .add_option ('--shared-zlib' ,
145
155
action = 'store_true' ,
146
156
dest = 'shared_zlib' ,
147
157
help = 'link to a shared zlib DLL instead of static linking' )
148
158
149
- parser .add_option ('--shared-zlib-includes' ,
159
+ shared_optgroup .add_option ('--shared-zlib-includes' ,
150
160
action = 'store' ,
151
161
dest = 'shared_zlib_includes' ,
152
162
help = 'directory containing zlib header files' )
153
163
154
- parser .add_option ('--shared-zlib-libname' ,
164
+ shared_optgroup .add_option ('--shared-zlib-libname' ,
155
165
action = 'store' ,
156
166
dest = 'shared_zlib_libname' ,
157
167
default = 'z' ,
158
168
help = 'alternative lib name to link to [default: %default]' )
159
169
160
- parser .add_option ('--shared-zlib-libpath' ,
170
+ shared_optgroup .add_option ('--shared-zlib-libpath' ,
161
171
action = 'store' ,
162
172
dest = 'shared_zlib_libpath' ,
163
173
help = 'a directory to search for the shared zlib DLL' )
164
174
175
+ parser .add_option_group (shared_optgroup )
176
+
165
177
# TODO document when we've decided on what the tracing API and its options will
166
178
# look like
167
179
parser .add_option ('--systemtap-includes' ,
@@ -225,33 +237,38 @@ parser.add_option('--with-etw',
225
237
dest = 'with_etw' ,
226
238
help = 'build with ETW (default is true on Windows)' )
227
239
228
- parser .add_option ('--download ' ,
240
+ parser .add_option ('--with-intl ' ,
229
241
action = 'store' ,
230
- dest = 'download_list' ,
231
- help = nodedownload .help ())
242
+ dest = 'with_intl' ,
243
+ default = 'none' ,
244
+ choices = valid_intl_modes ,
245
+ help = 'Intl mode (valid choices: {0}) [default: %default]' .format (
246
+ ', ' .join (valid_intl_modes )))
232
247
233
- parser .add_option ('--with-icu-path' ,
248
+ intl_optgroup .add_option ('--with-icu-path' ,
234
249
action = 'store' ,
235
250
dest = 'with_icu_path' ,
236
251
help = 'Path to icu.gyp (ICU i18n, Chromium version only.)' )
237
252
238
- parser .add_option ('--with-icu-locales' ,
253
+ intl_optgroup .add_option ('--with-icu-locales' ,
239
254
action = 'store' ,
240
255
dest = 'with_icu_locales' ,
241
256
default = 'root,en' ,
242
257
help = 'Comma-separated list of locales for "small-icu". "root" is assumed. '
243
258
'[default: %default]' )
244
259
245
- parser .add_option ('--with-intl' ,
246
- action = 'store' ,
247
- dest = 'with_intl' ,
248
- help = 'Intl mode: none, full-icu, small-icu [default: none]' )
249
-
250
- parser .add_option ('--with-icu-source' ,
260
+ intl_optgroup .add_option ('--with-icu-source' ,
251
261
action = 'store' ,
252
262
dest = 'with_icu_source' ,
253
263
help = 'Intl mode: optional local path to icu/ dir, or path/URL of icu source archive.' )
254
264
265
+ intl_optgroup .add_option ('--download' ,
266
+ action = 'store' ,
267
+ dest = 'download_list' ,
268
+ help = nodedownload .help ())
269
+
270
+ parser .add_option_group (intl_optgroup )
271
+
255
272
parser .add_option ('--with-perfctr' ,
256
273
action = 'store_true' ,
257
274
dest = 'with_perfctr' ,
@@ -812,7 +829,7 @@ def configure_intl(o):
812
829
with_intl = options .with_intl
813
830
with_icu_source = options .with_icu_source
814
831
have_icu_path = bool (options .with_icu_path )
815
- if have_icu_path and with_intl :
832
+ if have_icu_path and with_intl != 'none' :
816
833
print 'Error: Cannot specify both --with-icu-path and --with-intl'
817
834
sys .exit (1 )
818
835
elif have_icu_path :
@@ -850,11 +867,6 @@ def configure_intl(o):
850
867
# use the "system" .gyp
851
868
o ['variables' ]['icu_gyp_path' ] = 'tools/icu/icu-system.gyp'
852
869
return
853
- else :
854
- print 'Error: unknown value --with-intl=%s' % with_intl
855
- sys .exit (1 )
856
- # Note: non-ICU implementations could use other 'with_intl'
857
- # values.
858
870
859
871
# this is just the 'deps' dir. Used for unpacking.
860
872
icu_parent_path = os .path .join (root_dir , 'deps' )
0 commit comments