Changeset e353e85 in mainline for tools/toolchain.sh
- Timestamp:
- 2011-04-01T11:59:10Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9b640c42
- Parents:
- cd1e6b62 (diff), 27bdfa5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/toolchain.sh
rcd1e6b62 re353e85 52 52 #endif 53 53 EOF 54 55 BINUTILS_VERSION="2.21" 56 GCC_VERSION="4.6.0" 57 58 BASEDIR="`pwd`" 59 BINUTILS="binutils-${BINUTILS_VERSION}.tar.bz2" 60 GCC_CORE="gcc-core-${GCC_VERSION}.tar.bz2" 61 GCC_OBJC="gcc-objc-${GCC_VERSION}.tar.bz2" 62 GCC_CPP="gcc-g++-${GCC_VERSION}.tar.bz2" 54 63 55 64 # … … 139 148 echo " sparc64 SPARC V9" 140 149 echo " all build all targets" 150 echo " parallel same as 'all', but in parallel" 141 151 echo 142 152 echo "The toolchain will be installed to the directory specified by" 143 153 echo "the CROSS_PREFIX environment variable. If the variable is not" 144 echo "defined, /usr/local will be used by default."154 echo "defined, /usr/local/cross will be used by default." 145 155 echo 146 156 … … 194 204 } 195 205 196 download_ check() {206 download_fetch() { 197 207 SOURCE="$1" 198 208 FILE="$2" … … 208 218 } 209 219 220 source_check() { 221 FILE="$1" 222 223 if [ ! -f "${FILE}" ]; then 224 echo 225 echo "File ${FILE} not found." 226 227 exit 4 228 fi 229 } 230 210 231 cleanup_dir() { 211 232 DIR="$1" … … 241 262 } 242 263 243 patch_binutils() { 244 PLATFORM="$1" 245 246 if [ "${PLATFORM}" == "arm32" ] ; then 247 patch -p1 <<EOF 248 diff -Naur binutils-2.20.orig/gas/config/tc-arm.c binutils-2.20/gas/config/tc-arm.c 249 --- binutils-2.20.orig/gas/config/tc-arm.c 2009-08-30 00:10:59.000000000 +0200 250 +++ binutils-2.20/gas/config/tc-arm.c 2009-11-02 14:25:11.000000000 +0100 251 @@ -2485,8 +2485,9 @@ 252 know (frag->tc_frag_data.first_map == NULL); 253 frag->tc_frag_data.first_map = symbolP; 254 } 255 - if (frag->tc_frag_data.last_map != NULL) 256 + if (frag->tc_frag_data.last_map != NULL) { 257 know (S_GET_VALUE (frag->tc_frag_data.last_map) < S_GET_VALUE (symbolP)); 258 + } 259 frag->tc_frag_data.last_map = symbolP; 260 } 261 EOF 262 check_error $? "Error patching binutils" 263 fi 264 prepare() { 265 show_dependencies 266 check_dependecies 267 show_countdown 10 268 269 BINUTILS_SOURCE="ftp://ftp.gnu.org/gnu/binutils/" 270 GCC_SOURCE="ftp://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/" 271 272 download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" "c84c5acc9d266f1a7044b51c85a823f5" 273 download_fetch "${GCC_SOURCE}" "${GCC_CORE}" "b1957f3209080b2f55bc3756d3a62b7c" 274 download_fetch "${GCC_SOURCE}" "${GCC_OBJC}" "120d4675366ee82ea52f9ed65b57da04" 275 download_fetch "${GCC_SOURCE}" "${GCC_CPP}" "a30090fa655d0db4c970740d353c81f1" 264 276 } 265 277 … … 268 280 TARGET="$2" 269 281 270 BINUTILS_VERSION="2.20" 271 GCC_VERSION="4.5.1" 272 273 BINUTILS="binutils-${BINUTILS_VERSION}.tar.bz2" 274 GCC_CORE="gcc-core-${GCC_VERSION}.tar.bz2" 275 GCC_OBJC="gcc-objc-${GCC_VERSION}.tar.bz2" 276 GCC_CPP="gcc-g++-${GCC_VERSION}.tar.bz2" 277 278 BINUTILS_SOURCE="ftp://ftp.gnu.org/gnu/binutils/" 279 GCC_SOURCE="ftp://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/" 280 281 WORKDIR="`pwd`" 282 WORKDIR="${BASEDIR}/${PLATFORM}" 282 283 BINUTILSDIR="${WORKDIR}/binutils-${BINUTILS_VERSION}" 283 284 GCCDIR="${WORKDIR}/gcc-${GCC_VERSION}" … … 285 286 286 287 if [ -z "${CROSS_PREFIX}" ] ; then 287 CROSS_PREFIX="/usr/local "288 CROSS_PREFIX="/usr/local/cross" 288 289 fi 289 290 … … 291 292 292 293 echo ">>> Downloading tarballs" 293 download_check "${BINUTILS_SOURCE}" "${BINUTILS}" "ee2d3e996e9a2d669808713360fa96f8"294 download_check "${GCC_SOURCE}" "${GCC_CORE}" "dc8959e31b01a65ce10d269614815054"295 download_check "${GCC_SOURCE}" "${GCC_OBJC}" "3c11b7037896e967eddf8178af2ddd98"296 download_check "${GCC_SOURCE}" "${GCC_CPP}" "b294953ff0bb2f20c7acb2bf005d832a"294 source_check "${BASEDIR}/${BINUTILS}" 295 source_check "${BASEDIR}/${GCC_CORE}" 296 source_check "${BASEDIR}/${GCC_OBJC}" 297 source_check "${BASEDIR}/${GCC_CPP}" 297 298 298 299 echo ">>> Removing previous content" 299 300 cleanup_dir "${PREFIX}" 300 cleanup_dir "${OBJDIR}" 301 cleanup_dir "${BINUTILSDIR}" 302 cleanup_dir "${GCCDIR}" 301 cleanup_dir "${WORKDIR}" 303 302 304 303 create_dir "${PREFIX}" "destination directory" … … 306 305 307 306 echo ">>> Unpacking tarballs" 308 unpack_tarball "${BINUTILS}" "binutils" 309 unpack_tarball "${GCC_CORE}" "GCC Core" 310 unpack_tarball "${GCC_OBJC}" "Objective C" 311 unpack_tarball "${GCC_CPP}" "C++" 307 cd "${WORKDIR}" 308 check_error $? "Change directory failed." 309 310 unpack_tarball "${BASEDIR}/${BINUTILS}" "binutils" 311 unpack_tarball "${BASEDIR}/${GCC_CORE}" "GCC Core" 312 unpack_tarball "${BASEDIR}/${GCC_OBJC}" "Objective C" 313 unpack_tarball "${BASEDIR}/${GCC_CPP}" "C++" 312 314 313 315 echo ">>> Processing binutils (${PLATFORM})" 314 316 cd "${BINUTILSDIR}" 315 317 check_error $? "Change directory failed." 316 patch_binutils "${PLATFORM}"317 318 318 319 change_title "binutils: configure (${PLATFORM})" … … 336 337 check_error $? "Error compiling/installing GCC." 337 338 338 cd "${ WORKDIR}"339 cd "${BASEDIR}" 339 340 check_error $? "Change directory failed." 340 341 341 342 echo ">>> Cleaning up" 342 cleanup_dir "${OBJDIR}" 343 cleanup_dir "${BINUTILSDIR}" 344 cleanup_dir "${GCCDIR}" 343 cleanup_dir "${WORKDIR}" 345 344 346 345 echo … … 352 351 fi 353 352 354 show_dependencies355 check_dependecies356 show_countdown 10357 358 353 case "$1" in 359 354 "amd64") 355 prepare 360 356 build_target "amd64" "amd64-linux-gnu" 361 357 ;; 362 358 "arm32") 359 prepare 363 360 build_target "arm32" "arm-linux-gnu" 364 361 ;; 365 362 "ia32") 363 prepare 366 364 build_target "ia32" "i686-pc-linux-gnu" 367 365 ;; 368 366 "ia64") 367 prepare 369 368 build_target "ia64" "ia64-pc-linux-gnu" 370 369 ;; 371 "ia64")372 build_target "ia64" "ia64-pc-linux-gnu"373 ;;374 370 "mips32") 371 prepare 375 372 build_target "mips32" "mipsel-linux-gnu" 376 373 ;; 377 374 "mips32eb") 375 prepare 378 376 build_target "mips32eb" "mips-linux-gnu" 379 377 ;; 380 378 "mips64") 379 prepare 381 380 build_target "mips64" "mips64el-linux-gnu" 382 381 ;; 383 382 "ppc32") 383 prepare 384 384 build_target "ppc32" "ppc-linux-gnu" 385 385 ;; 386 386 "ppc64") 387 prepare 387 388 build_target "ppc64" "ppc64-linux-gnu" 388 389 ;; 389 390 "sparc64") 391 prepare 390 392 build_target "sparc64" "sparc64-linux-gnu" 391 393 ;; 392 394 "all") 395 prepare 393 396 build_target "amd64" "amd64-linux-gnu" 394 397 build_target "arm32" "arm-linux-gnu" 395 398 build_target "ia32" "i686-pc-linux-gnu" 396 build_target "ia64" "ia64-pc-linux-gnu"397 399 build_target "ia64" "ia64-pc-linux-gnu" 398 400 build_target "mips32" "mipsel-linux-gnu" … … 403 405 build_target "sparc64" "sparc64-linux-gnu" 404 406 ;; 407 "parallel") 408 prepare 409 build_target "amd64" "amd64-linux-gnu" & 410 build_target "arm32" "arm-linux-gnu" & 411 build_target "ia32" "i686-pc-linux-gnu" & 412 build_target "ia64" "ia64-pc-linux-gnu" & 413 build_target "mips32" "mipsel-linux-gnu" & 414 build_target "mips32eb" "mips-linux-gnu" & 415 build_target "mips64" "mips64el-linux-gnu" & 416 build_target "ppc32" "ppc-linux-gnu" & 417 build_target "ppc64" "ppc64-linux-gnu" & 418 build_target "sparc64" "sparc64-linux-gnu" & 419 wait 420 ;; 405 421 *) 406 422 show_usage
Note:
See TracChangeset
for help on using the changeset viewer.