llvm.org GIT mirror llvm / e034393
* 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 Misha Brukman 11 years ago
1 changed file(s) with 17 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
1616
1717 readonly CROSS_HOST="x86_64-unknown-linux-gnu"
1818 readonly CROSS_TARGET="arm-none-linux-gnueabi"
19 readonly CROSS_MARCH="${CROSS_MARCH:-armv6}"
1920
2021 readonly CODE_SOURCERY="${INSTALL_ROOT}/codesourcery"
2122 readonly CODE_SOURCERY_PKG_PATH="${CODE_SOURCERY_PKG_PATH:-${HOME}/codesourcery}"
103104 }
104105
105106 installCodeSourcery() {
106 # Create CodeSourcery dir, if necessary.
107 verifyNotDir ${CODE_SOURCERY}
108 sudoCreateDir ${CODE_SOURCERY}
109
110 # Unpack the tarball.
107 # Unpack the tarball, creating the CodeSourcery dir, if necessary.
111108 if [[ ! -d ${CODE_SOURCERY_ROOT} ]]; then
109 sudoCreateDir ${CODE_SOURCERY}
112110 cd ${CODE_SOURCERY}
113111 if [[ -e ${CODE_SOURCERY_PKG_PATH}/${CODE_SOURCERY_PKG} ]]; then
114112 runCommand "Unpacking CodeSourcery in ${CODE_SOURCERY}" \
121119 exit
122120 fi
123121 else
124 echo "CodeSourcery install dir already exists."
122 echo "CodeSourcery install dir already exists; skipping."
125123 fi
126124
127125 # Verify our CodeSourcery toolchain installation.
140138 }
141139
142140 installLLVM() {
143 verifyNotDir ${LLVM_INSTALL_DIR}
141 if [[ -d ${LLVM_INSTALL_DIR} ]]; then
142 echo "LLVM install dir ${LLVM_INSTALL_DIR} exists; skipping."
143 return
144 fi
145
144146 sudoCreateDir ${LLVM_INSTALL_DIR}
145147
146148 # Unpack LLVM tarball; should create the directory "llvm".
164166 }
165167
166168 installLLVMGCC() {
167 verifyNotDir ${LLVMGCC_INSTALL_DIR}
169 if [[ -d ${LLVMGCC_INSTALL_DIR} ]]; then
170 echo "LLVM-GCC install dir ${LLVMGCC_INSTALL_DIR} exists; skipping."
171 return
172 fi
173
168174 sudoCreateDir ${LLVMGCC_INSTALL_DIR}
169175
170176 # Unpack LLVM-GCC tarball; should create the directory "llvm-gcc-4.2".
181187 --prefix=${LLVMGCC_INSTALL_DIR} \
182188 --program-prefix=llvm- \
183189 --target=${CROSS_TARGET} \
184 --with-gnu-as=${CROSS_TARGET_AS} \
185 --with-gnu-ld=${CROSS_TARGET_LD} \
190 --with-arch=${CROSS_MARCH} \
191 --with-as=${CROSS_TARGET_AS} \
192 --with-ld=${CROSS_TARGET_LD} \
186193 --with-sysroot=${SYSROOT}
187194 runAndLog "Building LLVM-GCC" ${LLVMGCC_OBJ_DIR}/llvmgcc-build.log \
188195 make