[llvm-commits] [llvm] r103125 - in /llvm/trunk/utils/buildit: GNUmakefile build_llvm

Bob Wilson bob.wilson at apple.com
Wed May 5 15:22:40 PDT 2010


Author: bwilson
Date: Wed May  5 17:22:40 2010
New Revision: 103125

URL: http://llvm.org/viewvc/llvm-project?rev=103125&view=rev
Log:
Select an ARM-hosted cross build with a separate makefile target instead of
a magic project name.

Modified:
    llvm/trunk/utils/buildit/GNUmakefile
    llvm/trunk/utils/buildit/build_llvm

Modified: llvm/trunk/utils/buildit/GNUmakefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/GNUmakefile?rev=103125&r1=103124&r2=103125&view=diff
==============================================================================
--- llvm/trunk/utils/buildit/GNUmakefile (original)
+++ llvm/trunk/utils/buildit/GNUmakefile Wed May  5 17:22:40 2010
@@ -49,6 +49,9 @@
 # Default to not install libLTO.dylib.
 INSTALL_LIBLTO := no
 
+# Default to do a native build, not a cross-build for an ARM host.
+ARM_HOSTED_BUILD := no
+
 ifndef RC_ProjectSourceVersion
 RC_ProjectSourceVersion = 9999
 endif
@@ -63,8 +66,12 @@
 	  $(SRC)/utils/buildit/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
 	    $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \
 	    $(ENABLE_ASSERTIONS) $(LLVM_OPTIMIZED) $(INSTALL_LIBLTO) \
+	    $(ARM_HOSTED_BUILD) \
 	    $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) 
 
+EmbeddedHosted:
+	$(MAKE) ARM_HOSTED_BUILD=yes install
+
 # installhdrs does nothing, because the headers aren't useful until
 # the compiler is installed.
 installhdrs:
@@ -113,4 +120,4 @@
 $(OBJROOT) $(SYMROOT) $(DSTROOT):
 	mkdir -p $@
 
-.PHONY: install installsrc clean
+.PHONY: install installsrc clean EmbeddedHosted

Modified: llvm/trunk/utils/buildit/build_llvm
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/build_llvm?rev=103125&r1=103124&r2=103125&view=diff
==============================================================================
--- llvm/trunk/utils/buildit/build_llvm (original)
+++ llvm/trunk/utils/buildit/build_llvm Wed May  5 17:22:40 2010
@@ -46,11 +46,14 @@
 # should be installed.
 INSTALL_LIBLTO="$9"
 
-# The tenth parameter is the version number of the submission, e.g. 1007.
-LLVM_SUBMIT_VERSION="${10}"
+# A yes/no parameter that controls whether to cross-build for an ARM host.
+ARM_HOSTED_BUILD="${10}"
 
-# The eleventh parameter is the subversion number of the submission, e.g. 03.
-LLVM_SUBMIT_SUBVERSION="${11}"
+# The version number of the submission, e.g. 1007.
+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
 # contain a partial result of an interrupted build, in which case this script
@@ -61,7 +64,7 @@
 echo DARWIN_VERS = $DARWIN_VERS
 
 DEVELOPER_DIR="${DEVELOPER_DIR-Developer}"
-if [ "x$RC_ProjectName" = "xllvmCore_EmbeddedHosted" ]; then
+if [ "$ARM_HOSTED_BUILD" = yes ]; then
     DT_HOME="$DEST_DIR/usr"
     HOST_SDKROOT=$SDKROOT
 else
@@ -89,8 +92,7 @@
 mkdir -p $DIR/obj-llvm || exit 1
 cd $DIR/obj-llvm || exit 1
 
-
-if [ "x$RC_ProjectName" = "xllvmCore_EmbeddedHosted" ]; then
+if [ "$ARM_HOSTED_BUILD" = yes ]; then
   # The cross-tools' build process expects to find an existing cross toolchain
   # under names like 'arm-apple-darwin$DARWIN_VERS-as'; so make them.
   rm -rf $DIR/bin || exit 1
@@ -129,28 +131,21 @@
   unset XTMPCC savedPATH
 fi
 
-
-if [ "x$RC_ProjectName" = "xllvmCore_EmbeddedHosted" ]; then
-  if [ \! -f Makefile.config ]; then
-      $SRC_DIR/configure --prefix=$DT_HOME \
-          --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
+if [ "$ARM_HOSTED_BUILD" = yes ]; then
+  configure_prefix=$DT_HOME
+  configure_opts="--enable-targets=arm --host=arm-apple-darwin10 \
+                  --target=arm-apple-darwin10 --build=i686-apple-darwin10"
 else
-  if [ \! -f Makefile.config ]; then
-      $SRC_DIR/configure --prefix=$DT_HOME/local \
-          --enable-targets=arm,x86,powerpc,cbe \
-          --enable-assertions=$LLVM_ASSERTIONS \
-          --enable-optimized=$LLVM_OPTIMIZED \
-          --disable-bindings \
-          || exit 1
-  fi
+  configure_prefix=$DT_HOME/local
+  configure_opts="--enable-targets=arm,x86,powerpc,cbe"
+fi
+
+if [ \! -f Makefile.config ]; then
+  $SRC_DIR/configure --prefix=$configure_prefix $configure_opts \
+    --enable-assertions=$LLVM_ASSERTIONS \
+    --enable-optimized=$LLVM_OPTIMIZED \
+    --disable-bindings \
+    || exit 1
 fi
 
 SUBVERSION=`echo $RC_ProjectSourceVersion | sed -e 's/[^.]*\.\([0-9]*\).*/\1/'`





More information about the llvm-commits mailing list