Changeset 90721


Ignore:
Timestamp:
Mar 13, 2012, 6:43:59 PM (8 years ago)
Author:
g5pw@…
Message:

avr-binutils Portfile:

Updated to use crossbinutils portgroup

File:
1 edited

Legend:

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

    r89851 r90721  
     1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=portfile:et:sw=4:ts=4:sts=4
    12# $Id$
    23
    34PortSystem          1.0
     5PortGroup                       crossbinutils 1.0
    46
    5 name                avr-binutils
    6 version             2.22
    7 description         FSF Binutils for avr cross development
    8 long_description    Free Software Foundation development toolchain ("binutils") for \
    9                     avr cross development.
    10 platforms           darwin
    11 categories          cross devel
    12 maintainers         nomaintainer
    13 homepage            http://www.gnu.org/software/binutils/binutils.html
    14 master_sites            gnu:binutils
    15 distname            binutils-${version}
    16 use_bzip2           yes
     7crossbinutils.setup avr 2.22
     8
     9maintainers         g5pw
     10
    1711checksums           md5     ee0f10756c84979622b992a4a61ea3f5         \
    1812                    sha1    65b304a0b9a53a686ce50a01173d1f40f8efe404 \
    1913                    rmd160  34cebe4cdca9480d5dc6f6b00b052c48c8ac30dc
    20 
    21 # Parameters for this port.
    22 set crossgcc-target avr
    23 
    24 depends_lib         port:gettext
    25 
    26 # All cross ports violate the mtree layout.
    27 destroot.violate_mtree  yes
    28 
    29 # Download everything to binutils/
    30 dist_subdir         binutils
    3114
    3215# fix crash in ld when given --relax option.
     
    3417patchfiles-append   pr12161.diff
    3518
    36 # Build in a different directory, as advised in the README file.
    37 pre-configure       { system "cd ${workpath} && mkdir -p build"}
    38 configure.dir       ${workpath}/build
    39 configure.cmd       ${worksrcpath}/configure
    40 configure.cc        "cc -no-cpp-precomp"
    41 
    4219# using --disable-werror because of
    4320# "strings.c:419: warning: 'stat64' is deprecated (declared at /usr/include/sys/stat.h:465)"
    4421# don't know how to fix this proper...
    45 configure.args      --disable-werror                     \
     22configure.args-append \
     23                                        --disable-werror                     \
    4624                    --infodir='${prefix}/share/info'     \
    47                     --disable-nls                        \
    48                     --target=${crossgcc-target}          \
    49                     --program-prefix=${crossgcc-target}- \
    50                     --mandir='${prefix}/share/man'       \
     25                                        --mandir='${prefix}/share/man'       \
    5126                    --enable-install-libiberty           \
    5227                    --enable-install-libbfd
     
    5732                          --host=${build_arch}-apple-darwin${os.major}
    5833}
    59 
    60 build.dir           ${workpath}/build
    61 
    62 # We don't want the etc module.
    63 post-extract {
    64     system "rm -rf ${worksrcpath}/etc"
    65 }
    66 
    67 post-patch {
    68     namespace eval crossgcc {}
    69 
    70     # Install avr-compatible libbfd/libiberty in the avr directory
    71     reinplace "s|bfdlibdir=.*|bfdlibdir='${prefix}/avr/host/lib'|g" \
    72         ${worksrcpath}/bfd/configure                                \
    73         ${worksrcpath}/opcodes/configure
    74     reinplace "s|bfdincludedir=.*|bfdincludedir='${prefix}/avr/host/include'|g"  \
    75         ${worksrcpath}/bfd/configure                                             \
    76         ${worksrcpath}/opcodes/configure
    77 
    78     reinplace "s|libdir = .*|libdir = \"${prefix}/avr/host/lib\"|g" \
    79         ${worksrcpath}/libiberty/Makefile.in
    80     reinplace "s|MULTIOSDIR = .*|MULTIOSDIR = |g" \
    81         ${worksrcpath}/libiberty/Makefile.in
    82 
    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
    91 
    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}
    99 
    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}
    105 
    106         # Rename the source
    107         file rename ${worksrcpath}/${path}/${name}.${suffix} \
    108             ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
    109 
    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     }
    115 
    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
    121 
    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     }
    135 
    136     # gas/doc/as.texinfo
    137     crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
    138 
    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
    158 }
    159 
    160 post-destroot {
    161     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"
    164 }
Note: See TracChangeset for help on using the changeset viewer.