common: expose build profile in cross env
[ci skip]
This commit is contained in:
parent
b4f0f4615a
commit
3c47efa808
2 changed files with 25 additions and 11 deletions
|
@ -9,3 +9,7 @@ for a specific architecture:
|
|||
- XBPS_CXXFLAGS (C++ compiler flags for the host compiler)
|
||||
- XBPS_FFLAGS (Fortran compiler flags for the host compiler)
|
||||
- XBPS_RUST_TARGET (the compiler triplet for usage by cargo)
|
||||
|
||||
These properties are also set in a cross environment, but the compiler
|
||||
flags are not added into the global flags. XBPS_RUST_TARGET is also
|
||||
exposed as RUST_BUILD instead of RUST_TARGET.
|
||||
|
|
|
@ -436,21 +436,21 @@ setup_pkg() {
|
|||
dbgflags="-g"
|
||||
fi
|
||||
|
||||
if [ -z "$cross" ]; then
|
||||
if [ -z "$CHROOT_READY" ]; then
|
||||
source_file ${XBPS_COMMONDIR}/build-profiles/bootstrap.sh
|
||||
else
|
||||
source_file ${XBPS_COMMONDIR}/build-profiles/${XBPS_MACHINE}.sh
|
||||
fi
|
||||
# build profile is used always in order to expose the host triplet,
|
||||
# but the compiler flags from it are only used when not crossing
|
||||
if [ -z "$CHROOT_READY" ]; then
|
||||
source_file ${XBPS_COMMONDIR}/build-profiles/bootstrap.sh
|
||||
else
|
||||
source_file ${XBPS_COMMONDIR}/build-profiles/${XBPS_MACHINE}.sh
|
||||
fi
|
||||
|
||||
set_build_options
|
||||
|
||||
export CFLAGS="$XBPS_TARGET_CFLAGS $XBPS_CFLAGS $XBPS_CROSS_CFLAGS $CFLAGS $dbgflags"
|
||||
export CXXFLAGS="$XBPS_TARGET_CXXFLAGS $XBPS_CXXFLAGS $XBPS_CROSS_CXXFLAGS $CXXFLAGS $dbgflags"
|
||||
export FFLAGS="$XBPS_TARGET_FFLAGS $XBPS_FFLAGS $XBPS_CROSS_FFLAGS $FFLAGS"
|
||||
export CPPFLAGS="$XBPS_TARGET_CPPFLAGS $XBPS_CPPFLAGS $XBPS_CROSS_CPPFLAGS $CPPFLAGS"
|
||||
export LDFLAGS="$XBPS_TARGET_LDFLAGS $XBPS_LDFLAGS $XBPS_CROSS_LDFLAGS $LDFLAGS"
|
||||
export CFLAGS="$XBPS_CFLAGS $XBPS_CROSS_CFLAGS $CFLAGS $dbgflags"
|
||||
export CXXFLAGS="$XBPS_CXXFLAGS $XBPS_CROSS_CXXFLAGS $CXXFLAGS $dbgflags"
|
||||
export FFLAGS="$XBPS_FFLAGS $XBPS_CROSS_FFLAGS $FFLAGS"
|
||||
export CPPFLAGS="$XBPS_CPPFLAGS $XBPS_CROSS_CPPFLAGS $CPPFLAGS"
|
||||
export LDFLAGS="$XBPS_LDFLAGS $XBPS_CROSS_LDFLAGS $LDFLAGS"
|
||||
|
||||
export BUILD_CC="cc"
|
||||
export BUILD_CFLAGS="$XBPS_CFLAGS"
|
||||
|
@ -530,7 +530,16 @@ setup_pkg() {
|
|||
export RUSTFLAGS="$XBPS_CROSS_RUSTFLAGS"
|
||||
# Rust target, which differs from our triplets
|
||||
export RUST_TARGET="$XBPS_CROSS_RUST_TARGET"
|
||||
# Rust build, which is the host system, may also differ
|
||||
export RUST_BUILD="$XBPS_RUST_TARGET"
|
||||
else
|
||||
# Target flags from build-profile
|
||||
export CFLAGS="$XBPS_TARGET_CFLAGS $CFLAGS"
|
||||
export CXXFLAGS="$XBPS_TARGET_CXXFLAGS $CXXFLAGS"
|
||||
export FFLAGS="$XBPS_TARGET_FFLAGS $FFLAGS"
|
||||
export CPPFLAGS="$XBPS_TARGET_CPPFLAGS $CPPFLAGS"
|
||||
export LDFLAGS="$XBPS_TARGET_LDFLAGS $LDFLAGS"
|
||||
# Tools
|
||||
export CC="cc"
|
||||
export CXX="g++"
|
||||
export CPP="cpp"
|
||||
|
@ -546,6 +555,7 @@ setup_pkg() {
|
|||
export NM="nm"
|
||||
export READELF="readelf"
|
||||
export RUST_TARGET="$XBPS_RUST_TARGET"
|
||||
export RUST_BUILD="$XBPS_RUST_TARGET"
|
||||
# Unset cross evironment variables
|
||||
unset CC_target CXX_target CPP_target GCC_target FC_target LD_target AR_target AS_target
|
||||
unset RANLIB_target STRIP_target OBJDUMP_target OBJCOPY_target NM_target READELF_target
|
||||
|
|
Loading…
Reference in a new issue