Select an ARM-hosted cross build with a separate makefile target instead of

a magic project name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103125 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bob Wilson 2010-05-05 22:22:40 +00:00
parent 676b2dfd27
commit 7d2552135d
2 changed files with 31 additions and 29 deletions

View File

@ -49,6 +49,9 @@ endif
# Default to not install libLTO.dylib. # Default to not install libLTO.dylib.
INSTALL_LIBLTO := no INSTALL_LIBLTO := no
# Default to do a native build, not a cross-build for an ARM host.
ARM_HOSTED_BUILD := no
ifndef RC_ProjectSourceVersion ifndef RC_ProjectSourceVersion
RC_ProjectSourceVersion = 9999 RC_ProjectSourceVersion = 9999
endif endif
@ -63,8 +66,12 @@ install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
$(SRC)/utils/buildit/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \ $(SRC)/utils/buildit/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
$(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \ $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \
$(ENABLE_ASSERTIONS) $(LLVM_OPTIMIZED) $(INSTALL_LIBLTO) \ $(ENABLE_ASSERTIONS) $(LLVM_OPTIMIZED) $(INSTALL_LIBLTO) \
$(ARM_HOSTED_BUILD) \
$(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion)
EmbeddedHosted:
$(MAKE) ARM_HOSTED_BUILD=yes install
# installhdrs does nothing, because the headers aren't useful until # installhdrs does nothing, because the headers aren't useful until
# the compiler is installed. # the compiler is installed.
installhdrs: installhdrs:
@ -113,4 +120,4 @@ clean:
$(OBJROOT) $(SYMROOT) $(DSTROOT): $(OBJROOT) $(SYMROOT) $(DSTROOT):
mkdir -p $@ mkdir -p $@
.PHONY: install installsrc clean .PHONY: install installsrc clean EmbeddedHosted

View File

@ -46,11 +46,14 @@ LLVM_OPTIMIZED="$8"
# should be installed. # should be installed.
INSTALL_LIBLTO="$9" INSTALL_LIBLTO="$9"
# The tenth parameter is the version number of the submission, e.g. 1007. # A yes/no parameter that controls whether to cross-build for an ARM host.
LLVM_SUBMIT_VERSION="${10}" ARM_HOSTED_BUILD="${10}"
# The eleventh parameter is the subversion number of the submission, e.g. 03. # The version number of the submission, e.g. 1007.
LLVM_SUBMIT_SUBVERSION="${11}" LLVM_SUBMIT_VERSION="${11}"
# The subversion number of the submission, e.g. 03.
LLVM_SUBMIT_SUBVERSION="${12}"
# The current working directory is where the build will happen. It may already # The current working directory is where the build will happen. It may already
# contain a partial result of an interrupted build, in which case this script # contain a partial result of an interrupted build, in which case this script
@ -61,7 +64,7 @@ DARWIN_VERS=`uname -r | sed 's/\..*//'`
echo DARWIN_VERS = $DARWIN_VERS echo DARWIN_VERS = $DARWIN_VERS
DEVELOPER_DIR="${DEVELOPER_DIR-Developer}" DEVELOPER_DIR="${DEVELOPER_DIR-Developer}"
if [ "x$RC_ProjectName" = "xllvmCore_EmbeddedHosted" ]; then if [ "$ARM_HOSTED_BUILD" = yes ]; then
DT_HOME="$DEST_DIR/usr" DT_HOME="$DEST_DIR/usr"
HOST_SDKROOT=$SDKROOT HOST_SDKROOT=$SDKROOT
else else
@ -89,8 +92,7 @@ sed -e '/[Aa]pple-style/d' -e '/include.*GNUmakefile/d' $ORIG_SRC_DIR/Makefile >
mkdir -p $DIR/obj-llvm || exit 1 mkdir -p $DIR/obj-llvm || exit 1
cd $DIR/obj-llvm || exit 1 cd $DIR/obj-llvm || exit 1
if [ "$ARM_HOSTED_BUILD" = yes ]; then
if [ "x$RC_ProjectName" = "xllvmCore_EmbeddedHosted" ]; then
# The cross-tools' build process expects to find an existing cross toolchain # The cross-tools' build process expects to find an existing cross toolchain
# under names like 'arm-apple-darwin$DARWIN_VERS-as'; so make them. # under names like 'arm-apple-darwin$DARWIN_VERS-as'; so make them.
rm -rf $DIR/bin || exit 1 rm -rf $DIR/bin || exit 1
@ -129,28 +131,21 @@ elif [ $DARWIN_VERS -gt 9 ]; then
unset XTMPCC savedPATH unset XTMPCC savedPATH
fi fi
if [ "$ARM_HOSTED_BUILD" = yes ]; then
if [ "x$RC_ProjectName" = "xllvmCore_EmbeddedHosted" ]; then configure_prefix=$DT_HOME
if [ \! -f Makefile.config ]; then configure_opts="--enable-targets=arm --host=arm-apple-darwin10 \
$SRC_DIR/configure --prefix=$DT_HOME \ --target=arm-apple-darwin10 --build=i686-apple-darwin10"
--enable-targets=arm \
--host=arm-apple-darwin10 \
--target=arm-apple-darwin10 \
--build=i686-apple-darwin10 \
--enable-assertions=$LLVM_ASSERTIONS \
--enable-optimized=$LLVM_OPTIMIZED \
--disable-bindings \
|| exit 1
fi
else else
if [ \! -f Makefile.config ]; then configure_prefix=$DT_HOME/local
$SRC_DIR/configure --prefix=$DT_HOME/local \ configure_opts="--enable-targets=arm,x86,powerpc,cbe"
--enable-targets=arm,x86,powerpc,cbe \ fi
--enable-assertions=$LLVM_ASSERTIONS \
--enable-optimized=$LLVM_OPTIMIZED \ if [ \! -f Makefile.config ]; then
--disable-bindings \ $SRC_DIR/configure --prefix=$configure_prefix $configure_opts \
|| exit 1 --enable-assertions=$LLVM_ASSERTIONS \
fi --enable-optimized=$LLVM_OPTIMIZED \
--disable-bindings \
|| exit 1
fi fi
SUBVERSION=`echo $RC_ProjectSourceVersion | sed -e 's/[^.]*\.\([0-9]*\).*/\1/'` SUBVERSION=`echo $RC_ProjectSourceVersion | sed -e 's/[^.]*\.\([0-9]*\).*/\1/'`