Changes in tools/toolchain.sh [3f7efa79:3666d38] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/toolchain.sh
r3f7efa79 r3666d38 52 52 #endif 53 53 EOF 54 55 BINUTILS_VERSION="2.21" 56 GCC_VERSION="4.6.1" 57 GDB_VERSION="7.2" 58 59 BASEDIR="`pwd`" 60 BINUTILS="binutils-${BINUTILS_VERSION}.tar.bz2" 61 GCC_CORE="gcc-core-${GCC_VERSION}.tar.bz2" 62 GCC_OBJC="gcc-objc-${GCC_VERSION}.tar.bz2" 63 GCC_CPP="gcc-g++-${GCC_VERSION}.tar.bz2" 64 GDB="gdb-${GDB_VERSION}.tar.bz2" 54 65 55 66 # … … 139 150 echo " sparc64 SPARC V9" 140 151 echo " all build all targets" 152 echo " parallel same as 'all', but in parallel" 141 153 echo 142 154 echo "The toolchain will be installed to the directory specified by" 143 155 echo "the CROSS_PREFIX environment variable. If the variable is not" 144 echo "defined, /usr/local will be used by default."156 echo "defined, /usr/local/cross will be used by default." 145 157 echo 146 158 … … 194 206 } 195 207 196 download_ check() {208 download_fetch() { 197 209 SOURCE="$1" 198 210 FILE="$2" … … 208 220 } 209 221 222 source_check() { 223 FILE="$1" 224 225 if [ ! -f "${FILE}" ]; then 226 echo 227 echo "File ${FILE} not found." 228 229 exit 4 230 fi 231 } 232 210 233 cleanup_dir() { 211 234 DIR="$1" … … 241 264 } 242 265 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 266 prepare() { 267 show_dependencies 268 check_dependecies 269 show_countdown 10 270 271 BINUTILS_SOURCE="ftp://ftp.gnu.org/gnu/binutils/" 272 GCC_SOURCE="ftp://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/" 273 GDB_SOURCE="ftp://ftp.gnu.org/gnu/gdb/" 274 275 download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" "c84c5acc9d266f1a7044b51c85a823f5" 276 download_fetch "${GCC_SOURCE}" "${GCC_CORE}" "0c0e7e35d2215e19de9c97efba507553" 277 download_fetch "${GCC_SOURCE}" "${GCC_OBJC}" "cbf0d4b701827922cf37ba6a4ace0079" 278 download_fetch "${GCC_SOURCE}" "${GCC_CPP}" "0d75ca7ca35b1e7f252223f9d23a6ad1" 279 download_fetch "${GDB_SOURCE}" "${GDB}" "64260e6c56979ee750a01055f16091a5" 264 280 } 265 281 … … 268 284 TARGET="$2" 269 285 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`" 286 WORKDIR="${BASEDIR}/${PLATFORM}" 282 287 BINUTILSDIR="${WORKDIR}/binutils-${BINUTILS_VERSION}" 283 288 GCCDIR="${WORKDIR}/gcc-${GCC_VERSION}" 284 289 OBJDIR="${WORKDIR}/gcc-obj" 290 GDBDIR="${WORKDIR}/gdb-${GDB_VERSION}" 285 291 286 292 if [ -z "${CROSS_PREFIX}" ] ; then 287 CROSS_PREFIX="/usr/local "293 CROSS_PREFIX="/usr/local/cross" 288 294 fi 289 295 … … 291 297 292 298 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" 299 source_check "${BASEDIR}/${BINUTILS}" 300 source_check "${BASEDIR}/${GCC_CORE}" 301 source_check "${BASEDIR}/${GCC_OBJC}" 302 source_check "${BASEDIR}/${GCC_CPP}" 303 source_check "${BASEDIR}/${GDB}" 297 304 298 305 echo ">>> Removing previous content" 299 306 cleanup_dir "${PREFIX}" 300 cleanup_dir "${OBJDIR}" 301 cleanup_dir "${BINUTILSDIR}" 302 cleanup_dir "${GCCDIR}" 307 cleanup_dir "${WORKDIR}" 303 308 304 309 create_dir "${PREFIX}" "destination directory" … … 306 311 307 312 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++" 313 cd "${WORKDIR}" 314 check_error $? "Change directory failed." 315 316 unpack_tarball "${BASEDIR}/${BINUTILS}" "binutils" 317 unpack_tarball "${BASEDIR}/${GCC_CORE}" "GCC Core" 318 unpack_tarball "${BASEDIR}/${GCC_OBJC}" "Objective C" 319 unpack_tarball "${BASEDIR}/${GCC_CPP}" "C++" 320 unpack_tarball "${BASEDIR}/${GDB}" "GDB" 312 321 313 322 echo ">>> Processing binutils (${PLATFORM})" 314 323 cd "${BINUTILSDIR}" 315 324 check_error $? "Change directory failed." 316 patch_binutils "${PLATFORM}"317 325 318 326 change_title "binutils: configure (${PLATFORM})" 319 ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --disable-nls327 CFLAGS=-Wno-error ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --disable-nls 320 328 check_error $? "Error configuring binutils." 321 329 … … 336 344 check_error $? "Error compiling/installing GCC." 337 345 338 cd "${WORKDIR}" 346 echo ">>> Processing GDB (${PLATFORM})" 347 cd "${GDBDIR}" 339 348 check_error $? "Change directory failed." 340 349 350 change_title "GDB: configure (${PLATFORM})" 351 ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" 352 check_error $? "Error configuring GDB." 353 354 change_title "GDB: make (${PLATFORM})" 355 make all install 356 check_error $? "Error compiling/installing GDB." 357 358 cd "${BASEDIR}" 359 check_error $? "Change directory failed." 360 341 361 echo ">>> Cleaning up" 342 cleanup_dir "${OBJDIR}" 343 cleanup_dir "${BINUTILSDIR}" 344 cleanup_dir "${GCCDIR}" 362 cleanup_dir "${WORKDIR}" 345 363 346 364 echo … … 352 370 fi 353 371 354 show_dependencies355 check_dependecies356 show_countdown 10357 358 372 case "$1" in 359 373 "amd64") 374 prepare 360 375 build_target "amd64" "amd64-linux-gnu" 361 376 ;; 362 377 "arm32") 378 prepare 363 379 build_target "arm32" "arm-linux-gnu" 364 380 ;; 365 381 "ia32") 382 prepare 366 383 build_target "ia32" "i686-pc-linux-gnu" 367 384 ;; 368 385 "ia64") 386 prepare 369 387 build_target "ia64" "ia64-pc-linux-gnu" 370 388 ;; 371 "ia64")372 build_target "ia64" "ia64-pc-linux-gnu"373 ;;374 389 "mips32") 390 prepare 375 391 build_target "mips32" "mipsel-linux-gnu" 376 392 ;; 377 393 "mips32eb") 394 prepare 378 395 build_target "mips32eb" "mips-linux-gnu" 379 396 ;; 380 397 "mips64") 398 prepare 381 399 build_target "mips64" "mips64el-linux-gnu" 382 400 ;; 383 401 "ppc32") 402 prepare 384 403 build_target "ppc32" "ppc-linux-gnu" 385 404 ;; 386 405 "ppc64") 406 prepare 387 407 build_target "ppc64" "ppc64-linux-gnu" 388 408 ;; 389 409 "sparc64") 410 prepare 390 411 build_target "sparc64" "sparc64-linux-gnu" 391 412 ;; 392 413 "all") 414 prepare 393 415 build_target "amd64" "amd64-linux-gnu" 394 416 build_target "arm32" "arm-linux-gnu" 395 417 build_target "ia32" "i686-pc-linux-gnu" 396 build_target "ia64" "ia64-pc-linux-gnu"397 418 build_target "ia64" "ia64-pc-linux-gnu" 398 419 build_target "mips32" "mipsel-linux-gnu" … … 403 424 build_target "sparc64" "sparc64-linux-gnu" 404 425 ;; 426 "parallel") 427 prepare 428 build_target "amd64" "amd64-linux-gnu" & 429 build_target "arm32" "arm-linux-gnu" & 430 build_target "ia32" "i686-pc-linux-gnu" & 431 build_target "ia64" "ia64-pc-linux-gnu" & 432 build_target "mips32" "mipsel-linux-gnu" & 433 build_target "mips32eb" "mips-linux-gnu" & 434 build_target "mips64" "mips64el-linux-gnu" & 435 build_target "ppc32" "ppc-linux-gnu" & 436 build_target "ppc64" "ppc64-linux-gnu" & 437 build_target "sparc64" "sparc64-linux-gnu" & 438 wait 439 ;; 405 440 *) 406 441 show_usage
Note:
See TracChangeset
for help on using the changeset viewer.