Changeset 2431f30 in mainline for uspace/app/binutils/intrusive.sh


Ignore:
Timestamp:
2011-06-13T01:32:54Z (14 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c1198c2
Parents:
df56f5c
Message:

Build process debugged and improved.
Added intrusive patches to pass configure scripts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/binutils/intrusive.sh

    rdf56f5c r2431f30  
    3434# would require too much complexity.
    3535#
     36# List of patch descriptions:
     37#
     38# Patch 1
     39# Even though binutils build process supports cross compilation where
     40# build and host platforms are different, it is not easily applicable
     41# to HelenOS. It would be difficult to satisfy binutils expectations
     42# of host headers, libraries and tools on a build system (at least
     43# until these are developed/ported). Another issue would be the
     44# necessity to carry out time consuming full canadian cross compilation
     45# (even in case when build, host and target hardware platforms are the
     46# same). Instead of going into such trouble, it is easier to leverage
     47# already  built HelenOS toolchain as a first stage of canadian cross
     48# and trick binutils scripts to do a simple cross compilation while
     49# actually doing second stage of canadian cross. Because binutils
     50# configure scripts try to compile and execute various testing code, it
     51# have to be ensured that these tests are skipped. Such behaviour can
     52# be acomplished by patching cross compilation flag while leaving host
     53# and build parameters empty (i.e. configure script believes it is
     54# not doing cross compilation while skipping some testing as in the case
     55# of cross compilation).
     56#
     57# Patch 2
     58# Enabled cross compilation flag brings along some anomalies which
     59# have to reverted.
     60#
     61# Patch 3
     62# Binutils plugin support is dependent on libdl.so library.
     63# By default, the plugin support is switched off for all
     64# configure scripts of binutils. The only exception is configure
     65# script of ld 2.21 (and possibly above), where plugin support
     66# became mandatory (although not really needed).
     67#
    3668
    3769case "$1" in
    3870        "do")
    39                 # Binutils plugin support is dependent on libdl.so library.
    40                 # By default, the plugin support is switched off for all
    41                 # configure scripts of binutils. The only exception is configure
    42                 # script of ld 2.21 (and possibly above), where plugin support
    43                 # became mandatory (although not really needed).
    44                 mv -f "$2/ld/configure" "$2/ld/configure.backup"
    45                 sed 's/enable_plugins=yes/enable_plugins=no/g' \
    46                         < "$2/ld/configure.backup" > "$2/ld/configure"
     71                # Backup original files.
     72                cp -f "$2/configure" "$2/configure.backup"
     73                cp -f "$2/bfd/configure" "$2/bfd/configure.backup"
     74                cp -f "$2/gas/configure" "$2/gas/configure.backup"
     75                cp -f "$2/intl/configure" "$2/intl/configure.backup"
     76                cp -f "$2/ld/configure" "$2/ld/configure.backup"
     77                cp -f "$2/libiberty/configure" "$2/libiberty/configure.backup"
     78                cp -f "$2/opcodes/configure" "$2/opcodes/configure.backup"
     79
     80                # Patch main binutils configure script.
     81                cat "$2/configure.backup" | \
     82                # See Patch 1.
     83                sed 's/^cross_compiling=no/cross_compiling=yes/g' \
     84                > "$2/configure"
     85
     86                # Patch bfd configure script.
     87                cat "$2/bfd/configure.backup" | \
     88                # See Patch 1.
     89                sed 's/^cross_compiling=no/cross_compiling=yes/g' \
     90                > "$2/bfd/configure"
     91
     92                # Patch gas configure script.
     93                cat "$2/gas/configure.backup" | \
     94                # See Patch 1.
     95                sed 's/^cross_compiling=no/cross_compiling=yes/g' \
     96                > "$2/gas/configure"
     97
     98                # Patch intl configure script.
     99                cat "$2/intl/configure.backup" | \
     100                # See Patch 1.
     101                sed 's/^cross_compiling=no/cross_compiling=yes/g' \
     102                > "$2/intl/configure"
     103
     104                # Patch ld configure script.
     105                cat "$2/ld/configure.backup" | \
     106                # See Patch 1.
     107                sed 's/^cross_compiling=no/cross_compiling=yes/g' | \
     108                # See Patch 3.
     109                sed 's/^enable_plugins=yes/enable_plugins=no/g' \
     110                > "$2/ld/configure"
     111
     112                # Patch libiberty configure script.
     113                cat "$2/libiberty/configure.backup" | \
     114                # See Patch 1.
     115                sed 's/^cross_compiling=no/cross_compiling=yes/g' \
     116                > "$2/libiberty/configure"
     117
     118                # Patch opcodes configure script.
     119                cat "$2/opcodes/configure.backup" | \
     120                # See Patch 1.
     121                sed 's/^cross_compiling=no/cross_compiling=yes/g' | \
     122                # See Patch 2.
     123                sed 's/BUILD_LIBS=-liberty/BUILD_LIBS=..\/libiberty\/libiberty.a/g' \
     124                > "$2/opcodes/configure"
     125
    47126                ;;
    48127        "undo")
     128                # Restore original files.
     129                mv -f "$2/configure.backup" "$2/configure"
     130                mv -f "$2/bfd/configure.backup" "$2/bfd/configure"
     131                mv -f "$2/gas/configure.backup" "$2/gas/configure"
     132                mv -f "$2/intl/configure.backup" "$2/intl/configure"
    49133                mv -f "$2/ld/configure.backup" "$2/ld/configure"
     134                mv -f "$2/libiberty/configure.backup" "$2/libiberty/configure"
     135                mv -f "$2/opcodes/configure.backup" "$2/opcodes/configure"
    50136                ;;
    51137        *)
Note: See TracChangeset for help on using the changeset viewer.