├── README.md ├── build-tools.sh ├── config-master.inc.sh ├── download.sh ├── files ├── asis_2016 │ ├── 0001-Change-Name_Find-to-Name_Find_Str.patch │ ├── 0002-Remove-strong-version-check.patch │ ├── 0003-Fix-spelling.patch │ ├── 0004-Set-all-Initialize-commands-to-a-weak-version-check.patch │ └── MANIFEST ├── gcc-4.9.2 │ └── 0001-Reinstate-dropped-code.patch ├── gcc-6.4.0 │ └── finalization_size.patch ├── gnatmem │ └── 0001-Added-missing-libs.patch ├── gprbuild │ ├── 0001-Added-gnatvsn.adb-from-FSF-GCC-4.9.2.-Modified-to-re.patch │ ├── 0002-Removed-reference-to-Pro.patch │ ├── 0003-Removed-reference-to-Try_Help-which-is-GNAT-Pro-only.patch │ ├── 0004-Changed-parameter-name-from-Env-to-Root_Environment.patch │ ├── 0005-Added-back-in-Rewrite_Data-as-it-doesn-t-exist-in-4..patch │ ├── 0006-Fixed-up-Rewrite_Data.-Removed-Link-calls-as-doesn-t.patch │ ├── 0007-File-permissions-not-available-in-4.9-yet.patch │ ├── 0008-Timestamp-setting-not-available-on-4.9-yet.patch │ ├── MANIFEST │ ├── expose-cargs-and-largs-makefile.patch │ └── relocatable-build.patch └── langkit │ └── 0001-Add-view-conversion-to-fix-compile.patch ├── includes ├── adacore │ └── base.inc.sh ├── arithmetic.inc.sh ├── bare_metal.inc ├── binutils.inc.sh ├── bootstrap.inc.sh ├── cross.inc ├── errors.inc.sh ├── gcc.inc.sh ├── gdb.inc.sh ├── native.inc ├── patch.inc ├── python.inc.sh └── version.inc.sh ├── source └── gnat_util │ ├── MANIFEST.gnat_util │ ├── Makefile │ ├── Makefile.bootstrap │ ├── gnat_util.gpr │ ├── gnat_util_dummies.c │ └── gnatvsn.adb └── tested-configs └── config-gcc-4.9.2.inc /README.md: -------------------------------------------------------------------------------- 1 | # Free Ada 2 | 3 | This is a set of build scripts to enable you to build the FSF Ada compiler with AdaCore's GPL'd tools. This is the FSF 4 | version of GCC, not AdaCore's GPL'd version which cannot be used for commercial closed source use! 5 | 6 | ## Why? 7 | 8 | GCC is a bitch to build and worse still are AdaCore's GPL'd (extra) projects. Having scripts to do it is a lot easier. 9 | 10 | ## What's provided? 11 | 12 | * FSF GCC 13 | * Binutils 14 | * GDB 15 | 16 | The following are AdaCore GPL-2018 versions: 17 | 18 | * XML/Ada 19 | * GPRBuild 20 | * GNATColl 21 | * GNATColl-Bindings 22 | * GNATColl-DB 23 | * LibAdaLang 24 | * LibAdaLang-Tools 25 | * AUnit 26 | 27 | To find out what versions are built, see the ```config-master.inc.sh``` file. 28 | 29 | ## Git branches 30 | 31 | I have the following branches I will develop on and changes in the latest branch will go into master. 32 | 33 | * gcc-9.x - As of 06/11/2019, this branch has been merged into master. 34 | * gcc-8.x - As of 06/11/2019, this is up to date with gcc-9.x, there will be no more updates on this branch unless deemed necessary. 35 | * gcc-7.x - Deprecated as of 06/11/2019, cannot support the current libadalang. 36 | 37 | I will be focussing on the latest GCC build's keeping the previous going as long as I can. I will note here the branches and what is deprecated and what isn't. When GCC-10.x is released I will add a new branch for that. 38 | 39 | ## Package manager 40 | 41 | You can try [Alire](https://github.com/mosteo/alire) to handle the installation of Ada packages. 42 | 43 | ## Help 44 | 45 | Get help with the scripts and what can be built so far: 46 | 47 | ```bash 48 | $ ./build-tools.sh -h 49 | ``` 50 | 51 | ## Building instructions 52 | 53 | To get a native toolchain, use the following instructions: 54 | 55 | ```bash 56 | cp config-master.inc.sh config.inc.sh 57 | # modify config.inc as required 58 | ./download.sh 59 | ./build-tools.sh -t 1 60 | ``` 61 | 62 | If you leave everything as default, you will have a bunch of archives in a packages directory and the toolchain installed 63 | to ```$HOME/opt/free-ada-new``` 64 | 65 | ### Gentoo 66 | 67 | ```bash 68 | $ emerge -av dev-util/dejagnu dev-tcltk/expect dev-lang/tcl 69 | ``` 70 | 71 | ### Bare metal cross compilers 72 | 73 | These options allow you to build bare metal C and Ada compilers, you have to provide your own runtime. 74 | 75 | The following targets have been built, but any target supported by GCC should build now. 76 | 77 | * arm-none-eabi 78 | * i386-elf 79 | * x86_64-elf 80 | * mips-elf 81 | * msp430-elf 82 | * avr - **NOTE** Don't use this as it doesn't match the build from the official avr-ada and it's Duration isn't right. 83 | * ppc-elf 84 | 85 | ## Copyright 86 | 87 | Copyright (C) 2011-2019 Luke A. Guest with assistance from David Rees 88 | 89 | ## Notes 90 | 91 | * This project no longer uses git flow. 92 | * GNATColl requires Python 2 to create documentation, it will not build with Python 3. 93 | * If you want to build the new [GNAT-LLVM](https://github.com/AdaCore/gnat-llvm) compiler, you need the gcc-9.x branch. 94 | -------------------------------------------------------------------------------- /build-tools.sh: -------------------------------------------------------------------------------- 1 | ######################################################################################################################## 2 | # Filename # build-tools.sh 3 | # Purpose # Batch build toolchain components 4 | # Description # 5 | # Copyright # Copyright (C) 2011-2014 Luke A. Guest, David Rees. 6 | # # All Rights Reserved. 7 | # Depends # http://gcc.gnu.org/install/prerequisites.html 8 | ######################################################################################################################## 9 | #!/bin/bash 10 | 11 | ######################################################################################################################## 12 | # Include everything we need here. 13 | ######################################################################################################################## 14 | 15 | # Cannot put this into config.inc.sh. 16 | export TOP=`pwd` 17 | export INC=$TOP/includes 18 | 19 | ######################################################################################################################## 20 | # Find out what platform we are on using the GCC config.guess script. 21 | ######################################################################################################################## 22 | #export HOST=$($SRC/gcc-$GCC_VERSION/config.guess) 23 | 24 | ######################################################################################################################## 25 | # What OS are we on? e.g. Linux, Darwin, MSYS_* 26 | # N.B: Don't call is OS because gprbuild.gpr grabs the variable. 27 | # TODO: Need to get the correct Darwin version! 28 | # Cannot rely on GCC config.guess script giving the correct value, gives x86_64-unknown-linux-gnu insteaed of 29 | # x86_64-pc-linux-gnu! 30 | # 31 | # N.B: Do not rename this variable to OS, it conflicts with a variable inside GPRBuild's gpr file. 32 | ######################################################################################################################## 33 | export THIS_OS=`uname -s` 34 | 35 | ######################################################################################################################## 36 | # What archtecture is this? e.g. x86_64, i686 37 | ######################################################################################################################## 38 | export CPU=`uname -m` 39 | 40 | ######################################################################################################################## 41 | # Find out what platform we are on. 42 | ######################################################################################################################## 43 | case $THIS_OS in 44 | "Linux") 45 | HOST="${CPU}-pc-linux-gnu" 46 | ;; 47 | "Darwin") 48 | HOST="${CPU}-apple-darwin15" 49 | ;; 50 | "MSYS*") 51 | ;; 52 | esac 53 | 54 | # As default, set the build system to the host, i.e. either native or cross build. 55 | BUILD=$HOST 56 | 57 | ######################################################################################################################## 58 | # Incudes with common function declarations 59 | ######################################################################################################################## 60 | source $INC/version.inc.sh 61 | source $INC/errors.inc.sh 62 | source $INC/arithmetic.inc.sh 63 | #source $INC/native.inc 64 | #source $INC/bare_metal.inc 65 | #source $INC/cross.inc 66 | 67 | VERSION="build-tools.sh ($VERSION_DATE)" 68 | 69 | ######################################################################################################################## 70 | # Enforce a personalised configuration 71 | ######################################################################################################################## 72 | 73 | if [ ! -f ./config.inc.sh ]; then 74 | display_no_config_error 75 | else 76 | source ./config.inc.sh 77 | fi 78 | 79 | source $INC/bootstrap.inc.sh 80 | source $INC/binutils.inc.sh 81 | source $INC/gdb.inc.sh 82 | source $INC/gcc.inc.sh 83 | source $INC/python.inc.sh 84 | source $INC/adacore/base.inc.sh 85 | 86 | ######################################################################################################################## 87 | # Check to make sure the source is downloaded. 88 | ######################################################################################################################## 89 | if [ ! -d $SRC ]; then 90 | echo "ERROR: ./source directory not present. Execute ./download.sh" 91 | exit 1 92 | fi 93 | 94 | ######################################################################################################################## 95 | 96 | usage="\ 97 | $VERSION 98 | $COPYRIGHT 99 | 100 | Automate the build of compiler toolchains. 101 | 102 | Usage: $0 [-t] TARGET 103 | 104 | Options: 105 | 106 | --help Display this help and exit 107 | --version Display version info and exit 108 | --target TARGET Build for specified TARGET 109 | 110 | Valid values for TARGET 111 | ----------------------- 112 | 1 - ${HOST} (This platform - native build) 113 | 2 - arm-none-eabi (Generic boards) 114 | 3 - aarch64-unknown-elf (Generic boards) 115 | 4 - mips-elf (Generic boards)" 116 | # 4 - i586-elf (Generic boards - TODO) 117 | # 5 - x86_64-elf (Generic boards - TODO) 118 | # 7 - msp430-elf (Generic boards - TODO) 119 | # 8 - avr (Generic boards - TODO) 120 | # 9 - ppc-elf (Generic boards - TODO) 121 | # 10 - ARM Android (TODO) 122 | # 11 - MIPS Android (TODO) 123 | # 12 - x86 Android (TODO) 124 | # 13 - Win32 (TODO) 125 | # 14 - Win64 (TODO) 126 | # 15 - Mac OS X (TODO) 127 | # 16 - iOS (TODO) 128 | # 17 - i586 Steam (TODO) 129 | # 18 - AMD64 Steam (TODO) 130 | # 19 - i686-pc-linux-gnu (cross - TODO) 131 | # 20 - i686-pc-linux-gnu (host-x-host - TODO) 132 | 133 | 134 | target_list="You must enter a target number to build, use -h flag to see list." 135 | 136 | ################################################################################ 137 | # Commandline parameters 138 | ################################################################################ 139 | 140 | case "$1" in 141 | --help|-h) 142 | echo "$usage" 143 | exit $? 144 | ;; 145 | 146 | --version|-v) 147 | echo "$VERSION" 148 | echo "$COPYRIGHT" 149 | exit $? 150 | ;; 151 | 152 | --target|-t) 153 | case $2 in 154 | 1) 155 | # TODO: build_type: native, cross, canadian 156 | build_type="native" 157 | variant="" 158 | TARGET=$HOST 159 | ;; 160 | 2) 161 | build_type="cross" 162 | variant="bare" 163 | TARGET="arm-none-eabi" 164 | ;; 165 | 3) 166 | build_type="cross" 167 | variant="bare" 168 | TARGET="aarch64-unknown-elf" 169 | ;; 170 | 4) 171 | build_type="cross" 172 | variant="bare" 173 | TARGET="mips-elf" 174 | ;; 175 | # 3) 176 | # build_type="i586-elf" 177 | # ;; 178 | # 4) 179 | # build_type="x86_64-elf" 180 | # ;; 181 | # 6) 182 | # build_type="msp430-elf" 183 | # ;; 184 | # 7) 185 | # build_type="avr" 186 | # ;; 187 | # 8) 188 | # build_type="ppc-elf" 189 | # ;; 190 | # 18) 191 | # build_type="i686-pc-linux-gnu" 192 | # ;; 193 | # 19) 194 | # ;; 195 | *) 196 | echo "$target_list" 197 | exit 1 198 | ;; 199 | esac 200 | ;; 201 | 202 | # Invalid 203 | -*) 204 | echo "$0: invalid option: $1" >&2 205 | exit 1 206 | ;; 207 | 208 | # Default 209 | *) 210 | echo "$target_list" 211 | exit 1 212 | ;; 213 | esac 214 | 215 | clear 216 | cat <> Creating symbolic link to GMP source..." 385 | # ln -s $SRC/gmp-$GMP_VERSION gmp 386 | # fi 387 | # } 388 | 389 | # function create_gcc_symlinks() 390 | # { 391 | # if [ ! -h $GCC_DIR/mpfr ]; then 392 | # echo " >> Creating symbolic link to MPFR source..." 393 | # ln -s $SRC/mpfr-$MPFR_VERSION mpfr 394 | # fi 395 | 396 | # if [ ! -h $GCC_DIR/mpc ]; then 397 | # echo " >> Creating symbolic link to MPC source..." 398 | # ln -s $SRC/mpc-$MPC_VERSION mpc 399 | # fi 400 | 401 | # if [ ! -h $GCC_DIR/gdb ]; then 402 | # echo " >> Creating symbolic link to GDB source..." 403 | # ln -s $SRC/gdb-$GDB_SRC_VERSION gdb 404 | # fi 405 | #} 406 | 407 | 408 | 409 | 410 | # function build_stlink() 411 | # { 412 | # echo " ( ) Start Processing stlink for $1" 413 | 414 | # cd $BLD 415 | 416 | # VER=$1 417 | # STAGE="$VER" 418 | # DIRS="stlink" 419 | 420 | # echo " >> Creating Directories (if needed)..." 421 | 422 | # for d in $DIRS; do 423 | # if [ ! -d $STAGE/$d ]; then 424 | # mkdir -p $STAGE/$d 425 | # fi 426 | # done 427 | 428 | # LOGPRE=$LOG/$1 429 | # CBD=$BLD/$STAGE 430 | 431 | # cd $CBD/stlink 432 | 433 | # make 434 | 435 | # if [ ! -f .make ]; then 436 | # echo " >> [1] Building stlink for $1..." 437 | # make &> $LOGPRE-stlink-make.txt 438 | # check_error .make 439 | # fi 440 | 441 | # if [ ! -f .make-install ]; then 442 | # echo " >> [2] Installing stlink..." 443 | # cp gdbserver/st-util $INSTALL_DIR/bin &> $LOGPRE-stlink-install.txt 444 | 445 | # check_error .make-install 446 | # fi 447 | # } 448 | 449 | # function build_qemu() 450 | # { 451 | # cd $BLD 452 | 453 | # if [ ! -d qemu ] 454 | # then 455 | # mkdir -p qemu 456 | # fi 457 | 458 | # cd qemu 459 | 460 | # if [ ! -f .config ] 461 | # then 462 | # echo " >> Configuring qemu..." 463 | 464 | # $SRC/qemu/configure --prefix=$INSTALL_DIR \ 465 | # --extra-cflags="-Wunused-function" \ 466 | # --disable-werror \ 467 | # &> $LOG/qemu-config.txt 468 | 469 | # check_error .config 470 | # fi 471 | 472 | # if [ ! -f .make ] 473 | # then 474 | # echo " >> Building qemu..." 475 | 476 | # make config-host.h all &> $LOG/qemu-make.txt 477 | 478 | # check_error .make 479 | # fi 480 | 481 | # if [ ! -f .make-install ] 482 | # then 483 | # echo " >> Installing qemu..." 484 | 485 | # make install &> $LOG/qemu-make-install.txt 486 | 487 | # check_error .make-install 488 | # fi 489 | # } 490 | 491 | # # U-Boot requires libgcc! 492 | # function build_u_boot() 493 | # { 494 | # if [ ! -d $1/u-boot ]; then 495 | # mkdir -p $1/u-boot 496 | # fi 497 | 498 | # # cd ../src/u-boot-$U_BOOT_VERSION 499 | # cd $TOP/src/u-boot 500 | 501 | # if [ ! -f .make ]; then 502 | # echo " >> Configuring and Building U-Boot for $1..." 503 | # make O=../../build/$1/u-boot distclean 504 | # make O=../../build/$1/u-boot omap3_beagle_config ARCH=arm CROSS_COMPILE=$1- 505 | # make O=../../build/$1/u-boot all ARCH=arm CROSS_COMPILE=$1- &> $LOG/$1-u-boot-make.txt 506 | 507 | # check_error .make 508 | # fi 509 | 510 | # # Back to the thirdparty directory 511 | # cd $TOP 512 | # } 513 | 514 | ################################################################################ 515 | # Install GNAT wrappers where we cannot build cross versions 516 | # of the gnattools 517 | # $1 = target (i.e. arm-none-eabi) 518 | # $2 = install directory 519 | ################################################################################ 520 | 521 | # function install_wrappers() 522 | # { 523 | # WRAPPERS="gnatmake gnatlink" 524 | 525 | # cd $TOP/../tools/gcc 526 | 527 | # echo " >> Installing Gnat Wrappers..." 528 | 529 | # for f in $WRAPPERS; do 530 | # install -m0755 -p $f $2/$1-$f 531 | # sed -i -e s/target/$1/ $2/$1-$f 532 | # done 533 | # } 534 | 535 | ################################################################################ 536 | # Prepare log directory, start building 537 | # Creates the $TOP/build directory as well. 538 | ################################################################################ 539 | 540 | if [ ! -d $LOG ]; then 541 | mkdir -p $LOG 542 | fi 543 | 544 | ################################################################################ 545 | # Prepare the packages directory. 546 | ################################################################################ 547 | 548 | if [ ! -d $PKG ]; then 549 | mkdir -p $PKG 550 | fi 551 | 552 | TIMEFORMAT=$' Last Process Took: %2lR'; 553 | # Begin the specified build operation 554 | case "$build_type" in 555 | native) 556 | { 557 | time { 558 | build_arithmetic_libs 559 | binutils $HOST $BUILD $TARGET "--enable-multilib" 560 | gcc $HOST $BUILD $TARGET \ 561 | "--enable-multilib --enable-threads=posix --enable-libgomp --with-libffi --enable-libsanitizer" 562 | 563 | # Add this here, caused a warning before. 564 | export LD_LIBRARY_PATH=$($INSTALL_DIR/bin/gnatls -v | grep adalib | xargs):$LD_LIBRARY_PATH 565 | 566 | python $HOST $BUILD $TARGET 567 | install_python_packages 568 | gdb $HOST $BUILD $TARGET 569 | gpr_bootstrap $HOST 570 | xmlada $HOST $BUILD $TARGET 571 | build_gprbuild $HOST $BUILD $TARGET 572 | gnatcoll_core $HOST $BUILD $TARGET 573 | gnatcoll_bindings $HOST $BUILD $TARGET 574 | gnatcoll_db 575 | gnatcoll_db_sql $HOST $BUILD $TARGET 576 | gnatcoll_db_sqlite $HOST $BUILD $TARGET 577 | gnatcoll_db_postgres $HOST $BUILD $TARGET 578 | gnatcoll_db_db2ada $HOST $BUILD $TARGET 579 | gnatcoll_db_sqlite2ada $HOST $BUILD $TARGET 580 | gnatcoll_db_postgres2ada $HOST $BUILD $TARGET 581 | gnatcoll_db_xref $HOST $BUILD $TARGET 582 | gnatcoll_db_gnatinspect $HOST $BUILD $TARGET 583 | langkit $HOST $BUILD $TARGET 584 | libadalang $HOST $BUILD $TARGET 585 | libadalang_tools $HOST $BUILD $TARGET 586 | aunit $HOST $BUILD $TARGET 587 | exit 0 588 | gnat_util $HOST $BUILD $TARGET 589 | asis $HOST $BUILD $TARGET 590 | #~ build_native_toolchain; 591 | } 592 | } 593 | ;; 594 | 595 | cross) 596 | { 597 | time { 598 | binutils $HOST $BUILD $TARGET \ 599 | "--enable-multilib --enable-interwork --disable-shared --disable-threads" 600 | gcc $HOST $BUILD $TARGET \ 601 | "--enable-multilib --enable-interwork --disable-shared --disable-threads --disable-lto --without-headers" 602 | #build_bare_metal_cross_toolchain arm-none-eabi y y n; 603 | } 604 | } 605 | ;; 606 | 607 | #~ i586-elf) 608 | #~ { time { 609 | #~ build_bare_metal_cross_toolchain i586-elf n n y; 610 | #~ } } 611 | #~ ;; 612 | 613 | #~ x86_64-elf) 614 | #~ { time { 615 | #~ build_bare_metal_cross_toolchain x86_64-elf n n n; 616 | #~ } } 617 | #~ ;; 618 | 619 | #~ x86_64-elf) 620 | #~ { time { 621 | #~ build_bare_metal_cross_toolchain x86_64-elf n n n; 622 | #~ } } 623 | #~ ;; 624 | 625 | #~ mips-elf) 626 | #~ { time { 627 | #~ build_bare_metal_cross_toolchain mips-elf n y n; 628 | #~ } } 629 | #~ ;; 630 | 631 | #~ msp430-elf) 632 | #~ { time { 633 | #~ build_bare_metal_cross_toolchain msp430-elf n y n; 634 | #~ } } 635 | #~ ;; 636 | 637 | #~ avr) 638 | #~ { time { 639 | #~ build_bare_metal_cross_toolchain avr n y n; 640 | #~ } } 641 | #~ ;; 642 | 643 | #~ ppc-elf) 644 | #~ { time { 645 | #~ build_bare_metal_cross_toolchain ppc-elf n y n; 646 | #~ } } 647 | #~ ;; 648 | 649 | *) # Default 650 | #{ time { 651 | #build_arithmetic_libs; 652 | #build_native_toolchain; 653 | #time ( build_cross_toolchain arm-none-eabi --enable-interwork ); 654 | #build_cross_toolchain i386-elf; 655 | #build_cross_toolchain mips-elf; 656 | # } } 657 | ;; 658 | 659 | esac 660 | 661 | exit 0 662 | -------------------------------------------------------------------------------- /config-master.inc.sh: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Filename # config.inc 3 | # Purpose # Defines the Toolchain source versions/mirrors 4 | # Copyright # Copyright (C) 2011-2013 Luke A. Guest, David Rees. 5 | # Depends # http://gcc.gnu.org/install/prerequisites.html 6 | # Description # 1) cp config-master.inc config.inc 7 | # # 2) edit config.inc as required for your machine. 8 | # # 3) ./build-tools.sh --help 9 | ################################################################################ 10 | 11 | ################################################################################ 12 | # Project name, can change. 13 | ################################################################################ 14 | export PROJECT_NAME=free-ada 15 | 16 | ################################################################################ 17 | # So we don't overwrite an already working toolchain! This is only valid when 18 | # building a new native toolchain. Once this has been done, move your old tools 19 | # to a new directory and rename the new one, then remove the "-new" from the 20 | # PROJECT variable. 21 | # TODO: Put in a check when building cross compilers. 22 | ################################################################################ 23 | export PROJECT=$PROJECT_NAME-9.2.0 24 | 25 | ################################################################################ 26 | # INSTALL_BASE_DIR - This is where tar needs to change directory to. 27 | # INSTALL_DIR - Where the actual local toolchain is going to placed. 28 | # STAGE_BASE_DIR - This is the where we stage the install to get ready for 29 | # packaging. 30 | # STAGE_DIR - We want to get to the base $PROJECT_NAME directory for 31 | # packaging. 32 | ################################################################################ 33 | INSTALL_BASE_DIR=$HOME/opt 34 | INSTALL_DIR=$INSTALL_BASE_DIR/$PROJECT 35 | STAGE_BASE_DIR=/tmp/opt/$PROJECT 36 | STAGE_DIR=$STAGE_BASE_DIR$INSTALL_DIR/.. 37 | 38 | ################################################################################ 39 | # Basic directories we need. 40 | ################################################################################ 41 | export SRC=$TOP/source 42 | export ARC=$TOP/archives 43 | export LOG=$TOP/build/logs 44 | export BLD=$TOP/build 45 | export PKG=$TOP/packages 46 | export FILES=$TOP/files 47 | 48 | ################################################################################ 49 | # Date variable for packaging anything from source control. 50 | ################################################################################ 51 | export DATE=`date +%d%m%Y` 52 | 53 | ################################################################################ 54 | # Is the host machine 64 bit? Used for LD_LIBRARY_PATH, leave blank for 32. 55 | ################################################################################ 56 | if grep -q 64 <<< $CPU; then 57 | export BITS=64 58 | # export MULTILIB="--enable-multilib" 59 | # export EXTRA_BINUTILS_FLAGS="--enable-64-bit-bfd" 60 | # export multilib_enabled="yes" 61 | else 62 | export BITS= 63 | # export MULTILIB="" 64 | # export EXTRA_64_BIT_CONFIGURE="" 65 | # export multilib_enabled="no" 66 | fi 67 | 68 | ################################################################################ 69 | # Parallel Make Threads/Jobs 70 | ################################################################################ 71 | # How many 'make' threads do you want to have going during the build? 72 | # In most cases using a value greater than the number of processors 73 | # in your machine will result in fewer and shorter I/O latency hits, 74 | # thus improving overall throughput; this is especially true for 75 | # slow drives and network filesystems. 76 | # Load-average Threshold tells 'make' to spawn new jobs only when the load 77 | # average is less than or equal to it's value. If the load average becomes 78 | # greater, 'make' will wait until the average drops below this number, 79 | # or until all the other jobs finish. Use only one of the options; 80 | # Static Jobs, Scaled Jobs, or Dynamic or Static Load-average Threshold. 81 | ################################################################################ 82 | CORES=`grep 'model name' /proc/cpuinfo | wc -l` 83 | 84 | # Static Jobs 85 | # 1 = No Parallel Make Jobs (slow) 86 | export JOBS_NUM="4" 87 | export JOBS="-j $JOBS_NUM" 88 | 89 | # Scaled Jobs, 2 jobs per cpu core (fast) 90 | # export JOBS="-j $(($CORES*2))" 91 | 92 | # Dynamic Load-average Threshold (slow, but can reduce cpu hammering) 93 | # Spawn parallel processes only at < 100% core utilization 94 | # export JOBS=--load-average=$(echo "scale=2; $CORES*100/100" | bc) 95 | 96 | # Static Load-average Threshold 97 | # export JOBS=--load-average=3.5 98 | 99 | 100 | # Edit package versions/mirrors as required. 101 | 102 | ################################################################################ 103 | # Required tools ############################################################### 104 | ################################################################################ 105 | 106 | ################################################################################ 107 | # BINUTILS ##################################################################### 108 | ################################################################################ 109 | 110 | export BINUTILS_SNAPSHOT=n 111 | 112 | if [ $BINUTILS_SNAPSHOT == "y" ]; then 113 | # Snapshot 114 | export BINUTILS_VERSION=2.31.1 # filename version 115 | export BINUTILS_SRC_VERSION=2.31.1 # extracted version 116 | export BINUTILS_MIRROR=ftp://sourceware.org/pub/binutils/snapshots 117 | export BINUTILS_TARBALL=binutils-$BINUTILS_VERSION.tar.bz2 118 | export BINUTILS_DIR=binutils-$BINUTILS_SRC_VERSION 119 | else 120 | # Release 121 | export BINUTILS_VERSION=2.32 # filename version 122 | export BINUTILS_SRC_VERSION=2.32 # extracted version 123 | export BINUTILS_MIRROR=ftp://sourceware.org/pub/binutils/releases 124 | export BINUTILS_TARBALL=binutils-$BINUTILS_VERSION.tar.bz2 125 | export BINUTILS_DIR=binutils-$BINUTILS_SRC_VERSION 126 | fi 127 | 128 | export BINUTILS_TARBALL 129 | export BINUTILS_SRC_VERSION 130 | 131 | ################################################################################ 132 | # GDB ########################################################################## 133 | ################################################################################ 134 | export GDB_VERSION=8.3.1 # filename version 135 | export GDB_SRC_VERSION=8.3.1 # extracted version 136 | export GDB_MIRROR=ftp://www.mirrorservice.org/sites/ftp.gnu.org/gnu/gdb 137 | #export GDB_MIRROR=http://ftp.gnu.org/gnu/gdb 138 | export GDB_TARBALL=gdb-$GDB_VERSION.tar.xz 139 | export GDB_DIR=gdb-$GDB_SRC_VERSION 140 | 141 | ################################################################################ 142 | # GCC ########################################################################## 143 | ################################################################################ 144 | 145 | export NATIVE_LANGUAGES="c,c++,objc,obj-c++,ada" 146 | 147 | export GCC_RELEASE=y 148 | export GCC_TESTS=n 149 | 150 | if [ $GCC_RELEASE == "y" ]; then 151 | export GCC_VERSION=9.2.0 # filename version 152 | export GCC_SRC_VERSION=$GCC_VERSION # extracted version, change if different 153 | export GCC_MIRROR=ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-$GCC_VERSION 154 | export GCC_TARBALL=gcc-$GCC_VERSION.tar.xz 155 | 156 | export GCC_DIR=gcc-$GCC_SRC_VERSION 157 | else 158 | # WARNING: DON'T USE THIS!! 159 | 160 | # Always get GCC from GitHub now. 161 | #export GCC_REPO=git@github.com:Lucretia/gcc.git 162 | #export GCC_REPO=https://github.com/gcc-mirror/gcc.git 163 | 164 | export GCC_DIR=$SRC/gcc 165 | fi 166 | 167 | ################################################################################ 168 | # Required libs ################################################################ 169 | ################################################################################ 170 | 171 | # GMP (GNU Multiple Precision Arithmetic Library) 172 | #export GMP_VERSION=4.3.2 173 | #export GMP_VERSION=5.1.2 174 | export GMP_VERSION=6.1.2 175 | export GMP_MIRROR=ftp://ftp.gmplib.org/pub/gmp-$GMP_VERSION 176 | export GMP_TARBALL=gmp-$GMP_VERSION.tar.xz 177 | export GMP_DIR=gmp-$GMP_VERSION 178 | 179 | # MPC 180 | #export MPC_VERSION=0.8.1 181 | #export MPC_VERSION=1.0.2 182 | export MPC_VERSION=1.0.3 183 | export MPC_MIRROR=http://www.multiprecision.org/mpc/download 184 | export MPC_TARBALL=mpc-$MPC_VERSION.tar.gz 185 | export MPC_DIR=mpc-$MPC_VERSION 186 | 187 | # MPFR (Multiple Precision Floating Point Computations With Correct Rounding) 188 | # Warning! Due to the fact that TLS support is now detected automatically, the 189 | # MPFR build can be incorrect on some platforms (compiler or system bug). Indeed, 190 | # the TLS implementation of some compilers/platforms is buggy, and MPFR cannot 191 | # detect every problem at configure time. Please run "make check" to see if your 192 | # build is affected. If you get failures, you should try the 193 | # --disable-thread-safe configure option to disable TLS and see if this solves 194 | # these failures. But you should not use an MPFR library with TLS disabled in a 195 | # multithreaded program (unless you know what you are doing). 196 | #export MPFR_VERSION=2.4.2 197 | #export MPFR_MIRROR=http://www.mpfr.org/mpfr-$MPFR_VERSION 198 | #export MPFR_PATCHES=http://www.mpfr.org/mpfr-$MPFR_VERSION/allpatches 199 | #export MPFR_VERSION=3.1.2 200 | export MPFR_VERSION=3.1.5 201 | export MPFR_MIRROR=http://mpfr.loria.fr/mpfr-current 202 | export MPFR_PATCHES=http://mpfr.loria.fr/mpfr-current/allpatches 203 | export MPFR_TARBALL=mpfr-$MPFR_VERSION.tar.xz 204 | export MPFR_DIR=mpfr-$MPFR_VERSION 205 | 206 | # ISL 207 | # The --with-isl configure option should be used if ISL is not installed in your 208 | # default library search path. 209 | export ISL_VERSION=0.16.1 210 | export ISL_MIRROR=ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/infrastructure/ 211 | #export ISL_MIRROR=ftp://gcc.gnu.org/pub/gcc/infrastructure 212 | export ISL_TARBALL=isl-$ISL_VERSION.tar.bz2 213 | export ISL_DIR=isl-$ISL_VERSION 214 | 215 | ################################################################################ 216 | # Python 217 | ################################################################################ 218 | export PYTHON_VERSION=2.7.14 219 | export PYTHON_MIRROR=https://www.python.org/ftp/python/$PYTHON_VERSION/ 220 | export PYTHON_TARBALL=Python-$PYTHON_VERSION.tar.xz 221 | export PYTHON_DIR=Python-$PYTHON_VERSION 222 | 223 | ################################################################################ 224 | # AdaCore GPL components ####################################################### 225 | ################################################################################ 226 | export GPL_YEAR=2018 227 | #export ASIS_HASH=51ecea080c3c6760cd024e8b467502de26f3c3f2 228 | #export ASIS_VERSION=asis-gpl-$GPL_YEAR-src 229 | #export GNATMEM_HASH=6de65bb7e300e299711f90396710ace741123656 230 | #export GNATMEM_VERSION=gnatmem-gpl-$GPL_YEAR-src 231 | #export POLYORB_HASH=22f27fec50a9c2b92be2e10aa5027eb49567787c 232 | #export POLYORB_VERSION=polyorb-gpl-$GPL_YEAR-src 233 | #export POLYORB_DIR=polyorb-$GPL_YEAR-src 234 | #export FLORIST_HASH=224f73e1cd4afd1f0f6ca3bd1ad0191aa7f81e05 235 | #export FLORIST_VERSION=florist-gpl-$GPL_YEAR-src 236 | #export FLORIST_DIR=florist-src 237 | 238 | export ADACORE_DOWNLOAD_MIRROR="http://mirrors.cdn.adacore.com/art/" 239 | export ADACORE_GITHUB="https://github.com/AdaCore" 240 | 241 | export GPRBUILD_DIR="gprbuild" 242 | export GPRBUILD_GIT="${ADACORE_GITHUB}/gprbuild.git" 243 | export GPRBUILD_BRANCH="master" 244 | export GPRBUILD_COMMIT="a10ee080de8e4ca0db9d4cb98d434b9307afccaf" 245 | 246 | export XMLADA_DIR="xmlada" 247 | export XMLADA_GIT="${ADACORE_GITHUB}/xmlada.git" 248 | export XMLADA_BRANCH="master" 249 | export XMLADA_COMMIT="b9344050e922545c0dbd4e1dabe8564705153bf7" 250 | 251 | export GNATCOLL_CORE_DIR="gnatcoll-core" 252 | export GNATCOLL_CORE_GIT="${ADACORE_GITHUB}/gnatcoll-core.git" 253 | export GNATCOLL_CORE_BRANCH="master" 254 | export GNATCOLL_CORE_COMMIT="9203fe1b1a3efc7d3841828bafb4763f02e261a2" 255 | 256 | export GNATCOLL_BINDINGS_DIR="gnatcoll-bindings" 257 | export GNATCOLL_BINDINGS_GIT="${ADACORE_GITHUB}/gnatcoll-bindings.git" 258 | export GNATCOLL_BINDINGS_BRANCH="master" 259 | export GNATCOLL_BINDINGS_COMMIT="2c7b8c22550c3bdb4fa43b7149a605554f7f1caf" 260 | export GNATCOLL_BINDINGS_GMP=y 261 | export GNATCOLL_BINDINGS_ICONV=y 262 | export GNATCOLL_BINDINGS_LZMA=y 263 | export GNATCOLL_BINDINGS_OMP=y 264 | export GNATCOLL_BINDINGS_PYTHON=y 265 | export GNATCOLL_BINDINGS_READLINE=y 266 | export GNATCOLL_BINDINGS_SYSLOG=y 267 | export GNATCOLL_BINDINGS_ZLIB=y 268 | 269 | export GNATCOLL_DB_DIR="gnatcoll-db" 270 | export GNATCOLL_DB_GIT="${ADACORE_GITHUB}/gnatcoll-db.git" 271 | export GNATCOLL_DB_BRANCH="master" 272 | export GNATCOLL_DB_COMMIT="a75c22bf43876fd299b30f65e472898bf9a0971e" 273 | export GNATCOLL_DB=y 274 | 275 | export LANGKIT_DIR="langkit" 276 | export LANGKIT_GIT="${ADACORE_GITHUB}/langkit.git" 277 | export LANGKIT_BRANCH="stable" 278 | export LANGKIT_COMMIT="8f8d6b56d9c63a27b29a6c984bec62fb5df40309" 279 | export LANGKIT_PATCHES="${FILES}/${LANGKIT_DIR}/0001-Add-view-conversion-to-fix-compile.patch" 280 | 281 | export LIBADALANG_DIR="libadalang" 282 | export LIBADALANG_GIT="${ADACORE_GITHUB}/libadalang.git" 283 | export LIBADALANG_BRANCH="stable" 284 | export LIBADALANG_COMMIT="85539c5896f5841b5b8d5007354f5bdc73663f83" 285 | 286 | export LIBADALANG_TOOLS_DIR="libadalang-tools" 287 | export LIBADALANG_TOOLS_GIT="${ADACORE_GITHUB}/libadalang-tools.git" 288 | export LIBADALANG_TOOLS_BRANCH="master" 289 | export LIBADALANG_TOOLS_COMMIT="3c25ee812ceb1d944f8031235e72af98aa4ee8ea" 290 | 291 | export AUNIT_DIR="aunit" 292 | export AUNIT_GIT="${ADACORE_GITHUB}/aunit.git" 293 | export AUNIT_BRANCH="master" 294 | export AUNIT_COMMIT="fd9801b79b56f5dd55ab1e6500f16daf5dd12fc9" 295 | 296 | export GNAT_UTIL_DIR=gnat_util 297 | 298 | export ASIS_GPL_YEAR=2016 299 | export ASIS_HASH=57399029c7a447658e0aff71 300 | export ASIS_VERSION_PREFIX=asis-gpl-${ASIS_GPL_YEAR}-src 301 | export ASIS_VERSION=${ASIS_VERSION_PREFIX} 302 | 303 | export ASIS_MIRROR="${ADACORE_DOWNLOAD_MIRROR}" 304 | export ASIS_TARBALL="${ASIS_VERSION}.tar.gz" 305 | export ASIS_DIR=${ASIS_VERSION_PREFIX} 306 | 307 | 308 | export GTKADA_MIRROR="${ADACORE_GITHUB}/gtkada.git" 309 | export GTKADA_DIR=gtkada 310 | 311 | export LIBADALANG_MIRROR="${ADACORE_GITHUB}/libadalang.git" 312 | export LIBADALANG_DIR=libadalang 313 | 314 | export GPS_MIRROR="${ADACORE_GITHUB}/gps.git" 315 | export GPS_DIR=gps 316 | 317 | # For Spark 318 | #export _MIRROR="${ADACORE_GITHUB}/" 319 | #export _DIR= 320 | 321 | ################################################################################ 322 | # Additional Options ########################################################### 323 | ################################################################################ 324 | 325 | export MATRESHKA_VERSION=0.7.0 326 | export MATRESHKA_MIRROR=http://forge.ada-ru.org/matreshka/downloads 327 | export MATRESHKA_DIR=matreshka-$MATRESHKA_VERSION 328 | 329 | export AHVEN_VERSION=2.6 330 | export AHVEN_MIRROR=http://www.ahven-framework.com/releases 331 | export AHVEN_DIR=ahven-$AHVEN_VERSION 332 | 333 | # export U_BOOT_VERSION=1.3.4 334 | # export U_BOOT_MIRROR=ftp://ftp.denx.de/pub/u-boot 335 | #export NEWLIB_VERSION=1.20.0 336 | #export NEWLIB_MIRROR=ftp://sources.redhat.com/pub/newlib 337 | #export STLINK_MIRROR=git://github.com/texane/stlink.git 338 | # export SPARK_FILE=spark-gpl-2011-x86_64-pc-linux-gnu.tar.gz 339 | 340 | # Bootstrap builds ############################################################# 341 | # 342 | # These builds consist of two types of build, a normal cross compiler using an 343 | # existing system root (--sysroot flag) and a host-x-host compiler which is 344 | # a compiler built to run on that system and produce binaries for that system. 345 | # 346 | # See https://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html 347 | # 348 | # The toolchains required to be built to gain a native i686 Linux bootstrap 349 | # compiler are as follows: 350 | # 351 | # e.g. Cross compiler 352 | # --build=x86_64-pc-linux-gnu = Built compiler is built on amd64 Linux 353 | # --host=x86_64-pc-linux-gnu = Built compiler runs on amd64 Linux 354 | # --target=i686-pc-linux-gnu = Built compiler builds programs for x86 Linux 355 | # 356 | # and e.g. host-x-host 357 | # --build=x86_64-pc-linux-gnu = Built compiler is built on amd64 Linux 358 | # --host=i686-pc-linux-gnu = Built compiler runs on x86 Linux 359 | # --target=i686-pc-linux-gnu = Built compiler builds programs for x86 Linux 360 | # 361 | # The host-x-host compiler wouldn't need binutils as these should be supplied 362 | # by the installed OS on which this compiler is to run. 363 | ################################################################################ 364 | 365 | # For bootstrap builds we are building compilers for full systems 366 | #SYSROOT_X86_LINUX = /usr 367 | #SYSROOT_AMD64_LINUX = /usr 368 | #SYSROOT_SPARC_LINUX = /usr 369 | #SYSROOT_MIPS_LINUX = /usr 370 | #SYSROOT_ARM_LINUX = /usr 371 | #SYSROOT_AMD64_WINDOWS = /usr 372 | 373 | # This flag tells the script whether to just build the bootstrap packages 374 | #INSTALL_BOOTSTRAPS = n 375 | 376 | # Build this bootstrap statically, no shared libs. 377 | #STATIC_BOOTSTRAP = y 378 | 379 | #BOOTSTRAP_VERSION=$(echo $GCC_VERSION | awk -F \. {'print $1"."$2'}) 380 | #BOOTSTRAP_BASE_DIR=/tmp/free-ada-bootstrap 381 | #BOOTSTRAP_DIR=$BOOTSTRAP_BASE_DIR/usr 382 | 383 | #X86_64_BOOTSTRAP_TARBALL="gnatboot-${BOOTSTRAP_VERSION}-amd64.tar.xz" 384 | #X86_64_BOOTSTRAP_MIRROR="https://www.dropbox.com/s/8qz551so8xn4t9r/${X86_64_BOOTSTRAP_TARBALL}?dl=0" 385 | 386 | BOOTSTRAP_MIRROR="http://mirrors.cdn.adacore.com/art" 387 | 388 | X86_64_LINUX_BOOTSTRAP_TARBALL="591c6d80c7a447af2deed1d7" 389 | X86_64_LINUX_BOOTSTRAP_TARBALL_NAME="gnat-gpl-2017-x86_64-linux-bin.tar.gz" 390 | X86_64_MACOS_BOOTSTRAP_TARBALL="591c9045c7a447af2deed24e" 391 | X86_64_MACOS_BOOTSTRAP_TARBALL_NAME="gnat-gpl-2017-x86_64-darwin-bin.tar.gz" 392 | #X86_64_WINDOWS_BOOTSTRAP_TARBALL="" 393 | 394 | BOOTSTRAP_DIR="$HOME/opt/gnat-gpl-2017" 395 | 396 | ################################################################################ 397 | # Implementation specific tuning ############################################### 398 | ################################################################################ 399 | 400 | # Versions of the GNU C library up to and including 2.11.1 included an incorrect 401 | # implementation of the cproj function. GCC optimizes its builtin cproj according 402 | # to the behavior specified and allowed by the ISO C99 standard. If you want to 403 | # avoid discrepancies between the C library and GCC's builtin transformations 404 | # when using cproj in your code, use GLIBC 2.12 or later. If you are using an 405 | # older GLIBC and actually rely on the incorrect behavior of cproj, then you can 406 | # disable GCC's transformations using -fno-builtin-cproj. 407 | 408 | #export EXTRA_NATIVE_CFLAGS="-march=native" 409 | 410 | ################################################################################ 411 | # GMP, MPFR, MPC static lib installation directory ############################# 412 | ################################################################################ 413 | # export STAGE1_LIBS_PREFIX=$STAGE1_PREFIX/opt/libs 414 | # export STAGE2_LIBS_PREFIX=$STAGE2_PREFIX/opt/libs 415 | -------------------------------------------------------------------------------- /download.sh: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Filename # download.sh 3 | # Purpose # Downloads the source required to build the toolchains 4 | # Description # 5 | # Copyright # Copyright (C) 2011-2018 Luke A. Guest, David Rees. 6 | # # All Rights Reserved. 7 | ################################################################################ 8 | #!/bin/bash 9 | 10 | # Cannot put this into config.inc.sh. 11 | export TOP=`pwd` 12 | export INC=$TOP/includes 13 | 14 | # Incudes with common function declarations 15 | source $INC/version.inc.sh 16 | source $INC/errors.inc.sh 17 | 18 | VERSION="download.sh ($VERSION_DATE)" 19 | 20 | usage="\ 21 | $VERSION 22 | $COPYRIGHT 23 | 24 | Automatically download the toolchain source. 25 | 26 | Usage: $0 27 | 28 | Options: 29 | 30 | --help Display this help and exit 31 | --version Display version info and exit 32 | " 33 | 34 | ################################################################################ 35 | # Commandline parameters 36 | ################################################################################ 37 | 38 | while test $# -ne 0; do 39 | 40 | case "$1" in 41 | # Version 42 | --version|-v) 43 | echo -e "$VERSION\n\n$COPYRIGHT" 44 | exit $? 45 | ;; 46 | 47 | # Help 48 | --help|-h) 49 | echo "$usage" 50 | exit $? 51 | ;; 52 | 53 | # Invalid 54 | -*) 55 | echo "$0: invalid option: $1" >&2 56 | exit 1 57 | ;; 58 | 59 | # Default 60 | *) break ;; 61 | esac 62 | 63 | done 64 | 65 | clear 66 | 67 | cat <> Downloading ${!PKG}..." 144 | wget -c ${!PKG_MIRROR}/${!PKG} 145 | 146 | check_error_exit 147 | else 148 | echo " (x) Already have ${!PKG}" 149 | fi 150 | } 151 | 152 | # $1 - Package macro prefix (in upper case) 153 | function download_git_package() 154 | { 155 | local PKG_DIR="$1_DIR" 156 | local PKG_GIT="$1_GIT" 157 | local PKG_BRANCH="$1_BRANCH" 158 | local PKG_COMMIT="$1_COMMIT" 159 | 160 | if [ ! -d ${!PKG_DIR} ]; then 161 | echo " >> Downloading ${!PKG_DIR}..." 162 | 163 | git clone -b ${!PKG_BRANCH} ${!PKG_GIT} ${!PKG_DIR} 164 | 165 | if [ ! -z ${!PKG_COMMIT} ]; then 166 | cd ${!PKG_DIR} 167 | git checkout ${!PKG_COMMIT} 168 | cd .. 169 | fi 170 | 171 | check_error_exit 172 | else 173 | echo " (x) Already have ${!PKG_DIR}" 174 | fi 175 | } 176 | 177 | # $1 - Package macro prefix (in upper case) 178 | function download_adacore_cdn_package() 179 | { 180 | local PKG="$1_TARBALL" 181 | local HASH="$1_HASH" 182 | local PKG_MIRROR="$1_MIRROR" 183 | 184 | if [ ! -f ${!PKG} ]; then 185 | echo " >> Downloading ${!PKG}..." 186 | 187 | wget -c ${!PKG_MIRROR}/${!HASH} -O ${!PKG} 188 | 189 | check_error_exit 190 | else 191 | echo " (x) Already have ${!PKG}" 192 | fi 193 | } 194 | 195 | # $1 - Package macro prefix (in upper case) 196 | # $2 - Compression letter for tar 197 | function download_unpack_package() 198 | { 199 | local PKG="$1_TARBALL" 200 | local PKG_DIR="$1_DIR" 201 | 202 | if [ ! -d ${!PKG_DIR} ]; then 203 | echo " >> Unpacking ${!PKG}..." 204 | 205 | tar -x${2}pf $ARC/${!PKG} 206 | 207 | check_error_exit 208 | fi 209 | } 210 | 211 | # $1 - Package macro prefix (in upper case) 212 | function apply_patches() 213 | { 214 | local PATCHES="$1_PATCHES" 215 | local PKG_DIR="$1_DIR" 216 | local PKG_NAME="$(echo $1 | tr [:upper:] [:lower:])" 217 | 218 | pushd ${!PKG_DIR} &>/dev/null 219 | 220 | for p in ${!PATCHES}; do 221 | local PATCH_NAME="$(basename ${p})" 222 | 223 | if [ ! -f .patched-${PATCH_NAME} ]; then 224 | echo " >> Applying ${PATCH_NAME} to ${PKG_NAME}..." 225 | 226 | patch -Np1 < ${p} &>/dev/null 227 | 228 | check_error .patched-${PATCH_NAME} 229 | fi 230 | done 231 | 232 | popd &>/dev/null 233 | } 234 | 235 | cd $ARC 236 | 237 | # Begin Downloading ############################################################ 238 | 239 | echo " >> Downloading archives, this may take quite a while..." 240 | 241 | # Base packages ################################################################ 242 | 243 | bootstrap_download 244 | 245 | download_package "BINUTILS" 246 | download_package "GDB" 247 | 248 | if [ $GCC_RELEASE == "y" ]; then 249 | download_package "GCC" 250 | fi 251 | 252 | # Prerequisite Libraries ########################################################### 253 | 254 | download_package "GMP" 255 | download_package "MPC" 256 | download_package "MPFR" 257 | download_package "ISL" 258 | download_package "PYTHON" 259 | 260 | # AdaCore Libraries/Tools ########################################################### 261 | 262 | # download_adacore_cdn_package "GPRBUILD" 263 | download_adacore_cdn_package "XMLADA" 264 | # download_adacore_cdn_package "GNATCOLL" 265 | # download_adacore_cdn_package "ASIS" 266 | 267 | ################################################################################# 268 | # Unpack the downloaded archives. 269 | ################################################################################# 270 | 271 | #bootstrap_install 272 | 273 | cd $SRC 274 | 275 | download_unpack_package "BINUTILS" "j" 276 | download_unpack_package "GDB" "J" 277 | download_unpack_package "GCC" "J" 278 | 279 | # Apply any patches 280 | 281 | #~ cd gcc-$GCC_VERSION 282 | 283 | #~ if [ -d $FILES/gcc-$GCC_VERSION ]; then 284 | #~ if [ "$(ls -A $FILES/gcc-$GCC_VERSION/*)" ] && [ ! -f .patched ]; then 285 | #~ echo " >> Patching gcc-$GCC_VERSION..." 286 | 287 | #~ for f in $FILES/gcc-$GCC_VERSION/*; do 288 | #~ patch -p1 < $f 289 | #~ check_error_exit 290 | #~ check_error .patched 291 | #~ done 292 | #~ fi 293 | #~ fi 294 | 295 | #~ cd $SRC 296 | 297 | download_unpack_package "GMP" "J" 298 | download_unpack_package "MPC" "z" 299 | download_unpack_package "MPFR" "J" 300 | 301 | cd mpfr-$MPFR_VERSION 302 | 303 | if [ ! -v $MPFR_PATCHES ] && [ ! -f .patched ]; then 304 | echo " >> Downloading mpfr-$MPFR_VERSION patches..." 305 | wget -c $MPFR_PATCHES 306 | check_error_exit 307 | 308 | mv allpatches ../mpfr-$MPFR_VERSION.patch 309 | check_error_exit 310 | 311 | echo " >> Applying mpfr-$MPFR_VERSION patches..." 312 | # Patch, ignoring patches already applied 313 | # Work silently unless an error occurs 314 | patch -s -N -p1 < ../mpfr-$MPFR_VERSION.patch 315 | check_error_exit 316 | check_error .patched 317 | fi 318 | 319 | cd $SRC 320 | 321 | # if [ ! -d newlib-$NEWLIB_VERSION ]; then 322 | # echo " >> Unpacking newlib-$NEWLIB_VERSION.tar.gz..." 323 | # tar -xzpf $ARC/newlib-$NEWLIB_VERSION.tar.gz 324 | # check_error_exit 325 | # fi 326 | 327 | cd $GCC_DIR 328 | if [ ! -f .patched ]; then 329 | cd gcc/ada 330 | 331 | # Make sure there is a directory of patches. 332 | if [ -d $FILES/$GCC_DIR ]; then 333 | patch -p0 < $FILES/$GCC_DIR/finalization_size.patch 334 | 335 | check_error .patched 336 | fi 337 | fi 338 | cd $SRC 339 | 340 | 341 | download_unpack_package "ISL" "j" 342 | 343 | download_unpack_package "PYTHON" "J" 344 | 345 | # download_unpack_package "GPRBUILD" "z" 346 | # apply_patches "GPRBUILD" 347 | 348 | # download_unpack_package "XMLADA" "z" 349 | # download_unpack_package "GNATCOLL" "z" 350 | # download_unpack_package "ASIS" "z" 351 | 352 | 353 | # if [ ! -d gcc ]; then 354 | # echo " >> Downloading GCC sources from GitHub, may take a while..." 355 | # git clone $GCC_REPO gcc 356 | # check_error_exit 357 | # else 358 | # echo " >> Pulling latest GCC sources from GitHub..." 359 | # cd gcc 360 | # git pull 361 | # fi 362 | 363 | #~ cd $SRC 364 | 365 | download_git_package "GPRBUILD" 366 | download_git_package "XMLADA" 367 | download_git_package "GNATCOLL_CORE" 368 | download_git_package "GNATCOLL_BINDINGS" 369 | 370 | # Remove the link lib iconv as this is in glibc 371 | if [ ! -f .gnatcoll-bindings-commented-out-iconv ]; then 372 | sed -i '51,58 {s/^/--/}' gnatcoll-bindings/iconv/gnatcoll_iconv.gpr 373 | sed -i '98,100 {s/^/--/}' gnatcoll-bindings/iconv/gnatcoll_iconv.gpr 374 | 375 | check_error .gnatcoll-bindings-commented-out-iconv 376 | fi 377 | 378 | download_git_package "GNATCOLL_DB" 379 | 380 | download_git_package "LANGKIT" 381 | apply_patches "LANGKIT" 382 | 383 | download_git_package "LIBADALANG" 384 | download_git_package "LIBADALANG_TOOLS" 385 | 386 | download_git_package "AUNIT" 387 | 388 | # download_git_package "GTKADA" 389 | # download_git_package "LANGKIT" 390 | # download_git_package "LIBADALANG" 391 | # download_git_package "GPS" 392 | -------------------------------------------------------------------------------- /files/asis_2016/0001-Change-Name_Find-to-Name_Find_Str.patch: -------------------------------------------------------------------------------- 1 | From 526a60f821822d0b03eb88346a4927fc2a70069a Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Thu, 12 Apr 2018 18:57:06 +0100 4 | Subject: [PATCH 1/4] Change Name_Find to Name_Find_Str. 5 | 6 | --- 7 | tools/gnat2xml/gnat2xml-xml2gnat.adb | 4 +- 8 | tools/gnat2xml/gnat2xml-xml2tree.adb | 22 +++---- 9 | tools/tool_utils/ada_trees-asis_to_tree.adb | 16 ++--- 10 | tools/tool_utils/ada_trees-asis_to_tree.ads | 4 +- 11 | .../ada_trees-formatting-tree_to_ada.adb | 66 +++++++++---------- 12 | tools/tool_utils/ada_trees-formatting.adb | 2 +- 13 | tools/tool_utils/ada_trees-rep_clauses.adb | 2 +- 14 | tools/tool_utils/ada_trees-scanner.adb | 6 +- 15 | tools/tool_utils/ada_trees.adb | 8 +-- 16 | tools/tool_utils/asis_ul-string_utilities.ads | 2 +- 17 | 10 files changed, 66 insertions(+), 66 deletions(-) 18 | 19 | diff --git a/tools/gnat2xml/gnat2xml-xml2gnat.adb b/tools/gnat2xml/gnat2xml-xml2gnat.adb 20 | index 297e9cc..7254004 100644 21 | --- a/tools/gnat2xml/gnat2xml-xml2gnat.adb 22 | +++ b/tools/gnat2xml/gnat2xml-xml2gnat.adb 23 | @@ -52,7 +52,7 @@ procedure Gnat2xml.Xml2gnat is 24 | 25 | Verbose_Mode : Boolean renames ASIS_UL.Options.Verbose_Mode; 26 | 27 | - Output_Dir : Name_Id := Name_Find (Current_Directory); 28 | + Output_Dir : Name_Id := Name_Find_Str (Current_Directory); 29 | -- Default is current directory; can be overridden by --output-dir=dir 30 | -- switch. Output goes in subdirectories of Output_Dir. 31 | 32 | @@ -172,7 +172,7 @@ procedure Gnat2xml.Xml2gnat is 33 | 34 | elsif Has_Prefix (Argument (X), Prefix => "--output-dir=") then 35 | Output_Dir := 36 | - Name_Find 37 | + Name_Find_Str 38 | (Full_Name 39 | (Strip_Prefix 40 | (Argument (X), 41 | diff --git a/tools/gnat2xml/gnat2xml-xml2tree.adb b/tools/gnat2xml/gnat2xml-xml2tree.adb 42 | index 92a4f90..bf86a08 100644 43 | --- a/tools/gnat2xml/gnat2xml-xml2tree.adb 44 | +++ b/tools/gnat2xml/gnat2xml-xml2tree.adb 45 | @@ -290,42 +290,42 @@ package body Gnat2xml.Xml2tree is 46 | Result.Unit_Origin := Unit_Origins'Value (Val); 47 | 48 | elsif Nm = "unit_full_name" then 49 | - Result.Unit_Full_Name := Name_Find (Val); 50 | + Result.Unit_Full_Name := Name_Find_Str (Val); 51 | 52 | elsif Nm = "def_name" then 53 | - Result.Def_Name := Name_Find (Val); 54 | + Result.Def_Name := Name_Find_Str (Val); 55 | 56 | elsif Nm = "source_file" then 57 | - Result.Source_File := Name_Find (Val); 58 | + Result.Source_File := Name_Find_Str (Val); 59 | 60 | elsif Nm = "def" then 61 | - Result.Def := Name_Find (Val); 62 | + Result.Def := Name_Find_Str (Val); 63 | 64 | elsif Nm = "type" then 65 | if Kind in Def_Names then 66 | - Result.Decl_Type := Name_Find (Val); 67 | + Result.Decl_Type := Name_Find_Str (Val); 68 | 69 | else 70 | - Result.Expr_Type := Name_Find (Val); 71 | + Result.Expr_Type := Name_Find_Str (Val); 72 | end if; 73 | 74 | elsif Nm = "ref_name" then 75 | - Result.Ref_Name := Name_Find (Val); 76 | + Result.Ref_Name := Name_Find_Str (Val); 77 | 78 | elsif Nm = "ref" then 79 | - Result.Ref := Name_Find (Val); 80 | + Result.Ref := Name_Find_Str (Val); 81 | 82 | elsif Nm = "lit_val" then 83 | - Result.Lit_Val := Name_Find (Val); 84 | + Result.Lit_Val := Name_Find_Str (Val); 85 | 86 | elsif Nm = "pragma_name" then 87 | - Result.Pragma_Name := Name_Find (Val); 88 | + Result.Pragma_Name := Name_Find_Str (Val); 89 | 90 | elsif Nm = "mode" then 91 | Result.Mode := Asis.Mode_Kinds'Value (Val); 92 | 93 | elsif Nm = "text" then 94 | - Result.Text := Name_Find (Val); 95 | + Result.Text := Name_Find_Str (Val); 96 | 97 | elsif Nm = "checks" then 98 | null; -- Ignore checks attribute for now 99 | diff --git a/tools/tool_utils/ada_trees-asis_to_tree.adb b/tools/tool_utils/ada_trees-asis_to_tree.adb 100 | index 520934a..b8e604b 100644 101 | --- a/tools/tool_utils/ada_trees-asis_to_tree.adb 102 | +++ b/tools/tool_utils/ada_trees-asis_to_tree.adb 103 | @@ -76,15 +76,15 @@ package body Ada_Trees.Asis_To_Tree is 104 | 105 | function Ref_Value (Ref_Id : Asis.Name) return String; 106 | function Ref_Value (Ref_Id : Asis.Name) return Name_Id is 107 | - (Name_Find (Ref_Value (Ref_Id))); 108 | + (Name_Find_Str (Ref_Value (Ref_Id))); 109 | 110 | function Ref_Name_Value (Ref_Id : Asis.Name) return String; 111 | function Ref_Name_Value (Ref_Id : Asis.Name) return Name_Id is 112 | - (Name_Find (Ref_Name_Value (Ref_Id))); 113 | + (Name_Find_Str (Ref_Name_Value (Ref_Id))); 114 | 115 | function Type_Value (Elem : Asis.Element) return String; 116 | function Type_Value (Elem : Asis.Element) return Name_Id is 117 | - (Name_Find (Type_Value (Elem))); 118 | + (Name_Find_Str (Type_Value (Elem))); 119 | 120 | procedure Set_Usage_Name_Attrs 121 | (Q : Structural_Queries; 122 | @@ -637,7 +637,7 @@ package body Ada_Trees.Asis_To_Tree is 123 | A_Real_Literal | 124 | A_String_Literal => 125 | Result.Lit_Val := 126 | - Name_Find (To_UTF8 (Value_Image (Element))); 127 | + Name_Find_Str (To_UTF8 (Value_Image (Element))); 128 | 129 | when others => 130 | null; 131 | @@ -647,7 +647,7 @@ package body Ada_Trees.Asis_To_Tree is 132 | pragma Assert 133 | (Asis.Elements.Pragma_Name_Image (Element) /= ""); 134 | Result.Pragma_Name := 135 | - Name_Find 136 | + Name_Find_Str 137 | (To_UTF8 (Asis.Elements.Pragma_Name_Image (Element))); 138 | 139 | when A_Parameter_Specification | A_Formal_Object_Declaration => 140 | @@ -849,9 +849,9 @@ package body Ada_Trees.Asis_To_Tree is 141 | Unit_Kind => Unit_Kind (The_Unit), 142 | Unit_Class => Unit_Class (The_Unit), 143 | Unit_Origin => Unit_Origin (The_Unit), 144 | - Unit_Full_Name => Name_Find (To_UTF8 (Unit_Full_Name (The_Unit))), 145 | - Def_Name => Name_Find (Name), 146 | - Source_File => Name_Find (Src), 147 | + Unit_Full_Name => Name_Find_Str (To_UTF8 (Unit_Full_Name (The_Unit))), 148 | + Def_Name => Name_Find_Str (Name), 149 | + Source_File => Name_Find_Str (Src), 150 | 151 | Subtrees => 152 | (1 => 153 | diff --git a/tools/tool_utils/ada_trees-asis_to_tree.ads b/tools/tool_utils/ada_trees-asis_to_tree.ads 154 | index 827e851..a5d7ccf 100644 155 | --- a/tools/tool_utils/ada_trees-asis_to_tree.ads 156 | +++ b/tools/tool_utils/ada_trees-asis_to_tree.ads 157 | @@ -46,10 +46,10 @@ package Ada_Trees.Asis_To_Tree is 158 | 159 | function Def_Value (Def_Id : Defining_Name) return String; 160 | function Def_Value (Def_Id : Defining_Name) return Name_Id is 161 | - (Name_Find (Def_Value (Def_Id))); 162 | + (Name_Find_Str (Def_Value (Def_Id))); 163 | 164 | function Def_Name_Value (Def_Id : Defining_Name) return String; 165 | function Def_Name_Value (Def_Id : Defining_Name) return Name_Id is 166 | - (Name_Find (Def_Name_Value (Def_Id))); 167 | + (Name_Find_Str (Def_Name_Value (Def_Id))); 168 | 169 | end Ada_Trees.Asis_To_Tree; 170 | diff --git a/tools/tool_utils/ada_trees-formatting-tree_to_ada.adb b/tools/tool_utils/ada_trees-formatting-tree_to_ada.adb 171 | index 976a6b7..bf6c2f7 100644 172 | --- a/tools/tool_utils/ada_trees-formatting-tree_to_ada.adb 173 | +++ b/tools/tool_utils/ada_trees-formatting-tree_to_ada.adb 174 | @@ -134,36 +134,36 @@ is 175 | 176 | -- Miscellaneous useful Name_Ids: 177 | 178 | - Name_Empty : constant Name_Id := Name_Find (""); 179 | - 180 | - Name_Semicolon : constant Name_Id := Name_Find (";"); 181 | - Name_L_Paren : constant Name_Id := Name_Find ("("); 182 | - Name_R_Paren : constant Name_Id := Name_Find (")"); 183 | - Name_Colon : constant Name_Id := Name_Find (":"); 184 | - Name_Assign : constant Name_Id := Name_Find (":="); 185 | - Name_Bang : constant Name_Id := Name_Find ("!"); 186 | - Name_Bar : constant Name_Id := Name_Find ("|"); 187 | - Name_Arrow : constant Name_Id := Name_Find ("=>"); 188 | - Name_Dot : constant Name_Id := Name_Find ("."); 189 | - 190 | - Name_And_Then : constant Name_Id := Name_Find ("and then"); 191 | - Name_Or_Else : constant Name_Id := Name_Find ("or else"); 192 | - 193 | - Name_Q_And : constant Name_Id := Name_Find ("""and"""); 194 | - Name_Q_Or : constant Name_Id := Name_Find ("""or"""); 195 | - Name_Q_Xor : constant Name_Id := Name_Find ("""xor"""); 196 | - Name_Q_Mod : constant Name_Id := Name_Find ("""mod"""); 197 | - Name_Q_Rem : constant Name_Id := Name_Find ("""rem"""); 198 | - Name_Q_Abs : constant Name_Id := Name_Find ("""abs"""); 199 | - Name_Q_Not : constant Name_Id := Name_Find ("""not"""); 200 | - 201 | - Name_Depends : constant Name_Id := Name_Find ("Depends"); 202 | + Name_Empty : constant Name_Id := Name_Find_Str (""); 203 | + 204 | + Name_Semicolon : constant Name_Id := Name_Find_Str (";"); 205 | + Name_L_Paren : constant Name_Id := Name_Find_Str ("("); 206 | + Name_R_Paren : constant Name_Id := Name_Find_Str (")"); 207 | + Name_Colon : constant Name_Id := Name_Find_Str (":"); 208 | + Name_Assign : constant Name_Id := Name_Find_Str (":="); 209 | + Name_Bang : constant Name_Id := Name_Find_Str ("!"); 210 | + Name_Bar : constant Name_Id := Name_Find_Str ("|"); 211 | + Name_Arrow : constant Name_Id := Name_Find_Str ("=>"); 212 | + Name_Dot : constant Name_Id := Name_Find_Str ("."); 213 | + 214 | + Name_And_Then : constant Name_Id := Name_Find_Str ("and then"); 215 | + Name_Or_Else : constant Name_Id := Name_Find_Str ("or else"); 216 | + 217 | + Name_Q_And : constant Name_Id := Name_Find_Str ("""and"""); 218 | + Name_Q_Or : constant Name_Id := Name_Find_Str ("""or"""); 219 | + Name_Q_Xor : constant Name_Id := Name_Find_Str ("""xor"""); 220 | + Name_Q_Mod : constant Name_Id := Name_Find_Str ("""mod"""); 221 | + Name_Q_Rem : constant Name_Id := Name_Find_Str ("""rem"""); 222 | + Name_Q_Abs : constant Name_Id := Name_Find_Str ("""abs"""); 223 | + Name_Q_Not : constant Name_Id := Name_Find_Str ("""not"""); 224 | + 225 | + Name_Depends : constant Name_Id := Name_Find_Str ("Depends"); 226 | 227 | Name_Tab_Insertion_Point : constant Name_Id := 228 | - Name_Find ("tab insertion point"); 229 | - Name_Tab_In_Out : constant Name_Id := Name_Find ("tab in out"); 230 | - Name_Dot_Dot : constant Name_Id := Name_Find (".."); 231 | - Name_R_Sq : constant Name_Id := Name_Find ("]"); 232 | + Name_Find_Str ("tab insertion point"); 233 | + Name_Tab_In_Out : constant Name_Id := Name_Find_Str ("tab in out"); 234 | + Name_Dot_Dot : constant Name_Id := Name_Find_Str (".."); 235 | + Name_R_Sq : constant Name_Id := Name_Find_Str ("]"); 236 | 237 | Op_Sym_Table : constant array (Positive range <>) of Name_Id := 238 | (Name_Q_And, 239 | @@ -540,7 +540,7 @@ is 240 | Indentation => Cur_Indentation, 241 | Length => <>, 242 | Kind => Not_An_Element, 243 | - Template => Name_Find ("Insert_Comments_And_Blank_Lines"), 244 | + Template => Name_Find_Str ("Insert_Comments_And_Blank_Lines"), 245 | UID => Next_Line_Break_Unique_Id)); 246 | Next_Line_Break_Unique_Id := Next_Line_Break_Unique_Id + 1; 247 | pragma Assert (Char_At (Out_Buf, M) = NL); 248 | @@ -2245,7 +2245,7 @@ is 249 | Affects_Comments => False, 250 | Level => 0, 251 | Kind => Tree.Kind, 252 | - Template => Name_Find ("Maybe_Blank_Line")); 253 | + Template => Name_Find_Str ("Maybe_Blank_Line")); 254 | end if; 255 | end Maybe_Blank_Line; 256 | 257 | @@ -2703,7 +2703,7 @@ is 258 | Q_Op_Sym (2 .. Q_Op_Sym'Last - 1); 259 | -- Strip off quotes 260 | begin 261 | - Result.Ref := Name_Find (Un_Q); 262 | + Result.Ref := Name_Find_Str (Un_Q); 263 | end; 264 | 265 | when An_And_Then_Short_Circuit => 266 | @@ -3340,8 +3340,8 @@ is 267 | if P.Kind = An_Implementation_Defined_Attribute then 268 | A := P.Subtrees (2).Ref_Name; 269 | if 270 | - (A = Name_Find ("Elab_Spec") 271 | - or else A = Name_Find ("Elab_Body")) 272 | + (A = Name_Find_Str ("Elab_Spec") 273 | + or else A = Name_Find_Str ("Elab_Body")) 274 | and then P.Subtrees (1) = Tree_Stack (N) 275 | then 276 | Elab_Spec_Seen := True; 277 | diff --git a/tools/tool_utils/ada_trees-formatting.adb b/tools/tool_utils/ada_trees-formatting.adb 278 | index 83f9584..be6bd2f 100644 279 | --- a/tools/tool_utils/ada_trees-formatting.adb 280 | +++ b/tools/tool_utils/ada_trees-formatting.adb 281 | @@ -805,7 +805,7 @@ package body Ada_Trees.Formatting is 282 | -- line all come from the same tree; other tabs in the line are ignored. 283 | -- Parent is used across lines to ensure that all lines within a 284 | -- paragraph to be aligned together all come from the same parent tree. 285 | - Token : Name_Id := Name_Find (""); 286 | + Token : Name_Id := Name_Find_Str (""); 287 | -- This is some text associated with the Tab. Usually, it is the text of 288 | -- the token that follows the Tab in the template. 289 | Mark : Marker; 290 | diff --git a/tools/tool_utils/ada_trees-rep_clauses.adb b/tools/tool_utils/ada_trees-rep_clauses.adb 291 | index 8ff6d8d..a7d45b7 100644 292 | --- a/tools/tool_utils/ada_trees-rep_clauses.adb 293 | +++ b/tools/tool_utils/ada_trees-rep_clauses.adb 294 | @@ -35,7 +35,7 @@ package body Ada_Trees.Rep_Clauses is 295 | 296 | package DD renames Asis.Data_Decomposition; 297 | 298 | - function "+" (S : String) return Name_Id renames Name_Find; 299 | + function "+" (S : String) return Name_Id renames Name_Find_Str; 300 | function Nil return Asis.Text.Span is (Asis.Text.Nil_Span); 301 | 302 | -- The following Do_... procedures are called by Append_Rep_Clauses (except 303 | diff --git a/tools/tool_utils/ada_trees-scanner.adb b/tools/tool_utils/ada_trees-scanner.adb 304 | index 11f9064..bdf0417 100644 305 | --- a/tools/tool_utils/ada_trees-scanner.adb 306 | +++ b/tools/tool_utils/ada_trees-scanner.adb 307 | @@ -66,9 +66,9 @@ package body Ada_Trees.Scanner is 308 | then 309 | Char_At (Input, Last_Position (Input)) = NL); 310 | 311 | - Name_Empty : constant Name_Id := Name_Find (""); 312 | - Name_R_Paren : constant Name_Id := Name_Find (")"); 313 | - Name_Tick : constant Name_Id := Name_Find ("'"); 314 | + Name_Empty : constant Name_Id := Name_Find_Str (""); 315 | + Name_R_Paren : constant Name_Id := Name_Find_Str (")"); 316 | + Name_Tick : constant Name_Id := Name_Find_Str ("'"); 317 | Name_NL : constant Name_Id := W_Name_Find ((1 => NL)); 318 | 319 | Cur_Line, Cur_Col : Positive := 1; 320 | diff --git a/tools/tool_utils/ada_trees.adb b/tools/tool_utils/ada_trees.adb 321 | index 81baf6c..9b64660 100644 322 | --- a/tools/tool_utils/ada_trees.adb 323 | +++ b/tools/tool_utils/ada_trees.adb 324 | @@ -497,11 +497,11 @@ package body Ada_Trees is 325 | pragma Assert (Has_Prefix (Def, Prefix => "ada://task_body")); 326 | declare 327 | Type_Def : constant Name_Id := 328 | - Name_Find 329 | + Name_Find_Str 330 | ("ada://task_type" & 331 | Strip_Prefix (Def, Prefix => "ada://task_body")); 332 | Obj_Def : constant Name_Id := 333 | - Name_Find 334 | + Name_Find_Str 335 | ("ada://single_task" & 336 | Strip_Prefix (Def, Prefix => "ada://task_body")); 337 | begin 338 | @@ -528,11 +528,11 @@ package body Ada_Trees is 339 | pragma Assert (Has_Prefix (Def, Prefix => "ada://protected_body")); 340 | declare 341 | Type_Def : constant Name_Id := 342 | - Name_Find 343 | + Name_Find_Str 344 | ("ada://protected_type" & 345 | Strip_Prefix (Def, Prefix => "ada://protected_body")); 346 | Obj_Def : constant Name_Id := 347 | - Name_Find 348 | + Name_Find_Str 349 | ("ada://single_protected" & 350 | Strip_Prefix (Def, Prefix => "ada://protected_body")); 351 | begin 352 | diff --git a/tools/tool_utils/asis_ul-string_utilities.ads b/tools/tool_utils/asis_ul-string_utilities.ads 353 | index a9ecf5a..4584d3a 100644 354 | --- a/tools/tool_utils/asis_ul-string_utilities.ads 355 | +++ b/tools/tool_utils/asis_ul-string_utilities.ads 356 | @@ -143,7 +143,7 @@ package ASIS_UL.String_Utilities is 357 | function W_Name_Find 358 | (S : W_Str) 359 | return Namet.Name_Id is 360 | - (Namet.Name_Find (To_UTF8 (S))); 361 | + (Namet.Name_Find_Str (To_UTF8 (S))); 362 | -- Wrapper for Namet.Name_Find 363 | 364 | function Get_Name_String 365 | -- 366 | 2.17.0 367 | 368 | -------------------------------------------------------------------------------- /files/asis_2016/0002-Remove-strong-version-check.patch: -------------------------------------------------------------------------------- 1 | From d148e12f300cbe6cb711fe8d5fa85b03ea53367d Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Thu, 12 Apr 2018 19:01:05 +0100 4 | Subject: [PATCH 2/4] Remove strong version check. 5 | 6 | --- 7 | tools/gnatcheck/asis_ul-source_table-gnatcheck_processing.adb | 2 +- 8 | tools/gnatstub/gnatstub-sampler-prepare_context.adb | 2 +- 9 | tools/tool_utils/asis_ul-source_table-processing.adb | 2 +- 10 | 3 files changed, 3 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/tools/gnatcheck/asis_ul-source_table-gnatcheck_processing.adb b/tools/gnatcheck/asis_ul-source_table-gnatcheck_processing.adb 13 | index 1ba1a4e..52107f6 100644 14 | --- a/tools/gnatcheck/asis_ul-source_table-gnatcheck_processing.adb 15 | +++ b/tools/gnatcheck/asis_ul-source_table-gnatcheck_processing.adb 16 | @@ -575,7 +575,7 @@ package body ASIS_UL.Source_Table.Gnatcheck_Processing is 17 | pragma Assert (not Incremental_Mode); 18 | 19 | if not Nothing_To_Do then 20 | - Asis.Implementation.Initialize ("-k -asis05 -ws -sv"); 21 | + Asis.Implementation.Initialize ("-k -asis05 -ws"); 22 | 23 | Process_Sources_From_Table (Only_Bodies => True); 24 | Process_Sources_From_Table (Only_Bodies => False); 25 | diff --git a/tools/gnatstub/gnatstub-sampler-prepare_context.adb b/tools/gnatstub/gnatstub-sampler-prepare_context.adb 26 | index d87afb2..34d2852 100644 27 | --- a/tools/gnatstub/gnatstub-sampler-prepare_context.adb 28 | +++ b/tools/gnatstub/gnatstub-sampler-prepare_context.adb 29 | @@ -60,7 +60,7 @@ begin 30 | Tree_Exists := True; 31 | end if; 32 | 33 | - Asis.Implementation.Initialize ("-ws -sv"); 34 | + Asis.Implementation.Initialize ("-ws"); 35 | 36 | Associate 37 | (My_Context, 38 | diff --git a/tools/tool_utils/asis_ul-source_table-processing.adb b/tools/tool_utils/asis_ul-source_table-processing.adb 39 | index 036d33e..1998c57 100644 40 | --- a/tools/tool_utils/asis_ul-source_table-processing.adb 41 | +++ b/tools/tool_utils/asis_ul-source_table-processing.adb 42 | @@ -400,7 +400,7 @@ package body ASIS_UL.Source_Table.Processing is 43 | Add_Needed_Sources : Boolean := Mimic_gcc) 44 | is 45 | begin 46 | - Asis.Implementation.Initialize ("-k -ws -asis05 -sv"); 47 | + Asis.Implementation.Initialize ("-k -ws -asis05"); 48 | 49 | if True then -- Can we get rid of Only_Bodies???? 50 | Process_Sources_From_Table 51 | -- 52 | 2.17.0 53 | 54 | -------------------------------------------------------------------------------- /files/asis_2016/0003-Fix-spelling.patch: -------------------------------------------------------------------------------- 1 | From b960b39b8fc028f0c3f63b6d8a0671a918e3de12 Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Thu, 12 Apr 2018 19:03:14 +0100 4 | Subject: [PATCH 3/4] Fix spelling. 5 | 6 | --- 7 | asis/a4g-ee_cache.adb | 4 ++-- 8 | tools/gnatpp/gnatpp-output.adb | 2 +- 9 | 2 files changed, 3 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/asis/a4g-ee_cache.adb b/asis/a4g-ee_cache.adb 12 | index 4e4eeb5..87f789d 100644 13 | --- a/asis/a4g-ee_cache.adb 14 | +++ b/asis/a4g-ee_cache.adb 15 | @@ -325,9 +325,9 @@ package body A4G.EE_Cache is 16 | Average_Hash_Chain := Average_Hash_Chain / Hash_Entries; 17 | 18 | Write_Line ("Number of Hash table entries :" & Hash_Entries'Img); 19 | - Write_Line ("Max hash chain lenght :" & 20 | + Write_Line ("Max hash chain length :" & 21 | Max_Hash_Chain'Img); 22 | - Write_Line ("Average hash chain lenght :" & 23 | + Write_Line ("Average hash chain length :" & 24 | Average_Hash_Chain'Img); 25 | 26 | end Print_EE_Cache_Summary_Info; 27 | diff --git a/tools/gnatpp/gnatpp-output.adb b/tools/gnatpp/gnatpp-output.adb 28 | index c9c2580..e371372 100644 29 | --- a/tools/gnatpp/gnatpp-output.adb 30 | +++ b/tools/gnatpp/gnatpp-output.adb 31 | @@ -138,7 +138,7 @@ package body GNATPP.Output is 32 | Info (" --pp-off=xxx - Use ""--xxx"" as the comment string to disable"); 33 | Info (" pretty printing instead of the default " & 34 | """--!pp off"""); 35 | - Info (" --pp-on=xxx - Use ""--xxx"" as the comment string to reenable"); 36 | + Info (" --pp-on=xxx - Use ""--xxx"" as the comment string to re-enable"); 37 | Info (" pretty printing instead of the default " & 38 | """--!pp on"""); 39 | 40 | -- 41 | 2.17.0 42 | 43 | -------------------------------------------------------------------------------- /files/asis_2016/0004-Set-all-Initialize-commands-to-a-weak-version-check.patch: -------------------------------------------------------------------------------- 1 | From 18ee4790b9d34c0c0ffff45206f1399be0f507eb Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Thu, 12 Apr 2018 19:15:54 +0100 4 | Subject: [PATCH 4/4] Set all Initialize commands to a weak version check. 5 | 6 | --- 7 | tools/gnat2xml/test/avatox.adb | 2 +- 8 | tools/gnatcheck/asis_ul-source_table-gnatcheck_processing.adb | 2 +- 9 | tools/gnatelim/gnatelim-closure.adb | 2 +- 10 | tools/gnatstub/gnatstub-sampler-prepare_context.adb | 2 +- 11 | tools/gnattest/gnattest-harness-generator.adb | 2 +- 12 | tools/gnattest/gnattest-skeleton-generator.adb | 2 +- 13 | tools/tool_utils/asis_ul-source_table-processing.adb | 2 +- 14 | 7 files changed, 7 insertions(+), 7 deletions(-) 15 | 16 | diff --git a/tools/gnat2xml/test/avatox.adb b/tools/gnat2xml/test/avatox.adb 17 | index 17dec0d..88a91e5 100644 18 | --- a/tools/gnat2xml/test/avatox.adb 19 | +++ b/tools/gnat2xml/test/avatox.adb 20 | @@ -601,7 +601,7 @@ begin 21 | end if; 22 | 23 | -- Initialization of Asis environment. 24 | - Asis.Implementation.Initialize("-asis05"); 25 | + Asis.Implementation.Initialize("-asis05 -wv"); 26 | Asis.Ada_Environments.Associate 27 | (The_Context => The_Avatox_Context, 28 | Name => "The_Avatox_Context", 29 | diff --git a/tools/gnatcheck/asis_ul-source_table-gnatcheck_processing.adb b/tools/gnatcheck/asis_ul-source_table-gnatcheck_processing.adb 30 | index 52107f6..e5b44e9 100644 31 | --- a/tools/gnatcheck/asis_ul-source_table-gnatcheck_processing.adb 32 | +++ b/tools/gnatcheck/asis_ul-source_table-gnatcheck_processing.adb 33 | @@ -575,7 +575,7 @@ package body ASIS_UL.Source_Table.Gnatcheck_Processing is 34 | pragma Assert (not Incremental_Mode); 35 | 36 | if not Nothing_To_Do then 37 | - Asis.Implementation.Initialize ("-k -asis05 -ws"); 38 | + Asis.Implementation.Initialize ("-k -asis05 -ws -wv"); 39 | 40 | Process_Sources_From_Table (Only_Bodies => True); 41 | Process_Sources_From_Table (Only_Bodies => False); 42 | diff --git a/tools/gnatelim/gnatelim-closure.adb b/tools/gnatelim/gnatelim-closure.adb 43 | index 8610d54..11f1957 100644 44 | --- a/tools/gnatelim/gnatelim-closure.adb 45 | +++ b/tools/gnatelim/gnatelim-closure.adb 46 | @@ -108,7 +108,7 @@ package body Gnatelim.Closure is 47 | -- but we have to add sources incrementally, after getting them from 48 | -- gnatmake 49 | 50 | - Asis.Implementation.Initialize ("-k -ws -asis05"); 51 | + Asis.Implementation.Initialize ("-k -ws -wv -asis05"); 52 | 53 | Next_Source := new String'(Main_Subprogram_Name.all); 54 | 55 | diff --git a/tools/gnatstub/gnatstub-sampler-prepare_context.adb b/tools/gnatstub/gnatstub-sampler-prepare_context.adb 56 | index 34d2852..5599d55 100644 57 | --- a/tools/gnatstub/gnatstub-sampler-prepare_context.adb 58 | +++ b/tools/gnatstub/gnatstub-sampler-prepare_context.adb 59 | @@ -60,7 +60,7 @@ begin 60 | Tree_Exists := True; 61 | end if; 62 | 63 | - Asis.Implementation.Initialize ("-ws"); 64 | + Asis.Implementation.Initialize ("-ws -wv"); 65 | 66 | Associate 67 | (My_Context, 68 | diff --git a/tools/gnattest/gnattest-harness-generator.adb b/tools/gnattest/gnattest-harness-generator.adb 69 | index b6d6490..f65ce56 100644 70 | --- a/tools/gnattest/gnattest-harness-generator.adb 71 | +++ b/tools/gnattest/gnattest-harness-generator.adb 72 | @@ -3998,7 +3998,7 @@ package body GNATtest.Harness.Generator is 73 | end if; 74 | end if; 75 | 76 | - Asis.Implementation.Initialize ("-asis05 -ws"); 77 | + Asis.Implementation.Initialize ("-asis05 -ws -wv"); 78 | 79 | loop 80 | Source_Name := new String'(Next_Non_Processed_Source); 81 | diff --git a/tools/gnattest/gnattest-skeleton-generator.adb b/tools/gnattest/gnattest-skeleton-generator.adb 82 | index de888b7..6bb5cfb 100644 83 | --- a/tools/gnattest/gnattest-skeleton-generator.adb 84 | +++ b/tools/gnattest/gnattest-skeleton-generator.adb 85 | @@ -5967,7 +5967,7 @@ package body GNATtest.Skeleton.Generator is 86 | 87 | begin 88 | 89 | - Asis.Implementation.Initialize ("-asis05 -ws"); 90 | + Asis.Implementation.Initialize ("-asis05 -ws -wv"); 91 | 92 | loop 93 | Source_Name := new String'(Next_Non_Processed_Source); 94 | diff --git a/tools/tool_utils/asis_ul-source_table-processing.adb b/tools/tool_utils/asis_ul-source_table-processing.adb 95 | index 1998c57..bc115dd 100644 96 | --- a/tools/tool_utils/asis_ul-source_table-processing.adb 97 | +++ b/tools/tool_utils/asis_ul-source_table-processing.adb 98 | @@ -400,7 +400,7 @@ package body ASIS_UL.Source_Table.Processing is 99 | Add_Needed_Sources : Boolean := Mimic_gcc) 100 | is 101 | begin 102 | - Asis.Implementation.Initialize ("-k -ws -asis05"); 103 | + Asis.Implementation.Initialize ("-k -ws -wv -asis05"); 104 | 105 | if True then -- Can we get rid of Only_Bodies???? 106 | Process_Sources_From_Table 107 | -- 108 | 2.17.0 109 | 110 | -------------------------------------------------------------------------------- /files/asis_2016/MANIFEST: -------------------------------------------------------------------------------- 1 | 0001-Change-Name_Find-to-Name_Find_Str.patch 2 | 0002-Remove-strong-version-check.patch 3 | 0003-Fix-spelling.patch 4 | 0004-Set-all-Initialize-commands-to-a-weak-version-check.patch 5 | -------------------------------------------------------------------------------- /files/gcc-4.9.2/0001-Reinstate-dropped-code.patch: -------------------------------------------------------------------------------- 1 | From acd8e7e37df3cad29e1a2ee3903895fe24bd8c59 Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Sat, 10 Oct 2015 16:06:48 +0100 4 | Subject: [PATCH] Reinstate dropped code. 5 | 6 | --- 7 | gcc/ada/ChangeLog | 5 +++++ 8 | gcc/ada/gcc-interface/Makefile.in | 8 ++++++++ 9 | 2 files changed, 13 insertions(+) 10 | 11 | diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog 12 | index de30982..b5c7a8f 100644 13 | --- a/gcc/ada/ChangeLog 14 | +++ b/gcc/ada/ChangeLog 15 | @@ -1,3 +1,8 @@ 16 | +2015-01-05 Eric Botcazou 17 | + 18 | + PR ada/64492 19 | + * gcc-interface/Makefile.in (../stamp-tools): Reinstate dropped code. 20 | + 21 | 2014-10-30 Release Manager 22 | 23 | * GCC 4.9.2 released. 24 | diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in 25 | index 5c36962..fef0975 100644 26 | --- a/gcc/ada/gcc-interface/Makefile.in 27 | +++ b/gcc/ada/gcc-interface/Makefile.in 28 | @@ -2513,6 +2513,14 @@ GCC_LINK=$(CXX) $(GCC_LINK_FLAGS) $(ADA_INCLUDES) $(LDFLAGS) 29 | # Note: dummy target, stamp-tools is mainly handled by gnattools. 30 | 31 | ../stamp-tools: 32 | + -$(RM) tools/* 33 | + -$(RMDIR) tools 34 | + -$(MKDIR) tools 35 | + -(cd tools; $(LN_S) ../sdefault.adb ../snames.ads ../snames.adb .) 36 | + -$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \ 37 | + $(RM) tools/$(word 1,$(subst <, ,$(PAIR)));\ 38 | + $(LN_S) $(fsrcpfx)ada/$(word 2,$(subst <, ,$(PAIR))) \ 39 | + tools/$(word 1,$(subst <, ,$(PAIR)));) 40 | touch ../stamp-tools 41 | 42 | # when compiling the tools, the runtime has to be first on the path so that 43 | -- 44 | 2.4.9 45 | 46 | -------------------------------------------------------------------------------- /files/gcc-6.4.0/finalization_size.patch: -------------------------------------------------------------------------------- 1 | Index: exp_attr.adb 2 | =================================================================== 3 | --- exp_attr.adb (revision 244125) 4 | +++ exp_attr.adb (working copy) 5 | @@ -3136,6 +3136,117 @@ 6 | Analyze_And_Resolve (N, Standard_String); 7 | end External_Tag; 8 | 9 | + ----------------------- 10 | + -- Finalization_Size -- 11 | + ----------------------- 12 | + 13 | + when Attribute_Finalization_Size => Finalization_Size : declare 14 | + 15 | + function Calculate_Header_Size return Node_Id; 16 | + -- Generate a runtime call to calculate the size of the hidden 17 | + -- header along with any added padding which would precede a 18 | + -- heap-allocated object of the prefix type. 19 | + 20 | + --------------------------- 21 | + -- Calculate_Header_Size -- 22 | + --------------------------- 23 | + 24 | + function Calculate_Header_Size return Node_Id is 25 | + begin 26 | + -- Generate: 27 | + -- Universal_Integer 28 | + -- (Header_Size_With_Padding (N'Alignment)) 29 | + 30 | + return 31 | + Convert_To (Universal_Integer, 32 | + Make_Function_Call (Loc, 33 | + Name => 34 | + New_Occurrence_Of 35 | + (RTE (RE_Header_Size_With_Padding), Loc), 36 | + Parameter_Associations => New_List ( 37 | + Make_Attribute_Reference (Loc, 38 | + Prefix => 39 | + New_Copy_Tree (Pref), 40 | + Attribute_Name => Name_Alignment)))); 41 | + end Calculate_Header_Size; 42 | + 43 | + -- Local variables 44 | + 45 | + Size : constant Entity_Id := Make_Temporary (Loc, 'S'); 46 | + 47 | + -- Start of Finalization_Size 48 | + 49 | + begin 50 | + -- An object of a class-wide type requires a runtime check to 51 | + -- determine whether it is actually controlled or not. Depending on 52 | + -- the outcome of this check, the Finalization_Size of the object 53 | + -- may be zero or some positive value. 54 | + -- 55 | + -- In this scenario, Obj'Finalization_Size is expanded into 56 | + -- 57 | + -- Size : Integer := 0; 58 | + -- 59 | + -- if Needs_Finalization (Pref'Tag) then 60 | + -- Size := 61 | + -- Universal_Integer 62 | + -- (Header_Size_With_Padding (Pref'Alignment)); 63 | + -- end if; 64 | + -- 65 | + -- and the attribute reference is replaced with a reference to Size. 66 | + 67 | + if Is_Class_Wide_Type (Ptyp) then 68 | + Insert_Actions (N, New_List ( 69 | + 70 | + -- Generate: 71 | + -- Size : Integer := 0; 72 | + 73 | + Make_Object_Declaration (Loc, 74 | + Defining_Identifier => Size, 75 | + Object_Definition => 76 | + New_Occurrence_Of (Standard_Integer, Loc), 77 | + Expression => Make_Integer_Literal (Loc, 0)), 78 | + 79 | + -- Generate: 80 | + -- if Needs_Finalization (Pref'Tag) then 81 | + -- Size := Universal_Integer 82 | + -- (Header_Size_With_Padding (Pref'Alignment)); 83 | + -- end if; 84 | + 85 | + Make_If_Statement (Loc, 86 | + Condition => 87 | + Make_Function_Call (Loc, 88 | + Name => 89 | + New_Occurrence_Of 90 | + (RTE (RE_Needs_Finalization), Loc), 91 | + Parameter_Associations => New_List ( 92 | + Make_Attribute_Reference (Loc, 93 | + Attribute_Name => Name_Tag, 94 | + Prefix => 95 | + New_Copy_Tree (Pref)))), 96 | + Then_Statements => New_List ( 97 | + Make_Assignment_Statement (Loc, 98 | + Name => New_Occurrence_Of (Size, Loc), 99 | + Expression => Calculate_Header_Size))))); 100 | + 101 | + Rewrite (N, New_Occurrence_Of (Size, Loc)); 102 | + 103 | + -- The the prefix is known to be controlled at compile time. 104 | + -- Calculate its Finalization_Size by calling runtime routine 105 | + -- Header_Size_With_Padding. 106 | + 107 | + elsif Needs_Finalization (Ptyp) then 108 | + Rewrite (N, Calculate_Header_Size); 109 | + 110 | + -- The prefix is not a controlled object, its Finalization_Size 111 | + -- is zero. 112 | + 113 | + else 114 | + Rewrite (N, Make_Integer_Literal (Loc, 0)); 115 | + end if; 116 | + 117 | + Analyze (N); 118 | + end Finalization_Size; 119 | + 120 | ----------- 121 | -- First -- 122 | ----------- 123 | Index: sem_attr.adb 124 | =================================================================== 125 | --- sem_attr.adb (revision 244124) 126 | +++ sem_attr.adb (working copy) 127 | @@ -3833,6 +3833,16 @@ 128 | Check_Standard_Prefix; 129 | Rewrite (N, New_Occurrence_Of (Boolean_Literals (Fast_Math), Loc)); 130 | 131 | + ----------------------- 132 | + -- Finalization_Size -- 133 | + ----------------------- 134 | + 135 | + when Attribute_Finalization_Size => 136 | + Check_E0; 137 | + Analyze_And_Resolve (P); 138 | + Check_Object_Reference (P); 139 | + Set_Etype (N, Universal_Integer); 140 | + 141 | ----------- 142 | -- First -- 143 | ----------- 144 | @@ -8398,6 +8408,13 @@ 145 | Fold_Uint (N, 146 | Eval_Fat.Exponent (P_Base_Type, Expr_Value_R (E1)), Static); 147 | 148 | + ----------------------- 149 | + -- Finalization_Size -- 150 | + ----------------------- 151 | + 152 | + when Attribute_Finalization_Size => 153 | + null; 154 | + 155 | ----------- 156 | -- First -- 157 | ----------- 158 | Index: sem_attr.ads 159 | =================================================================== 160 | --- sem_attr.ads (revision 244124) 161 | +++ sem_attr.ads (working copy) 162 | @@ -6,7 +6,7 @@ 163 | -- -- 164 | -- S p e c -- 165 | -- -- 166 | --- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- 167 | +-- Copyright (C) 1992-2016, Free Software Foundation, Inc. -- 168 | -- -- 169 | -- GNAT is free software; you can redistribute it and/or modify it under -- 170 | -- terms of the GNU General Public License as published by the Free Soft- -- 171 | @@ -242,6 +242,16 @@ 172 | -- enumeration value. Constraint_Error is raised if no value of the 173 | -- enumeration type corresponds to the given integer value. 174 | 175 | + ----------------------- 176 | + -- Finalization_Size -- 177 | + ----------------------- 178 | + 179 | + Attribute_Finalization_Size => True, 180 | + -- For every object, Finalization_Size will return the size of the 181 | + -- internal header required for finalization (including padding). If 182 | + -- the type is not controlled or contains no controlled components 183 | + -- then the result is always zero. 184 | + 185 | ----------------- 186 | -- Fixed_Value -- 187 | ----------------- 188 | Index: snames.ads-tmpl 189 | =================================================================== 190 | --- snames.ads-tmpl (revision 244126) 191 | +++ snames.ads-tmpl (working copy) 192 | @@ -885,6 +885,7 @@ 193 | Name_Exponent : constant Name_Id := N + $; 194 | Name_External_Tag : constant Name_Id := N + $; 195 | Name_Fast_Math : constant Name_Id := N + $; -- GNAT 196 | + Name_Finalization_Size : constant Name_Id := N + $; -- GNAT 197 | Name_First : constant Name_Id := N + $; 198 | Name_First_Bit : constant Name_Id := N + $; 199 | Name_First_Valid : constant Name_Id := N + $; -- Ada 12 200 | @@ -1524,6 +1525,7 @@ 201 | Attribute_Exponent, 202 | Attribute_External_Tag, 203 | Attribute_Fast_Math, 204 | + Attribute_Finalization_Size, 205 | Attribute_First, 206 | Attribute_First_Bit, 207 | Attribute_First_Valid, 208 | -------------------------------------------------------------------------------- /files/gnatmem/0001-Added-missing-libs.patch: -------------------------------------------------------------------------------- 1 | From 2803b4c1594d3a0cb7a0d98d800af7ff445d1d6c Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Fri, 30 Jan 2015 20:35:58 +0000 4 | Subject: [PATCH] Added missing libs. 5 | 6 | --- 7 | gnatmem.gpr.in | 4 ++-- 8 | 1 file changed, 2 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/gnatmem.gpr.in b/gnatmem.gpr.in 11 | index 9790478..dcc7a5d 100644 12 | --- a/gnatmem.gpr.in 13 | +++ b/gnatmem.gpr.in 14 | @@ -20,7 +20,8 @@ project Gnatmem is 15 | package Linker is 16 | for Default_Switches ("ada") use 17 | (BINUTILS_OBJDIR & "/bfd/libbfd.a", 18 | - BINUTILS_OBJDIR & "/libiberty/libiberty.a"); 19 | + BINUTILS_OBJDIR & "/libiberty/libiberty.a", 20 | + "-lz", "-ldl"); 21 | end Linker; 22 | 23 | package Builder is 24 | @@ -36,4 +37,3 @@ project Gnatmem is 25 | end Ide; 26 | 27 | end Gnatmem; 28 | - 29 | -- 30 | 2.0.5 31 | 32 | -------------------------------------------------------------------------------- /files/gprbuild/0001-Added-gnatvsn.adb-from-FSF-GCC-4.9.2.-Modified-to-re.patch: -------------------------------------------------------------------------------- 1 | From 6c94308813cb670419ea87b844643a8b9fc93771 Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Fri, 30 Jan 2015 18:57:08 +0000 4 | Subject: [PATCH 1/8] Added gnatvsn.adb from FSF GCC 4.9.2. Modified to return 5 | the compiler version from attribute. 6 | 7 | --- 8 | gnat/MANIFEST.GPRBUILD | 1 - 9 | gnat/gnatvsn.adb | 45 ++++++++++----------------------------------- 10 | 2 files changed, 10 insertions(+), 36 deletions(-) 11 | 12 | diff --git a/gnat/MANIFEST.GPRBUILD b/gnat/MANIFEST.GPRBUILD 13 | index 609dbe9..4ced04a 100644 14 | --- a/gnat/MANIFEST.GPRBUILD 15 | +++ b/gnat/MANIFEST.GPRBUILD 16 | @@ -36,7 +36,6 @@ fname-uf.ads 17 | fname.adb 18 | fname.ads 19 | gnat_style.css 20 | -gnatvsn.adb 21 | gnatvsn.ads 22 | hostparm.ads 23 | krunch.adb 24 | diff --git a/gnat/gnatvsn.adb b/gnat/gnatvsn.adb 25 | index c5a3cee..84b34b6 100644 26 | --- a/gnat/gnatvsn.adb 27 | +++ b/gnat/gnatvsn.adb 28 | @@ -6,7 +6,7 @@ 29 | -- -- 30 | -- B o d y -- 31 | -- -- 32 | --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- 33 | +-- Copyright (C) 2002-2009 Free Software Foundation, Inc. -- 34 | -- -- 35 | -- GNAT is free software; you can redistribute it and/or modify it under -- 36 | -- terms of the GNU General Public License as published by the Free Soft- -- 37 | @@ -15,9 +15,9 @@ 38 | -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- 39 | -- or FITNESS FOR A PARTICULAR PURPOSE. -- 40 | -- -- 41 | --- -- 42 | --- -- 43 | --- -- 44 | +-- As a special exception under Section 7 of GPL version 3, you are granted -- 45 | +-- additional permissions described in the GCC Runtime Library Exception, -- 46 | +-- version 3.1, as published by the Free Software Foundation. -- 47 | -- -- 48 | -- You should have received a copy of the GNU General Public License and -- 49 | -- a copy of the GCC Runtime Library Exception along with this program; -- 50 | @@ -46,29 +46,11 @@ package body Gnatvsn is 51 | 52 | function Gnat_Free_Software return String is 53 | begin 54 | - case Build_Type is 55 | - when GPL | FSF => 56 | - return 57 | - "This is free software; see the source for copying conditions." & 58 | - ASCII.LF & 59 | - "There is NO warranty; not even for MERCHANTABILITY or FITNESS" & 60 | - " FOR A PARTICULAR PURPOSE."; 61 | - 62 | - when Gnatpro => 63 | - return 64 | - "This is free software; see the source for copying conditions." & 65 | - ASCII.LF & 66 | - "See your AdaCore support agreement for details of warranty" & 67 | - " and support." & 68 | - ASCII.LF & 69 | - "If you do not have a current support agreement, then there" & 70 | - " is absolutely" & 71 | - ASCII.LF & 72 | - "no warranty; not even for MERCHANTABILITY or FITNESS FOR" & 73 | - " A PARTICULAR" & 74 | - ASCII.LF & 75 | - "PURPOSE."; 76 | - end case; 77 | + return 78 | + "This is free software; see the source for copying conditions." & 79 | + ASCII.LF & 80 | + "There is NO warranty; not even for MERCHANTABILITY or FITNESS" & 81 | + " FOR A PARTICULAR PURPOSE."; 82 | end Gnat_Free_Software; 83 | 84 | ------------------------- 85 | @@ -77,14 +59,7 @@ package body Gnatvsn is 86 | 87 | function Gnat_Version_String return String is 88 | begin 89 | - case Build_Type is 90 | - when Gnatpro => 91 | - return "Pro " & Gnat_Static_Version_String; 92 | - when GPL => 93 | - return "GPL " & Gnat_Static_Version_String; 94 | - when FSF => 95 | - return Gnat_Static_Version_String; 96 | - end case; 97 | + return Standard'Compiler_Version; 98 | end Gnat_Version_String; 99 | 100 | end Gnatvsn; 101 | -- 102 | 2.0.5 103 | 104 | -------------------------------------------------------------------------------- /files/gprbuild/0002-Removed-reference-to-Pro.patch: -------------------------------------------------------------------------------- 1 | From c90d15aeeb53c30ee4dd50b097914c3e57f518a9 Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Fri, 30 Jan 2015 18:57:30 +0000 4 | Subject: [PATCH 2/8] Removed reference to Pro. 5 | 6 | --- 7 | src/gpr_version.adb | 2 -- 8 | 1 file changed, 2 deletions(-) 9 | 10 | diff --git a/src/gpr_version.adb b/src/gpr_version.adb 11 | index 4ec66a8..64c82cc 100644 12 | --- a/src/gpr_version.adb 13 | +++ b/src/gpr_version.adb 14 | @@ -66,8 +66,6 @@ package body GPR_Version is 15 | end loop Last_Loop; 16 | 17 | case Build_Type is 18 | - when Gnatpro => 19 | - return "Pro " & Gpr_Version & " " & Date & Host; 20 | when GPL => 21 | return "GPL " & Gpr_Version & " " & Date & Host; 22 | when FSF => 23 | -- 24 | 2.0.5 25 | 26 | -------------------------------------------------------------------------------- /files/gprbuild/0003-Removed-reference-to-Try_Help-which-is-GNAT-Pro-only.patch: -------------------------------------------------------------------------------- 1 | From 8731b60512dfaae2cdbee50a2625549bda001cbe Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Fri, 30 Jan 2015 18:58:50 +0000 4 | Subject: [PATCH 3/8] Removed reference to Try_Help which is GNAT Pro only at 5 | this time. 6 | 7 | --- 8 | src/gprbuild-main.adb | 1 - 9 | src/gprclean-main.adb | 1 - 10 | src/gprconfig-main.adb | 1 - 11 | src/gprinstall-main.adb | 1 - 12 | 4 files changed, 4 deletions(-) 13 | 14 | diff --git a/src/gprbuild-main.adb b/src/gprbuild-main.adb 15 | index 860ae23..4144f60 100644 16 | --- a/src/gprbuild-main.adb 17 | +++ b/src/gprbuild-main.adb 18 | @@ -1573,7 +1573,6 @@ procedure Gprbuild.Main is 19 | end if; 20 | 21 | if Project_File_Name = null then 22 | - Try_Help; 23 | Fail_Program 24 | (Project_Tree, 25 | "no project file specified and no default project file"); 26 | diff --git a/src/gprclean-main.adb b/src/gprclean-main.adb 27 | index 8cac791..135b430 100644 28 | --- a/src/gprclean-main.adb 29 | +++ b/src/gprclean-main.adb 30 | @@ -642,7 +642,6 @@ begin 31 | -- Check that a project file was specified and get the configuration 32 | 33 | if Project_File_Name = null then 34 | - Try_Help; 35 | Fail_Program 36 | (Project_Tree, 37 | "no project file specified and no default project file"); 38 | diff --git a/src/gprconfig-main.adb b/src/gprconfig-main.adb 39 | index 476690a..d7178a5 100644 40 | --- a/src/gprconfig-main.adb 41 | +++ b/src/gprconfig-main.adb 42 | @@ -642,6 +642,5 @@ exception 43 | null; 44 | when Invalid_Switch | Invalid_Parameter => 45 | Put_Line ("Invalid command line switch: -" & Full_Switch); 46 | - Try_Help; 47 | Ada.Command_Line.Set_Exit_Status (2); 48 | end GprConfig.Main; 49 | diff --git a/src/gprinstall-main.adb b/src/gprinstall-main.adb 50 | index f736eb6..fd9d714 100644 51 | --- a/src/gprinstall-main.adb 52 | +++ b/src/gprinstall-main.adb 53 | @@ -556,7 +556,6 @@ procedure Gprinstall.Main is 54 | if Project_File_Name = null 55 | and then Usage_Mode /= List_Mode 56 | then 57 | - Try_Help; 58 | Fail_Program (Project_Tree, "no project file specified"); 59 | end if; 60 | 61 | -- 62 | 2.0.5 63 | 64 | -------------------------------------------------------------------------------- /files/gprbuild/0004-Changed-parameter-name-from-Env-to-Root_Environment.patch: -------------------------------------------------------------------------------- 1 | From 6f6c113dd6c949f19d4b48df3d2f807d5832f714 Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Fri, 30 Jan 2015 19:11:42 +0000 4 | Subject: [PATCH 4/8] Changed parameter name from Env to Root_Environment. 5 | 6 | --- 7 | src/gprbuild-main.adb | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/src/gprbuild-main.adb b/src/gprbuild-main.adb 11 | index 4144f60..2ed45a5 100644 12 | --- a/src/gprbuild-main.adb 13 | +++ b/src/gprbuild-main.adb 14 | @@ -2098,7 +2098,7 @@ begin 15 | 16 | Do_Compute_Builder_Switches 17 | (Project_Tree => Project_Tree, 18 | - Env => Root_Environment, 19 | + Root_Environment => Root_Environment, 20 | Main_Project => Main_Project); 21 | 22 | Queue.Initialize (Opt.One_Compilation_Per_Obj_Dir); 23 | -- 24 | 2.0.5 25 | 26 | -------------------------------------------------------------------------------- /files/gprbuild/0005-Added-back-in-Rewrite_Data-as-it-doesn-t-exist-in-4..patch: -------------------------------------------------------------------------------- 1 | From db13f11ab54c72c999559cdb9903cb1563c40553 Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Fri, 30 Jan 2015 19:16:19 +0000 4 | Subject: [PATCH 5/8] Added back in Rewrite_Data as it doesn't exist in 4.9 5 | yet. 6 | 7 | --- 8 | src/rewrite_data.adb | 189 +++++++++++++++++++++++++++++++++++++++++++++++++++ 9 | src/rewrite_data.ads | 86 +++++++++++++++++++++++ 10 | 2 files changed, 275 insertions(+) 11 | create mode 100644 src/rewrite_data.adb 12 | create mode 100644 src/rewrite_data.ads 13 | 14 | diff --git a/src/rewrite_data.adb b/src/rewrite_data.adb 15 | new file mode 100644 16 | index 0000000..3b0b4e4 17 | --- /dev/null 18 | +++ b/src/rewrite_data.adb 19 | @@ -0,0 +1,189 @@ 20 | +------------------------------------------------------------------------------ 21 | +-- GNAT COMPILER COMPONENTS -- 22 | +-- -- 23 | +-- R E W R I T E _ D A T A -- 24 | +-- -- 25 | +-- B o d y -- 26 | +-- -- 27 | +-- Copyright (C) 2012, Free Software Foundation, Inc. -- 28 | +-- -- 29 | +-- This is free software; you can redistribute it and/or modify it under -- 30 | +-- terms of the GNU General Public License as published by the Free Soft- -- 31 | +-- ware Foundation; either version 3, or (at your option) any later ver- -- 32 | +-- sion. This software is distributed in the hope that it will be useful, -- 33 | +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- 34 | +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- 35 | +-- License for more details. You should have received a copy of the GNU -- 36 | +-- General Public License distributed with this software; see file -- 37 | +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- 38 | +-- of the license. -- 39 | +------------------------------------------------------------------------------ 40 | + 41 | +with Ada.Unchecked_Conversion; 42 | + 43 | +package body Rewrite_Data is 44 | + 45 | + use Ada; 46 | + 47 | + subtype SEO is Stream_Element_Offset; 48 | + 49 | + ------------ 50 | + -- Create -- 51 | + ------------ 52 | + 53 | + function Create 54 | + (Pattern, Value : String; 55 | + Size : Stream_Element_Offset := 1_024) return Buffer 56 | + is 57 | + 58 | + subtype SP is String (1 .. Pattern'Length); 59 | + subtype SEAP is Stream_Element_Array (1 .. Pattern'Length); 60 | + 61 | + subtype SV is String (1 .. Value'Length); 62 | + subtype SEAV is Stream_Element_Array (1 .. Value'Length); 63 | + 64 | + function To_SEAP is new Unchecked_Conversion (SP, SEAP); 65 | + function To_SEAV is new Unchecked_Conversion (SV, SEAV); 66 | + 67 | + begin 68 | + return B : Buffer 69 | + (SEO'Max (Size, SEO (Pattern'Length)), -- can't be smaller than pattern 70 | + SEO (Pattern'Length), 71 | + SEO (Value'Length)) 72 | + do 73 | + B.Pattern := To_SEAP (Pattern); 74 | + B.Value := To_SEAV (Value); 75 | + B.Pos_C := 0; 76 | + B.Pos_B := 0; 77 | + end return; 78 | + end Create; 79 | + 80 | + ----------- 81 | + -- Flush -- 82 | + ----------- 83 | + 84 | + procedure Flush 85 | + (B : in out Buffer; 86 | + Output : not null access procedure (Data : Stream_Element_Array)) is 87 | + begin 88 | + if B.Pos_B > 0 then 89 | + Output (B.Buffer (1 .. B.Pos_B)); 90 | + end if; 91 | + 92 | + if B.Pos_C > 0 then 93 | + Output (B.Current (1 .. B.Pos_C)); 94 | + end if; 95 | + 96 | + Reset (B); 97 | + end Flush; 98 | + 99 | + ----------- 100 | + -- Reset -- 101 | + ----------- 102 | + 103 | + procedure Reset (B : in out Buffer) is 104 | + begin 105 | + B.Pos_B := 0; 106 | + B.Pos_C := 0; 107 | + end Reset; 108 | + 109 | + ------------- 110 | + -- Rewrite -- 111 | + ------------- 112 | + 113 | + procedure Rewrite 114 | + (B : in out Buffer; 115 | + Input : not null access procedure 116 | + (Buffer : out Stream_Element_Array; 117 | + Last : out Stream_Element_Offset); 118 | + Output : not null access procedure (Data : Stream_Element_Array)) 119 | + is 120 | + Buffer : Stream_Element_Array (1 .. B.Size); 121 | + Last : Stream_Element_Offset; 122 | + begin 123 | + Rewrite_All : loop 124 | + Input (Buffer, Last); 125 | + exit Rewrite_All when Last = 0; 126 | + Write (B, Buffer (1 .. Last), Output); 127 | + end loop Rewrite_All; 128 | + 129 | + Flush (B, Output); 130 | + end Rewrite; 131 | + 132 | + ---------- 133 | + -- Size -- 134 | + ---------- 135 | + 136 | + function Size (B : Buffer) return Natural is 137 | + begin 138 | + return Natural (B.Pos_B + B.Pos_C); 139 | + end Size; 140 | + 141 | + ----------- 142 | + -- Write -- 143 | + ----------- 144 | + 145 | + procedure Write 146 | + (B : in out Buffer; 147 | + Data : Stream_Element_Array; 148 | + Output : not null access procedure (Data : Stream_Element_Array)) 149 | + is 150 | + 151 | + procedure Need_Space (Size : Stream_Element_Offset); 152 | + pragma Inline (Need_Space); 153 | + 154 | + ---------------- 155 | + -- Need_Space -- 156 | + ---------------- 157 | + 158 | + procedure Need_Space (Size : Stream_Element_Offset) is 159 | + begin 160 | + if B.Pos_B + Size > B.Size then 161 | + Output (B.Buffer (1 .. B.Pos_B)); 162 | + B.Pos_B := 0; 163 | + end if; 164 | + end Need_Space; 165 | + 166 | + begin 167 | + if B.Size_Pattern = 0 then 168 | + Output (Data); 169 | + 170 | + else 171 | + for K in Data'Range loop 172 | + if Data (K) = B.Pattern (B.Pos_C + 1) then 173 | + -- Store possible start of a macth 174 | + B.Pos_C := B.Pos_C + 1; 175 | + B.Current (B.Pos_C) := Data (K); 176 | + 177 | + else 178 | + -- Not part of pattern, if a start of a match was found, 179 | + -- remove it. 180 | + 181 | + if B.Pos_C /= 0 then 182 | + Need_Space (B.Pos_C); 183 | + 184 | + B.Buffer (B.Pos_B + 1 .. B.Pos_B + B.Pos_C) := 185 | + B.Current (1 .. B.Pos_C); 186 | + B.Pos_B := B.Pos_B + B.Pos_C; 187 | + B.Pos_C := 0; 188 | + end if; 189 | + 190 | + Need_Space (1); 191 | + B.Pos_B := B.Pos_B + 1; 192 | + B.Buffer (B.Pos_B) := Data (K); 193 | + end if; 194 | + 195 | + if B.Pos_C = B.Size_Pattern then 196 | + -- The pattern is found 197 | + 198 | + Need_Space (B.Size_Value); 199 | + 200 | + B.Buffer (B.Pos_B + 1 .. B.Pos_B + B.Size_Value) := B.Value; 201 | + B.Pos_C := 0; 202 | + B.Pos_B := B.Pos_B + B.Size_Value; 203 | + end if; 204 | + end loop; 205 | + end if; 206 | + end Write; 207 | + 208 | +end Rewrite_Data; 209 | diff --git a/src/rewrite_data.ads b/src/rewrite_data.ads 210 | new file mode 100644 211 | index 0000000..a0d6577 212 | --- /dev/null 213 | +++ b/src/rewrite_data.ads 214 | @@ -0,0 +1,86 @@ 215 | +------------------------------------------------------------------------------ 216 | +-- Gnat COMPILER COMPONENTS -- 217 | +-- -- 218 | +-- R E W R I T E _ D A T A -- 219 | +-- -- 220 | +-- S p e c -- 221 | +-- -- 222 | +-- Copyright (C) 2012, Free Software Foundation, Inc. -- 223 | +-- -- 224 | +-- This is free software; you can redistribute it and/or modify it under -- 225 | +-- terms of the GNU General Public License as published by the Free Soft- -- 226 | +-- ware Foundation; either version 3, or (at your option) any later ver- -- 227 | +-- sion. This software is distributed in the hope that it will be useful, -- 228 | +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- 229 | +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- 230 | +-- License for more details. You should have received a copy of the GNU -- 231 | +-- General Public License distributed with this software; see file -- 232 | +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- 233 | +-- of the license. -- 234 | +------------------------------------------------------------------------------ 235 | + 236 | +with Ada.Streams; use Ada.Streams; 237 | + 238 | +package Rewrite_Data is 239 | + 240 | + type Buffer 241 | + (Size, Size_Pattern, Size_Value : Stream_Element_Offset) is 242 | + limited private; 243 | + 244 | + function Create 245 | + (Pattern, Value : String; 246 | + Size : Stream_Element_Offset := 1_024) return Buffer; 247 | + -- Create and return a buffer 248 | + 249 | + procedure Write 250 | + (B : in out Buffer; 251 | + Data : Stream_Element_Array; 252 | + Output : not null access procedure (Data : Stream_Element_Array)); 253 | + -- Write Data into the buffer, call Output for any prepared data 254 | + 255 | + function Size (B : Buffer) return Natural; 256 | + -- Returns the current size of the buffer (count of Stream_Array_Element) 257 | + 258 | + procedure Flush 259 | + (B : in out Buffer; 260 | + Output : not null access procedure (Data : Stream_Element_Array)); 261 | + -- Call Output for all remaining data in the buffer. The buffer is 262 | + -- reset and ready for another use after this call. 263 | + 264 | + procedure Reset (B : in out Buffer); 265 | + pragma Inline (Reset); 266 | + -- Clear all data in buffer, B is ready for another use. Note that this is 267 | + -- not needed after a Flush. 268 | + 269 | + procedure Rewrite 270 | + (B : in out Buffer; 271 | + Input : not null access procedure 272 | + (Buffer : out Stream_Element_Array; 273 | + Last : out Stream_Element_Offset); 274 | + Output : not null access procedure (Data : Stream_Element_Array)); 275 | + -- Read data from Input, rewrite them and then call Output 276 | + 277 | +private 278 | + 279 | + type Buffer 280 | + (Size, Size_Pattern, Size_Value : Stream_Element_Offset) is 281 | + limited record 282 | + -- Fully prepared/rewritten data waiting to be output 283 | + Buffer : Stream_Element_Array (1 .. Size); 284 | + 285 | + -- Current data checked, this buffer contains every piece of data 286 | + -- starting with the pattern. It means that at any point: 287 | + -- Current (1 .. Pos_C) = Pattern (1 .. Pos_C) 288 | + Current : Stream_Element_Array (1 .. Size_Pattern); 289 | + 290 | + -- The pattern to look for 291 | + Pattern : Stream_Element_Array (1 .. Size_Pattern); 292 | + 293 | + -- The value the pattern is replaced by 294 | + Value : Stream_Element_Array (1 .. Size_Value); 295 | + 296 | + Pos_C : Stream_Element_Offset; -- last valid element in Current 297 | + Pos_B : Stream_Element_Offset; -- last valid element in Buffer 298 | + end record; 299 | + 300 | +end Rewrite_Data; 301 | -- 302 | 2.0.5 303 | 304 | -------------------------------------------------------------------------------- /files/gprbuild/0006-Fixed-up-Rewrite_Data.-Removed-Link-calls-as-doesn-t.patch: -------------------------------------------------------------------------------- 1 | From 703133210126a5d346548792b3a64206a2dcabca Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Fri, 30 Jan 2015 19:16:44 +0000 4 | Subject: [PATCH 6/8] Fixed up Rewrite_Data. Removed Link calls as doesn't 5 | exist yet. 6 | 7 | --- 8 | src/gprbuild-compilation-protocol.adb | 6 +----- 9 | 1 file changed, 1 insertion(+), 5 deletions(-) 10 | 11 | diff --git a/src/gprbuild-compilation-protocol.adb b/src/gprbuild-compilation-protocol.adb 12 | index 070d6e1..f68df33 100644 13 | --- a/src/gprbuild-compilation-protocol.adb 14 | +++ b/src/gprbuild-compilation-protocol.adb 15 | @@ -24,7 +24,7 @@ with Ada.Streams.Stream_IO; 16 | with Ada.Strings.Fixed; use Ada.Strings.Fixed; 17 | with Ada.Strings.Maps.Constants; use Ada.Strings.Maps; 18 | 19 | -with GNAT.Rewrite_Data; 20 | +with Rewrite_Data; 21 | with GNAT.String_Split; use GNAT.String_Split; 22 | 23 | with Gnatvsn; use Gnatvsn; 24 | @@ -180,8 +180,6 @@ package body Gprbuild.Compilation.Protocol is 25 | end Output; 26 | 27 | begin 28 | - Rewrite_Data.Link (Rewriter, Rewriter_CD'Unchecked_Access); 29 | - 30 | if Dir /= "" and then not Exists (Dir) then 31 | Create_Directory (Dir); 32 | end if; 33 | @@ -666,8 +664,6 @@ package body Gprbuild.Compilation.Protocol is 34 | end Output; 35 | 36 | begin 37 | - Rewrite_Data.Link (Rewriter, Rewriter_CD'Unchecked_Access); 38 | - 39 | if Exists (Path_Name) then 40 | Open (File, In_File, Path_Name); 41 | 42 | -- 43 | 2.0.5 44 | 45 | -------------------------------------------------------------------------------- /files/gprbuild/0007-File-permissions-not-available-in-4.9-yet.patch: -------------------------------------------------------------------------------- 1 | From dc71209972e5062499898d1ed1e040032658bd9a Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Fri, 30 Jan 2015 19:22:33 +0000 4 | Subject: [PATCH 7/8] File permissions not available in 4.9 yet. 5 | 6 | --- 7 | src/gprinstall-install.adb | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/src/gprinstall-install.adb b/src/gprinstall-install.adb 11 | index d174846..2b186ee 100644 12 | --- a/src/gprinstall-install.adb 13 | +++ b/src/gprinstall-install.adb 14 | @@ -723,7 +723,7 @@ package body Gprinstall.Install is 15 | 16 | if Executable then 17 | Set_Executable 18 | - (Dest_Filename, Mode => S_Owner + S_Group + S_Others); 19 | + (Dest_Filename); 20 | end if; 21 | 22 | -- Add file to manifest 23 | -- 24 | 2.0.5 25 | 26 | -------------------------------------------------------------------------------- /files/gprbuild/0008-Timestamp-setting-not-available-on-4.9-yet.patch: -------------------------------------------------------------------------------- 1 | From 07582582197fb3756e59bd7938045c4b56331870 Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Fri, 30 Jan 2015 19:22:54 +0000 4 | Subject: [PATCH 8/8] Timestamp setting not available on 4.9 yet. 5 | 6 | --- 7 | src/gprslave.adb | 11 +---------- 8 | 1 file changed, 1 insertion(+), 10 deletions(-) 9 | 10 | diff --git a/src/gprslave.adb b/src/gprslave.adb 11 | index a9ce851..f342863 100644 12 | --- a/src/gprslave.adb 13 | +++ b/src/gprslave.adb 14 | @@ -1261,17 +1261,8 @@ procedure Gprslave is 15 | procedure Set_Stamp 16 | (Path_Name : String; Time_Stamp : Time_Stamp_Type) 17 | is 18 | - TS : constant String := String (Time_Stamp); 19 | begin 20 | - Set_File_Last_Modify_Time_Stamp 21 | - (Path_Name, 22 | - GM_Time_Of 23 | - (Year => Year_Type'Value (TS (1 .. 4)), 24 | - Month => Month_Type'Value (TS (5 .. 6)), 25 | - Day => Day_Type'Value (TS (7 .. 8)), 26 | - Hour => Hour_Type'Value (TS (9 .. 10)), 27 | - Minute => Minute_Type'Value (TS (11 .. 12)), 28 | - Second => Second_Type'Value (TS (13 .. 14)))); 29 | + pragma Unreferenced (Path_Name, Time_Stamp); 30 | end Set_Stamp; 31 | 32 | ------------------ 33 | -- 34 | 2.0.5 35 | 36 | -------------------------------------------------------------------------------- /files/gprbuild/MANIFEST: -------------------------------------------------------------------------------- 1 | 0001-Added-gnatvsn.adb-from-FSF-GCC-4.9.2.-Modified-to-re.patch 2 | 0002-Removed-reference-to-Pro.patch 3 | 0003-Removed-reference-to-Try_Help-which-is-GNAT-Pro-only.patch 4 | 0004-Changed-parameter-name-from-Env-to-Root_Environment.patch 5 | 0005-Added-back-in-Rewrite_Data-as-it-doesn-t-exist-in-4..patch 6 | 0006-Fixed-up-Rewrite_Data.-Removed-Link-calls-as-doesn-t.patch 7 | 0007-File-permissions-not-available-in-4.9-yet.patch 8 | 0008-Timestamp-setting-not-available-on-4.9-yet.patch 9 | -------------------------------------------------------------------------------- /files/gprbuild/expose-cargs-and-largs-makefile.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Makefile b/Makefile 2 | index b591cb9a..4d711028 100644 3 | --- a/Makefile 4 | +++ b/Makefile 5 | @@ -67,6 +67,14 @@ else 6 | LIBGPR_TYPES=static 7 | endif 8 | 9 | +ifneq ($(strip $(CFLAGS)),) 10 | + CARGS := -cargs $(CFLAGS) 11 | +endif 12 | + 13 | +ifneq ($(strip $(LDFLAGS)),) 14 | + LARGS := -largs $(LDFLAGS) 15 | +endif 16 | + 17 | # Used to pass extra options to GPRBUILD, like -d for instance 18 | GPRBUILD_OPTIONS= 19 | 20 | @@ -75,7 +83,7 @@ LIB_INSTALLER=gprinstall -p -f --target=$(TARGET) $(RBD) --prefix=${prefix} 21 | CLEANER=gprclean -q $(RBD) 22 | 23 | GPRBUILD_BUILDER=$(BUILDER) $(GPRBUILD_GPR) \ 24 | - -XLIBRARY_TYPE=relocatable -XXMLADA_BUILD=relocatable 25 | + -XLIBRARY_TYPE=relocatable -XXMLADA_BUILD=relocatable $(CARGS) $(LARGS) 26 | LIBGPR_BUILDER=$(BUILDER) $(GPR_GPR) 27 | LIBGPR_INSTALLER=$(LIB_INSTALLER) $(GPR_GPR) -XBUILD=${BUILD} \ 28 | --install-name=gpr --build-var=LIBRARY_TYPE $(GTARGET) 29 | -------------------------------------------------------------------------------- /files/gprbuild/relocatable-build.patch: -------------------------------------------------------------------------------- 1 | --- a/Makefile 2 | +++ b/Makefile 3 | @@ -75,7 +75,7 @@ 4 | CLEANER=gprclean -q $(RBD) 5 | 6 | GPRBUILD_BUILDER=$(BUILDER) $(GPRBUILD_GPR) \ 7 | - -XLIBRARY_TYPE=static -XXMLADA_BUILD=static 8 | + -XLIBRARY_TYPE=relocatable -XXMLADA_BUILD=relocatable 9 | LIBGPR_BUILDER=$(BUILDER) $(GPR_GPR) 10 | LIBGPR_INSTALLER=$(LIB_INSTALLER) $(GPR_GPR) -XBUILD=${BUILD} \ 11 | --install-name=gpr --build-var=LIBRARY_TYPE $(GTARGET) 12 | -------------------------------------------------------------------------------- /files/langkit/0001-Add-view-conversion-to-fix-compile.patch: -------------------------------------------------------------------------------- 1 | From 70dc3b7bf176a4b0161f395fd7473fa025c7e85b Mon Sep 17 00:00:00 2001 2 | From: "Luke A. Guest" 3 | Date: Tue, 5 Nov 2019 13:56:09 +0000 4 | Subject: [PATCH] Add view conversion to fix compile. 5 | 6 | --- 7 | langkit/support/langkit_support-adalog-eq_same.ads | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/langkit/support/langkit_support-adalog-eq_same.ads b/langkit/support/langkit_support-adalog-eq_same.ads 11 | index cc45f660..b8ac074b 100644 12 | --- a/langkit/support/langkit_support-adalog-eq_same.ads 13 | +++ b/langkit/support/langkit_support-adalog-eq_same.ads 14 | @@ -123,7 +123,7 @@ package Langkit_Support.Adalog.Eq_Same is 15 | Eq_Data : Equals_Data; 16 | Sloc_Info : String_Access := null) return Relation 17 | is 18 | - (Impl.Equals (L, R, Data, Eq_Data, Sloc_Info)); 19 | + (Relation (Impl.Equals (L, R, Data, Eq_Data, Sloc_Info))); 20 | 21 | function Create 22 | (L : LR_Type; 23 | -- 24 | 2.23.0 25 | 26 | -------------------------------------------------------------------------------- /includes/arithmetic.inc.sh: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Filename # artihmetic.inc 3 | # Purpose # Common arithmetic lib handling functions. 4 | # Description # 5 | # Copyright # Copyright (C) 2011-2017 Luke A. Guest, David Rees. 6 | # # All Rights Reserved. 7 | ################################################################################ 8 | 9 | ################################################################################ 10 | # Build the Arithmetic/Optimisation Libs 11 | ################################################################################ 12 | 13 | function build_arithmetic_libs() 14 | { 15 | echo " ( ) Start Processing GMP, MPFR, MPC and ISL" 16 | 17 | # Constants 18 | local TASK_COUNT_TOTAL=21 19 | VER="$build_type/$TARGET" 20 | DIRS="$GMP_DIR $MPFR_DIR $MPC_DIR $ISL_DIR" 21 | LOGPRE=$LOG/$VER 22 | OBD=$BLD/$VER 23 | 24 | #multiarch support on some distributions 25 | #export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/ 26 | 27 | echo " >> [1/$TASK_COUNT_TOTAL] Creating Directories (if needed)..." 28 | 29 | cd $BLD 30 | mkdir -p $LOGPRE 31 | for d in $DIRS; do 32 | if [ ! -d $VER/$d ]; then 33 | mkdir -p $VER/$d 34 | fi 35 | done 36 | 37 | # GMP ###################################################################### 38 | 39 | 40 | cd $OBD/$GMP_DIR 41 | 42 | if [ ! -f .config ]; then 43 | echo " >> [2/$TASK_COUNT_TOTAL] Configuring GMP..." 44 | 45 | $SRC/$GMP_DIR/configure \ 46 | --prefix=$INSTALL_DIR \ 47 | --disable-shared \ 48 | --enable-cxx \ 49 | &> $LOGPRE/$GMP_DIR-configure.txt 50 | 51 | check_error .config 52 | fi 53 | 54 | if [ ! -f .make ]; then 55 | echo " >> [3/$TASK_COUNT_TOTAL] Building GMP..." 56 | 57 | make $JOBS &> $LOGPRE/$GMP_DIR-make.txt 58 | 59 | check_error .make 60 | fi 61 | 62 | # if [ ! -f $OBD/$GMP_DIR/.tuned ]; then 63 | # echo " >> [3/$TASK_COUNT_TOTAL] Generating tuneup metrics for GMP..." 64 | # cd $OBD/gmp-$GMP_VERSION/tune 65 | # make tuneup 66 | # generate better contents for the `gmp-mparam.h' parameter file 67 | # ./tuneup > ../.tuned 68 | # cd .. 69 | # fi 70 | 71 | 72 | if [ ! -f .make-check ]; then 73 | echo " >> [4/$TASK_COUNT_TOTAL] Logging GMP Check..." 74 | 75 | make check &> $LOGPRE/$GMP_DIR-check.txt 76 | 77 | check_error .make-check 78 | fi 79 | 80 | if [ ! -f .make-pkg-stage ]; then 81 | echo " >> [5/$TASK_COUNT_TOTAL] Packaging GMP..." 82 | 83 | make DESTDIR=$STAGE_BASE_DIR install-strip &> $LOGPRE/$GMP_DIR-pkg.txt 84 | 85 | check_error .make-pkg-stage 86 | 87 | if [ ! -f .make-pkg ]; then 88 | cd $STAGE_DIR 89 | 90 | tar -cjpf $PKG/$PROJECT-$HOST-$GMP_DIR.tbz2 . 91 | 92 | check_error $OBD/$GMP_DIR/.make-pkg 93 | 94 | cd $OBD/$GMP_DIR 95 | 96 | rm -rf /tmp/opt 97 | fi 98 | fi 99 | 100 | if [ ! -f .make-install ]; then 101 | echo " >> [6/$TASK_COUNT_TOTAL] Installing GMP..." 102 | 103 | tar -xjpf $PKG/$PROJECT-$HOST-$GMP_DIR.tbz2 -C $INSTALL_BASE_DIR 104 | 105 | check_error .make-install 106 | fi 107 | 108 | # MPFR ##################################################################### 109 | 110 | cd $OBD/$MPFR_DIR 111 | 112 | if [ ! -f .config ]; then 113 | echo " >> [7/$TASK_COUNT_TOTAL] Configuring MPFR..." 114 | 115 | $SRC/$MPFR_DIR/configure \ 116 | --prefix=$INSTALL_DIR \ 117 | --disable-shared \ 118 | --with-gmp=$INSTALL_DIR \ 119 | &> $LOGPRE/$MPFR_DIR-configure.txt 120 | 121 | check_error .config 122 | fi 123 | 124 | if [ ! -f .make ]; then 125 | echo " >> [8/$TASK_COUNT_TOTAL] Building MPFR..." 126 | 127 | make $JOBS &> $LOGPRE/$MPFR_DIR-make.txt 128 | 129 | check_error .make 130 | fi 131 | 132 | if [ ! -f .make-check ]; then 133 | echo " >> [9/$TASK_COUNT_TOTAL] Logging MPFR Check..." 134 | 135 | make check &> $LOGPRE/$MPFR_DIR-check.txt 136 | 137 | check_error .make-check 138 | fi 139 | 140 | if [ ! -f .make-pkg-stage ]; then 141 | echo " >> [10/$TASK_COUNT_TOTAL] Packaging MPFR..." 142 | 143 | make DESTDIR=$STAGE_BASE_DIR install-strip &> $LOGPRE/$MPFR_DIR-pkg.txt 144 | 145 | check_error .make-pkg-stage 146 | 147 | if [ ! -f .make-pkg ]; then 148 | cd $STAGE_DIR 149 | 150 | tar -cjpf $PKG/$PROJECT-$HOST-$MPFR_DIR.tbz2 . 151 | 152 | check_error $OBD/$MPFR_DIR/.make-pkg 153 | 154 | cd $OBD/$MPFR_DIR 155 | rm -rf /tmp/opt 156 | fi 157 | fi 158 | 159 | if [ ! -f .make-install ]; then 160 | echo " >> [11/$TASK_COUNT_TOTAL] Installing MPFR..." 161 | 162 | tar -xjpf $PKG/$PROJECT-$HOST-$MPFR_DIR.tbz2 -C $INSTALL_BASE_DIR 163 | 164 | check_error .make-install 165 | fi 166 | 167 | # MPC ###################################################################### 168 | 169 | cd $OBD/$MPC_DIR 170 | 171 | if [ ! -f .config ]; then 172 | echo " >> [12/$TASK_COUNT_TOTAL] Configuring MPC..." 173 | 174 | $SRC/$MPC_DIR/configure \ 175 | --prefix=$INSTALL_DIR \ 176 | --disable-shared \ 177 | --with-mpfr=$INSTALL_DIR \ 178 | --with-gmp=$INSTALL_DIR \ 179 | &> $LOGPRE/$MPC_DIR-configure.txt 180 | 181 | check_error .config 182 | fi 183 | 184 | if [ ! -f .make ]; then 185 | echo " >> [13/$TASK_COUNT_TOTAL] Building MPC..." 186 | 187 | make $JOBS &> $LOGPRE/$MPC_DIR-make.txt 188 | 189 | check_error .make 190 | fi 191 | 192 | if [ ! -f .make-check ]; then 193 | echo " >> [14/$TASK_COUNT_TOTAL] Logging MPC Check..." 194 | 195 | make check &> $LOGPRE/$MPC_DIR-check.txt 196 | 197 | check_error .make-check 198 | fi 199 | 200 | if [ ! -f .make-pkg-stage ]; then 201 | echo " >> [15/$TASK_COUNT_TOTAL] Packaging MPC..." 202 | 203 | make DESTDIR=$STAGE_BASE_DIR install-strip &> $LOGPRE/$MPC_DIR-pkg.txt 204 | 205 | check_error .make-pkg-stage 206 | 207 | if [ ! -f .make-pkg ]; then 208 | cd $STAGE_DIR 209 | 210 | tar -cjpf $PKG/$PROJECT-$HOST-$MPC_DIR.tbz2 . 211 | check_error $OBD/$MPC_DIR/.make-pkg 212 | 213 | cd $OBD/$MPC_DIR 214 | rm -rf /tmp/opt 215 | fi 216 | fi 217 | 218 | if [ ! -f .make-install ]; then 219 | echo " >> [16/$TASK_COUNT_TOTAL] Installing MPC..." 220 | 221 | tar -xjpf $PKG/$PROJECT-$HOST-$MPC_DIR.tbz2 -C $INSTALL_BASE_DIR 222 | 223 | check_error .make-install 224 | fi 225 | 226 | # ISL ###################################################################### 227 | # http://www.kotnet.org/~skimo/isl/user.html#installation 228 | 229 | cd $OBD/$ISL_DIR 230 | 231 | if [ ! -f .config ]; then 232 | echo " >> [17/$TASK_COUNT_TOTAL] Configuring ISL..." 233 | 234 | $SRC/$ISL_DIR/configure \ 235 | --prefix=$INSTALL_DIR \ 236 | --disable-shared \ 237 | --with-gmp-prefix=$INSTALL_DIR \ 238 | &> $LOGPRE/$ISL_DIR-configure.txt 239 | 240 | check_error .config 241 | fi 242 | 243 | if [ ! -f .make ]; then 244 | echo " >> [18/$TASK_COUNT_TOTAL] Building ISL..." 245 | 246 | make $JOBS &> $LOGPRE/$ISL_DIR-make.txt 247 | 248 | check_error .make 249 | fi 250 | 251 | if [ ! -f .make-check ]; then 252 | echo " >> [19/$TASK_COUNT_TOTAL] Logging ISL Check..." 253 | 254 | make check &> $LOGPRE/$ISL_DIR-check.txt 255 | 256 | check_error .make-check 257 | fi 258 | 259 | if [ ! -f .make-pkg-stage ]; then 260 | echo " >> [20/$TASK_COUNT_TOTAL] Packaging ISL..." 261 | 262 | make DESTDIR=$STAGE_BASE_DIR install-strip &> $LOGPRE/$ISL_DIR-pkg.txt 263 | 264 | check_error .make-pkg-stage 265 | 266 | if [ ! -f .make-pkg ]; then 267 | cd $STAGE_DIR 268 | 269 | tar -cjpf $PKG/$PROJECT-$HOST-$ISL_DIR.tbz2 . 270 | 271 | check_error $OBD/$ISL_DIR/.make-pkg 272 | 273 | cd $OBD/$ISL_DIR 274 | rm -rf /tmp/opt 275 | fi 276 | fi 277 | 278 | if [ ! -f .make-install ]; then 279 | echo " >> [21/$TASK_COUNT_TOTAL] Installing ISL..." 280 | 281 | tar -xjpf $PKG/$PROJECT-$HOST-$ISL_DIR.tbz2 -C $INSTALL_BASE_DIR 282 | 283 | check_error .make-install 284 | fi 285 | 286 | 287 | # export LD_LIBRARY_PATH="$INSTALL_DIR/lib:$LD_LIBRARY_PATH" 288 | # export LD_LIBRARY_PATH="$INSTALL_DIR/lib$BITS:$LD_LIBRARY_PATH" 289 | 290 | echo " (x) Finished Processing GMP, MPFR, MPC and ISL" 291 | } 292 | -------------------------------------------------------------------------------- /includes/bare_metal.inc: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Filename # bare_metal.inc 3 | # Purpose # Build a cross-compiler for bare metal compilers. 4 | # Description # 5 | # Copyright # Copyright (C) 2011-2015 Luke A. Guest, David Rees. 6 | # # All Rights Reserved. 7 | ################################################################################ 8 | 9 | ################################################################################ 10 | # $1 = Target. 11 | # $2 = Enable interwork. 12 | # $3 = Enable multilib. 13 | # $4 = Add EFI targets. 14 | ################################################################################ 15 | function build_bare_metal_cross_toolchain() 16 | { 17 | if [ $CLOOG_REQUIRED = "y" ]; then 18 | CLOOG_OPTS="--enable-cloog-backend=isl --disable-cloog-version-check --with-cloog=$INSTALL_DIR" 19 | fi 20 | 21 | VER=$1 22 | TARGET="$VER" 23 | INTERWORK="" 24 | MULTILIB="" 25 | EFI="" 26 | STAGE="$VER" 27 | 28 | if [ $2 = "y" ]; then 29 | INTERWORK="--enable-interwork" 30 | fi 31 | 32 | if [ $3 = "y" ]; then 33 | MULTILIB="--enable-multilib" 34 | fi 35 | 36 | if [ $4 = "y" ]; then 37 | EFI="--enable-targets=i386-efi-pe,$1" 38 | fi 39 | 40 | EXTRA_CONFIGURE_FLAGS="$INTERWORK $MULTILIB $EFI" 41 | 42 | cd $BLD 43 | 44 | echo " ( ) Start Processing GNAT/GCC for $TARGET" 45 | 46 | if [ $TARGET = "x86_64-elf" ]; then 47 | DIRS="binutils-$BINUTILS_SRC_VERSION gcc" 48 | else 49 | DIRS="binutils-$BINUTILS_SRC_VERSION gcc gdb-$GDB_SRC_VERSION" 50 | fi 51 | 52 | local TASK_COUNT_TOTAL=15 53 | echo " >> [1/$TASK_COUNT_TOTAL] Creating Directories (if needed)..." 54 | 55 | for d in $DIRS; do 56 | if [ ! -d $STAGE/$d ]; then 57 | mkdir -p $STAGE/$d 58 | fi 59 | done 60 | 61 | LOGPRE=$LOG/$VER 62 | CBD=$BLD/$STAGE 63 | OBD=$BLD/$VER 64 | 65 | export PATH=$INSTALL_DIR/bin:$PATH 66 | export LD_LIBRARY_PATH=$INSTALL_DIR/lib:$INSTALL_DIR/lib$BITS:$LD_LIBRARY_PATH 67 | 68 | export NATIVE_INSTALL_DIR=$INSTALL_DIR 69 | 70 | # Build Cross version of BinUtils. 71 | cd $CBD/binutils-$BINUTILS_SRC_VERSION 72 | 73 | if [ ! -f .config ]; then 74 | echo " >> [2/$TASK_COUNT_TOTAL] Configuring Binutils for ($TARGET)..." 75 | $SRC/binutils-$BINUTILS_SRC_VERSION/configure \ 76 | --prefix=$INSTALL_DIR \ 77 | --target=$TARGET \ 78 | $EXTRA_CONFIGURE_FLAGS \ 79 | --disable-nls \ 80 | --disable-shared \ 81 | --disable-threads \ 82 | --with-gcc \ 83 | --with-gnu-as \ 84 | --with-gnu-ld \ 85 | --with-ppl=$INSTALL_DIR \ 86 | --disable-isl-version-check \ 87 | --disable-ppl-version-check \ 88 | --with-gmp=$INSTALL_DIR \ 89 | --with-mpfr=$INSTALL_DIR \ 90 | --with-mpc=$INSTALL_DIR \ 91 | --with-isl=$INSTALL_DIR \ 92 | $CLOOG_OPTS \ 93 | &> $LOGPRE-binutils-config.txt 94 | 95 | check_error .config 96 | fi 97 | 98 | if [ ! -f .make ]; then 99 | echo " >> [3/$TASK_COUNT_TOTAL] Building Binutils for ($TARGET)..." 100 | make $JOBS &> $LOGPRE-binutils-make.txt 101 | check_error .make 102 | fi 103 | 104 | if [ ! -f .make-pkg-stage ]; then 105 | echo " >> [4/$TASK_COUNT_TOTAL] Packaging Binutils ($TARGET)..." 106 | make DESTDIR=$STAGE_BASE_DIR install-strip &> $LOGPRE-binutils-$BINUTILS_SRC_VERSION-pkg.txt 107 | check_error .make-pkg-stage 108 | 109 | if [ ! -f .make-pkg ]; then 110 | cd $STAGE_DIR 111 | tar -cjpf $PKG/$PROJECT-$TARGET-binutils-$BINUTILS_SRC_VERSION.tbz2 . 112 | check_error $OBD/binutils-$BINUTILS_VERSION/.make-pkg 113 | 114 | cd $OBD/binutils-$BINUTILS_VERSION 115 | rm -rf /tmp/opt 116 | fi 117 | fi 118 | 119 | if [ ! -f .make-install ]; then 120 | echo " >> [5/$TASK_COUNT_TOTAL] Installing Binutils for ($TARGET)..." 121 | tar -xjpf $PKG/$PROJECT-$TARGET-binutils-$BINUTILS_SRC_VERSION.tbz2 -C $INSTALL_BASE_DIR 122 | check_error .make-install 123 | fi 124 | 125 | echo " >> Binutils ($TARGET) Installed" 126 | 127 | # Build GCC. 128 | cd $CBD/gcc 129 | 130 | if [ ! -f .config ]; then 131 | echo " >> [6/$TASK_COUNT_TOTAL] Configuring Cross GCC ($TARGET)..." 132 | $GCC_DIR/configure \ 133 | --prefix=$INSTALL_DIR \ 134 | --target=$TARGET \ 135 | $EXTRA_CONFIGURE_FLAGS \ 136 | --disable-nls \ 137 | --disable-shared \ 138 | --disable-threads \ 139 | --disable-lto \ 140 | --with-gnu-as \ 141 | --with-gnu-ld \ 142 | --enable-languages=c,ada \ 143 | --disable-libssp \ 144 | --without-headers \ 145 | --disable-isl-version-check \ 146 | --disable-ppl-version-check \ 147 | --with-gmp=$INSTALL_DIR \ 148 | --with-mpfr=$INSTALL_DIR \ 149 | --with-mpc=$INSTALL_DIR \ 150 | --with-isl=$INSTALL_DIR \ 151 | $CLOOG_OPTS \ 152 | --disable-libada \ 153 | &> $LOGPRE-gcc-config.txt 154 | 155 | check_error .config 156 | fi 157 | 158 | if [ ! -f .make ]; then 159 | echo " >> [7/$TASK_COUNT_TOTAL] Building Cross GCC ($TARGET)..." 160 | make $JOBS all-gcc &> $LOGPRE-gcc-make.txt 161 | 162 | check_error .make 163 | fi 164 | 165 | if [ ! -f .make-libgcc ]; then 166 | echo " >> [8/$TASK_COUNT_TOTAL] Building Cross libgcc ($TARGET)..." 167 | make $JOBS all-target-libgcc &> $LOGPRE-gcc-make.txt 168 | 169 | check_error .make-libgcc 170 | fi 171 | 172 | if [ ! -f .make-gnattools ]; then 173 | echo " >> [9/$TASK_COUNT_TOTAL] Building Cross GNAT tools ($TARGET)..." 174 | make $JOBS -C gcc cross-gnattools ada.all.cross &> $LOGPRE-gcc-gnattools-make.txt 175 | 176 | check_error .make-gnattools 177 | fi 178 | 179 | if [ ! -f .make-pkg-stage ]; then 180 | echo " >> [10/$TASK_COUNT_TOTAL] Packaging GNAT/GCC ($TARGET)..." 181 | make DESTDIR=$STAGE_BASE_DIR install-strip-gcc install-target-libgcc &> $LOGPRE-gcc-pkg.txt 182 | check_error .make-pkg-stage 183 | 184 | if [ ! -f .make-pkg ]; then 185 | cd $STAGE_DIR 186 | tar -cjpf $PKG/$PROJECT-$TARGET-gcc-$GCC_VERSION.tbz2 . 187 | check_error $OBD/gcc/.make-pkg 188 | 189 | cd $OBD/gcc 190 | rm -rf /tmp/opt 191 | fi 192 | fi 193 | 194 | if [ ! -f .make-install ]; then 195 | echo " >> [11/$TASK_COUNT_TOTAL] Installing Cross GCC ($TARGET)..." 196 | tar -xjpf $PKG/$PROJECT-$TARGET-gcc-$GCC_VERSION.tbz2 -C $INSTALL_BASE_DIR 197 | 198 | check_error .make-install 199 | fi 200 | 201 | echo " >> GCC ($TARGET) Installed" 202 | 203 | ## GDB 204 | 205 | if [ $TARGET = "x86_64-elf" ]; then 206 | echo " >> [12-15/$TASK_COUNT_TOTAL] Skipping x86-elf-gdb as it is broken and doesn't build, use your native gdb instead" 207 | else 208 | cd $CBD/gdb-$GDB_SRC_VERSION 209 | 210 | if [ ! -f .config ]; then 211 | echo " >> [12/$TASK_COUNT_TOTAL] Configuring Cross GDB ($TARGET)..." 212 | CFLAGS="-O2" LDFLAGS="-s" $SRC/gdb-$GDB_SRC_VERSION/configure \ 213 | --prefix=$INSTALL_DIR \ 214 | --target=$TARGET \ 215 | $EXTRA_CONFIGURE_FLAGS \ 216 | --disable-nls \ 217 | --disable-shared \ 218 | --disable-threads \ 219 | &> $LOGPRE-gdb-$GDB_SRC_VERSION-config.txt 220 | 221 | check_error .config 222 | fi 223 | 224 | if [ ! -f .make ]; then 225 | echo " >> [13/$TASK_COUNT_TOTAL] Building Cross GDB ($TARGET)..." 226 | make all $JOBS &> $LOGPRE-gdb-$GDB_SRC_VERSION-make.txt 227 | check_error .make 228 | fi 229 | 230 | if [ ! -f .make-pkg-stage ]; then 231 | echo " >> [14/$TASK_COUNT_TOTAL] Packaging Cross GDB ($TARGET)..." 232 | make DESTDIR=$STAGE_BASE_DIR install &> $LOGPRE-gdb-$GDB_SRC_VERSION-pkg.txt 233 | check_error .make-pkg-stage 234 | 235 | # strip $STAGE_BASE_DIR$INSTALL_DIR/bin/gdb 236 | # strip $STAGE_BASE_DIR$INSTALL_DIR/bin/gdbserver 237 | 238 | if [ ! -f .make-pkg ]; then 239 | cd $STAGE_DIR 240 | tar -cjpf $PKG/$PROJECT-$TARGET-gdb-$GDB_SRC_VERSION.tbz2 . 241 | check_error $OBD/gdb-$GDB_VERSION/.make-pkg 242 | 243 | cd $OBD/gdb-$GDB_VERSION 244 | rm -rf /tmp/opt 245 | fi 246 | fi 247 | 248 | if [ ! -f .make-install ]; then 249 | echo " >> [15/$TASK_COUNT_TOTAL] Installing Cross GDB ($TARGET)..." 250 | tar -xjpf $PKG/$PROJECT-$TARGET-gdb-$GDB_SRC_VERSION.tbz2 -C $INSTALL_BASE_DIR 251 | check_error .make-install 252 | fi 253 | 254 | echo " >> GDB ($TARGET) Installed" 255 | fi 256 | } 257 | -------------------------------------------------------------------------------- /includes/binutils.inc.sh: -------------------------------------------------------------------------------- 1 | ######################################################################################################################## 2 | # Filename # binutils.inc 3 | # Purpose # Common functions for building binutils for the various platforms. 4 | # Description # 5 | # Copyright # Copyright (C) 2011-2017 Luke A. Guest, David Rees. 6 | # # All Rights Reserved. 7 | ######################################################################################################################## 8 | 9 | # $1 - Host triple 10 | # $2 - Build triple 11 | # $3 - Target triple 12 | # $4 - Configure options 13 | function binutils() 14 | { 15 | local TASK_COUNT_TOTAL=4 16 | VER="$build_type/$3" 17 | DIRS="$BINUTILS_DIR" 18 | LOGPRE=$LOG/$VER 19 | OBD=$BLD/$VER 20 | 21 | echo " >> Creating Directories (if needed)..." 22 | cd $BLD 23 | for d in $DIRS; do 24 | if [ ! -d $VER/$d ]; then 25 | mkdir -p $VER/$d 26 | fi 27 | done 28 | 29 | if [ ! -d $LOGPRE ]; then 30 | mkdir -p $LOGPRE 31 | fi 32 | 33 | cd $OBD/$BINUTILS_DIR 34 | 35 | if [ ! -f .config ]; then 36 | echo " >> [1/$TASK_COUNT_TOTAL] Configuring Binutils ($3)..." 37 | $SRC/$BINUTILS_DIR/configure \ 38 | --prefix=$INSTALL_DIR \ 39 | --target=$3 \ 40 | --build=$2\ 41 | --host=$1\ 42 | $4 \ 43 | --disable-nls \ 44 | --enable-threads=posix \ 45 | --with-gcc \ 46 | --with-gnu-as \ 47 | --with-gnu-ld \ 48 | --with-ppl=$INSTALL_DIR \ 49 | --disable-isl-version-check \ 50 | --disable-ppl-version-check \ 51 | --with-gmp=$INSTALL_DIR \ 52 | --with-mpfr=$INSTALL_DIR \ 53 | --with-mpc=$INSTALL_DIR \ 54 | --with-isl=$INSTALL_DIR \ 55 | &> $LOGPRE/$BINUTILS_DIR-config.txt 56 | 57 | 58 | # --disable-threads \ 59 | # --disable-ppl \ 60 | # --disable-cloog \ 61 | 62 | check_error .config 63 | fi 64 | 65 | if [ ! -f .make ]; then 66 | echo " >> [2/$TASK_COUNT_TOTAL] Building Binutils ($3)..." 67 | 68 | make all $JOBS &> $LOGPRE/$BINUTILS_DIR-make.txt 69 | 70 | check_error .make 71 | fi 72 | 73 | if [ ! -f .make-pkg-stage ]; then 74 | echo " >> [3/$TASK_COUNT_TOTAL] Packaging Binutils ($3)..." 75 | 76 | make DESTDIR=$STAGE_BASE_DIR install-strip install-html &> $LOGPRE/$BINUTILS_DIR-pkg.txt 77 | 78 | check_error .make-pkg-stage 79 | 80 | if [ ! -f .make-pkg ]; then 81 | cd $STAGE_DIR 82 | 83 | tar -cjpf $PKG/$PROJECT-$1-$BINUTILS_DIR.tbz2 . 84 | 85 | check_error $OBD/$BINUTILS_DIR/.make-pkg 86 | 87 | cd $OBD/$BINUTILS_DIR 88 | rm -rf /tmp/opt 89 | fi 90 | fi 91 | 92 | if [ ! -f .make-install ]; then 93 | echo " >> [4/$TASK_COUNT_TOTAL] Installing Binutils ($3)..." 94 | 95 | tar -xjpf $PKG/$PROJECT-$1-$BINUTILS_DIR.tbz2 -C $INSTALL_BASE_DIR 96 | 97 | check_error .make-install 98 | fi 99 | 100 | echo -e " >> Binutils ($3) Installed\n" 101 | } 102 | 103 | -------------------------------------------------------------------------------- /includes/bootstrap.inc.sh: -------------------------------------------------------------------------------- 1 | ######################################################################################################################## 2 | # Filename # bootstrap.inc 3 | # Purpose # Download and install the bootstrap compiler if required. 4 | # Description # 5 | # Copyright # Copyright (C) 2011-2017 Luke A. Guest, David Rees. 6 | # # All Rights Reserved. 7 | ######################################################################################################################## 8 | function is_bootstrap_required() 9 | { 10 | command -v gnat >/dev/null 2>&1 || return 1 11 | } 12 | 13 | function bootstrap_download() 14 | { 15 | if [ is_bootstrap_required ]; then 16 | local PKG_CPU=$(echo $(uname -m) | tr [:lower:] [:upper:]) 17 | local PKG_OS=$(echo $(uname) | tr [:lower:] [:upper:]) 18 | local PKG_PREFIX=${PKG_CPU}_${PKG_OS} 19 | local PKG="${PKG_PREFIX}_BOOTSTRAP_TARBALL" 20 | local PKG_NAME="${PKG_PREFIX}_BOOTSTRAP_TARBALL_NAME" 21 | local PKG_MIRROR="${BOOTSTRAP_MIRROR}/${!PKG}" 22 | 23 | if [ ! -f $ARC/${!PKG_NAME} ]; then 24 | echo " >> Downloading ${!PKG_NAME}..." 25 | 26 | wget ${PKG_MIRROR} -O $ARC/${!PKG_NAME} 27 | 28 | check_error_exit 29 | else 30 | echo " (x) Already have ${!PKG_NAME}" 31 | fi 32 | 33 | echo -e "** Unpack and install $ARC/${!PKG_NAME} then set up the bootstrap paths before running build-tools.sh -t 1, e.g.:\n\n" 34 | echo -e "\texport OLD_PATH=\$PATH" 35 | echo -e "\texport OLD_LD_LIBRARY_PATH=\$LD_LIBRARY_PATH" 36 | echo -e "\texport PATH=${BOOTSTRAP_DIR}/bin:\$PATH" 37 | echo -e "\texport LD_LIBRARY_PATH=${BOOTSTRAP_DIR}/lib64:${BOOTSTRAP_DIR}/lib:\$LD_LIBRARY_PATH" 38 | echo -e "\n\tWhen you have built your native toolchain, set the paths back to the originals:" 39 | echo -e "\texport PATH=\$OLD_PATH" 40 | echo -e "\texport LD_LIBRARY_PATH=\$OLD_LD_LIBRARY_PATH" 41 | fi 42 | } 43 | 44 | #export OLD_PATH=$PATH 45 | #export BS_CC="$BOOTSTRAP_DIR/bin/gcc" 46 | #export BS_CXX="$BOOTSTRAP_DIR/bin/g++" 47 | #export BS_AR="$BOOTSTRAP_DIR/bin/gcc-ar" 48 | #export BS_NM="$BOOTSTRAP_DIR/bin/gcc-nm" 49 | #export BS_RANLIB="$BOOTSTRAP_DIR/bin/gcc-ranlib" 50 | #export BS_LD="$BOOTSTRAP_DIR/bin/g++" 51 | 52 | #export BS_CC= 53 | #export BS_CXX= 54 | #export BS_AR= 55 | #export BS_NM= 56 | #export BS_RANLIB= 57 | #export BS_LD= 58 | 59 | function bootstrap_install() 60 | { 61 | echo " >> Installing bootstrap compiler" 62 | 63 | if [ is_bootstrap_required ]; then 64 | if [ ! -d $BOOTSTRAP_BASE_DIR ]; then 65 | mkdir -p $BOOTSTRAP_BASE_DIR 66 | 67 | local PKG_PREFIX=$(echo $(uname -m) | tr [:lower:] [:upper:]) 68 | local PKG="${PKG_PREFIX}_BOOTSTRAP_TARBALL" 69 | 70 | if [ ! -d $BOOTSTRAP_BASE_DIR/usr ]; then 71 | tar -xJpf $ARC/${!PKG} -C $BOOTSTRAP_BASE_DIR 72 | 73 | fi 74 | fi 75 | 76 | export PATH=$BOOTSTRAP_DIR/bin:$PATH 77 | 78 | export BS_CC="$BOOTSTRAP_DIR/bin/gcc" 79 | export BS_CXX="$BOOTSTRAP_DIR/bin/g++" 80 | export BS_AR="$BOOTSTRAP_DIR/bin/gcc-ar" 81 | export BS_NM="$BOOTSTRAP_DIR/bin/gcc-nm" 82 | export BS_RANLIB="$BOOTSTRAP_DIR/bin/gcc-ranlib" 83 | export BS_LD="$BOOTSTRAP_DIR/bin/g++" 84 | 85 | echo ">>> PATH: $PATH" 86 | echo ">>> BS_CC: $BS_CC" 87 | fi 88 | } 89 | 90 | function bootstrap_remove() 91 | { 92 | if [ is_bootstrap_required ]; then 93 | echo " >> Uninstalling bootstrap compiler" 94 | 95 | rm -rf $BOOTSTRAP_DIR 96 | 97 | #echo ">>> PATH: $PATH" 98 | #echo ">>> OLD_PATH: $OLD_PATH" 99 | 100 | export PATH=$OLD_PATH 101 | 102 | #echo ">>> PATH: $PATH" 103 | fi 104 | } 105 | -------------------------------------------------------------------------------- /includes/cross.inc: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Filename # cross.inc 3 | # Purpose # Common cross handling functions. 4 | # Description # 5 | # Copyright # Copyright (C) 2011-2014 Luke A. Guest, David Rees. 6 | # # All Rights Reserved. 7 | ################################################################################ 8 | 9 | ################################################################################ 10 | # $1 = Target. 11 | # $2 = Any extra configure parameters. 12 | ################################################################################ 13 | function build_cross_toolchain() 14 | { 15 | echo " ( ) Start Processing GNAT/GCC for $1" 16 | 17 | apply_cross_gcc_patches 18 | 19 | cd $BLD 20 | 21 | VER=$1 22 | STAGE="$VER" 23 | DIRS="binutils-$BINUTILS_SRC_VERSION gcc1 newlib gcc2" 24 | 25 | local TASK_COUNT_TOTAL=13 26 | echo " >> [1/$TASK_COUNT_TOTAL] Creating Directories (if needed)..." 27 | 28 | for d in $DIRS; do 29 | if [ ! -d $STAGE/$d ]; then 30 | mkdir -p $STAGE/$d 31 | fi 32 | done 33 | 34 | LOGPRE=$LOG/$1 35 | CBD=$BLD/$STAGE 36 | 37 | export PATH=$INSTALL_DIR/bin:$PATH 38 | export LD_LIBRARY_PATH=$INSTALL_DIR/lib:$INSTALL_DIR/lib$BITS:$LD_LIBRARY_PATH 39 | 40 | export NATIVE_INSTALL_DIR=$INSTALL_DIR 41 | 42 | # Build Cross version of BinUtils. 43 | cd $CBD/binutils-$BINUTILS_SRC_VERSION 44 | 45 | if [ ! -f .config ]; then 46 | echo " >> [2/$TASK_COUNT_TOTAL] Configuring Binutils for $1..." 47 | $SRC/binutils-$BINUTILS_SRC_VERSION/configure \ 48 | --prefix=$INSTALL_DIR \ 49 | --target=$1 \ 50 | --enable-targets=all \ 51 | $2 \ 52 | --enable-multilib \ 53 | --disable-nls \ 54 | --disable-shared \ 55 | --disable-threads \ 56 | --with-gcc \ 57 | --with-gnu-as \ 58 | --with-gnu-ld \ 59 | --with-ppl=$INSTALL_DIR \ 60 | --enable-cloog-backend=isl \ 61 | --disable-cloog-version-check \ 62 | --disable-isl-version-check \ 63 | --disable-ppl-version-check \ 64 | --with-gmp=$INSTALL_DIR \ 65 | --with-mpfr=$INSTALL_DIR \ 66 | --with-mpc=$INSTALL_DIR \ 67 | --with-isl=$INSTALL_DIR \ 68 | --with-cloog=$INSTALL_DIR \ 69 | &> $LOGPRE-binutils-config.txt 70 | # --without-ppl \ 71 | # --without-cloog \ 72 | 73 | check_error .config 74 | fi 75 | 76 | if [ ! -f .make ]; then 77 | echo " >> [3/$TASK_COUNT_TOTAL] Building Binutils for $1..." 78 | make $JOBS &> $LOGPRE-binutils-make.txt 79 | check_error .make 80 | fi 81 | 82 | if [ ! -f .make-install ]; then 83 | echo " >> [4/$TASK_COUNT_TOTAL] Installing Binutils for $1..." 84 | make install &> $LOGPRE-binutils-install.txt 85 | check_error .make-install 86 | fi 87 | echo " >> Binutils Installed" 88 | 89 | LAST=`pwd` 90 | 91 | # Build stage 1 GCC with C only. 92 | cd $CBD/gcc1 93 | 94 | if [ -f $LAST/.make-install ]; then 95 | if [ ! -f .config ]; then 96 | echo " >> [5/$TASK_COUNT_TOTAL] Configuring Cross Stage 1 GCC (C Only)..." 97 | $GCC_DIR/configure \ 98 | --prefix=$INSTALL_DIR \ 99 | --target=$1 \ 100 | $2 \ 101 | --enable-multilib \ 102 | --with-newlib \ 103 | --disable-nls \ 104 | --disable-shared \ 105 | --disable-threads \ 106 | --disable-lto \ 107 | --with-gnu-as \ 108 | --with-gnu-ld \ 109 | --enable-languages=c \ 110 | --disable-libssp \ 111 | --without-headers \ 112 | --disable-cloog-version-check \ 113 | --disable-isl-version-check \ 114 | --with-gmp=$INSTALL_DIR \ 115 | --with-mpfr=$INSTALL_DIR \ 116 | --with-mpc=$INSTALL_DIR \ 117 | --with-isl=$INSTALL_DIR \ 118 | --with-cloog=$INSTALL_DIR \ 119 | &> $LOGPRE-gcc1-config.txt 120 | # --without-ppl \ 121 | # --without-cloog \ 122 | # --with-gmp-include=$NATIVE_INSTALL_DIR/include \ 123 | # --with-ppl=$NATIVE_INSTALL_DIR \ 124 | # --with-cloog=$INSTALL_DIR \ 125 | 126 | check_error .config 127 | fi 128 | 129 | if [ ! -f .make ]; then 130 | echo " >> [6/$TASK_COUNT_TOTAL] Building Cross Stage 1 GCC (C Only)..." 131 | # use all-gcc, otherwise libiberty fails as it requires sys/types.h 132 | # which doesn't exist and tbh, shouldn't even be getting built, it's 133 | # a bug which has been reported here: 134 | # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43073 135 | make $JOBS all-gcc &> $LOGPRE-gcc1-make.txt 136 | 137 | check_error .make 138 | fi 139 | 140 | if [ ! -f .make-install ]; then 141 | echo " >> [7/$TASK_COUNT_TOTAL] Installing Cross Stage 1 GCC (C Only)..." 142 | make install-gcc &> $LOGPRE-gcc1-install.txt 143 | 144 | check_error .make-install 145 | fi 146 | fi 147 | echo " (x) Cross Stage 1 GCC (C Only) Installed" 148 | 149 | LAST=`pwd` 150 | 151 | # Build NewLib 152 | cd $CBD/newlib 153 | 154 | if [ -f $LAST/.make-install ]; then 155 | if [ ! -f .config ]; then 156 | echo " >> [8/$TASK_COUNT_TOTAL] Configuring Newlib for $1..." 157 | $SRC/newlib-$NEWLIB_VERSION/configure \ 158 | --prefix=$INSTALL_DIR \ 159 | --target=$1 \ 160 | $2 \ 161 | --enable-multilib \ 162 | --with-gnu-as \ 163 | --with-gnu-ld \ 164 | --disable-nls \ 165 | --with-gmp=$NATIVE_INSTALL_DIR \ 166 | --with-ppl=$NATIVE_INSTALL_DIR \ 167 | --with-cloog=$NATIVE_INSTALL_DIR \ 168 | &> $LOGPRE-newlib-config.txt 169 | # --without-ppl \ 170 | # --without-cloog \ 171 | 172 | check_error .config 173 | fi 174 | 175 | if [ ! -f .make ]; then 176 | echo " >> [9/$TASK_COUNT_TOTAL] Building Newlib for $1..." 177 | make $JOBS &> $LOGPRE-newlib-make.txt 178 | 179 | check_error .make 180 | fi 181 | 182 | if [ ! -f .make-install ]; then 183 | echo " >> [10/$TASK_COUNT_TOTAL] Installing Newlib for $1..." 184 | make install &> $LOGPRE-newlib-install.txt 185 | 186 | check_error .make-install 187 | fi 188 | fi 189 | echo " (x) Newlib Installed" 190 | LAST=`pwd` 191 | 192 | # Build Stage 2 GCC with C, C++ & Ada 193 | cd $CBD/gcc2 194 | 195 | if [ -f $LAST/.make-install ]; then 196 | if [ ! -f .config ]; then 197 | echo " >> [11/$TASK_COUNT_TOTAL] Configuring Cross Stage 2 GCC (C/Ada)..." 198 | $GCC_DIR/configure \ 199 | --prefix=$INSTALL_DIR \ 200 | --target=$1 \ 201 | $2 \ 202 | --enable-multilib \ 203 | --with-newlib \ 204 | --with-headers=$SRC/newlib-$NEWLIB_VERSION/newlib/libc/include \ 205 | --disable-nls \ 206 | --disable-shared \ 207 | --disable-threads \ 208 | --disable-lto \ 209 | --with-gnu-as \ 210 | --with-gnu-ld \ 211 | --enable-languages=c,c++,ada \ 212 | --disable-libssp \ 213 | --disable-cloog-version-check \ 214 | --disable-isl-version-check \ 215 | --with-gmp=$INSTALL_DIR \ 216 | --with-mpfr=$INSTALL_DIR \ 217 | --with-mpc=$INSTALL_DIR \ 218 | --with-isl=$INSTALL_DIR \ 219 | --with-cloog=$INSTALL_DIR \ 220 | &> $LOGPRE-gcc2-config.txt 221 | # --without-ppl \ 222 | # --without-cloog \ 223 | # this next line actually forces gnattools not to build! 224 | # --disable-libada \ 225 | # --with-gmp=$NATIVE_INSTALL_DIR \ 226 | # --with-ppl=$NATIVE_INSTALL_DIR \ 227 | # --with-cloog=$NATIVE_INSTALL_DIR \ 228 | 229 | check_error .config 230 | fi 231 | 232 | if [ ! -f .make ]; then 233 | echo " >> [12/$TASK_COUNT_TOTAL] Building Cross Stage 2 GCC (C/Ada)..." 234 | make $JOBS &> $LOGPRE-gcc2-make.txt 235 | 236 | check_error .make 237 | fi 238 | 239 | # if [ ! -f .make-gnattools ]; then 240 | # echo " >> [13/$TASK_COUNT_TOTAL] Building Cross Stage 2 GCC (GNAT Tools)..." 241 | # make $JOBS all-gnattools &> $LOGPRE-gcc2-make-gnattools.txt 242 | 243 | # check_error .make-gnattools 244 | # fi 245 | 246 | if [ ! -f .make-install ]; then 247 | echo " >> [13/$TASK_COUNT_TOTAL] Installing Cross Stage 2 GCC (C/Ada)..." 248 | make install &> $LOGPRE-gcc2-install.txt 249 | 250 | check_error .make-install 251 | fi 252 | fi 253 | 254 | echo " (x) Cross Stage 2 GCC (C/Ada) Installed" 255 | 256 | # Get back to the build directory. 257 | cd $BLD 258 | } 259 | -------------------------------------------------------------------------------- /includes/errors.inc.sh: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Filename # errors.inc 3 | # Purpose # Common error handling functions. 4 | # Description # 5 | # Copyright # Copyright (C) 2011-2014 Luke A. Guest, David Rees. 6 | # # All Rights Reserved. 7 | ################################################################################ 8 | 9 | function check_error_exit() 10 | { 11 | if [ $? != 0 ]; then 12 | echo " ERROR: Something went wrong!" 13 | exit 2; 14 | fi 15 | } 16 | 17 | # $1 = Filename to create using touch, used in successive steps to test 18 | # if the previous step was completed. 19 | function check_error() 20 | { 21 | if [ $? != 0 ]; then 22 | echo " ERROR: Something went wrong!" 23 | exit 2; 24 | else 25 | touch $1 26 | fi 27 | } 28 | 29 | # $1 = Package name. 30 | # $2 = command to check for. 31 | function check_package_installed() 32 | { 33 | which $2 &> /dev/null 34 | 35 | if [ $? != 0 ]; then 36 | echo " ERROR: $1 not installed on this system, install and restart script!" 37 | exit 2; 38 | fi 39 | } 40 | 41 | function display_no_config_error() 42 | { 43 | cat << 'NOCONFIG_ERR' 44 | 45 | ERROR: No config.inc found. 46 | 47 | 1) cp config-master.inc config.inc 48 | 2) Peronalise config.inc for your system 49 | 3) Run this script again 50 | 51 | NOCONFIG_ERR 52 | 53 | exit 2 54 | } 55 | 56 | -------------------------------------------------------------------------------- /includes/gcc.inc.sh: -------------------------------------------------------------------------------- 1 | ######################################################################################################################## 2 | # Filename # gcc.inc 3 | # Purpose # Common functions for building GCC for the various platforms. 4 | # Description # 5 | # Copyright # Copyright (C) 2011-2017 Luke A. Guest, David Rees. 6 | # # All Rights Reserved. 7 | ######################################################################################################################## 8 | 9 | # $1 - Host triple 10 | # $2 - Build triple 11 | # $3 - Target triple 12 | # $4 - Configure options 13 | function gcc() 14 | { 15 | local TASK_COUNT_TOTAL=5 16 | VER="$build_type/$3" 17 | DIRS="$GCC_DIR" 18 | LOGPRE=$LOG/$VER 19 | OBD=$BLD/$VER 20 | 21 | case $build_type in 22 | "native") 23 | MAKEFILE_ALL_TARGET="all" 24 | MAKEFILE_INSTALL_TARGET="install-strip install-html" 25 | LANGUAGES=$NATIVE_LANGUAGES 26 | ;; 27 | 28 | "cross") 29 | MAKEFILE_ALL_TARGET="all-gcc" 30 | MAKEFILE_INSTALL_TARGET="install-strip-gcc install-target-libgcc" 31 | 32 | # Special variant for bare metal. 33 | if [ $variant == "bare" ]; then 34 | LANGUAGES="c,ada" 35 | fi 36 | ;; 37 | esac 38 | 39 | echo " >> Creating Directories (if needed)..." 40 | 41 | cd $BLD 42 | for d in $DIRS; do 43 | if [ ! -d $VER/$d ]; then 44 | mkdir -p $VER/$d 45 | fi 46 | done 47 | 48 | cd $OBD/$GCC_DIR 49 | 50 | if [ ! -f .config ]; then 51 | echo " >> [1/$TASK_COUNT_TOTAL] Configuring GCC ($3)..." 52 | $SRC/$GCC_DIR/configure \ 53 | --prefix=$INSTALL_DIR \ 54 | --target=$3 \ 55 | --build=$2\ 56 | --host=$1\ 57 | $4 \ 58 | --disable-nls \ 59 | --with-gnu-as \ 60 | --with-gnu-ld \ 61 | --enable-languages=$LANGUAGES \ 62 | --with-system-zlib \ 63 | --without-libiconv-prefix \ 64 | --disable-libmudflap \ 65 | --disable-libstdcxx-pch \ 66 | --enable-lto \ 67 | --disable-isl-version-check \ 68 | --disable-ppl-version-check \ 69 | --with-gmp=$INSTALL_DIR \ 70 | --with-mpfr=$INSTALL_DIR \ 71 | --with-mpc=$INSTALL_DIR \ 72 | --with-isl=$INSTALL_DIR \ 73 | &> $LOGPRE/$GCC_DIR-config.txt 74 | 75 | 76 | # --disable-threads \ 77 | # --disable-ppl \ 78 | # --disable-cloog \ 79 | 80 | check_error .config 81 | fi 82 | 83 | if [ ! -f .make ]; then 84 | echo " >> [2/$TASK_COUNT_TOTAL] Building GCC ($3)..." 85 | 86 | make $MAKEFILE_ALL_TARGET $JOBS &> $LOGPRE/$GCC_DIR-make.txt 87 | 88 | check_error .make 89 | fi 90 | 91 | # Only run the testsuite if this is a native build. 92 | case $build_type in 93 | "native") 94 | if [ ! -f .make-test ] && [ $GCC_TESTS = "y" ]; then 95 | echo " >> [3-pre/$TASK_COUNT_TOTAL] Checking environment for test tools..." 96 | 97 | check_package_installed "Tcl" tclsh 98 | check_package_installed "Expect" expect 99 | check_package_installed "DejaGNU" runtest 100 | 101 | echo " >> Tcl, Expect and DejaGNU installed..." 102 | 103 | echo " >> [3/$TASK_COUNT_TOTAL] Testing GNAT/GCC ($3)..." 104 | make -k check-gcc &> $LOGPRE/$GCC_DIR-test.txt 105 | 106 | check_error .make-test 107 | else 108 | echo " >> [3/$TASK_COUNT_TOTAL] Skipping testing GNAT/GCC ($3)..." 109 | fi 110 | ;; 111 | 112 | "cross") 113 | if [ ! -f .make-libgcc ]; then 114 | echo " >> [3.1/$TASK_COUNT_TOTAL] Building Cross libgcc ($3)..." 115 | 116 | make $JOBS all-target-libgcc &> $LOGPRE/$GCC_DIR-libgcc-make.txt 117 | 118 | check_error .make-libgcc 119 | fi 120 | 121 | if [ ! -f .make-gnattools ]; then 122 | echo " >> [3.2/$TASK_COUNT_TOTAL] Building Cross GNAT tools ($3)..." 123 | 124 | make $JOBS -C gcc cross-gnattools ada.all.cross &> $LOGPRE/$GCC_DIR-gnattools-make.txt 125 | 126 | check_error .make-gnattools 127 | fi 128 | ;; 129 | esac 130 | 131 | if [ ! -f .make-pkg-stage ]; then 132 | echo " >> [4/$TASK_COUNT_TOTAL] Packaging GCC ($3)..." 133 | 134 | make DESTDIR=$STAGE_BASE_DIR $MAKEFILE_INSTALL_TARGET &> $LOGPRE/$GCC_DIR-pkg.txt 135 | 136 | check_error .make-pkg-stage 137 | 138 | if [ ! -f .make-pkg ]; then 139 | cd $STAGE_DIR 140 | 141 | tar -cjpf $PKG/$PROJECT-$1-$GCC_DIR.tbz2 . 142 | 143 | check_error $OBD/$GCC_DIR/.make-pkg 144 | 145 | cd $OBD/$GCC_DIR 146 | rm -rf /tmp/opt 147 | fi 148 | fi 149 | 150 | if [ ! -f .make-install ]; then 151 | echo " >> [5/$TASK_COUNT_TOTAL] Installing GCC ($3)..." 152 | 153 | tar -xjpf $PKG/$PROJECT-$1-$GCC_DIR.tbz2 -C $INSTALL_BASE_DIR 154 | 155 | check_error .make-install 156 | fi 157 | 158 | echo " >> GCC ($3) Installed" 159 | 160 | echo -e "\n\tDon't forget to set the paths back to the originals:" 161 | echo -e "\texport PATH=\$OLD_PATH" 162 | echo -e "\texport LD_LIBRARY_PATH=\$OLD_LD_LIBRARY_PATH\n" 163 | } 164 | 165 | -------------------------------------------------------------------------------- /includes/gdb.inc.sh: -------------------------------------------------------------------------------- 1 | ######################################################################################################################## 2 | # Filename # gdb.inc 3 | # Purpose # Common functions for building gdb for the various platforms. 4 | # Description # 5 | # Copyright # Copyright (C) 2011-2017 Luke A. Guest, David Rees. 6 | # # All Rights Reserved. 7 | ######################################################################################################################## 8 | 9 | # $1 - Host triple 10 | # $2 - Build triple 11 | # $3 - Target triple 12 | # $4 - Configure options 13 | function gdb() 14 | { 15 | local TASK_COUNT_TOTAL=4 16 | VER="$build_type/$3" 17 | DIRS="$GDB_DIR" 18 | LOGPRE=$LOG/$VER 19 | OBD=$BLD/$VER 20 | 21 | PYVER=`echo $PYTHON_VERSION |awk -F \. {'print $1"."$2'}` 22 | 23 | echo " >> Creating Directories (if needed)..." 24 | cd $BLD 25 | for d in $DIRS; do 26 | if [ ! -d $VER/$d ]; then 27 | mkdir -p $VER/$d 28 | fi 29 | done 30 | 31 | if [ ! -d $LOGPRE ]; then 32 | mkdir -p $LOGPRE 33 | fi 34 | 35 | cd $OBD/$GDB_DIR 36 | 37 | if [ ! -f .config ]; then 38 | echo " >> [1/$TASK_COUNT_TOTAL] Configuring GDB ($3)..." 39 | $SRC/$GDB_DIR/configure \ 40 | --prefix=$INSTALL_DIR \ 41 | --target=$3 \ 42 | --build=$2\ 43 | --host=$1\ 44 | $4 \ 45 | --disable-nls \ 46 | --enable-threads=posix \ 47 | --with-system-readline \ 48 | --without-guile \ 49 | --with-gcc \ 50 | --with-gnu-as \ 51 | --with-gnu-ld \ 52 | --with-ppl=$INSTALL_DIR \ 53 | --disable-isl-version-check \ 54 | --disable-ppl-version-check \ 55 | --with-gmp=$INSTALL_DIR \ 56 | --with-mpfr=$INSTALL_DIR \ 57 | --with-mpc=$INSTALL_DIR \ 58 | --with-isl=$INSTALL_DIR \ 59 | --with-python=${INSTALL_DIR}/bin/python${PYVER} \ 60 | &> $LOGPRE/$GDB_DIR-config.txt 61 | 62 | 63 | # --disable-threads \ 64 | # --disable-ppl \ 65 | # --disable-cloog \ 66 | 67 | check_error .config 68 | fi 69 | 70 | if [ ! -f .make ]; then 71 | echo " >> [2/$TASK_COUNT_TOTAL] Building GDB ($3)..." 72 | 73 | make all $JOBS &> $LOGPRE/$GDB_DIR-make.txt 74 | 75 | check_error .make 76 | fi 77 | 78 | if [ ! -f .make-pkg-stage ]; then 79 | echo " >> [3/$TASK_COUNT_TOTAL] Packaging GDB ($3)..." 80 | 81 | make -C gdb DESTDIR=$STAGE_BASE_DIR install-strip >> $LOGPRE/$GDB_DIR-pkg.txt 2>&1 82 | make DESTDIR=$STAGE_BASE_DIR install-html >> $LOGPRE/$GDB_DIR-pkg.txt 2>&1 83 | 84 | check_error .make-pkg-stage 85 | 86 | if [ ! -f .make-pkg ]; then 87 | cd $STAGE_DIR 88 | 89 | tar -cjpf $PKG/$PROJECT-$1-$GDB_DIR.tbz2 . 90 | 91 | check_error $OBD/$GDB_DIR/.make-pkg 92 | 93 | cd $OBD/$GDB_DIR 94 | rm -rf /tmp/opt 95 | fi 96 | fi 97 | 98 | if [ ! -f .make-install ]; then 99 | echo " >> [4/$TASK_COUNT_TOTAL] Installing GDB ($3)..." 100 | 101 | tar -xjpf $PKG/$PROJECT-$1-$GDB_DIR.tbz2 -C $INSTALL_BASE_DIR 102 | 103 | check_error .make-install 104 | fi 105 | 106 | echo -e " >> GDB ($3) Installed\n" 107 | } 108 | 109 | -------------------------------------------------------------------------------- /includes/patch.inc: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Filename # patch.inc 3 | # Purpose # Common patch handling functions. 4 | # Description # 5 | # Copyright # Luke A. Guest, David Rees Copyright (C) 2011 6 | ################################################################################ 7 | 8 | function apply_native_gcc_patches() 9 | { 10 | # Patch gcc trunk sources 11 | # if [ $GCC_FROM_REPO = "y" ]; then 12 | 13 | cd $GCC_DIR 14 | 15 | # if [ ! -f .patched ]; then 16 | # local PATCHES="gnatvsn.patch" 17 | 18 | # echo " >> Applying Patches to GNAT/GCC (Native)..." 19 | # for p in $PATCHES; do 20 | # patch -p1 -s -d $GCC_DIR < $TOP/patches/gcc-$GCC_VERSION/$p 21 | # check_error .patched 22 | # done 23 | # fi 24 | 25 | 26 | # Patching a gcc snapshot or release 27 | # else 28 | 29 | #cd $GCC_DIR 30 | 31 | #if [ ! -f .patched ]; then 32 | #local PATCHES="ada-symbolic-tracebacks.diff" 33 | #echo " >> Patching GNAT/GCC (Native)..." 34 | 35 | #if [ $GCC_VERSION == "4.6.1" ]; then 36 | # 37 | #fi 38 | 39 | #for p in $PATCHES; do 40 | # patch -p1 -s -d $GCC_DIR < $TOP/patches/gcc-$GCC_VERSION/$p 41 | #done 42 | 43 | # check_error .patched 44 | #fi 45 | 46 | # fi 47 | } 48 | 49 | function apply_cross_gcc_patches() 50 | { 51 | # Patch gcc trunk source 52 | if [ $GCC_FROM_REPO = "y" ]; then 53 | 54 | cd $GCC_DIR 55 | local PATCHES="gcc-$GCC_VERSION.diff t-arm-elf.patch" 56 | # local PATCHES="gcc-4.6.1.diff t-arm-elf.patch" 57 | 58 | if [ ! -f .patched ]; then 59 | echo " >> Applying Patches to GNAT/GCC Cross..." 60 | for p in $PATCHES; do 61 | patch -p1 -s -d $GCC_DIR < $TOP/patches/gcc-$GCC_VERSION/$p 62 | check_error .patched 63 | done 64 | fi 65 | # Patch gcc snapshots or releases 66 | else 67 | 68 | cd $GCC_DIR 69 | local PATCHES="gcc-$GCC_VERSION.diff" 70 | 71 | if [ ! -f .patched ]; then 72 | echo " >> Applying Patches to GNAT/GCC Cross..." 73 | for p in $PATCHES; do 74 | patch -p1 -s -d $GCC_DIR < $TOP/patches/gcc-$GCC_VERSION/$p 75 | check_error .patched 76 | done 77 | fi 78 | fi 79 | } 80 | 81 | function reverse_patches() 82 | { 83 | echo " >> Reversing patches that were previously applied to src/gcc" 84 | cat $TOP/patches/gcc-$GCC_VERSION/* | patch -p1 -s -t -d $GCC_DIR -i -; 85 | rm -f $GCC_DIR/.patched; 86 | } 87 | -------------------------------------------------------------------------------- /includes/python.inc.sh: -------------------------------------------------------------------------------- 1 | ######################################################################################################################## 2 | # Filename # python.inc 3 | # Purpose # Python 2.7 4 | # Description # Required by AdaCore's packages. 5 | # Copyright # Copyright (C) 2011-2018 Luke A. Guest, David Rees. 6 | # # All Rights Reserved. 7 | ######################################################################################################################## 8 | 9 | # $1 - Host triple 10 | # $2 - Build triple 11 | # $3 - Target triple 12 | # $4 - Configure options 13 | function python() 14 | { 15 | local TASK_COUNT_TOTAL=4 16 | VER="$build_type/$1" 17 | DIRS="$PYTHON_DIR" 18 | LOGPRE=$LOG/$VER 19 | OBD=$BLD/$VER 20 | 21 | echo " >> Creating Directories (if needed)..." 22 | 23 | cd $BLD 24 | for d in $DIRS; do 25 | if [ ! -d $VER/$d ]; then 26 | mkdir -p $VER/$d 27 | fi 28 | done 29 | 30 | cd $OBD/$PYTHON_DIR 31 | 32 | MAKEFILE=$SRC/$PYTHON_DIR/Makefile 33 | 34 | if [ ! -f .config ]; then 35 | echo " >> [1/$TASK_COUNT_TOTAL] Configuring Python ($3)..." 36 | 37 | $SRC/$PYTHON_DIR/configure \ 38 | --prefix=$INSTALL_DIR \ 39 | --without-pymalloc \ 40 | --enable-shared &> $LOGPRE/$PYTHON_DIR-config.txt 41 | 42 | check_error .config 43 | fi 44 | 45 | if [ ! -f .make ]; then 46 | echo " >> [2/$TASK_COUNT_TOTAL] Building Python ($3)..." 47 | 48 | check_error .make 49 | 50 | make $JOBS &> $LOGPRE/$PYTHON_DIR-make.txt 51 | 52 | check_error_exit 53 | fi 54 | 55 | if [ ! -f .make-pkg-stage ]; then 56 | echo " >> [3/$TASK_COUNT_TOTAL] Packaging Python ($3)..." 57 | 58 | make DESTDIR=$STAGE_BASE_DIR altinstall &> $LOGPRE/$PYTHON_DIR-pkg.txt 59 | 60 | strip $STAGE_BASE_DIR$INSTALL_DIR/bin/python2.7 61 | 62 | check_error .make-pkg-stage 63 | 64 | if [ ! -f .make-pkg ]; then 65 | cd $STAGE_DIR 66 | 67 | tar -cjpf $PKG/$PROJECT-$1-$PYTHON_DIR.tbz2 . 68 | 69 | check_error $OBD/$PYTHON_DIR/.make-pkg 70 | 71 | cd $OBD/$PYTHON_DIR 72 | rm -rf /tmp/opt 73 | fi 74 | fi 75 | 76 | if [ ! -f .make-install ]; then 77 | echo " >> [4/$TASK_COUNT_TOTAL] Installing Python ($3)..." 78 | 79 | tar -xjpf $PKG/$PROJECT-$1-$PYTHON_DIR.tbz2 -C $INSTALL_BASE_DIR 80 | 81 | check_error .make-install 82 | fi 83 | 84 | echo " >> Python bootstrap ($3) Installed" 85 | } 86 | 87 | function install_python_packages() 88 | { 89 | local TASK_COUNT_TOTAL=8 90 | VER="$build_type/$1" 91 | DIRS="python-pkgs" 92 | LOGPRE=$LOG/$VER 93 | OBD=$BLD/$VER 94 | 95 | echo " >> Creating Directories (if needed)..." 96 | 97 | cd $BLD 98 | for d in $DIRS; do 99 | if [ ! -d $VER/$d ]; then 100 | mkdir -p $VER/$d 101 | fi 102 | done 103 | 104 | cd $OBD/$DIRS 105 | 106 | echo " >> Downloading required Python packages..." 107 | 108 | if [ ! -f get-pip.py ]; then 109 | echo " >> [1/$TASK_COUNT_TOTAL] Downloading get-pip.py..." 110 | 111 | curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py &> $LOGPRE/$DIRS-pip-download.txt 112 | 113 | check_error_exit 114 | fi 115 | 116 | if [ ! -f .installed-pip ]; then 117 | echo " >> [2/$TASK_COUNT_TOTAL] Packaging PIP..." 118 | 119 | python2.7 get-pip.py &> $LOGPRE/$DIRS-pip-install.txt 120 | 121 | check_error .installed-pip 122 | fi 123 | 124 | if [ ! -f .installed-mako ]; then 125 | echo " >> [3/$TASK_COUNT_TOTAL] Packaging Mako..." 126 | 127 | pip2.7 install mako &> $LOGPRE/$DIRS-mako-install.txt 128 | 129 | check_error .installed-mako 130 | fi 131 | 132 | if [ ! -f .installed-pyyaml ]; then 133 | echo " >> [4/$TASK_COUNT_TOTAL] Packaging PyYAML..." 134 | 135 | pip2.7 install pyyaml &> $LOGPRE/$DIRS-pyyaml-install.txt 136 | 137 | check_error .installed-pyyaml 138 | fi 139 | 140 | if [ ! -f .installed-enum ]; then 141 | echo " >> [5/$TASK_COUNT_TOTAL] Packaging Enum..." 142 | 143 | pip2.7 install enum &> $LOGPRE/$DIRS-enum-install.txt 144 | 145 | check_error .installed-enum 146 | fi 147 | 148 | if [ ! -f .installed-enum34 ]; then 149 | echo " >> [6/$TASK_COUNT_TOTAL] Packaging Enum34..." 150 | 151 | pip2.7 install enum34 &> $LOGPRE/$DIRS-enum34-install.txt 152 | 153 | check_error .installed-enum34 154 | fi 155 | 156 | if [ ! -f .installed-funcy ]; then 157 | echo " >> [7/$TASK_COUNT_TOTAL] Packaging Funcy..." 158 | 159 | pip2.7 install funcy &> $LOGPRE/$DIRS-funcy-install.txt 160 | 161 | check_error .installed-funcy 162 | fi 163 | 164 | if [ ! -f .installed-docutils ]; then 165 | echo " >> [8/$TASK_COUNT_TOTAL] Packaging DocUtils..." 166 | 167 | pip2.7 install docutils &> $LOGPRE/$DIRS-docutils-install.txt 168 | 169 | check_error .installed-docutils 170 | fi 171 | 172 | echo " >> Python packages Installed" 173 | } -------------------------------------------------------------------------------- /includes/version.inc.sh: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Filename # date.inc 3 | # Purpose # Defines date version 4 | # Copyright # Copyright (C) 2011-2017 Luke A. Guest, David Rees. 5 | ################################################################################ 6 | VERSION_DATE="14/09/2018" 7 | BUILD_DATE=$(date +%d/%m/%Y) 8 | 9 | COPYRIGHT="Copyright (C) 2011-2018 Luke A. Guest, David Rees. All Rights Reserved." 10 | -------------------------------------------------------------------------------- /source/gnat_util/MANIFEST.gnat_util: -------------------------------------------------------------------------------- 1 | ali-util.adb 2 | ali-util.ads 3 | ali.adb 4 | ali.ads 5 | alloc.ads 6 | aspects.adb 7 | aspects.ads 8 | atree.adb 9 | atree.ads 10 | binderr.adb 11 | binderr.ads 12 | butil.adb 13 | butil.ads 14 | casing.adb 15 | casing.ads 16 | csets.adb 17 | csets.ads 18 | debug.adb 19 | debug.ads 20 | einfo.adb 21 | einfo.ads 22 | elists.adb 23 | elists.ads 24 | err_vars.ads 25 | errout.ads 26 | errout.adb 27 | erroutc.adb 28 | erroutc.ads 29 | errutil.adb 30 | errutil.ads 31 | fmap.adb 32 | fmap.ads 33 | fname.adb 34 | fname.ads 35 | fname-uf.ads 36 | fname-uf.adb 37 | get_scos.adb 38 | get_scos.ads 39 | gnatvsn.ads 40 | hostparm.ads 41 | krunch.adb 42 | krunch.ads 43 | lib-list.adb 44 | lib-sort.adb 45 | lib.adb 46 | lib.ads 47 | link.c 48 | makeutl.adb 49 | makeutl.ads 50 | mlib-fil.adb 51 | mlib-fil.ads 52 | mlib-tgt-specific.adb 53 | mlib-tgt-specific.ads 54 | mlib-tgt.adb 55 | mlib-tgt.ads 56 | mlib-utl.adb 57 | mlib-utl.ads 58 | mlib.adb 59 | mlib.ads 60 | namet.adb 61 | namet.ads 62 | nlists.adb 63 | nlists.ads 64 | opt.adb 65 | opt.ads 66 | osint.adb 67 | osint.ads 68 | output.adb 69 | output.ads 70 | prj-attr-pm.adb 71 | prj-attr-pm.ads 72 | prj-attr.adb 73 | prj-attr.ads 74 | prj-com.ads 75 | prj-conf.adb 76 | prj-conf.ads 77 | prj-dect.adb 78 | prj-dect.ads 79 | prj-env.adb 80 | prj-env.ads 81 | prj-err.adb 82 | prj-err.ads 83 | prj-ext.adb 84 | prj-ext.ads 85 | prj-nmsc.adb 86 | prj-nmsc.ads 87 | prj-part.adb 88 | prj-part.ads 89 | prj-pp.adb 90 | prj-pp.ads 91 | prj-proc.adb 92 | prj-proc.ads 93 | prj-strt.adb 94 | prj-strt.ads 95 | prj-tree.adb 96 | prj-tree.ads 97 | prj-util.adb 98 | prj-util.ads 99 | prj.adb 100 | prj.ads 101 | put_scos.ads 102 | put_scos.adb 103 | repinfo.adb 104 | repinfo.ads 105 | restrict.ads 106 | restrict.adb 107 | rident.ads 108 | scans.adb 109 | scans.ads 110 | scng.adb 111 | scng.ads 112 | scos.ads 113 | scos.adb 114 | sdefault.ads 115 | sem_aux.adb 116 | sem_aux.ads 117 | sinfo.adb 118 | sinfo.ads 119 | sinput-c.adb 120 | sinput-c.ads 121 | sinput-p.adb 122 | sinput-p.ads 123 | sinput.adb 124 | sinput.ads 125 | snames.adb-tmpl 126 | snames.ads-tmpl 127 | snames.h-tmpl 128 | stand.adb 129 | stand.ads 130 | stringt.adb 131 | stringt.ads 132 | styleg.adb 133 | styleg.ads 134 | stylesw.adb 135 | stylesw.ads 136 | switch-m.adb 137 | switch-m.ads 138 | switch.adb 139 | switch.ads 140 | table.adb 141 | table.ads 142 | targparm.adb 143 | targparm.ads 144 | tempdir.adb 145 | tempdir.ads 146 | tree_in.adb 147 | tree_in.ads 148 | tree_io.adb 149 | tree_io.ads 150 | types.adb 151 | types.ads 152 | uintp.adb 153 | uintp.ads 154 | uname.adb 155 | uname.ads 156 | urealp.adb 157 | urealp.ads 158 | widechar.adb 159 | widechar.ads 160 | xsnamest.adb 161 | xutil.adb 162 | xutil.ads 163 | -------------------------------------------------------------------------------- /source/gnat_util/Makefile: -------------------------------------------------------------------------------- 1 | # This makefile is used to build and install Gnat_Util 2 | # For information on building and installing Gnat_Util see README.gnat_util. 3 | 4 | ENABLE_SHARED=no 5 | BUILD_TYPE=Production 6 | 7 | prefix=/usr/local 8 | 9 | BUILDER=gprbuild -j0 10 | INSTALLER=gprinstall 11 | 12 | OS_TYPE=unix 13 | 14 | ifeq ($(OS),Windows_NT) 15 | OS_TYPE=Windows_NT 16 | endif 17 | 18 | CP=cp -p 19 | MKDIR=mkdir -p 20 | SRC=gen_src 21 | 22 | .PHONY: all 23 | all: generate_sources 24 | ${BUILDER} -m -XOS=$(OS_TYPE) -XBUILD=$(BUILD_TYPE) \ 25 | -XLIBRARY_TYPE=static -Pgnat_util -p 26 | ifeq ($(ENABLE_SHARED), yes) 27 | ${BUILDER} -m -XOS=$(OS_TYPE) -XBUILD=$(BUILD_TYPE) \ 28 | -XLIBRARY_TYPE=relocatable -Pgnat_util -p 29 | endif 30 | 31 | .PHONY: generate_sources 32 | generate_sources: 33 | $(MKDIR) $(SRC) 34 | $(CP) xsnamest.adb xutil.* snames.adb-tmpl snames.ads-tmpl snames.h-tmpl $(SRC) 35 | (cd $(SRC) && \ 36 | gnatmake -gnatf -gnatwae -gnatyg -gnatyS xsnamest && \ 37 | ./xsnamest && mv snames.ns snames.ads && mv snames.nb snames.adb) 38 | $(CP) sdefault.adb $(SRC)/sdefault.adb 39 | # $(CP) sdefault_adb.gnat_util $(SRC)/sdefault.adb 40 | 41 | install-clean: 42 | ifneq (,$(wildcard $(prefix)/lib/gnat/manifests/gnat_util)) 43 | -$(INSTALLER) -XOS=$(OS_TYPE) -XBUILD=$(BUILD_TYPE) --uninstall \ 44 | --prefix=$(prefix) --project-subdir=lib/gnat gnat_util 45 | endif 46 | 47 | .PHONY: install 48 | install: install-clean 49 | ${INSTALLER} -p -f -XOS=$(OS_TYPE) -XBUILD=$(BUILD_TYPE) \ 50 | -XLIBRARY_TYPE=static \ 51 | --prefix=$(prefix) \ 52 | --sources-subdir=include/gnat_util \ 53 | --lib-subdir=lib/gnat_util/static \ 54 | --project-subdir=lib/gnat \ 55 | --build-var=LIBRARY_TYPE --build-name=static -Pgnat_util 56 | ifeq ($(ENABLE_SHARED), yes) 57 | ${INSTALLER} -p -f -XOS=$(OS_TYPE) -XBUILD=$(BUILD_TYPE) \ 58 | -XLIBRARY_TYPE=relocatable \ 59 | --prefix=$(prefix) \ 60 | --sources-subdir=include/gnat_util \ 61 | --lib-subdir=lib/gnat_util/relocatable \ 62 | --project-subdir=lib/gnat \ 63 | --build-var=LIBRARY_TYPE --build-name=relocatable -Pgnat_util 64 | endif 65 | 66 | .PHONY: clean 67 | clean: 68 | -gprclean -r -q -Pgnat_util -XOS=$(OS_TYPE) -XLIBRARY_TYPE=relocatable 69 | -gprclean -r -q -Pgnat_util -XOS=$(OS_TYPE) -XLIBRARY_TYPE=static 70 | -------------------------------------------------------------------------------- /source/gnat_util/Makefile.bootstrap: -------------------------------------------------------------------------------- 1 | # This makefile is used to build and install Gnat_Util using gnatmake. 2 | 3 | BUILD_TYPE=Production 4 | 5 | prefix=/usr/local 6 | 7 | 8 | CP = cp -p 9 | MV = mv 10 | MKDIR = mkdir -p 11 | AR = ar rc 12 | RANLIB = ranlib 13 | RM = rm -rf 14 | SRC = gen_src 15 | STATIC_BUILD_DIR= lib/static 16 | SHARED_BUILD_DIR= lib/shared 17 | 18 | # Only listing these files to pass to gnatmake. Gnatmake builds the rest automatically. 19 | ADA_SRCS = ali-util.adb \ 20 | binderr.adb \ 21 | butil.adb \ 22 | get_scos.adb \ 23 | lib.adb \ 24 | mlib.adb \ 25 | prj-attr-pm.adb \ 26 | prj-conf.adb \ 27 | put_scos.adb \ 28 | repinfo.adb \ 29 | switch-m.adb \ 30 | tree_in.adb \ 31 | xsnamest.adb 32 | C_SRCS = gnat_util_dummies.c \ 33 | link.c 34 | 35 | COMMON_ADAFLAGS = -c -k -aI$(SRC) 36 | COMMON_CFLAGS = -c 37 | 38 | ifeq ($(BUILD_TYPE), Production) 39 | BUILD_ADAFLAGS = -O2 -gnatn -gnatws -gnat05 40 | BUILD_CFLAGS = -O2 41 | else 42 | BUILD_ADAFLAGS = -O0 -gnato -g -gnata -gnat05 43 | BUILD_CFLAGS = -g 44 | endif 45 | 46 | STATIC_ADAFLAGS = $(COMMON_ADAFLAGS) $(BUILD_ADAFLAGS) -D $(STATIC_BUILD_DIR) 47 | STATIC_CFLAGS = $(COMMON_CFLAGS) $(BUILD_CFLAGS) 48 | 49 | SHARED_ADAFLAGS = $(COMMON_ADAFLAGS) $(BUILD_ADAFLAGS) -D $(SHARED_BUILD_DIR) -fPIC 50 | SHARED_CFLAGS = $(COMMON_CFLAGS) $(BUILD_CFLAGS) -fPIC 51 | 52 | .PHONY: all 53 | all: dirs generate_sources static shared 54 | 55 | # Build static lib. 56 | static: $(STATIC_BUILD_DIR)/libgnat_util.a 57 | 58 | $(STATIC_BUILD_DIR)/libgnat_util.a: 59 | gnatmake $(STATIC_ADAFLAGS) $(ADA_SRCS) 60 | gcc $(STATIC_CFLAGS) gnat_util_dummies.c -o $(STATIC_BUILD_DIR)/gnat_util_dummies.o 61 | gcc $(STATIC_CFLAGS) link.c -o $(STATIC_BUILD_DIR)/link.o 62 | $(AR) $@ $(STATIC_BUILD_DIR)/*.o 63 | $(RANLIB) $@ 64 | 65 | # Build shared lib. 66 | shared: $(SHARED_BUILD_DIR)/libgnat_util.so 67 | 68 | $(SHARED_BUILD_DIR)/libgnat_util.so: 69 | gnatmake $(SHARED_ADAFLAGS) $(ADA_SRCS) 70 | gcc $(SHARED_CFLAGS) gnat_util_dummies.c -o $(SHARED_BUILD_DIR)/gnat_util_dummies.o 71 | gcc $(SHARED_CFLAGS) link.c -o $(SHARED_BUILD_DIR)/link.o 72 | gcc -shared -o $@ $(SHARED_BUILD_DIR)/*.o 73 | 74 | .PHONY: dirs 75 | dirs: 76 | $(MKDIR) $(STATIC_BUILD_DIR) 77 | $(MKDIR) $(SHARED_BUILD_DIR) 78 | 79 | .PHONY: generate_sources 80 | generate_sources: 81 | $(MKDIR) $(SRC) 82 | $(CP) xsnamest.adb xutil.* snames.adb-tmpl snames.ads-tmpl snames.h-tmpl $(SRC) 83 | (cd $(SRC) && \ 84 | gnatmake -gnatf -gnatwae -gnatyg -gnatyS xsnamest && \ 85 | ./xsnamest && mv snames.ns snames.ads && mv snames.nb snames.adb) 86 | 87 | .PHONY: install 88 | install: 89 | $(MKDIR) $(prefix)/include/gnat_util 90 | $(MKDIR) $(prefix)/lib/gnat 91 | $(MKDIR) $(prefix)/lib/gnat_util/static 92 | $(MKDIR) $(prefix)/lib/gnat_util/relocatable 93 | $(CP) gnat_util-installed.gpr $(prefix)/lib/gnat/gnat_util.gpr 94 | $(CP) *.ads $(prefix)/include/gnat_util 95 | $(RM) $(prefix)/include/gnat_util/xutil.ads 96 | $(CP) $(STATIC_BUILD_DIR)/*.ali $(STATIC_BUILD_DIR)/libgnat_util.a $(prefix)/lib/gnat_util/static 97 | $(CP) $(SHARED_BUILD_DIR)/*.ali $(SHARED_BUILD_DIR)/libgnat_util.so $(prefix)/lib/gnat_util/relocatable 98 | 99 | .PHONY: clean 100 | clean: 101 | $(RM) $(STATIC_BUILD_DIR) 102 | $(RM) $(SHARED_BUILD_DIR) 103 | -------------------------------------------------------------------------------- /source/gnat_util/gnat_util.gpr: -------------------------------------------------------------------------------- 1 | project Gnat_Util is 2 | 3 | type Build_Type is ("Debug", "Production"); 4 | Build : Build_Type := External ("BUILD", "Production"); 5 | 6 | type OS_Type is ("unix", "avms", "ivms", "Windows_NT"); 7 | OS : OS_Type := external ("OS", "unix"); 8 | 9 | type Library_Type_Type is ("relocatable", "static"); 10 | Gnat_Shared_Type : Library_Type_Type := 11 | external ("LIBRARY_TYPE", "static"); 12 | 13 | for Library_Name use "gnat_util"; 14 | 15 | for Source_Dirs use (".", "gen_src"); 16 | 17 | -- case OS is 18 | -- when "unix" | "Windows_NT" => 19 | -- for Locally_Removed_Files use 20 | -- ("mlib-tgt-specific-vms-alpha.adb", 21 | -- "mlib-tgt-specific-vms-ia64.adb", 22 | -- "mlib-tgt-vms_common.adb", 23 | -- "mlib-tgt-vms_common.ads"); 24 | -- when "avms" => 25 | -- for Locally_Removed_Files use 26 | -- ("mlib-tgt-specific.adb", 27 | -- "mlib-tgt-specific-vms-ia64.adb"); 28 | -- when "ivms" => 29 | -- for Locally_Removed_Files use 30 | -- ("mlib-tgt-specific.adb", 31 | -- "mlib-tgt-specific-vms-alpha.adb"); 32 | -- end case; 33 | 34 | for Library_Kind use Gnat_Shared_Type; 35 | 36 | for Object_Dir use "obj/" & Project'Library_Kind; 37 | for Library_Dir use "lib/" & Project'Library_Kind; 38 | 39 | Processors := External ("PROCESSORS", "0"); 40 | 41 | for Languages use ("Ada", "C"); 42 | 43 | package Compiler is 44 | case Build is 45 | when "Production" => 46 | for Default_Switches ("Ada") use 47 | ("-O2", "-gnatn", "-gnatws", "-gnat05"); 48 | for Default_Switches ("C") use 49 | ("-O2"); 50 | when "Debug" => 51 | for Default_Switches ("Ada") use 52 | ("-O0", "-gnato", "-g", "-gnata", "-gnat05"); 53 | for Default_Switches ("C") use 54 | ("-g"); 55 | end case; 56 | end Compiler; 57 | 58 | package Builder is 59 | for Switches ("Ada") use ("-m", "-j" & Processors); 60 | end Builder; 61 | 62 | package Ide is 63 | for Vcs_Kind use "Subversion"; 64 | end Ide; 65 | 66 | package Linker is 67 | end Linker; 68 | 69 | package Naming is 70 | case OS is 71 | when "unix" | "Windows_NT" => 72 | for Body ("mlib.tgt.specific") 73 | use "mlib-tgt-specific.adb"; 74 | when others => 75 | null; 76 | -- when "avms" => 77 | -- for Body ("mlib.tgt.specific") 78 | -- use "mlib-tgt-specific-vms-alpha.adb"; 79 | -- when "ivms" => 80 | -- for Body ("mlib.tgt.specific") 81 | -- use "mlib-tgt-specific-vms-ia64.adb"; 82 | end case; 83 | end Naming; 84 | 85 | end Gnat_Util; 86 | -------------------------------------------------------------------------------- /source/gnat_util/gnat_util_dummies.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * GNAT COMPILER COMPONENTS * 4 | * * 5 | * G N A T _ U T I L _ D U M M I E S * 6 | * * 7 | * Copyright (C) 2010-2012, AdaCore * 8 | * * 9 | * GNAT is free software; you can redistribute it and/or modify it under * 10 | * terms of the GNU General Public License as published by the Free Soft- * 11 | * ware Foundation; either version 3, or (at your option) any later ver- * 12 | * sion. GNAT is distributed in the hope that it will be useful, but WITH- * 13 | * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * 14 | * or FITNESS FOR A PARTICULAR PURPOSE. * 15 | * * 16 | * * 17 | * * 18 | * * 19 | * * 20 | * You should have received a copy of the GNU General Public License and * 21 | * a copy of the GCC Runtime Library Exception along with this program; * 22 | * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see * 23 | * . * 24 | * * 25 | * GNAT was originally developed by the GNAT team at New York University. * 26 | * Extensive contributions were provided by Ada Core Technologies Inc. * 27 | * * 28 | ****************************************************************************/ 29 | 30 | void 31 | set_std_prefix (char *path, int len) 32 | { 33 | } 34 | 35 | char * 36 | update_path (char *path, char *key) 37 | { 38 | return path; 39 | } 40 | -------------------------------------------------------------------------------- /source/gnat_util/gnatvsn.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT COMPILER COMPONENTS -- 4 | -- -- 5 | -- G N A T V S N -- 6 | -- -- 7 | -- B o d y -- 8 | -- -- 9 | -- Copyright (C) 2002-2009 Free Software Foundation, Inc. -- 10 | -- -- 11 | -- GNAT is free software; you can redistribute it and/or modify it under -- 12 | -- terms of the GNU General Public License as published by the Free Soft- -- 13 | -- ware Foundation; either version 3, or (at your option) any later ver- -- 14 | -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 15 | -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- 16 | -- or FITNESS FOR A PARTICULAR PURPOSE. -- 17 | -- -- 18 | -- As a special exception under Section 7 of GPL version 3, you are granted -- 19 | -- additional permissions described in the GCC Runtime Library Exception, -- 20 | -- version 3.1, as published by the Free Software Foundation. -- 21 | -- -- 22 | -- You should have received a copy of the GNU General Public License and -- 23 | -- a copy of the GCC Runtime Library Exception along with this program; -- 24 | -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- 25 | -- . -- 26 | -- -- 27 | -- GNAT was originally developed by the GNAT team at New York University. -- 28 | -- Extensive contributions were provided by Ada Core Technologies Inc. -- 29 | -- -- 30 | ------------------------------------------------------------------------------ 31 | 32 | package body Gnatvsn is 33 | 34 | ---------------------- 35 | -- Copyright_Holder -- 36 | ---------------------- 37 | 38 | function Copyright_Holder return String is 39 | begin 40 | return "Free Software Foundation, Inc."; 41 | end Copyright_Holder; 42 | 43 | ------------------------ 44 | -- Gnat_Free_Software -- 45 | ------------------------ 46 | 47 | function Gnat_Free_Software return String is 48 | begin 49 | return 50 | "This is free software; see the source for copying conditions." & 51 | ASCII.LF & 52 | "There is NO warranty; not even for MERCHANTABILITY or FITNESS" & 53 | " FOR A PARTICULAR PURPOSE."; 54 | end Gnat_Free_Software; 55 | 56 | ------------------------- 57 | -- Gnat_Version_String -- 58 | ------------------------- 59 | 60 | function Gnat_Version_String return String is 61 | begin 62 | return Standard'Compiler_Version; 63 | end Gnat_Version_String; 64 | 65 | end Gnatvsn; 66 | -------------------------------------------------------------------------------- /tested-configs/config-gcc-4.9.2.inc: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Filename # config.inc 3 | # Purpose # Defines the Toolchain source versions/mirrors 4 | # Copyright # Copyright (C) 2011-2013 Luke A. Guest, David Rees. 5 | # Depends # http://gcc.gnu.org/install/prerequisites.html 6 | # Description # 1) cp config-master.inc config.inc 7 | # # 2) edit config.inc as required for your machine. 8 | # # 3) ./build-tools.sh --help 9 | ################################################################################ 10 | 11 | ################################################################################ 12 | # Project name, can change. 13 | ################################################################################ 14 | export PROJECT_NAME=free-ada 15 | 16 | ################################################################################ 17 | # So we don't overwrite an already working toolchain! This is only valid when 18 | # building a new native toolchain. Once this has been done, move your old tools 19 | # to a new directory and rename the new one, then remove the "-new" from the 20 | # PROJECT variable. 21 | # TODO: Put in a check when building cross compilers. 22 | ################################################################################ 23 | export PROJECT=$PROJECT_NAME-new 24 | 25 | ################################################################################ 26 | # INSTALL_BASE_DIR - This is where tar needs to change directory to. 27 | # INSTALL_DIR - Where the actual local toolchain is going to placed. 28 | # STAGE_BASE_DIR - This is the where we stage the install to get ready for 29 | # packaging. 30 | # STAGE_DIR - We want to get to the base $PROJECT_NAME directory for 31 | # packaging. 32 | ################################################################################ 33 | INSTALL_BASE_DIR=$HOME/opt 34 | INSTALL_DIR=$INSTALL_BASE_DIR/$PROJECT 35 | STAGE_BASE_DIR=/tmp/opt/$PROJECT 36 | STAGE_DIR=$STAGE_BASE_DIR$INSTALL_DIR/.. 37 | 38 | ################################################################################ 39 | # Basic directories we need. 40 | ################################################################################ 41 | export SRC=$TOP/source 42 | export ARC=$TOP/archives 43 | export LOG=$TOP/build/logs 44 | export BLD=$TOP/build 45 | export PKG=$TOP/packages 46 | export FILES=$TOP/files 47 | 48 | ################################################################################ 49 | # Date variable for packaging anything from source control. 50 | ################################################################################ 51 | export DATE=`date +%d%m%Y` 52 | 53 | ################################################################################ 54 | # What OS are we on? e.g. Linux, Darwin, MSYS_* 55 | # N.B: Don't call is OS because gprbuild.gpr grabs the variable. 56 | ################################################################################ 57 | export LOCAL_OS=`uname -s` 58 | 59 | ################################################################################ 60 | # What archtecture is this? e.g. x86_64, i686 61 | ################################################################################ 62 | export ARCH=`uname -m` 63 | 64 | ################################################################################ 65 | # Find out what platform we are on. 66 | ################################################################################ 67 | 68 | case $LOCAL_OS in 69 | "Linux") 70 | HOST=$ARCH-pc-linux-gnu 71 | ;; 72 | "Darwin") 73 | ;; 74 | "MSYS*") 75 | ;; 76 | esac 77 | 78 | ################################################################################ 79 | # Is the host machine 64 bit? Used for LD_LIBRARY_PATH, leave blank for 32. 80 | ################################################################################ 81 | if grep -q 64 <<< $ARCH; then 82 | export BITS=64 83 | export MULTILIB="--enable-multilib" 84 | export EXTRA_BINUTILS_FLAGS="--enable-64-bit-bfd" 85 | export multilib_enabled="yes" 86 | else 87 | export BITS= 88 | export MULTILIB="" 89 | export EXTRA_64_BIT_CONFIGURE="" 90 | export multilib_enabled="no" 91 | fi 92 | 93 | ################################################################################ 94 | # Parallel Make Threads/Jobs 95 | ################################################################################ 96 | # How many 'make' threads do you want to have going during the build? 97 | # In most cases using a value greater than the number of processors 98 | # in your machine will result in fewer and shorter I/O latency hits, 99 | # thus improving overall throughput; this is especially true for 100 | # slow drives and network filesystems. 101 | # Load-average Threshold tells 'make' to spawn new jobs only when the load 102 | # average is less than or equal to it's value. If the load average becomes 103 | # greater, 'make' will wait until the average drops below this number, 104 | # or until all the other jobs finish. Use only one of the options; 105 | # Static Jobs, Scaled Jobs, or Dynamic or Static Load-average Threshold. 106 | ################################################################################ 107 | CORES=`grep 'model name' /proc/cpuinfo | wc -l` 108 | 109 | # Static Jobs 110 | # 1 = No Parallel Make Jobs (slow) 111 | export JOBS="-j 4" 112 | 113 | # Scaled Jobs, 2 jobs per cpu core (fast) 114 | # export JOBS="-j $(($CORES*2))" 115 | 116 | # Dynamic Load-average Threshold (slow, but can reduce cpu hammering) 117 | # Spawn parallel processes only at < 100% core utilization 118 | # export JOBS=--load-average=$(echo "scale=2; $CORES*100/100" | bc) 119 | 120 | # Static Load-average Threshold 121 | # export JOBS=--load-average=3.5 122 | 123 | 124 | # Edit package versions/mirrors as required. 125 | 126 | ################################################################################ 127 | # Required tools ############################################################### 128 | ################################################################################ 129 | 130 | ################################################################################ 131 | # BINUTILS ##################################################################### 132 | ################################################################################ 133 | 134 | export BINUTILS_SNAPSHOT=n 135 | 136 | if [ $BINUTILS_SNAPSHOT == "y" ]; then 137 | # Snapshot 138 | export BINUTILS_VERSION=2.24.51 # filename version 139 | BINUTILS_SRC_VERSION=2.24.51 # extracted version 140 | BINUTILS_TARBALL=ftp://sourceware.org/pub/binutils/snapshots/binutils-$BINUTILS_VERSION.tar.bz2 141 | else 142 | # Release 143 | export BINUTILS_VERSION=2.25 # filename version 144 | BINUTILS_SRC_VERSION=2.25 # extracted version 145 | export BINUTILS_MIRROR=http://ftp.gnu.org/gnu/binutils 146 | BINUTILS_TARBALL=$BINUTILS_MIRROR/binutils-$BINUTILS_VERSION.tar.bz2 147 | fi 148 | 149 | export BINUTILS_TARBALL 150 | export BINUTILS_SRC_VERSION 151 | 152 | ################################################################################ 153 | # GDB ########################################################################## 154 | ################################################################################ 155 | export GDB_VERSION=7.8.1 # filename version 156 | export GDB_SRC_VERSION=7.8.1 # extracted version 157 | export GDB_MIRROR=http://ftp.gnu.org/gnu/gdb 158 | export GDB_TARBALL=$GDB_MIRROR/gdb-$GDB_VERSION.tar.xz 159 | 160 | ################################################################################ 161 | # GCC ########################################################################## 162 | ################################################################################ 163 | 164 | export NATIVE_LANGUAGES="c,c++,objc,obj-c++,ada" 165 | 166 | export GCC_RELEASE=y 167 | 168 | if [ $GCC_RELEASE == "y" ]; then 169 | export GCC_VERSION=4.9.2 # filename version 170 | export GCC_SRC_VERSION=4.9.2 # extracted version 171 | export GCC_MIRROR=ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.2 172 | export GCC_TARBALL=$GCC_MIRROR/gcc-$GCC_VERSION.tar.bz2 173 | 174 | export GCC_DIR=$SRC/gcc-$GCC_SRC_VERSION 175 | else 176 | # Always get GCC from GitHub now. 177 | #export GCC_REPO=git@github.com:Lucretia/gcc.git 178 | #export GCC_REPO=https://github.com/gcc-mirror/gcc.git 179 | 180 | export GCC_DIR=$SRC/gcc 181 | fi 182 | 183 | ################################################################################ 184 | # Required libs ################################################################ 185 | ################################################################################ 186 | 187 | # GMP (GNU Multiple Precision Arithmetic Library) 188 | #export GMP_VERSION=4.3.2 189 | export GMP_VERSION=5.1.2 190 | export GMP_MIRROR=ftp://ftp.gmplib.org/pub/gmp-$GMP_VERSION 191 | 192 | # MPC 193 | #export MPC_VERSION=0.8.1 194 | export MPC_VERSION=1.0.2 195 | export MPC_MIRROR=http://www.multiprecision.org/mpc/download 196 | 197 | # MPFR (Multiple Precision Floating Point Computations With Correct Rounding) 198 | # Warning! Due to the fact that TLS support is now detected automatically, the 199 | # MPFR build can be incorrect on some platforms (compiler or system bug). Indeed, 200 | # the TLS implementation of some compilers/platforms is buggy, and MPFR cannot 201 | # detect every problem at configure time. Please run "make check" to see if your 202 | # build is affected. If you get failures, you should try the 203 | # --disable-thread-safe configure option to disable TLS and see if this solves 204 | # these failures. But you should not use an MPFR library with TLS disabled in a 205 | # multithreaded program (unless you know what you are doing). 206 | #export MPFR_VERSION=2.4.2 207 | #export MPFR_MIRROR=http://www.mpfr.org/mpfr-$MPFR_VERSION 208 | #export MPFR_PATCHES=http://www.mpfr.org/mpfr-$MPFR_VERSION/allpatches 209 | export MPFR_VERSION=3.1.2 210 | export MPFR_MIRROR=http://mpfr.loria.fr/mpfr-current 211 | export MPFR_PATCHES=http://mpfr.loria.fr/mpfr-current/allpatches 212 | 213 | # ISL (Dependancy for CLooG) 214 | # Added support to use the official cloog.org 215 | # The --with-isl configure option should be used if ISL is not installed in your 216 | # default library search path. 217 | export ISL_VERSION=0.12.2 218 | #export ISL_VERSION=0.14 219 | export ISL_MIRROR=ftp://gcc.gnu.org/pub/gcc/infrastructure 220 | 221 | #CLooG (uses isl as polyhedral library) 222 | # The --with-cloog configure option should be used if CLooG is not installed in 223 | # your default library search path. CLooG needs to be built against ISL 0.10, 224 | # not its included copy of ISL which is too old. Use --with-isl=system to direct 225 | # CLooG to pick up an already installed ISL. CLooG needs to be configured to use 226 | # GMP internally, use --with-bits=gmp to direct it to do that. 227 | export CLOOG_REQUIRED=y 228 | 229 | if [ $CLOOG_REQUIRED = "y" ]; then 230 | export CLOOG_VERSION=0.18.1 231 | export CLOOG_MIRROR=ftp://gcc.gnu.org/pub/gcc/infrastructure 232 | fi 233 | 234 | ################################################################################ 235 | # AdaCore GPL components ####################################################### 236 | ################################################################################ 237 | export GPL_YEAR=2014 238 | export XMLADA_HASH=065e0e6750288d9ecc2f7780d3ed8ef3c86ab991 239 | export XMLADA_VERSION=xmlada-gpl-$GPL_YEAR-src 240 | export GPRBUILD_HASH=c9d9271952a829ff1d355a01285a8558f24baf93 241 | export GPRBUILD_VERSION=gprbuild-gpl-$GPL_YEAR-src 242 | export ASIS_HASH=51ecea080c3c6760cd024e8b467502de26f3c3f2 243 | export ASIS_VERSION=asis-gpl-$GPL_YEAR-src 244 | export GNATMEM_HASH=6de65bb7e300e299711f90396710ace741123656 245 | export GNATMEM_VERSION=gnatmem-gpl-$GPL_YEAR-src 246 | export AUNIT_HASH=43f6630248c40941c77be5c06571000925764bbb 247 | export AUNIT_VERSION=aunit-gpl-$GPL_YEAR-src 248 | export AUNIT_DIR=aunit-3.7.0w-src 249 | export GNATCOLL_HASH=0f1572cadf981e4e493497dfbf783889387d52be 250 | export GNATCOLL_VERSION=gnatcoll-gpl-$GPL_YEAR-src 251 | export POLYORB_HASH=22f27fec50a9c2b92be2e10aa5027eb49567787c 252 | export POLYORB_VERSION=polyorb-gpl-$GPL_YEAR-src 253 | export POLYORB_DIR=polyorb-$GPL_YEAR-src 254 | export FLORIST_HASH=224f73e1cd4afd1f0f6ca3bd1ad0191aa7f81e05 255 | export FLORIST_VERSION=florist-gpl-$GPL_YEAR-src 256 | export FLORIST_DIR=florist-src 257 | 258 | ################################################################################ 259 | # Additional Options ########################################################### 260 | ################################################################################ 261 | 262 | export MATRESHKA_VERSION=0.7.0 263 | export MATRESHKA_MIRROR=http://forge.ada-ru.org/matreshka/downloads 264 | export MATRESHKA_DIR=matreshka-$MATRESHKA_VERSION 265 | 266 | export AHVEN_VERSION=2.6 267 | export AHVEN_MIRROR=http://www.ahven-framework.com/releases 268 | export AHVEN_DIR=ahven-$AHVEN_VERSION 269 | 270 | # export U_BOOT_VERSION=1.3.4 271 | # export U_BOOT_MIRROR=ftp://ftp.denx.de/pub/u-boot 272 | #export NEWLIB_VERSION=1.20.0 273 | #export NEWLIB_MIRROR=ftp://sources.redhat.com/pub/newlib 274 | #export STLINK_MIRROR=git://github.com/texane/stlink.git 275 | # export SPARK_FILE=spark-gpl-2011-x86_64-pc-linux-gnu.tar.gz 276 | 277 | ################################################################################ 278 | # Implementation specific tuning ############################################### 279 | ################################################################################ 280 | 281 | # Versions of the GNU C library up to and including 2.11.1 included an incorrect 282 | # implementation of the cproj function. GCC optimizes its builtin cproj according 283 | # to the behavior specified and allowed by the ISO C99 standard. If you want to 284 | # avoid discrepancies between the C library and GCC's builtin transformations 285 | # when using cproj in your code, use GLIBC 2.12 or later. If you are using an 286 | # older GLIBC and actually rely on the incorrect behavior of cproj, then you can 287 | # disable GCC's transformations using -fno-builtin-cproj. 288 | 289 | #export EXTRA_NATIVE_CFLAGS="-march=native" 290 | 291 | ################################################################################ 292 | # GMP, MPFR, MPC static lib installation directory ############################# 293 | ################################################################################ 294 | # export STAGE1_LIBS_PREFIX=$STAGE1_PREFIX/opt/libs 295 | # export STAGE2_LIBS_PREFIX=$STAGE2_PREFIX/opt/libs 296 | --------------------------------------------------------------------------------