Add support for building with a static libstd for testing static crate support.

This commit is contained in:
Rafael Ávila de Espíndola 2011-07-20 16:02:36 -04:00
parent 7a919da04e
commit 88894b6f9c
4 changed files with 23 additions and 2 deletions

View File

@ -49,6 +49,12 @@ CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm)
CFG_STDLIB :=$(call CFG_LIB_NAME,std) CFG_STDLIB :=$(call CFG_LIB_NAME,std)
CFG_LIBRUSTC :=$(call CFG_LIB_NAME,rustc) CFG_LIBRUSTC :=$(call CFG_LIB_NAME,rustc)
ifdef CFG_DISABLE_SHAREDSTD
CFG_STDLIB_DEFAULT := lib/libstd.rlib
else
CFG_STDLIB_DEFAULT := $(CFG_STDLIB)
endif
# version-string calculation # version-string calculation
CFG_GIT_DIR := $(CFG_SRC_DIR).git CFG_GIT_DIR := $(CFG_SRC_DIR).git
CFG_VERSION = prerelease CFG_VERSION = prerelease
@ -156,15 +162,26 @@ LLC := $(CFG_LLVM_BINDIR)/llc$(X)
###################################################################### ######################################################################
define SREQ define SREQ
ifdef CFG_DISABLE_SHAREDSTD
SREQ$(1) = stage$(1)/rustc$(X) \ SREQ$(1) = stage$(1)/rustc$(X) \
stage$(1)/$$(CFG_RUNTIME) \ stage$(1)/$$(CFG_RUNTIME) \
stage$(1)/$$(CFG_STDLIB) \ stage$(1)/$$(CFG_STDLIB_DEFAULT) \
stage$(1)/$$(CFG_RUSTLLVM) \
stage$(1)/lib/glue.o \
stage$(1)/lib/main.o \
stage$(1)/lib/$$(CFG_RUNTIME) \
$$(MKFILES)
else
SREQ$(1) = stage$(1)/rustc$(X) \
stage$(1)/$$(CFG_RUNTIME) \
stage$(1)/$$(CFG_STDLIB_DEFAULT) \
stage$(1)/$$(CFG_RUSTLLVM) \ stage$(1)/$$(CFG_RUSTLLVM) \
stage$(1)/lib/glue.o \ stage$(1)/lib/glue.o \
stage$(1)/lib/main.o \ stage$(1)/lib/main.o \
stage$(1)/lib/$$(CFG_RUNTIME) \ stage$(1)/lib/$$(CFG_RUNTIME) \
stage$(1)/lib/$$(CFG_STDLIB) \ stage$(1)/lib/$$(CFG_STDLIB) \
$$(MKFILES) $$(MKFILES)
endif
STAGE$(1) := $$(Q)$$(call CFG_RUN_TARG,stage$(1),stage$(1), \ STAGE$(1) := $$(Q)$$(call CFG_RUN_TARG,stage$(1),stage$(1), \
$$(CFG_VALGRIND_COMPILE) stage$(1)/rustc$$(X) \ $$(CFG_VALGRIND_COMPILE) stage$(1)/rustc$$(X) \

1
configure vendored
View File

@ -162,6 +162,7 @@ else
step_msg "processing $CFG_SELF args" step_msg "processing $CFG_SELF args"
fi fi
opt sharedstd 1 "build libstd as a shared library"
opt valgrind 1 "run tests with valgrind" opt valgrind 1 "run tests with valgrind"
opt docs 1 "build documentation" opt docs 1 "build documentation"
opt optimize 1 "build optimized rust code" opt optimize 1 "build optimized rust code"

View File

@ -33,3 +33,6 @@ stage0/lib/$(CFG_RUNTIME): stage0/rustc$(X)
stage0/lib/$(CFG_STDLIB): stage0/rustc$(X) stage0/lib/$(CFG_STDLIB): stage0/rustc$(X)
$(Q)touch $@ $(Q)touch $@
stage0/lib/libstd.rlib: stage0/rustc$(X)
$(Q)touch $@

View File

@ -23,7 +23,7 @@ stage$(2)/%.o: stage$(2)/%.s
stage$(2)/rustc$$(X): $$(COMPILER_CRATE) $$(COMPILER_INPUTS) \ stage$(2)/rustc$$(X): $$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
stage$(2)/$$(CFG_RUNTIME) \ stage$(2)/$$(CFG_RUNTIME) \
stage$(2)/$$(CFG_STDLIB) \ stage$(1)/$$(CFG_STDLIB_DEFAULT) \
stage$(2)/$$(CFG_RUSTLLVM) \ stage$(2)/$$(CFG_RUSTLLVM) \
$$(SREQ$(1)) $$(SREQ$(1))
@$$(call E, compile_and_link: $$@) @$$(call E, compile_and_link: $$@)