mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 19:58:32 +00:00
configure: Add an option to use the cargo build system
This commit adds a `--enable-rustbuild` option to the configure script which will copy a different `Makefile.in` into place to intercept all `make` invocations. Currently this makefile only has one target, but it's expected to be filled out quite a bit over time!
This commit is contained in:
parent
34f7364332
commit
bb2e92171f
18
configure
vendored
18
configure
vendored
@ -606,6 +606,7 @@ opt stage0-landing-pads 1 "enable landing pads during bootstrap with stage0"
|
|||||||
opt dist-host-only 0 "only install bins for the host architecture"
|
opt dist-host-only 0 "only install bins for the host architecture"
|
||||||
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
|
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
|
||||||
opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
|
opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
|
||||||
|
opt rustbuild 0 "use the rust and cargo based build system"
|
||||||
|
|
||||||
# Optimization and debugging options. These may be overridden by the release channel, etc.
|
# Optimization and debugging options. These may be overridden by the release channel, etc.
|
||||||
opt_nosave optimize 1 "build optimized rust code"
|
opt_nosave optimize 1 "build optimized rust code"
|
||||||
@ -1422,7 +1423,7 @@ done
|
|||||||
step_msg "configuring submodules"
|
step_msg "configuring submodules"
|
||||||
|
|
||||||
# Have to be in the top of src directory for this
|
# Have to be in the top of src directory for this
|
||||||
if [ -z $CFG_DISABLE_MANAGE_SUBMODULES ]
|
if [ -z $CFG_DISABLE_MANAGE_SUBMODULES ] && [ -z $CFG_ENABLE_RUSTBUILD ]
|
||||||
then
|
then
|
||||||
cd ${CFG_SRC_DIR}
|
cd ${CFG_SRC_DIR}
|
||||||
|
|
||||||
@ -1481,7 +1482,11 @@ do
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -z $CFG_LLVM_ROOT ]
|
if [ -n "$CFG_ENABLE_RUSTBUILD" ]
|
||||||
|
then
|
||||||
|
msg "not configuring LLVM, rustbuild in use"
|
||||||
|
do_reconfigure=0
|
||||||
|
elif [ -z $CFG_LLVM_ROOT ]
|
||||||
then
|
then
|
||||||
LLVM_BUILD_DIR=${CFG_BUILD_DIR}$t/llvm
|
LLVM_BUILD_DIR=${CFG_BUILD_DIR}$t/llvm
|
||||||
if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]
|
if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]
|
||||||
@ -1812,8 +1817,15 @@ do
|
|||||||
putvar $CFG_LLVM_INST_DIR
|
putvar $CFG_LLVM_INST_DIR
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -n "$CFG_ENABLE_RUSTBUILD" ]
|
||||||
|
then
|
||||||
|
INPUT_MAKEFILE=src/bootstrap/mk/Makefile.in
|
||||||
|
else
|
||||||
|
INPUT_MAKEFILE=Makefile.in
|
||||||
|
fi
|
||||||
|
|
||||||
msg
|
msg
|
||||||
copy_if_changed ${CFG_SRC_DIR}Makefile.in ./Makefile
|
copy_if_changed ${CFG_SRC_DIR}${INPUT_MAKEFILE} ./Makefile
|
||||||
move_if_changed config.tmp config.mk
|
move_if_changed config.tmp config.mk
|
||||||
rm -f config.tmp
|
rm -f config.tmp
|
||||||
touch config.stamp
|
touch config.stamp
|
||||||
|
23
src/bootstrap/mk/Makefile.in
Normal file
23
src/bootstrap/mk/Makefile.in
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Copyright 20126 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
# file at the top-level directory of this distribution and at
|
||||||
|
# http://rust-lang.org/COPYRIGHT.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
# option. This file may not be copied, modified, or distributed
|
||||||
|
# except according to those terms.
|
||||||
|
|
||||||
|
include config.mk
|
||||||
|
include $(CFG_SRC_DIR)mk/util.mk
|
||||||
|
|
||||||
|
ifdef VERBOSE
|
||||||
|
BOOTSTRAP_ARGS := -v
|
||||||
|
else
|
||||||
|
BOOTSTRAP_ARGS :=
|
||||||
|
endif
|
||||||
|
|
||||||
|
BOOTSTRAP := $(CFG_PYTHON) $(CFG_SRC_DIR)src/bootstrap/bootstrap.py $(BOOTSTRAP_ARGS)
|
||||||
|
|
||||||
|
all:
|
||||||
|
$(Q)$(BOOTSTRAP)
|
Loading…
Reference in New Issue
Block a user