[llvm-commits] [llvm-gcc-4.2] r103395 - in /llvm-gcc-4.2/trunk/extras: ./ build-4-mingw32 buildbot-launcher
Duncan Sands
baldrick at free.fr
Mon May 10 00:17:37 PDT 2010
Author: baldrick
Date: Mon May 10 02:17:37 2010
New Revision: 103395
URL: http://llvm.org/viewvc/llvm-project?rev=103395&view=rev
Log:
Patch by Galina Kistanova, adding 2 shell script to the llvm-gcc/extras directory
(the same way we have it for DragonEgg):
* buildbot-launcher - prepares environment and launches required build script;
* build-4-mingw32 - cross builds llvm and llvm-gcc for
--build=x86_64-apple-darwin10 --host=i686-pc-mingw32
--target=i686-pc-mingw32
Added:
llvm-gcc-4.2/trunk/extras/
llvm-gcc-4.2/trunk/extras/build-4-mingw32
llvm-gcc-4.2/trunk/extras/buildbot-launcher
Added: llvm-gcc-4.2/trunk/extras/build-4-mingw32
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/extras/build-4-mingw32?rev=103395&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/extras/build-4-mingw32 (added)
+++ llvm-gcc-4.2/trunk/extras/build-4-mingw32 Mon May 10 02:17:37 2010
@@ -0,0 +1,175 @@
+#!/bin/bash
+
+set -e # Terminate script at the first line that fails.
+set -o pipefail # Return the first non-zero pipe command error.
+set -x # Print commands as they are executed
+
+# This script performs an automated cross build on x86_64-apple-darwin10 of
+# self-hosted llvm-gcc for i686-pc-mingw32. It assumes the valid native
+# cross compiler for i686-pc-mingw32 is in place and available as well as
+# cross libraries and headers.
+
+# --build=x86_64-apple-darwin10
+# --host=i686-pc-mingw32
+# --target=i686-pc-mingw32
+
+# The usage:
+# Run this build from the build from the build root directory as
+# build-4-mingw32 [<step>] [<extra args>]
+
+# Expected project tree structure:
+# <build root>
+# +-- ${LLVM_src}
+# +-- ${LLVM_GCC_src}
+# +-- ${LLVM_obj}
+# +-- ${LLVM_GCC_obj}
+# +-- ${INSTALL}
+
+LLVM_src=llvm.src # The LLVM source code root directory name.
+LLVM_GCC_src=llvm-gcc.src # The LLVM-GCC source code root directory name.
+LLVM_obj=llvm.obj # The LLVM build root directory name.
+LLVM_GCC_obj=llvm-gcc.obj # The LLVM-GCC build root directory name.
+INSTALL=install # Where the result will be installed.
+
+# CFLAGS and CXXFLAGS must not be set during the building of cross-tools.
+unset CFLAGS
+unset CXXFLAGS
+
+BUILD_ROOT=$PWD # Where build happens.
+PRIVATE_INSTALL=${BUILD_ROOT}/${INSTALL} # Where the result will be installed.
+
+#------------------------------------------------------------------------------
+# Define build steps, parse and validate input parameters
+#------------------------------------------------------------------------------
+
+# This script supports the following steps:
+do_clean=no # Clean up the build directory.
+do_configure_llvm=no # Configure LLVM.
+do_make_llvm=no # Make LLVM.
+do_configure_llvmgcc=no # Configure LLVM-GCC.
+do_make_llvmgcc=no # Make LLVM-GCC.
+do_install_llvmgcc=no # Install LLVM-GCC.
+do_all=no # Runs all steps at once when requested.
+
+# Set step parameter
+if (( $# == 0 )) ; then
+ do_all=yes
+fi
+# else
+if (( ! $# == 0 )) ; then
+ # First check that the parameter actually defines a step.
+ case $1 in
+ clean | \
+ configure_llvm | \
+ make_llvm | \
+ configure_llvmgcc | \
+ make_llvmgcc | \
+ install_llvmgcc | \
+ all)
+ eval do_$1=yes # Set the flag for the requested step .
+ shift # Remove it since is is ours and already precessed.
+ ;;
+
+ *)
+ # Not our parameter. Pass it as is.
+ esac
+fi
+
+# Set all steps if do_all requested
+if [ "$do_all" == "yes" ] ; then
+ # Set all steps to yes
+ do_clean=yes
+ do_configure_llvm=yes
+ do_make_llvm=yes
+ do_configure_llvmgcc=yes
+ do_make_llvmgcc=yes
+ do_install_llvmgcc=yes
+fi
+
+#------------------------------------------------------------------------------
+# Step: Clean up.
+#------------------------------------------------------------------------------
+if [ "$do_clean" == "yes" ] ; then
+
+ # Remove everything from where we will be installing the result.
+ rm -rf ${PRIVATE_INSTALL}
+ mkdir -p ${PRIVATE_INSTALL}
+ chmod a+rx ${PRIVATE_INSTALL}
+
+fi
+
+#------------------------------------------------------------------------------
+# Step: Configure LLVM.
+#------------------------------------------------------------------------------
+if [ "$do_configure_llvm" == "yes" ] ; then
+
+ # Remove previous build files if any.
+ rm -rf ${BUILD_ROOT}/${LLVM_obj}
+ mkdir -p ${BUILD_ROOT}/${LLVM_obj}
+ chmod a+rx ${BUILD_ROOT}/${LLVM_obj}
+ cd ${BUILD_ROOT}/${LLVM_obj}
+
+ ../${LLVM_src}/configure --prefix=${PRIVATE_INSTALL} \
+ --build=x86_64-apple-darwin10 --host=i686-pc-mingw32 \
+ --target=i686-pc-mingw32 \
+ --enable-optimize \
+ $@ # Extra args if any
+
+fi
+
+#------------------------------------------------------------------------------
+# Step: Make LLVM.
+#------------------------------------------------------------------------------
+if [ "$do_make_llvm" == "yes" ] ; then
+
+ cd ${BUILD_ROOT}/${LLVM_obj}
+ nice -n 20 make ENABLE_OPTIMIZED=1 \
+ $@ # Extra args if any, like -j16 for example.
+
+fi
+
+#------------------------------------------------------------------------------
+# Step: Configure LLVM-GCC.
+#------------------------------------------------------------------------------
+if [ "$do_configure_llvmgcc" == "yes" ] ; then
+
+ # Remove previous build files if any.
+ rm -rf ${BUILD_ROOT}/${LLVM_GCC_obj}
+ mkdir -p ${BUILD_ROOT}/${LLVM_GCC_obj}
+ chmod a+rx ${BUILD_ROOT}/${LLVM_GCC_obj}
+ cd ${BUILD_ROOT}/${LLVM_GCC_obj}
+
+ ../${LLVM_GCC_src}/configure --prefix=${PRIVATE_INSTALL} \
+ --build=x86_64-apple-darwin10 --host=i686-pc-mingw32 \
+ --target=i686-pc-mingw32 \
+ --program-prefix=llvm- \
+ --enable-llvm=${BUILD_ROOT}/${LLVM_obj} \
+ --enable-languages=c,c++ \
+ --disable-multilib --disable-nls --disable-shared \
+ --disable-sjlj-exceptions --disable-__cxa_atexit \
+ $@ # Extra args if any
+
+fi
+
+#------------------------------------------------------------------------------
+# Step: Make LLVM-GCC.
+#------------------------------------------------------------------------------
+if [ "$do_make_llvmgcc" == "yes" ] ; then
+
+ cd ${BUILD_ROOT}/${LLVM_GCC_obj}
+ # NOTE: Do not build in parallel! It doesn't build.
+ nice -n 20 make \
+ $@ # Extra args if any
+
+fi
+
+#------------------------------------------------------------------------------
+# Step: Install LLVM-GCC.
+#------------------------------------------------------------------------------
+if [ "$do_install_llvmgcc" == "yes" ] ; then
+
+ cd ${BUILD_ROOT}/${LLVM_GCC_obj}
+ nice -n 20 make install \
+ $@ # Extra args if any
+
+fi
Added: llvm-gcc-4.2/trunk/extras/buildbot-launcher
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/extras/buildbot-launcher?rev=103395&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/extras/buildbot-launcher (added)
+++ llvm-gcc-4.2/trunk/extras/buildbot-launcher Mon May 10 02:17:37 2010
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -e # Terminate script at the first line that fails.
+set -o pipefail # Return the first non-zero pipe command error.
+set -x # Print commands as they are executed
+
+# The fist 4 parameters are consumed by this script and they are:
+BUILD_SCRIPT=$1 # Build script name to launch
+shift
+LLVM_SOURCE=$1 # Directory name where the LLVM source code is.
+shift
+LLVM_GCC_SOURCE=$1 # Directory name where the LLVM-GCC source code is.
+shift
+BUILD_DIR=$1 # Path to the build root directory.
+shift
+# The rest of the parameters will pass through.
+
+# The build script expects to be run from the build root directory.
+cd $BUILD_DIR
+
+# The build script expects source code directories in certain place with
+# certain names.
+# TODO: Handle relative paths here
+if [ "$LLVM_SOURCE" != "llvm.src" ] ; then
+ ln -sf $BUILD_DIR/$LLVM_SOURCE $BUILD_DIR/llvm.src
+fi
+if [ "$LLVM_GCC_SOURCE" != "llvm-gcc.src" ] ; then
+ ln -sf $BUILD_DIR/$LLVM_GCC_SOURCE $BUILD_DIR/llvm-gcc.src
+fi
+
+# Launch the build script with all the remaining parameters
+$BUILD_SCRIPT $@
More information about the llvm-commits
mailing list