1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

* Allow skipping parts of the installation to be able to do it in parts 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.

llvm-svn: 74840
This commit is contained in:
Misha Brukman 2009-07-06 18:29:03 +00:00
parent d9f964a39e
commit fa6225a9fb

View File

@ -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}"
@ -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}" \
@ -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.
@ -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".
@ -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".
@ -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