Changeset c9f61150 in mainline for tools/toolchain.sh
- Timestamp:
- 2013-05-30T14:16:53Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6e8e4e19
- Parents:
- 9bda5d90 (diff), 469739f (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
r9bda5d90 rc9f61150 53 53 EOF 54 54 55 BINUTILS_VERSION="2.2 2"55 BINUTILS_VERSION="2.23.1" 56 56 BINUTILS_RELEASE="" 57 #GCC_VERSION="4.7.2" 58 GCC_VERSION="4.7.3" 59 #GCC_VERSION="4.8.0" 60 GDB_VERSION="7.5" 57 GCC_VERSION="4.8.0" 58 GDB_VERSION="7.5.1" 61 59 62 60 BASEDIR="`pwd`" … … 73 71 HEADER="$2" 74 72 BODY="$3" 75 73 76 74 FNAME="/tmp/conftest-$$" 77 75 78 76 echo "#include ${HEADER}" > "${FNAME}.c" 79 77 echo >> "${FNAME}.c" … … 83 81 echo " return 0;" >> "${FNAME}.c" 84 82 echo "}" >> "${FNAME}.c" 85 83 86 84 cc -c -o "${FNAME}.o" "${FNAME}.c" 2> "${FNAME}.log" 87 85 RC="$?" 88 86 89 87 if [ "$RC" -ne "0" ] ; then 90 88 echo " ${DEPENDENCY} not found, too old or compiler error." … … 115 113 echo 116 114 echo "Script failed: $2" 117 115 118 116 exit 1 119 117 fi … … 123 121 FILE="$1" 124 122 SUM="$2" 125 123 126 124 COMPUTED="`md5sum "${FILE}" | cut -d' ' -f1`" 127 125 if [ "${SUM}" != "${COMPUTED}" ] ; then 128 126 echo 129 127 echo "Checksum of ${FILE} does not match." 130 128 131 129 exit 2 132 130 fi … … 158 156 echo "defined, /usr/local/cross will be used by default." 159 157 echo 160 158 161 159 exit 3 162 160 } … … 168 166 show_countdown() { 169 167 TM="$1" 170 168 171 169 if [ "${TM}" -eq 0 ] ; then 172 170 echo 173 171 return 0 174 172 fi 175 173 176 174 echo -n "${TM} " 177 175 change_title "${TM}" 178 176 sleep 1 179 177 180 178 TM="`expr "${TM}" - 1`" 181 179 show_countdown "${TM}" … … 213 211 FILE="$2" 214 212 CHECKSUM="$3" 215 213 216 214 if [ ! -f "${FILE}" ]; then 217 215 change_title "Downloading ${FILE}" … … 219 217 check_error $? "Error downloading ${FILE}." 220 218 fi 221 219 222 220 check_md5 "${FILE}" "${CHECKSUM}" 223 221 } … … 225 223 source_check() { 226 224 FILE="$1" 227 225 228 226 if [ ! -f "${FILE}" ]; then 229 227 echo 230 228 echo "File ${FILE} not found." 231 229 232 230 exit 4 233 231 fi … … 236 234 cleanup_dir() { 237 235 DIR="$1" 238 236 239 237 if [ -d "${DIR}" ]; then 240 238 change_title "Removing ${DIR}" … … 247 245 DIR="$1" 248 246 DESC="$2" 249 247 250 248 change_title "Creating ${DESC}" 251 249 echo ">>> Creating ${DESC}" 252 250 253 251 mkdir -p "${DIR}" 254 252 test -d "${DIR}" … … 259 257 FILE="$1" 260 258 DESC="$2" 261 259 262 260 change_title "Unpacking ${DESC}" 263 261 echo " >>> Unpacking ${DESC}" 264 262 265 263 tar -xjf "${FILE}" 266 264 check_error $? "Error unpacking ${DESC}." … … 271 269 check_dependecies 272 270 show_countdown 10 273 271 274 272 BINUTILS_SOURCE="ftp://ftp.gnu.org/gnu/binutils/" 275 273 GCC_SOURCE="ftp://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/" 276 274 GDB_SOURCE="ftp://ftp.gnu.org/gnu/gdb/" 277 278 download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" " ee0f10756c84979622b992a4a61ea3f5"279 download_fetch "${GCC_SOURCE}" "${GCC}" " cc308a0891e778cfda7a151ab8a6e762"280 download_fetch "${GDB_SOURCE}" "${GDB}" " 24a6779a9fe0260667710de1b082ef61"275 276 download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" "33adb18c3048d057ac58d07a3f1adb38" 277 download_fetch "${GCC_SOURCE}" "${GCC}" "e6040024eb9e761c3bea348d1fa5abb0" 278 download_fetch "${GDB_SOURCE}" "${GDB}" "3f48f468b24447cf24820054ff6e85b1" 281 279 } 282 280 … … 284 282 PLATFORM="$1" 285 283 TARGET="$2" 286 284 287 285 WORKDIR="${BASEDIR}/${PLATFORM}" 288 286 BINUTILSDIR="${WORKDIR}/binutils-${BINUTILS_VERSION}" … … 290 288 OBJDIR="${WORKDIR}/gcc-obj" 291 289 GDBDIR="${WORKDIR}/gdb-${GDB_VERSION}" 292 290 293 291 if [ -z "${CROSS_PREFIX}" ] ; then 294 292 CROSS_PREFIX="/usr/local/cross" 295 293 fi 296 294 297 295 PREFIX="${CROSS_PREFIX}/${PLATFORM}" 298 296 299 297 echo ">>> Downloading tarballs" 300 #source_check "${BASEDIR}/${BINUTILS}"298 source_check "${BASEDIR}/${BINUTILS}" 301 299 source_check "${BASEDIR}/${GCC}" 302 #source_check "${BASEDIR}/${GDB}"303 300 source_check "${BASEDIR}/${GDB}" 301 304 302 echo ">>> Removing previous content" 305 #cleanup_dir "${PREFIX}"306 #cleanup_dir "${WORKDIR}"307 303 cleanup_dir "${PREFIX}" 304 cleanup_dir "${WORKDIR}" 305 308 306 create_dir "${PREFIX}" "destination directory" 309 307 create_dir "${OBJDIR}" "GCC object directory" 310 308 311 309 echo ">>> Unpacking tarballs" 312 310 cd "${WORKDIR}" 313 311 check_error $? "Change directory failed." 314 315 #unpack_tarball "${BASEDIR}/${BINUTILS}" "binutils"312 313 unpack_tarball "${BASEDIR}/${BINUTILS}" "binutils" 316 314 unpack_tarball "${BASEDIR}/${GCC}" "GCC" 317 #unpack_tarball "${BASEDIR}/${GDB}" "GDB"318 319 #echo ">>> Processing binutils (${PLATFORM})"320 #cd "${BINUTILSDIR}"321 #check_error $? "Change directory failed."322 323 #change_title "binutils: configure (${PLATFORM})"324 #CFLAGS=-Wno-error ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --disable-nls --disable-werror325 #check_error $? "Error configuring binutils."326 327 #change_title "binutils: make (${PLATFORM})"328 #make all install329 #check_error $? "Error compiling/installing binutils."330 315 unpack_tarball "${BASEDIR}/${GDB}" "GDB" 316 317 echo ">>> Processing binutils (${PLATFORM})" 318 cd "${BINUTILSDIR}" 319 check_error $? "Change directory failed." 320 321 change_title "binutils: configure (${PLATFORM})" 322 CFLAGS=-Wno-error ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --disable-nls --disable-werror 323 check_error $? "Error configuring binutils." 324 325 change_title "binutils: make (${PLATFORM})" 326 make all install 327 check_error $? "Error compiling/installing binutils." 328 331 329 echo ">>> Processing GCC (${PLATFORM})" 332 330 cd "${OBJDIR}" 333 331 check_error $? "Change directory failed." 334 332 335 333 change_title "GCC: configure (${PLATFORM})" 336 334 "${GCCDIR}/configure" "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --with-gnu-as --with-gnu-ld --disable-nls --disable-threads --enable-languages=c,objc,c++,obj-c++ --disable-multilib --disable-libgcj --without-headers --disable-shared --enable-lto --disable-werror 337 335 check_error $? "Error configuring GCC." 338 336 339 337 change_title "GCC: make (${PLATFORM})" 340 338 PATH="${PATH}:${PREFIX}/bin" make all-gcc install-gcc 341 339 check_error $? "Error compiling/installing GCC." 342 343 #echo ">>> Processing GDB (${PLATFORM})"344 #cd "${GDBDIR}"345 #check_error $? "Change directory failed."346 347 #change_title "GDB: configure (${PLATFORM})"348 #./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-"349 #check_error $? "Error configuring GDB."350 351 #change_title "GDB: make (${PLATFORM})"352 #make all install353 #check_error $? "Error compiling/installing GDB."354 340 341 echo ">>> Processing GDB (${PLATFORM})" 342 cd "${GDBDIR}" 343 check_error $? "Change directory failed." 344 345 change_title "GDB: configure (${PLATFORM})" 346 ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" 347 check_error $? "Error configuring GDB." 348 349 change_title "GDB: make (${PLATFORM})" 350 make all install 351 check_error $? "Error compiling/installing GDB." 352 355 353 cd "${BASEDIR}" 356 354 check_error $? "Change directory failed." 357 355 358 356 echo ">>> Cleaning up" 359 357 cleanup_dir "${WORKDIR}" 360 358 361 359 echo 362 360 echo ">>> Cross-compiler for ${TARGET} installed." … … 369 367 case "$1" in 370 368 "amd64") 371 #prepare369 prepare 372 370 build_target "amd64" "amd64-linux-gnu" 373 371 ;; … … 377 375 ;; 378 376 "ia32") 379 #prepare377 prepare 380 378 build_target "ia32" "i686-pc-linux-gnu" 381 379 ;; … … 440 438 build_target "arm32" "arm-linux-gnueabi" & 441 439 wait 442 440 443 441 build_target "ia32" "i686-pc-linux-gnu" & 444 442 build_target "ia64" "ia64-pc-linux-gnu" & 445 443 wait 446 444 447 445 build_target "mips32" "mipsel-linux-gnu" & 448 446 build_target "mips32eb" "mips-linux-gnu" & 449 447 wait 450 448 451 449 build_target "mips64" "mips64el-linux-gnu" & 452 450 build_target "ppc32" "ppc-linux-gnu" & 453 451 wait 454 452 455 453 build_target "ppc64" "ppc64-linux-gnu" & 456 454 build_target "sparc64" "sparc64-linux-gnu" &
Note:
See TracChangeset
for help on using the changeset viewer.