mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 00:52:16 +00:00
Implement a pseudo-toolset for cross-compiling (#196)
When running build.sh with the cross-cc toolset, it uses the native compiler settings found in the BUILD_CC, BUILD_CFLAGS, and BUILD_LDFLAGS environment variables to create executables to run on the build system. It then sets the toolset to cc so that the cross-compilers given as CC etc. are propagated to subprocesses. This ensures both that the build system can build and execute its required programs and that final executables are cross-compiled for the target architecture.
This commit is contained in:
committed by
Rene Rivera
parent
d44023da09
commit
4746def4a2
@@ -40,6 +40,12 @@ error_exit ()
|
||||
echo "### detected. The 'cc' toolset will use the CC, CFLAGS, and LIBS"
|
||||
echo "### environment variables, if present."
|
||||
echo "###"
|
||||
echo "### Similarly, the cross-cc toolset is available for cross-compiling"
|
||||
echo "### by using the BUILD_CC, BUILD_CFLAGS, and BUILD_LDFLAGS environment"
|
||||
echo "### variables to compile binaries that will be executed on the build"
|
||||
echo "### system. This allows CC etc. to be set for cross-compilers to be"
|
||||
echo "### propagated to subprocesses."
|
||||
echo "###"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -268,6 +274,15 @@ case $BOOST_JAM_TOOLSET in
|
||||
BOOST_JAM_OPT_YYACC="$BOOST_JAM_OPT_YYACC $CFLAGS $LIBS"
|
||||
;;
|
||||
|
||||
cross-cc)
|
||||
if test -z "$BUILD_CC" ; then BUILD_CC=cc ; fi
|
||||
BOOST_JAM_CC=$BUILD_CC
|
||||
BOOST_JAM_OPT_JAM="$BOOST_JAM_OPT_JAM $BUILD_CFLAGS $BUILD_LDFLAGS"
|
||||
BOOST_JAM_OPT_MKJAMBASE="$BOOST_JAM_OPT_MKJAMBASE $BUILD_CFLAGS $BUILD_LDFLAGS"
|
||||
BOOST_JAM_OPT_YYACC="$BOOST_JAM_OPT_YYACC $BUILD_CFLAGS $BUILD_LDFLAGS"
|
||||
BOOST_JAM_TOOLSET=cc
|
||||
;;
|
||||
|
||||
qcc)
|
||||
BOOST_JAM_CC=qcc
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user