@@ -151,22 +151,11 @@ validate_opt () {
151
151
done
152
152
}
153
153
154
- # `valopt OPTION_NAME DEFAULT DOC` extracts a string-valued option
155
- # from command line, using provided default value for the option if
156
- # not present, and saves it to the generated config.mk.
157
- #
158
- # `valopt_nosave` is much the same, except that it does not save the
159
- # result to config.mk (instead the script should use `putvar` itself
160
- # later on to save it). `valopt_core` is the core upon which the
161
- # other two are built.
162
-
163
- valopt_core () {
164
- VAL_OPTIONS=" $VAL_OPTIONS $2 "
154
+ valopt () {
155
+ VAL_OPTIONS=" $VAL_OPTIONS $1 "
165
156
166
- local SAVE=$1
167
- local OP=$2
168
- local DEFAULT=$3
169
- shift
157
+ local OP=$1
158
+ local DEFAULT=$2
170
159
shift
171
160
shift
172
161
local DOC=" $* "
@@ -183,10 +172,7 @@ valopt_core() {
183
172
eval $V =$val
184
173
fi
185
174
done
186
- if [ " $SAVE " = " save" ]
187
- then
188
- putvar $V
189
- fi
175
+ putvar $V
190
176
else
191
177
if [ -z " $DEFAULT " ]
192
178
then
@@ -197,30 +183,11 @@ valopt_core() {
197
183
fi
198
184
}
199
185
200
- valopt_nosave () {
201
- valopt_core nosave " $@ "
202
- }
203
-
204
- valopt () {
205
- valopt_core save " $@ "
206
- }
207
-
208
- # `opt OPTION_NAME DEFAULT DOC` extracts a boolean-valued option from
209
- # command line, using the provided default value (0/1) for the option
210
- # if not present, and saves it to the generated config.mk.
211
- #
212
- # `opt_nosave` is much the same, except that it does not save the
213
- # result to config.mk (instead the script should use `putvar` itself
214
- # later on to save it). `opt_core` is the core upon which the other
215
- # two are built.
216
-
217
- opt_core () {
218
- BOOL_OPTIONS=" $BOOL_OPTIONS $2 "
186
+ opt () {
187
+ BOOL_OPTIONS=" $BOOL_OPTIONS $1 "
219
188
220
- local SAVE=$1
221
- local OP=$2
222
- local DEFAULT=$3
223
- shift
189
+ local OP=$1
190
+ local DEFAULT=$2
224
191
shift
225
192
shift
226
193
local DOC=" $* "
@@ -244,10 +211,7 @@ opt_core() {
244
211
FLAG=$( echo $FLAG | tr ' a-z' ' A-Z' )
245
212
local V=" CFG_${FLAG} _${OP} "
246
213
eval $V =1
247
- if [ " $SAVE " = " save" ]
248
- then
249
- putvar $V
250
- fi
214
+ putvar $V
251
215
fi
252
216
done
253
217
else
@@ -259,14 +223,6 @@ opt_core() {
259
223
fi
260
224
}
261
225
262
- opt_nosave () {
263
- opt_core nosave " $@ "
264
- }
265
-
266
- opt () {
267
- opt_core save " $@ "
268
- }
269
-
270
226
envopt () {
271
227
local NAME=$1
272
228
local V=" CFG_${NAME} "
@@ -466,40 +422,38 @@ opt llvm-assertions 1 "build LLVM with assertions"
466
422
opt debug 1 " build with extra debug fun"
467
423
opt ratchet-bench 0 " ratchet benchmarks"
468
424
opt fast-make 0 " use .gitmodules as timestamp for submodule deps"
425
+ opt manage-submodules 1 " let the build manage the git submodules"
469
426
opt mingw-cross 0 " cross-compile for win32 using mingw"
427
+ opt clang 0 " prefer clang to gcc for building the runtime"
470
428
opt ccache 0 " invoke gcc/clang via ccache to reuse object files between builds"
471
429
opt local-rust 0 " use an installed rustc rather than downloading a snapshot"
430
+ opt inject-std-version 1 " inject the current compiler version of libstd into programs"
472
431
opt llvm-static-stdcpp 0 " statically link to libstdc++ for LLVM"
473
432
opt rpath 0 " build rpaths into rustc itself"
474
433
opt nightly 0 " build nightly packages"
475
434
opt verify-install 1 " verify installed binaries work"
435
+ opt jemalloc 1 " build liballoc with jemalloc"
476
436
# This is used by the automation to produce single-target nightlies
477
437
opt dist-host-only 0 " only install bins for the host architecture"
478
- opt inject-std-version 1 " inject the current compiler version of libstd into programs"
479
- opt jemalloc 1 " build liballoc with jemalloc"
438
+ valopt prefix " /usr/local" " set installation prefix"
439
+ valopt local-rust-root " /usr/local" " set prefix for local rust binary"
440
+ valopt llvm-root " " " set LLVM root"
441
+ valopt jemalloc-root " " " set directory where libjemalloc_pic.a is located"
442
+ valopt android-cross-path " /opt/ndk_standalone" " Android NDK standalone path"
443
+ valopt mingw32-cross-path " " " MinGW32 cross compiler path"
444
+
445
+ valopt build " ${DEFAULT_BUILD} " " GNUs ./configure syntax LLVM build triple"
446
+ valopt host " ${CFG_BUILD} " " GNUs ./configure syntax LLVM host triples"
447
+ valopt target " ${CFG_HOST} " " GNUs ./configure syntax LLVM target triples"
480
448
481
449
valopt localstatedir " /var/lib" " local state directory"
482
450
valopt sysconfdir " /etc" " install system configuration files"
483
451
484
452
valopt datadir " ${CFG_PREFIX} /share" " install data"
485
453
valopt infodir " ${CFG_PREFIX} /share/info" " install additional info"
486
- valopt llvm-root " " " set LLVM root"
487
- valopt jemalloc-root " " " set directory where libjemalloc_pic.a is located"
488
- valopt build " ${DEFAULT_BUILD} " " GNUs ./configure syntax LLVM build triple"
489
- valopt android-cross-path " /opt/ndk_standalone" " Android NDK standalone path"
490
- valopt mingw32-cross-path " " " MinGW32 cross compiler path"
491
-
492
- # Many of these are saved below during the "writing configuration" step
493
- # (others are conditionally saved).
494
- opt_nosave manage-submodules 1 " let the build manage the git submodules"
495
- opt_nosave clang 0 " prefer clang to gcc for building the runtime"
454
+ valopt mandir " ${CFG_PREFIX} /share/man" " install man pages in PATH"
496
455
497
- valopt_nosave prefix " /usr/local" " set installation prefix"
498
- valopt_nosave local-rust-root " /usr/local" " set prefix for local rust binary"
499
- valopt_nosave host " ${CFG_BUILD} " " GNUs ./configure syntax LLVM host triples"
500
- valopt_nosave target " ${CFG_HOST} " " GNUs ./configure syntax LLVM target triples"
501
- valopt_nosave mandir " ${CFG_PREFIX} /share/man" " install man pages in PATH"
502
- valopt_nosave release-channel " dev" " the name of the release channel to build"
456
+ valopt release-channel " dev" " the name of the release channel to build"
503
457
504
458
# On windows we just store the libraries in the bin directory because
505
459
# there's no rpath. This is where the build system itself puts libraries;
537
491
if [ ! -z " $CFG_ENABLE_NIGHTLY " ]
538
492
then
539
493
CFG_RELEASE_CHANNEL=nightly
494
+ putvar CFG_RELEASE_CHANNEL
540
495
fi
541
- putvar CFG_RELEASE_CHANNEL
542
496
543
497
step_msg " looking for build programs"
544
498
@@ -651,27 +605,17 @@ then
651
605
err " no local rust to use"
652
606
fi
653
607
654
- CMD=" ${CFG_LOCAL_RUST_ROOT} /bin/rustc${BIN_SUF} "
655
- LRV=` $CMD --version`
656
- if [ $? -ne 0 ]
657
- then
658
- step_msg " failure while running $CMD --version"
659
- exit 1
660
- fi
608
+ LRV=` ${CFG_LOCAL_RUST_ROOT} /bin/rustc${BIN_SUF} --version`
661
609
step_msg " using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV "
662
610
putvar CFG_LOCAL_RUST_ROOT
663
- else
664
- if [ ! -z " $CFG_LOCAL_RUST_ROOT " ]
665
- then
666
- warn " Use of --local-rust-root without --enable-local-rust"
667
- fi
668
611
fi
669
612
670
613
# Force freebsd to build with clang; gcc doesn't like us there
671
614
if [ $CFG_OSTYPE = unknown-freebsd ]
672
615
then
673
616
step_msg " on FreeBSD, forcing use of clang"
674
617
CFG_ENABLE_CLANG=1
618
+ putvar CFG_ENABLE_CLANG
675
619
fi
676
620
677
621
if [ -z " $CFG_ENABLE_CLANG " -a -z " $CFG_GCC " ]
@@ -688,10 +632,12 @@ then
688
632
then
689
633
step_msg " on OS X 10.9, forcing use of clang"
690
634
CFG_ENABLE_CLANG=1
635
+ putvar CFG_ENABLE_CLANG
691
636
else
692
637
if [ $( " $CFG_GCC " --version 2>&1 | grep -c ' 4\.[0-6]' ) -ne 0 ]; then
693
638
step_msg " older GCC found, using clang instead"
694
639
CFG_ENABLE_CLANG=1
640
+ putvar CFG_ENABLE_CLANG
695
641
else
696
642
# on OS X, with xcode 5 and newer, certain developers may have
697
643
# cc, gcc and g++ point to a mixture of clang and gcc
@@ -717,13 +663,6 @@ then
717
663
fi
718
664
fi
719
665
720
- # Okay, at this point, we have made up our minds about whether we are
721
- # going to force CFG_ENABLE_CLANG or not; save the setting if so.
722
- if [ ! -z " $CFG_ENABLE_CLANG " ]
723
- then
724
- putvar CFG_ENABLE_CLANG
725
- fi
726
-
727
666
if [ ! -z " $CFG_LLVM_ROOT " -a -e " $CFG_LLVM_ROOT /bin/llvm-config" ]
728
667
then
729
668
step_msg " using custom LLVM at $CFG_LLVM_ROOT "
@@ -842,7 +781,7 @@ CFG_PREFIX=${CFG_PREFIX%/}
842
781
CFG_MANDIR=${CFG_MANDIR%/ }
843
782
CFG_HOST=" $( echo $CFG_HOST | tr ' ,' ' ' ) "
844
783
CFG_TARGET=" $( echo $CFG_TARGET | tr ' ,' ' ' ) "
845
- CFG_SUPPORTED_TARGET=" $( grep ^CC_ * = * ${CFG_SRC_DIR} mk/platform.mk | sed -e ' s/^CC_// ' -e ' s/\([^=]*\).*/\1/ ' | xargs ) "
784
+ CFG_SUPPORTED_TARGET=" $( ls ${CFG_SRC_DIR} mk/cfg ) "
846
785
847
786
# copy host-triples to target-triples so that hosts are a subset of targets
848
787
V_TEMP=" "
989
928
make_dir $h /test/doc-guide-container
990
929
make_dir $h /test/doc-guide-tasks
991
930
make_dir $h /test/doc-guide-plugin
992
- make_dir $h /test/doc-guide-crates
993
931
make_dir $h /test/doc-rust
994
932
done
995
933
@@ -1265,11 +1203,18 @@ putvar CFG_OSTYPE
1265
1203
putvar CFG_CPUTYPE
1266
1204
putvar CFG_CONFIGURE_ARGS
1267
1205
putvar CFG_PREFIX
1206
+ putvar CFG_BUILD
1268
1207
putvar CFG_HOST
1269
1208
putvar CFG_TARGET
1209
+ putvar CFG_LIBDIR
1270
1210
putvar CFG_LIBDIR_RELATIVE
1271
1211
putvar CFG_DISABLE_MANAGE_SUBMODULES
1212
+ putvar CFG_ANDROID_CROSS_PATH
1213
+ putvar CFG_MINGW32_CROSS_PATH
1272
1214
putvar CFG_MANDIR
1215
+ putvar CFG_DISABLE_INJECT_STD_VERSION
1216
+ putvar CFG_JEMALLOC_ROOT
1217
+ putvar CFG_DISABLE_JEMALLOC
1273
1218
1274
1219
# Avoid spurious warnings from clang by feeding it original source on
1275
1220
# ccache-miss rather than preprocessed input.
@@ -1292,6 +1237,7 @@ then
1292
1237
putvar CFG_PANDOC
1293
1238
fi
1294
1239
1240
+ putvar CFG_LLVM_ROOT
1295
1241
putvar CFG_LLVM_SRC_DIR
1296
1242
1297
1243
for t in $CFG_HOST
0 commit comments