Changeset 89851 for trunk/dports/cross


Ignore:
Timestamp:
Feb 13, 2012, 9:36:04 AM (8 years ago)
Author:
titus@…
Message:

ticket #33201 : update avr-binutils to 2.22

Location:
trunk/dports/cross/avr-binutils
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/cross/avr-binutils/Portfile

    r89561 r89851  
    11# $Id$
    22
    3 PortSystem                      1.0
    4 name                            avr-binutils
    5 version                         2.20
    6 revision                        1
     3PortSystem          1.0
     4
     5name                avr-binutils
     6version             2.22
     7description         FSF Binutils for avr cross development
     8long_description    Free Software Foundation development toolchain ("binutils") for \
     9                    avr cross development.
     10platforms           darwin
     11categories          cross devel
     12maintainers         nomaintainer
     13homepage            http://www.gnu.org/software/binutils/binutils.html
     14master_sites            gnu:binutils
     15distname            binutils-${version}
     16use_bzip2           yes
     17checksums           md5     ee0f10756c84979622b992a4a61ea3f5         \
     18                    sha1    65b304a0b9a53a686ce50a01173d1f40f8efe404 \
     19                    rmd160  34cebe4cdca9480d5dc6f6b00b052c48c8ac30dc
    720
    821# Parameters for this port.
    922set crossgcc-target avr
    1023
    11 description                     FSF Binutils for avr cross development
    12 long_description        Free Software Foundation development toolchain ("binutils") for \
    13                                         avr cross development.
    14 platforms                       darwin
    15 categories                      cross devel
    16 maintainers                     nomaintainer
    17 homepage                        http://www.gnu.org/software/binutils/binutils.html
    18 master_sites            gnu:binutils \
    19                                         ftp://ftp.kernel.org/pub/linux/devel/binutils/ \
    20                                         http://ftp.kernel.org/pub/linux/devel/binutils/
    21 distname                        binutils-${version}
    22 use_bzip2                       yes
    23 checksums                       md5     ee2d3e996e9a2d669808713360fa96f8 \
    24                                         sha1    747e7b4d94bce46587236dc5f428e5b412a590dc \
    25                                         rmd160  284074e2453e517d036ffce2c0f3d56439e2e5c0
    26 
    27 depends_lib                 port:gettext
     24depends_lib         port:gettext
    2825
    2926# All cross ports violate the mtree layout.
    30 destroot.violate_mtree  yes
     27destroot.violate_mtree  yes
    3128
    3229# Download everything to binutils/
    33 dist_subdir                     binutils
     30dist_subdir         binutils
     31
     32# fix crash in ld when given --relax option.
     33# see http://sourceware.org/bugzilla/show_bug.cgi?id=12161
     34patchfiles-append   pr12161.diff
    3435
    3536# Build in a different directory, as advised in the README file.
    36 pre-configure           { system "cd ${workpath} && mkdir -p build"}
    37 configure.dir           ${workpath}/build
    38 configure.cmd           ${worksrcpath}/configure
    39 configure.cc            "cc -no-cpp-precomp"
     37pre-configure       { system "cd ${workpath} && mkdir -p build"}
     38configure.dir       ${workpath}/build
     39configure.cmd       ${worksrcpath}/configure
     40configure.cc        "cc -no-cpp-precomp"
    4041
    41 # using --disable-werror because of 
     42# using --disable-werror because of
    4243# "strings.c:419: warning: 'stat64' is deprecated (declared at /usr/include/sys/stat.h:465)"
    4344# don't know how to fix this proper...
    44 configure.args          --disable-werror \
    45                                         --infodir='${prefix}/share/info' \
    46                                         --disable-nls \
    47                                         --target=${crossgcc-target} \
    48                                         --program-prefix=${crossgcc-target}- \
    49                                         --mandir='${prefix}/share/man' \
    50                                         --enable-install-libiberty \
    51                                         --enable-install-libbfd
     45configure.args      --disable-werror                    \
     46                    --infodir='${prefix}/share/info'    \
     47                    --disable-nls                        \
     48                    --target=${crossgcc-target}          \
     49                    --program-prefix=${crossgcc-target}- \
     50                    --mandir='${prefix}/share/man'      \
     51                    --enable-install-libiberty          \
     52                    --enable-install-libbfd
    5253
    5354
    54 if {$build_arch != "" && ${os.platform} == "darwin"} { 
    55         configure.args-append --build=${build_arch}-apple-darwin${os.major} \
    56                                                   --host=${build_arch}-apple-darwin${os.major}
     55if {$build_arch != "" && ${os.platform} == "darwin"} {
     56    configure.args-append --build=${build_arch}-apple-darwin${os.major} \
     57                          --host=${build_arch}-apple-darwin${os.major}
    5758}
    5859
    59 build.dir               ${workpath}/build
    60                                        
     60build.dir           ${workpath}/build
     61
    6162# We don't want the etc module.
    6263post-extract {
    63         system "rm -rf ${worksrcpath}/etc"
     64    system "rm -rf ${worksrcpath}/etc"
    6465}
    6566
    6667post-patch {
    67         namespace eval crossgcc {}
     68    namespace eval crossgcc {}
    6869
    6970    # Install avr-compatible libbfd/libiberty in the avr directory
    7071    reinplace "s|bfdlibdir=.*|bfdlibdir='${prefix}/avr/host/lib'|g" \
    71         ${worksrcpath}/bfd/configure \
     72        ${worksrcpath}/bfd/configure                                \
    7273        ${worksrcpath}/opcodes/configure
    7374    reinplace "s|bfdincludedir=.*|bfdincludedir='${prefix}/avr/host/include'|g"  \
    74         ${worksrcpath}/bfd/configure \
     75        ${worksrcpath}/bfd/configure                                             \
    7576        ${worksrcpath}/opcodes/configure
    7677
    77     reinplace "s|libdir = .*|libdir = \"${prefix}/avr/host/lib\"|g"  \
     78    reinplace "s|libdir = .*|libdir = \"${prefix}/avr/host/lib\"|g" \
    7879        ${worksrcpath}/libiberty/Makefile.in
    79     reinplace "s|MULTIOSDIR = .*|MULTIOSDIR = |g"  \
     80    reinplace "s|MULTIOSDIR = .*|MULTIOSDIR = |g" \
    8081        ${worksrcpath}/libiberty/Makefile.in
    8182
    82         # Fix the info pages and related stuff.
    83         #       
    84         # path: path to the doc directory (e.g. gas/doc/)
    85         # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
    86         # name: name of the info page (e.g. as)
    87         # suffix: suffix of the souce page (texinfo or texi)
    88         proc crossgcc::fixinfo { path makefile name suffix } {
    89                 global crossgcc-target worksrcpath
     83    # Fix the info pages and related stuff.
     84    #
     85    # path: path to the doc directory (e.g. gas/doc/)
     86    # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
     87    # name: name of the info page (e.g. as)
     88    # suffix: suffix of the souce page (texinfo or texi)
     89    proc crossgcc::fixinfo { path makefile name suffix } {
     90        global crossgcc-target worksrcpath
    9091
    91                 # Fix the source
    92                 reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
    93                         ${worksrcpath}/${path}/${name}.${suffix}
    94                 reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
    95                         ${worksrcpath}/${path}/${name}.${suffix}
    96                 reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
    97                         ${worksrcpath}/${path}/${name}.${suffix}
    98                
    99                 # Fix the Makefile
    100                 reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
    101                         ${worksrcpath}/${makefile}
    102                 reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
    103                         ${worksrcpath}/${makefile}
    104                
    105                 # Rename the source
    106                 file rename ${worksrcpath}/${path}/${name}.${suffix} \
    107                         ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
    108                
    109                 # Fix install-info's dir.
    110                 # (note: this may be effectless if there was no info dir to be fixed)
    111                 reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-dir|g" \
    112                         "${worksrcpath}/${makefile}"
    113         }
     92        # Fix the source
     93        reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
     94            ${worksrcpath}/${path}/${name}.${suffix}
     95        reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
     96            ${worksrcpath}/${path}/${name}.${suffix}
     97        reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
     98            ${worksrcpath}/${path}/${name}.${suffix}
    11499
    115         # Fix the gettext files and related stuff.
    116         #       
    117         # module: name of the module (e.g. gas)
    118         proc crossgcc::fixgettext { module } {
    119                 global crossgcc-target worksrcpath
     100        # Fix the Makefile
     101        reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
     102            ${worksrcpath}/${makefile}
     103        reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
     104            ${worksrcpath}/${makefile}
    120105
    121                 if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
    122                         reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
    123                                 "${worksrcpath}/${module}/Makefile.in"
    124                 }
    125                 if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
    126                         reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
    127                                 "${worksrcpath}/${module}/doc/Makefile.in"
    128                 }
    129                 if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
    130                         reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
    131                                 "${worksrcpath}/${module}/po/Make-in"
    132                 }
    133         }
     106        # Rename the source
     107        file rename ${worksrcpath}/${path}/${name}.${suffix} \
     108            ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
    134109
    135         # gas/doc/as.texinfo
    136         crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
     110        # Fix install-info's dir.
     111        # (note: this may be effectless if there was no info dir to be fixed)
     112        reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-dir|g" \
     113            "${worksrcpath}/${makefile}"
     114    }
    137115
    138         # bfd/doc/bfd.texinfo
    139         crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
     116    # Fix the gettext files and related stuff.
     117    #
     118    # module: name of the module (e.g. gas)
     119    proc crossgcc::fixgettext { module } {
     120        global crossgcc-target worksrcpath
    140121
    141         # binutils/doc/binutils.texi
    142         crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
     122        if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
     123            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
     124                "${worksrcpath}/${module}/Makefile.in"
     125        }
     126        if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
     127            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
     128                "${worksrcpath}/${module}/doc/Makefile.in"
     129        }
     130        if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
     131            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
     132                "${worksrcpath}/${module}/po/Make-in"
     133        }
     134    }
    143135
    144         # gprof/gprof.texi
    145         crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
     136    # gas/doc/as.texinfo
     137    crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
    146138
    147         # ld/ld.texinfo
    148         crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
    149        
    150         # gettext stuff.
    151         crossgcc::fixgettext bfd
    152         crossgcc::fixgettext binutils
    153         crossgcc::fixgettext gas
    154         crossgcc::fixgettext gprof
    155         crossgcc::fixgettext ld
    156         crossgcc::fixgettext opcodes
     139    # bfd/doc/bfd.texinfo
     140    crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
     141
     142    # binutils/doc/binutils.texi
     143    crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
     144
     145    # gprof/gprof.texi
     146    crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
     147
     148    # ld/ld.texinfo
     149    crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
     150
     151    # gettext stuff.
     152    crossgcc::fixgettext bfd
     153    crossgcc::fixgettext binutils
     154    crossgcc::fixgettext gas
     155    crossgcc::fixgettext gprof
     156    crossgcc::fixgettext ld
     157    crossgcc::fixgettext opcodes
    157158}
    158159
    159160post-destroot {
    160161    file rename "${destroot}/${prefix}/lib/libiberty.a" "${destroot}/${prefix}/avr/host/lib/"
     162# For LTO optimization: With LTO enabled, collect2 searches for avr-ld
     163    ln -sf "${prefix}/avr/bin/ld" "${destroot}/${prefix}/avr/bin/avr-ld"
    161164}
Note: See TracChangeset for help on using the changeset viewer.