Skip to content

Commit

Permalink
* Allow skipping parts of the installation to be able to do it in par…
Browse files Browse the repository at this point in the history
…ts if one

  phase fails and the user wants to reinstall one of the components.
* Fixed LLVM-GCC configuration flags: s/--with-gnu-{as,ld}/--with-{as,ld}/
  The former is a boolean flag, the latter is a flag that takes a path.
* Added a new flag CROSS_MARCH, defaults to armv6.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74840 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
mbrukman committed Jul 6, 2009
1 parent 53cf829 commit e034393
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions utils/crosstool/ARM/build-install-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ readonly OBJ_ROOT="${SCRATCH_ROOT}/obj"

readonly CROSS_HOST="x86_64-unknown-linux-gnu"
readonly CROSS_TARGET="arm-none-linux-gnueabi"
readonly CROSS_MARCH="${CROSS_MARCH:-armv6}"

readonly CODE_SOURCERY="${INSTALL_ROOT}/codesourcery"
readonly CODE_SOURCERY_PKG_PATH="${CODE_SOURCERY_PKG_PATH:-${HOME}/codesourcery}"
Expand Down Expand Up @@ -104,12 +105,9 @@ runAndLog() {
}

installCodeSourcery() {
# Create CodeSourcery dir, if necessary.
verifyNotDir ${CODE_SOURCERY}
sudoCreateDir ${CODE_SOURCERY}

# Unpack the tarball.
# Unpack the tarball, creating the CodeSourcery dir, if necessary.
if [[ ! -d ${CODE_SOURCERY_ROOT} ]]; then
sudoCreateDir ${CODE_SOURCERY}
cd ${CODE_SOURCERY}
if [[ -e ${CODE_SOURCERY_PKG_PATH}/${CODE_SOURCERY_PKG} ]]; then
runCommand "Unpacking CodeSourcery in ${CODE_SOURCERY}" \
Expand All @@ -122,7 +120,7 @@ installCodeSourcery() {
exit
fi
else
echo "CodeSourcery install dir already exists."
echo "CodeSourcery install dir already exists; skipping."
fi

# Verify our CodeSourcery toolchain installation.
Expand All @@ -141,7 +139,11 @@ installCodeSourcery() {
}

installLLVM() {
verifyNotDir ${LLVM_INSTALL_DIR}
if [[ -d ${LLVM_INSTALL_DIR} ]]; then
echo "LLVM install dir ${LLVM_INSTALL_DIR} exists; skipping."
return
fi

sudoCreateDir ${LLVM_INSTALL_DIR}

# Unpack LLVM tarball; should create the directory "llvm".
Expand All @@ -165,7 +167,11 @@ installLLVM() {
}

installLLVMGCC() {
verifyNotDir ${LLVMGCC_INSTALL_DIR}
if [[ -d ${LLVMGCC_INSTALL_DIR} ]]; then
echo "LLVM-GCC install dir ${LLVMGCC_INSTALL_DIR} exists; skipping."
return
fi

sudoCreateDir ${LLVMGCC_INSTALL_DIR}

# Unpack LLVM-GCC tarball; should create the directory "llvm-gcc-4.2".
Expand All @@ -182,8 +188,9 @@ installLLVMGCC() {
--prefix=${LLVMGCC_INSTALL_DIR} \
--program-prefix=llvm- \
--target=${CROSS_TARGET} \
--with-gnu-as=${CROSS_TARGET_AS} \
--with-gnu-ld=${CROSS_TARGET_LD} \
--with-arch=${CROSS_MARCH} \
--with-as=${CROSS_TARGET_AS} \
--with-ld=${CROSS_TARGET_LD} \
--with-sysroot=${SYSROOT}
runAndLog "Building LLVM-GCC" ${LLVMGCC_OBJ_DIR}/llvmgcc-build.log \
make
Expand Down

0 comments on commit e034393

Please sign in to comment.