Changes in tools/toolchain.sh [603c8740:3f7efa79] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/toolchain.sh
r603c8740 r3f7efa79 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"63 54 64 55 # … … 148 139 echo " sparc64 SPARC V9" 149 140 echo " all build all targets" 150 echo " parallel same as 'all', but in parallel"151 141 echo 152 142 echo "The toolchain will be installed to the directory specified by" 153 143 echo "the CROSS_PREFIX environment variable. If the variable is not" 154 echo "defined, /usr/local /crosswill be used by default."144 echo "defined, /usr/local will be used by default." 155 145 echo 156 146 … … 204 194 } 205 195 206 download_ fetch() {196 download_check() { 207 197 SOURCE="$1" 208 198 FILE="$2" … … 218 208 } 219 209 220 source_check() {221 FILE="$1"222 223 if [ ! -f "${FILE}" ]; then224 echo225 echo "File ${FILE} not found."226 227 exit 4228 fi229 }230 231 210 cleanup_dir() { 232 211 DIR="$1" … … 262 241 } 263 242 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" 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 276 264 } 277 265 … … 280 268 TARGET="$2" 281 269 282 WORKDIR="${BASEDIR}/${PLATFORM}" 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`" 283 282 BINUTILSDIR="${WORKDIR}/binutils-${BINUTILS_VERSION}" 284 283 GCCDIR="${WORKDIR}/gcc-${GCC_VERSION}" … … 286 285 287 286 if [ -z "${CROSS_PREFIX}" ] ; then 288 CROSS_PREFIX="/usr/local /cross"287 CROSS_PREFIX="/usr/local" 289 288 fi 290 289 … … 292 291 293 292 echo ">>> Downloading tarballs" 294 source_check "${BASEDIR}/${BINUTILS}"295 source_check "${BASEDIR}/${GCC_CORE}"296 source_check "${BASEDIR}/${GCC_OBJC}"297 source_check "${BASEDIR}/${GCC_CPP}"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" 298 297 299 298 echo ">>> Removing previous content" 300 299 cleanup_dir "${PREFIX}" 301 cleanup_dir "${WORKDIR}" 300 cleanup_dir "${OBJDIR}" 301 cleanup_dir "${BINUTILSDIR}" 302 cleanup_dir "${GCCDIR}" 302 303 303 304 create_dir "${PREFIX}" "destination directory" … … 305 306 306 307 echo ">>> Unpacking tarballs" 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++" 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++" 314 312 315 313 echo ">>> Processing binutils (${PLATFORM})" 316 314 cd "${BINUTILSDIR}" 317 315 check_error $? "Change directory failed." 316 patch_binutils "${PLATFORM}" 318 317 319 318 change_title "binutils: configure (${PLATFORM})" … … 337 336 check_error $? "Error compiling/installing GCC." 338 337 339 cd "${ BASEDIR}"338 cd "${WORKDIR}" 340 339 check_error $? "Change directory failed." 341 340 342 341 echo ">>> Cleaning up" 343 cleanup_dir "${WORKDIR}" 342 cleanup_dir "${OBJDIR}" 343 cleanup_dir "${BINUTILSDIR}" 344 cleanup_dir "${GCCDIR}" 344 345 345 346 echo … … 351 352 fi 352 353 354 show_dependencies 355 check_dependecies 356 show_countdown 10 357 353 358 case "$1" in 354 359 "amd64") 355 prepare356 360 build_target "amd64" "amd64-linux-gnu" 357 361 ;; 358 362 "arm32") 359 prepare360 363 build_target "arm32" "arm-linux-gnu" 361 364 ;; 362 365 "ia32") 363 prepare364 366 build_target "ia32" "i686-pc-linux-gnu" 365 367 ;; 366 368 "ia64") 367 prepare368 369 build_target "ia64" "ia64-pc-linux-gnu" 369 370 ;; 371 "ia64") 372 build_target "ia64" "ia64-pc-linux-gnu" 373 ;; 370 374 "mips32") 371 prepare372 375 build_target "mips32" "mipsel-linux-gnu" 373 376 ;; 374 377 "mips32eb") 375 prepare376 378 build_target "mips32eb" "mips-linux-gnu" 377 379 ;; 378 380 "mips64") 379 prepare380 381 build_target "mips64" "mips64el-linux-gnu" 381 382 ;; 382 383 "ppc32") 383 prepare384 384 build_target "ppc32" "ppc-linux-gnu" 385 385 ;; 386 386 "ppc64") 387 prepare388 387 build_target "ppc64" "ppc64-linux-gnu" 389 388 ;; 390 389 "sparc64") 391 prepare392 390 build_target "sparc64" "sparc64-linux-gnu" 393 391 ;; 394 392 "all") 395 prepare396 393 build_target "amd64" "amd64-linux-gnu" 397 394 build_target "arm32" "arm-linux-gnu" 398 395 build_target "ia32" "i686-pc-linux-gnu" 396 build_target "ia64" "ia64-pc-linux-gnu" 399 397 build_target "ia64" "ia64-pc-linux-gnu" 400 398 build_target "mips32" "mipsel-linux-gnu" … … 405 403 build_target "sparc64" "sparc64-linux-gnu" 406 404 ;; 407 "parallel")408 prepare409 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 wait420 ;;421 405 *) 422 406 show_usage
Note:
See TracChangeset
for help on using the changeset viewer.