Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CFG_LIBDIR specified by target triples in platform.mk #5577

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export CFG_BUILD_TRIPLE
export CFG_LLVM_ROOT
export CFG_ENABLE_MINGW_CROSS
export CFG_PREFIX
export CFG_LIBDIR
export CFG_DEFAULT_LIB_DIR

######################################################################
# Subprograms
Expand All @@ -330,12 +330,12 @@ define SREQ
# Destinations of artifacts for the host compiler
HROOT$(1)_H_$(3) = $(3)/stage$(1)
HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR)
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIB_DIR_$(CFG_BUILD_TRIPLE))

# Destinations of artifacts for target architectures
TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustc/$(2)
TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin
TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/$$(CFG_LIBDIR)
TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/$$(CFG_LIB_DIR_$(CFG_BUILD_TRIPLE))

# The name of the core and standard libraries used by rustc
ifdef CFG_DISABLE_SHAREDSTD
Expand Down
17 changes: 5 additions & 12 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -673,14 +673,7 @@ do
done
done

# On windows we just store the libraries in the bin directory because
# there's no rpath
# FIXME: Thise needs to parameterized over target triples. Do it in platform.mk
CFG_LIBDIR=lib
if [ "$CFG_OSTYPE" = "pc-mingw32" ]
then
CFG_LIBDIR=bin
fi
CFG_DEFAULT_LIB_DIR="$(grep ^CFG_LIB_DIR_$CFG_BUILD_TRIPLE $CFG_SRC_DIR/mk/platform.mk | sed 's,^[^=]*=,,' )"

for h in $CFG_HOST_TRIPLES
do
Expand All @@ -692,13 +685,13 @@ do
make_dir $h/stage$i/bin

# host lib dir
make_dir $h/stage$i/$CFG_LIBDIR
make_dir $h/stage$i/$CFG_DEFAULT_LIB_DIR

# target bin dir
make_dir $h/stage$i/$CFG_LIBDIR/rustc/$t/bin
make_dir $h/stage$i/$CFG_DEFAULT_LIB_DIR/rustc/$t/bin

# target lib dir
make_dir $h/stage$i/$CFG_LIBDIR/rustc/$t/$CFG_LIBDIR
make_dir $h/stage$i/$CFG_DEFAULT_LIB_DIR/rustc/$t/$CFG_DEFAULT_LIB_DIR
done
done

Expand Down Expand Up @@ -912,7 +905,7 @@ putvar CFG_BUILD_TRIPLE
putvar CFG_HOST_TRIPLES
putvar CFG_TARGET_TRIPLES
putvar CFG_C_COMPILER
putvar CFG_LIBDIR
putvar CFG_DEFAULT_LIB_DIR
putvar CFG_DISABLE_MANAGE_SUBMODULES
putvar CFG_ANDROID_CROSS_PATH
putvar CFG_MINGW32_CROSS_PATH
Expand Down
4 changes: 2 additions & 2 deletions mk/install.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ISTAGE = 2

PREFIX_ROOT = $(CFG_PREFIX)
PREFIX_BIN = $(PREFIX_ROOT)/bin
PREFIX_LIB = $(PREFIX_ROOT)/$(CFG_LIBDIR)
PREFIX_LIB = $(PREFIX_ROOT)/$(CFG_LIB_DIR_$(CFG_BUILD_TRIPLE))

define INSTALL_PREPARE_N
# $(1) is the target triple
Expand All @@ -41,7 +41,7 @@ TL$(1)$(2) = $$(TLIB$$(ISTAGE)_T_$(1)_H_$(2))
# PT{R,B,L} == Prefix Target {Root, Bin, Lib}
PTR$(1)$(2) = $$(PREFIX_LIB)/rustc/$(1)
PTB$(1)$(2) = $$(PTR$(1)$(2))/bin
PTL$(1)$(2) = $$(PTR$(1)$(2))/$(CFG_LIBDIR)
PTL$(1)$(2) = $$(PTR$(1)$(2))/$(CFG_LIB_DIR_$(CFG_BUILD_TRIPLE))

endef

