Changeset 5a65d29 in mainline
- Timestamp:
- 2013-07-19T14:36:31Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f03c3da
- Parents:
- 6c9f1a6
- Location:
- tools
- Files:
-
- 4 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/toolchain.sh
r6c9f1a6 r5a65d29 55 55 BINUTILS_VERSION="2.23.1" 56 56 BINUTILS_RELEASE="" 57 BINUTILS_PATCHES="toolchain-binutils-2.23.1.patch" 57 58 GCC_VERSION="4.8.1" 59 GCC_PATCHES="toolchain-gcc-4.8.1-targets.patch toolchain-gcc-4.8.1-headers.patch" 58 60 GDB_VERSION="7.6" 61 GDB_PATCHES="toolchain-gdb-7.6.patch" 59 62 60 63 BASEDIR="`pwd`" … … 64 67 65 68 REAL_INSTALL=true 69 USE_HELENOS_TARGET=false 66 70 INSTALL_DIR="${BASEDIR}/PKG" 67 71 … … 138 142 echo 139 143 echo "Syntax:" 140 echo " $0 [--no-install] <platform>"144 echo " $0 [--no-install] [--helenos-target] <platform>" 141 145 echo 142 146 echo "Possible target platforms are:" … … 158 162 echo "CROSS_PREFIX environment variable. If the variable is not" 159 163 echo "defined, /usr/local/cross/ is used as default." 164 echo 160 165 echo "If --no-install is present, the toolchain still uses the" 161 166 echo "CROSS_PREFIX as the target directory but the installation" … … 163 168 echo "the actual root file system. That is only useful if you do" 164 169 echo "not want to run the script under the super user." 170 echo 171 echo "The --helenos-target will build HelenOS-specific toolchain" 172 echo "(i.e. it will use *-helenos-* triplet instead of *-linux-*)." 173 echo "This toolchain is installed into /usr/local/cross-helenos by" 174 echo "default. The settings can be changed by setting environment" 175 echo "variable CROSS_HELENOS_PREFIX." 165 176 echo 166 177 … … 273 284 } 274 285 286 patch_sources() { 287 PATCH_FILE="$1" 288 PATCH_STRIP="$2" 289 DESC="$3" 290 291 change_title "Patching ${DESC}" 292 echo " >>> Patching ${DESC} with ${PATCH_FILE}" 293 294 patch -t "-p${PATCH_STRIP}" <"$PATCH_FILE" 295 check_error $? "Error patching ${DESC}." 296 } 297 275 298 prepare() { 276 299 show_dependencies … … 290 313 case "$1" in 291 314 "amd64") 292 TARGET="amd64-linux-gnu" 315 LINUX_TARGET="amd64-linux-gnu" 316 HELENOS_TARGET="amd64-helenos" 293 317 ;; 294 318 "arm32") 295 TARGET="arm-linux-gnueabi" 319 LINUX_TARGET="arm-linux-gnueabi" 320 HELENOS_TARGET="arm-helenos-gnueabi" 296 321 ;; 297 322 "ia32") 298 TARGET="i686-pc-linux-gnu" 323 LINUX_TARGET="i686-pc-linux-gnu" 324 HELENOS_TARGET="i686-pc-helenos" 299 325 ;; 300 326 "ia64") 301 TARGET="ia64-pc-linux-gnu" 327 LINUX_TARGET="ia64-pc-linux-gnu" 328 HELENOS_TARGET="ia64-pc-helenos" 302 329 ;; 303 330 "mips32") 304 TARGET="mipsel-linux-gnu" 331 LINUX_TARGET="mipsel-linux-gnu" 332 HELENOS_TARGET="mipsel-helenos" 305 333 ;; 306 334 "mips32eb") 307 TARGET="mips-linux-gnu" 335 LINUX_TARGET="mips-linux-gnu" 336 HELENOS_TARGET="mips-helenos" 308 337 ;; 309 338 "mips64") 310 TARGET="mips64el-linux-gnu" 339 LINUX_TARGET="mips64el-linux-gnu" 340 HELENOS_TARGET="mips64el-helenos" 311 341 ;; 312 342 "ppc32") 313 TARGET="ppc-linux-gnu" 343 LINUX_TARGET="ppc-linux-gnu" 344 HELENOS_TARGET="ppc-helenos" 314 345 ;; 315 346 "ppc64") 316 TARGET="ppc64-linux-gnu" 347 LINUX_TARGET="ppc64-linux-gnu" 348 HELENOS_TARGET="ppc64-helenos" 317 349 ;; 318 350 "sparc64") 319 TARGET="sparc64-linux-gnu" 351 LINUX_TARGET="sparc64-linux-gnu" 352 HELENOS_TARGET="sparc64-helenos" 320 353 ;; 321 354 *) … … 327 360 build_target() { 328 361 PLATFORM="$1" 329 # This sets the TARGET variable362 # This sets the *_TARGET variables 330 363 set_target_from_platform "$PLATFORM" 364 if $USE_HELENOS_TARGET; then 365 TARGET="$HELENOS_TARGET" 366 else 367 TARGET="$LINUX_TARGET" 368 fi 331 369 332 370 WORKDIR="${BASEDIR}/${PLATFORM}" … … 339 377 CROSS_PREFIX="/usr/local/cross" 340 378 fi 341 342 PREFIX="${CROSS_PREFIX}/${PLATFORM}" 379 if [ -z "${CROSS_HELENOS_PREFIX}" ] ; then 380 CROSS_HELENOS_PREFIX="/usr/local/cross-helenos" 381 fi 382 383 if $USE_HELENOS_TARGET; then 384 PREFIX="${CROSS_HELENOS_PREFIX}/${PLATFORM}" 385 else 386 PREFIX="${CROSS_PREFIX}/${PLATFORM}" 387 fi 343 388 344 389 echo ">>> Downloading tarballs" … … 362 407 unpack_tarball "${BASEDIR}/${GDB}" "GDB" 363 408 409 echo ">>> Applying patches" 410 for p in $BINUTILS_PATCHES; do 411 patch_sources "${BASEDIR}/${p}" 0 "binutils" 412 done 413 for p in $GCC_PATCHES; do 414 patch_sources "${BASEDIR}/${p}" 0 "GCC" 415 done 416 for p in $GDB_PATCHES; do 417 patch_sources "${BASEDIR}/${p}" 0 "GDB" 418 done 364 419 365 420 echo ">>> Processing binutils (${PLATFORM})" … … 447 502 } 448 503 449 if [ "$1" = "--no-install" ]; then 450 REAL_INSTALL=false 451 shift 452 fi 504 while [ "$#" -gt 1 ]; do 505 case "$1" in 506 --no-install) 507 REAL_INSTALL=false 508 shift 509 ;; 510 --helenos-target) 511 USE_HELENOS_TARGET=true 512 shift 513 ;; 514 *) 515 show_usage 516 ;; 517 esac 518 done 453 519 454 520 if [ "$#" -lt "1" ]; then
Note:
See TracChangeset
for help on using the changeset viewer.