From bb2e92171fb95c911572ef58a6110c1c53fdd34c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 21 Jan 2016 17:05:04 -0800 Subject: [PATCH] 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! --- configure | 18 +++++++++++++++--- src/bootstrap/mk/Makefile.in | 23 +++++++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 src/bootstrap/mk/Makefile.in diff --git a/configure b/configure index 631c5f49f06..7958ac9bfcf 100755 --- a/configure +++ b/configure @@ -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 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 rustbuild 0 "use the rust and cargo based build system" # Optimization and debugging options. These may be overridden by the release channel, etc. opt_nosave optimize 1 "build optimized rust code" @@ -1422,7 +1423,7 @@ done step_msg "configuring submodules" # 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 cd ${CFG_SRC_DIR} @@ -1481,7 +1482,11 @@ do ;; 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 LLVM_BUILD_DIR=${CFG_BUILD_DIR}$t/llvm if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ] @@ -1812,8 +1817,15 @@ do putvar $CFG_LLVM_INST_DIR done +if [ -n "$CFG_ENABLE_RUSTBUILD" ] +then + INPUT_MAKEFILE=src/bootstrap/mk/Makefile.in +else + INPUT_MAKEFILE=Makefile.in +fi + 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 rm -f config.tmp touch config.stamp diff --git a/src/bootstrap/mk/Makefile.in b/src/bootstrap/mk/Makefile.in new file mode 100644 index 00000000000..1157346d774 --- /dev/null +++ b/src/bootstrap/mk/Makefile.in @@ -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 or the MIT license +# , 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)