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