Skip to content

Commit

Permalink
Add support for building with a static libstd for testing static crat…
Browse files Browse the repository at this point in the history
…e support.
  • Loading branch information
cixtor committed Jul 20, 2011
1 parent 7a919da commit 88894b6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
19 changes: 18 additions & 1 deletion Makefile.in
Expand Up @@ -49,6 +49,12 @@ CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm)
CFG_STDLIB :=$(call CFG_LIB_NAME,std)
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
CFG_GIT_DIR := $(CFG_SRC_DIR).git
CFG_VERSION = prerelease
Expand Down Expand Up @@ -156,15 +162,26 @@ LLC := $(CFG_LLVM_BINDIR)/llc$(X)
######################################################################

define SREQ
ifdef CFG_DISABLE_SHAREDSTD
SREQ$(1) = stage$(1)/rustc$(X) \
stage$(1)/$$(CFG_RUNTIME) \
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) \
stage$(1)/$$(CFG_STDLIB_DEFAULT) \
stage$(1)/$$(CFG_RUSTLLVM) \
stage$(1)/lib/glue.o \
stage$(1)/lib/main.o \
stage$(1)/lib/$$(CFG_RUNTIME) \
stage$(1)/lib/$$(CFG_STDLIB) \
$$(MKFILES)
endif

STAGE$(1) := $$(Q)$$(call CFG_RUN_TARG,stage$(1),stage$(1), \
$$(CFG_VALGRIND_COMPILE) stage$(1)/rustc$$(X) \
Expand Down
1 change: 1 addition & 0 deletions configure
Expand Up @@ -162,6 +162,7 @@ else
step_msg "processing $CFG_SELF args"
fi

opt sharedstd 1 "build libstd as a shared library"
opt valgrind 1 "run tests with valgrind"
opt docs 1 "build documentation"
opt optimize 1 "build optimized rust code"
Expand Down
3 changes: 3 additions & 0 deletions mk/stage0.mk
Expand Up @@ -33,3 +33,6 @@ stage0/lib/$(CFG_RUNTIME): stage0/rustc$(X)

stage0/lib/$(CFG_STDLIB): stage0/rustc$(X)
$(Q)touch $@

stage0/lib/libstd.rlib: stage0/rustc$(X)
$(Q)touch $@
2 changes: 1 addition & 1 deletion mk/stageN.mk
Expand Up @@ -23,7 +23,7 @@ stage$(2)/%.o: stage$(2)/%.s

stage$(2)/rustc$$(X): $$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
stage$(2)/$$(CFG_RUNTIME) \
stage$(2)/$$(CFG_STDLIB) \
stage$(1)/$$(CFG_STDLIB_DEFAULT) \
stage$(2)/$$(CFG_RUSTLLVM) \
$$(SREQ$(1))
@$$(call E, compile_and_link: $$@)
Expand Down

0 comments on commit 88894b6

Please sign in to comment.