Changeset 322ac35c in mainline
- Timestamp:
- 2013-07-16T13:01:08Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6c9f1a6
- Parents:
- cdc8a391
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/toolchain.sh
rcdc8a391 r322ac35c 62 62 GCC="gcc-${GCC_VERSION}.tar.bz2" 63 63 GDB="gdb-${GDB_VERSION}.tar.bz2" 64 65 REAL_INSTALL=true 66 INSTALL_DIR="${BASEDIR}/PKG" 64 67 65 68 # … … 135 138 echo 136 139 echo "Syntax:" 137 echo " $0 <platform>"140 echo " $0 [--no-install] <platform>" 138 141 echo 139 142 echo "Possible target platforms are:" … … 152 155 echo " 2-way same as 'all', but 2-way parallel" 153 156 echo 154 echo "The toolchain will be installed to the directory specified by" 155 echo "the CROSS_PREFIX environment variable. If the variable is not" 156 echo "defined, /usr/local/cross will be used by default." 157 echo "The toolchain is installed into directory specified by the" 158 echo "CROSS_PREFIX environment variable. If the variable is not" 159 echo "defined, /usr/local/cross/ is used as default." 160 echo "If --no-install is present, the toolchain still uses the" 161 echo "CROSS_PREFIX as the target directory but the installation" 162 echo "copies the files into PKG/ subdirectory without affecting" 163 echo "the actual root file system. That is only useful if you do" 164 echo "not want to run the script under the super user." 157 165 echo 158 166 … … 301 309 302 310 echo ">>> Removing previous content" 303 cleanup_dir "${PREFIX}"311 $REAL_INSTALL && cleanup_dir "${PREFIX}" 304 312 cleanup_dir "${WORKDIR}" 305 313 306 create_dir "${PREFIX}" "destination directory"314 $REAL_INSTALL && create_dir "${PREFIX}" "destination directory" 307 315 create_dir "${OBJDIR}" "GCC object directory" 308 316 … … 315 323 unpack_tarball "${BASEDIR}/${GDB}" "GDB" 316 324 325 317 326 echo ">>> Processing binutils (${PLATFORM})" 318 327 cd "${BINUTILSDIR}" … … 320 329 321 330 change_title "binutils: configure (${PLATFORM})" 322 CFLAGS=-Wno-error ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --disable-nls --disable-werror 331 CFLAGS=-Wno-error ./configure \ 332 "--target=${TARGET}" \ 333 "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" \ 334 --disable-nls --disable-werror 323 335 check_error $? "Error configuring binutils." 324 336 325 337 change_title "binutils: make (${PLATFORM})" 326 make all install 327 check_error $? "Error compiling/installing binutils." 338 make all 339 check_error $? "Error compiling binutils." 340 341 change_title "binutils: install (${PLATFORM})" 342 if $REAL_INSTALL; then 343 make install 344 else 345 make install "DESTDIR=${INSTALL_DIR}" 346 fi 347 check_error $? "Error installing binutils." 348 328 349 329 350 echo ">>> Processing GCC (${PLATFORM})" … … 332 353 333 354 change_title "GCC: configure (${PLATFORM})" 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 355 PATH="$PATH:${INSTALL_DIR}/${PREFIX}/bin" "${GCCDIR}/configure" \ 356 "--target=${TARGET}" \ 357 "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" \ 358 --with-gnu-as --with-gnu-ld --disable-nls --disable-threads \ 359 --enable-languages=c,objc,c++,obj-c++ \ 360 --disable-multilib --disable-libgcj --without-headers \ 361 --disable-shared --enable-lto --disable-werror 335 362 check_error $? "Error configuring GCC." 336 363 337 364 change_title "GCC: make (${PLATFORM})" 338 PATH="${PATH}:${PREFIX}/bin" make all-gcc install-gcc 339 check_error $? "Error compiling/installing GCC." 365 PATH="${PATH}:${PREFIX}/bin:${INSTALL_DIR}/${PREFIX}/bin" make all-gcc 366 check_error $? "Error compiling GCC." 367 368 change_title "GCC: install (${PLATFORM})" 369 if $REAL_INSTALL; then 370 PATH="${PATH}:${PREFIX}/bin" make install-gcc 371 else 372 PATH="${PATH}:${INSTALL_DIR}/${PREFIX}/bin" make install-gcc "DESTDIR=${INSTALL_DIR}" 373 fi 374 check_error $? "Error installing GCC." 375 340 376 341 377 echo ">>> Processing GDB (${PLATFORM})" … … 344 380 345 381 change_title "GDB: configure (${PLATFORM})" 346 ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" 382 PATH="$PATH:${INSTALL_DIR}/${PREFIX}/bin" ./configure \ 383 "--target=${TARGET}" \ 384 "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" 347 385 check_error $? "Error configuring GDB." 348 386 349 387 change_title "GDB: make (${PLATFORM})" 350 make all install 351 check_error $? "Error compiling/installing GDB." 388 PATH="${PATH}:${PREFIX}/bin:${INSTALL_DIR}/${PREFIX}/bin" make all 389 check_error $? "Error compiling GDB." 390 391 change_title "GDB: make (${PLATFORM})" 392 if $REAL_INSTALL; then 393 PATH="${PATH}:${PREFIX}/bin" make install 394 else 395 PATH="${PATH}:${INSTALL_DIR}/${PREFIX}/bin" make install "DESTDIR=${INSTALL_DIR}" 396 fi 397 check_error $? "Error installing GDB." 398 352 399 353 400 cd "${BASEDIR}" … … 360 407 echo ">>> Cross-compiler for ${TARGET} installed." 361 408 } 409 410 if [ "$1" = "--no-install" ]; then 411 REAL_INSTALL=false 412 shift 413 fi 362 414 363 415 if [ "$#" -lt "1" ]; then
Note:
See TracChangeset
for help on using the changeset viewer.