mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00: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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74840 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
53cf8298cf
commit
e034393b15
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user