Expand Down
8 changes: 8 additions & 0 deletions mk/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ CC_x86_64-unknown-linux-gnu=$(CC)
CXX_x86_64-unknown-linux-gnu=$(CXX)
CPP_x86_64-unknown-linux-gnu=$(CPP)
AR_x86_64-unknown-linux-gnu=$(AR)
CFG_LIB_DIR_x86_64-unknown-linux-gnu=lib
CFG_LIB_NAME_x86_64-unknown-linux-gnu=lib$(1).so
CFG_LIB_GLOB_x86_64-unknown-linux-gnu=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_x86_64-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
Expand All @@ -144,6 +145,7 @@ CC_i686-unknown-linux-gnu=$(CC)
CXX_i686-unknown-linux-gnu=$(CXX)
CPP_i686-unknown-linux-gnu=$(CPP)
AR_i686-unknown-linux-gnu=$(AR)
CFG_LIB_DIR_686-unknown-linux-gnu=lib
CFG_LIB_NAME_i686-unknown-linux-gnu=lib$(1).so
CFG_LIB_GLOB_i686-unknown-linux-gnu=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_i686-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
Expand All @@ -170,6 +172,7 @@ CC_x86_64-apple-darwin=$(CC)
CXX_x86_64-apple-darwin=$(CXX)
CPP_x86_64-apple-darwin=$(CPP)
AR_x86_64-apple-darwin=$(AR)
CFG_LIB_DIR_x86_64-apple-darwin=lib
CFG_LIB_NAME_x86_64-apple-darwin=lib$(1).dylib
CFG_LIB_GLOB_x86_64-apple-darwin=lib$(1)-*.dylib
CFG_LIB_DSYM_GLOB_x86_64-apple-darwin=lib$(1)-*.dylib.dSYM
Expand All @@ -195,6 +198,7 @@ CC_i686-apple-darwin=$(CC)
CXX_i686-apple-darwin=$(CXX)
CPP_i686-apple-darwin=$(CPP)
AR_i686-apple-darwin=$(AR)
CFG_LIB_DIR_i686-apple-darwin=lib
CFG_LIB_NAME_i686-apple-darwin=lib$(1).dylib
CFG_LIB_GLOB_i686-apple-darwin=lib$(1)-*.dylib
CFG_LIB_DSYM_GLOB_i686-apple-darwin=lib$(1)-*.dylib.dSYM
Expand All @@ -220,6 +224,7 @@ CC_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-gcc
CXX_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-g++
CPP_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-gcc
AR_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-ar
CFG_LIB_DIR_arm-linux-androideabi=lib
CFG_LIB_NAME_arm-linux-androideabi=lib$(1).so
CFG_LIB_GLOB_arm-linux-androideabi=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_arm-linux-androideabi=lib$(1)-*.dylib.dSYM
Expand All @@ -246,6 +251,7 @@ CC_i686-pc-mingw32=$(CC)
CXX_i686-pc-mingw32=$(CXX)
CPP_i686-pc-mingw32=$(CPP)
AR_i686-pc-mingw32=$(AR)
CFG_LIB_DIR_i686-pc-mingw32=bin
CFG_LIB_NAME_i686-pc-mingw32=$(1).dll
CFG_LIB_GLOB_i686-pc-mingw32=$(1)-*.dll
CFG_LIB_DSYM_GLOB_i686-pc-mingw32=$(1)-*.dylib.dSYM
Expand All @@ -271,6 +277,7 @@ CC_i586-mingw32msvc=$(CFG_MINGW32_CROSS_PATH)/bin/i586-mingw32msvc-gcc
CXX_i586-mingw32msvc=$(CFG_MINGW32_CROSS_PATH)/bin/i586-mingw32msvc-g++
CPP_i586-mingw32msvc=$(CFG_MINGW32_CROSS_PATH)/bin/i586-mingw32msvc-cpp
AR_i586-mingw32msvc=$(CFG_MINGW32_CROSS_PATH)/bin/i586-mingw32msvc-ar
CFG_LIB_DIR_i586-mingw32msvc=bin
CFG_LIB_NAME_i586-mingw32msvc=$(1).dll
CFG_LIB_GLOB_i586-mingw32msvc=$(1)-*.dll
CFG_LIB_DSYM_GLOB_i586-mingw32msvc=$(1)-*.dylib.dSYM
Expand Down Expand Up @@ -298,6 +305,7 @@ CC_x86_64-unknown-freebsd=$(CC)
CXX_x86_64-unknown-freebsd=$(CXX)
CPP_x86_64-unknown-freebsd=$(CPP)
AR_x86_64-unknown-freebsd=$(AR)
CFG_LIB_DIR_x86_64-unknown-freebsd=lib
CFG_LIB_NAME_x86_64-unknown-freebsd=lib$(1).so
CFG_LIB_GLOB_x86_64-unknown-freebsd=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_x86_64-unknown-freebsd=$(1)-*.dylib.dSYM
Expand Down
10 changes: 5 additions & 5 deletions mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ endif
ifdef CFG_WINDOWSY_$(1)
CFG_TESTLIB_$(1)=$$(CFG_BUILD_DIR)/$$(2)/$$(strip \
$$(if $$(findstring stage0,$$(1)), \
stage0/$$(CFG_LIBDIR), \
stage0/$$(CFG_LIB_DIR_$(CFG_BUILD_TRIPLE)), \
$$(if $$(findstring stage1,$$(1)), \
stage1/$$(CFG_LIBDIR), \
stage1/$$(CFG_LIB_DIR_$(CFG_BUILD_TRIPLE)), \
$$(if $$(findstring stage2,$$(1)), \
stage2/$$(CFG_LIBDIR), \
stage2/$$(CFG_LIB_DIR_$(CFG_BUILD_TRIPLE)), \
$$(if $$(findstring stage3,$$(1)), \
stage3/$$(CFG_LIBDIR), \
)))))/rustc/$$(CFG_BUILD_TRIPLE)/$$(CFG_LIBDIR)
stage3/$$(CFG_LIB_DIR_$(CFG_BUILD_TRIPLE)), \
)))))/rustc/$$(CFG_BUILD_TRIPLE)/$$(CFG_LIB_DIR_$(CFG_BUILD_TRIPLE))
CFG_RUN_TEST_$(1)=$$(call CFG_RUN_$(1),$$(call CFG_TESTLIB_$(1),$$(1),$$(3)),$$(1))
endif

Expand Down
4 changes: 2 additions & 2 deletions src/librustc/metadata/filesearch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ fn get_rustpkg_lib_path_nearest() -> Result<Path, ~str> {
// The name of the directory rustc expects libraries to be located.
// On Unix should be "lib", on windows "bin"
pub fn libdir() -> ~str {
let libdir = env!("CFG_LIBDIR");
let libdir = env!("CFG_DEFAULT_LIB_DIR");
if str::is_empty(libdir) {
fail!(~"rustc compiled without CFG_LIBDIR environment variable");
fail!(~"rustc compiled without CFG_DEFAULT_LIB_DIR environment variable");
}
libdir
}