Changeset 89852 for trunk/dports/cross


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

ticket #33107 : update avr-gcc to 4.6.2

Location:
trunk/dports/cross/avr-gcc
Files:
1 added
3 deleted
1 edited

Legend:

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

    r89561 r89852  
    11# $Id$
    22
    3 PortSystem                      1.0
    4 name                    avr-gcc
    5 version                 4.0.2
     3PortSystem              1.0
     4
     5name                    avr-gcc
     6version                 4.6.2
     7platforms               darwin
     8categories              cross devel
     9maintainers             nomaintainer
     10license                 {GPL-3+ Permissive}
     11description             GNU cross compilers for Atmel AVR
     12long_description        GNU compilers collection (c and c++) for Atmel AVR 8bit microcontrollers..
     13homepage                http://gcc.gnu.org/
     14master_sites            gnu:gcc/gcc-${version}/
     15distfiles               gcc-${version}.tar.bz2
     16use_bzip2               yes
     17worksrcdir              gcc-${version}
     18checksums               md5 028115c4fbfb6cfd75d6369f4a90d87e                                    \
     19                        sha256 60b05463dfe18d40d68fb8a71b25b408a01f86cc6ceaf5e6b22238b6b0f450c2 \
     20                        rmd160 e7041933b39629f9524848dcf81a1a4c02a225c6
    621
    722# Parameters for this port.
    8 set crossgcc-target avr
    9 set default-languages --enable-languages="c,c++"
    10 
    11 description             gcc cross-compilers for avr
    12 long_description        GNU compilers collection (c and c++) for avr.
    13 homepage                        http://gcc.gnu.org/
    14 platforms               darwin
    15 categories              cross devel
    16 maintainers             nomaintainer
    17 master_sites            gnu:gcc/gcc-${version}/
    18 distfiles                       gcc-${version}.tar.bz2
    19 worksrcdir                      gcc-${version}
    20 checksums                       md5 a659b8388cac9db2b13e056e574ceeb0 \
    21                                         sha1 f1b714c6398393d8f7f4ad5be933b462a95b075d \
    22                                         rmd160 70c7e21820da4d29ce6e8e48329d906ee19333aa
     23set crossgcc-target     avr
     24set default-languages   --enable-languages="c,c++"
    2325
    2426# All cross ports violate the mtree layout.
    25 destroot.violate_mtree  yes
     27destroot.violate_mtree  yes
    2628
    2729# Download everything to gcc/
    28 dist_subdir                     gcc
    29 
    30 depends_lib                     bin:${crossgcc-target}-ar:${crossgcc-target}-binutils \
    31                                         bin:${crossgcc-target}-as:${crossgcc-target}-binutils \
    32                                         bin:${crossgcc-target}-ld:${crossgcc-target}-binutils \
    33                                         bin:${crossgcc-target}-nm:${crossgcc-target}-binutils \
    34                                         bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils
    35 depends_build           bin:msgfmt:gettext
    36 
    37 # gcc is .bz2.
    38 use_bzip2                       yes
     30dist_subdir             gcc
     31
     32depends_lib             bin:${crossgcc-target}-ar:${crossgcc-target}-binutils \
     33                        bin:${crossgcc-target}-as:${crossgcc-target}-binutils \
     34                        bin:${crossgcc-target}-ld:${crossgcc-target}-binutils \
     35                        bin:${crossgcc-target}-nm:${crossgcc-target}-binutils \
     36                        bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils \
     37                        port:gmp port:mpfr port:libiconv port:libmpc port:ppl
     38
     39depends_build           bin:msgfmt:gettext
     40
    3941# Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
    4042# program names as gcc's name (add -${version} with ${version} being the version of gcc).
     
    4345# So let's tell gcc's Makefile not to do that mistake.
    4446
    45 set environment [list AR_FOR_TARGET=${crossgcc-target}-ar \
    46                                 AS_FOR_TARGET=${crossgcc-target}-as \
    47                                 LD_FOR_TARGET=${crossgcc-target}-ld \
    48                                 NM_FOR_TARGET=${crossgcc-target}-nm \
    49                                 RANLIB_FOR_TARGET=${crossgcc-target}-ranlib]
     47set environment [list   AR_FOR_TARGET=${crossgcc-target}-ar \
     48                        AS_FOR_TARGET=${crossgcc-target}-as \
     49                        LD_FOR_TARGET=${crossgcc-target}-ld \
     50                        NM_FOR_TARGET=${crossgcc-target}-nm \
     51                        RANLIB_FOR_TARGET=${crossgcc-target}-ranlib]
    5052
    5153
    5254# Build in a different directory, as advised in the README file.
    53 pre-configure   {
    54         file mkdir "${workpath}/build"
    55 }
    56 configure.dir   ${workpath}/build
    57 configure.cmd   ${workpath}/gcc-${version}/configure
    58 configure.cc    "cc -no-cpp-precomp"
    59 configure.env   ${environment}
    60 configure.args  --infodir='${prefix}/share/info' \
    61                                 --mandir='${prefix}/share/man' \
    62                                 --target=${crossgcc-target} \
    63                                 --program-prefix=${crossgcc-target}- \
    64                                 --with-included-gettext \
    65                                 --enable-obsolete \
    66                                 --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/ \
    67                                 ${default-languages}
     55pre-configure {
     56    file mkdir "${workpath}/build"
     57}
     58
     59patchfiles-append       patch-lto-plugin-osx.diff
     60
     61configure.dir           ${workpath}/build
     62configure.cmd           ${workpath}/gcc-${version}/configure
     63# configure.cc           "cc -no-cpp-precomp"
     64configure.env           ${environment}
     65configure.args          --infodir='${prefix}/share/info'       \
     66                        --mandir='${prefix}/share/man'         \
     67                        --target=${crossgcc-target}            \
     68                        --program-prefix=${crossgcc-target}-   \
     69                        --with-included-gettext                \
     70                        --enable-obsolete                      \
     71                        --disable-nls                          \
     72                        --enable-lto                           \
     73                        --with-plugin-ld=${crossgcc-target}-ld \
     74                        --disable-libquadmath                  \
     75                        --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/ \
     76                        ${default-languages}
     77
    6878if {$build_arch != "" && ${os.platform} == "darwin"} {
    6979    configure.cc_archflags
     
    7484}
    7585
    76 build.dir       ${workpath}/build
    77 
    78 build.args              ${environment}
    79 destroot.args   ${environment}
    80 
    81 patchfiles              gcc-config-avr-avr.c.diff \
    82                                 gcc-config-avr-avr.h.diff \
    83                                 gcc-config-avr-t-avr.diff
    84 
    85 platform darwin 9 {
    86         patchfiles-append       gcc-config-rs6000-host-darwin.c.diff
    87 }
     86build.dir               ${workpath}/build
     87
     88build.args              ${environment}
     89destroot.args           ${environment}
     90
     91# left as a reference; this was for gcc-4.0.2
     92# don't know if this is still needed for gcc-4.6.2
     93#platform darwin 9 {
     94#    patchfiles-append   gcc-config-rs6000-host-darwin.c.diff
     95#}
    8896
    8997post-patch {
    90         namespace eval crossgcc {}
    91 
    92         # Fix the info pages and related stuff.
    93         #       
    94         # path: path to the doc directory (e.g. gas/doc/)
    95         # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
    96         # name: name of the info page (e.g. as)
    97         # suffix: suffix of the souce page (texinfo or texi)
    98         proc crossgcc::fixinfo { path makefile name suffix } {
    99                 global crossgcc-target worksrcpath
    100 
    101                 # Fix the source
    102                 reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
    103                         ${worksrcpath}/${path}/${name}.${suffix}
    104                 reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
    105                         ${worksrcpath}/${path}/${name}.${suffix}
    106                 reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
    107                         ${worksrcpath}/${path}/${name}.${suffix}
    108                
    109                 # Fix the Makefile
    110                 reinplace "s| ${name}.info| ${crossgcc-target}-${name}.info|g" \
    111                         ${worksrcpath}/${makefile}
    112                 reinplace "s|/${name}.info|/${crossgcc-target}-${name}.info|g" \
    113                         ${worksrcpath}/${makefile}
    114                 reinplace "s|^${name}.info|${crossgcc-target}-${name}.info|g" \
    115                         ${worksrcpath}/${makefile}
    116                 reinplace "s| ${name}.pod| ${crossgcc-target}-${name}.pod|g" \
    117                         ${worksrcpath}/${makefile}
    118                 reinplace "s|/${name}.pod|/${crossgcc-target}-${name}.pod|g" \
    119                         ${worksrcpath}/${makefile}
    120                 reinplace "s|^${name}.pod|${crossgcc-target}-${name}.pod|g" \
    121                         ${worksrcpath}/${makefile}
    122                 reinplace "s| ${name}.${suffix}| ${crossgcc-target}-${name}.${suffix}|g" \
    123                         ${worksrcpath}/${makefile}
    124                 reinplace "s|/${name}.${suffix}|/${crossgcc-target}-${name}.${suffix}|g" \
    125                         ${worksrcpath}/${makefile}
    126                 reinplace "s|^${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
    127                         ${worksrcpath}/${makefile}
    128                
    129                 # Rename the source
    130                 file rename ${worksrcpath}/${path}/${name}.${suffix} \
    131                         ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
    132                
    133                 # Fix install-info's dir.
    134                 # (note: this may be effectless if there was no info dir to be fixed)
    135                 reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-gcc-dir|g" \
    136                         "${worksrcpath}/${makefile}"
    137         }
    138 
    139         # Fix the gettext files and related stuff.
    140         #       
    141         # module: name of the module (e.g. gas)
    142         proc crossgcc::fixgettext { module } {
    143                 global crossgcc-target worksrcpath
    144 
    145                 if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
    146                         reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
    147                                 "${worksrcpath}/${module}/Makefile.in"
    148                 }
    149                 if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
    150                         reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
    151                                 "${worksrcpath}/${module}/doc/Makefile.in"
    152                 }
    153                 if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
    154                         reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
    155                                 "${worksrcpath}/${module}/po/Make-in"
    156                 }
    157         }
    158 
    159         # gcc/doc/cpp.texi
    160         crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cpp texi
    161 
    162         # gcc/doc/cppinternals.texi
    163         crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cppinternals texi
    164 
    165         # gcc/doc/gcc.texi
    166         crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gcc texi
    167 
    168         # gcc/doc/gccint.texi
    169         crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccint texi
    170 
    171         # gcc/f/g77.texi
    172         crossgcc::fixinfo gcc/fortran/ gcc/fortran/Make-lang.in gfortran texi
    173 
    174         # gcc/java/gcj.texi
    175         crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi
    176 
    177         # fastjar/fastjar.texi
    178         crossgcc::fixinfo fastjar/ fastjar/Makefile.in fastjar texi
    179        
    180         # gcc/doc/gccinstall.info
    181         crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccinstall info
    182 
    183         # gettext stuff.
    184         crossgcc::fixgettext gcc
    185         crossgcc::fixgettext fastjar
     98    namespace eval crossgcc {}
     99
     100    # Fix the info pages and related stuff.
     101    #
     102    # path: path to the doc directory (e.g. gas/doc/)
     103    # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
     104    # name: name of the info page (e.g. as)
     105    # suffix: suffix of the souce page (texinfo or texi)
     106    proc crossgcc::fixinfo { path makefile name suffix } {
     107        global crossgcc-target worksrcpath
     108
     109        # Fix the source
     110        reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
     111            ${worksrcpath}/${path}/${name}.${suffix}
     112        reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
     113            ${worksrcpath}/${path}/${name}.${suffix}
     114        reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
     115            ${worksrcpath}/${path}/${name}.${suffix}
     116
     117        # Fix the Makefile
     118        reinplace "s| ${name}.info| ${crossgcc-target}-${name}.info|g" \
     119            ${worksrcpath}/${makefile}
     120        reinplace "s|/${name}.info|/${crossgcc-target}-${name}.info|g" \
     121            ${worksrcpath}/${makefile}
     122        reinplace "s|^${name}.info|${crossgcc-target}-${name}.info|g" \
     123            ${worksrcpath}/${makefile}
     124        reinplace "s| ${name}.pod| ${crossgcc-target}-${name}.pod|g" \
     125            ${worksrcpath}/${makefile}
     126        reinplace "s|/${name}.pod|/${crossgcc-target}-${name}.pod|g" \
     127            ${worksrcpath}/${makefile}
     128        reinplace "s|^${name}.pod|${crossgcc-target}-${name}.pod|g" \
     129            ${worksrcpath}/${makefile}
     130        reinplace "s| ${name}.${suffix}| ${crossgcc-target}-${name}.${suffix}|g" \
     131            ${worksrcpath}/${makefile}
     132        reinplace "s|/${name}.${suffix}|/${crossgcc-target}-${name}.${suffix}|g" \
     133            ${worksrcpath}/${makefile}
     134        reinplace "s|^${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
     135            ${worksrcpath}/${makefile}
     136
     137        # Rename the source
     138        file rename ${worksrcpath}/${path}/${name}.${suffix} \
     139            ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
     140
     141        # Fix install-info's dir.
     142        # (note: this may be effectless if there was no info dir to be fixed)
     143        reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-gcc-dir|g" \
     144            "${worksrcpath}/${makefile}"
     145    }
     146
     147    # Fix the gettext files and related stuff.
     148    #
     149    # module: name of the module (e.g. gas)
     150    proc crossgcc::fixgettext { module } {
     151        global crossgcc-target worksrcpath
     152
     153        if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
     154            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
     155                "${worksrcpath}/${module}/Makefile.in"
     156        }
     157        if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
     158            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
     159                "${worksrcpath}/${module}/doc/Makefile.in"
     160        }
     161        if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
     162            reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
     163                "${worksrcpath}/${module}/po/Make-in"
     164        }
     165    }
     166
     167    # gcc/doc/cpp.texi
     168    crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cpp texi
     169
     170    # gcc/doc/cppinternals.texi
     171    crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cppinternals texi
     172
     173    # gcc/doc/gcc.texi
     174    crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gcc texi
     175
     176    # gcc/doc/gccint.texi
     177    crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccint texi
     178
     179    # libquadmath/libquadmath.texi
     180    crossgcc::fixinfo libquadmath libquadmath/Makefile.in libquadmath texi
     181
     182    # gcc/f/g77.texi
     183    crossgcc::fixinfo gcc/fortran/ gcc/fortran/Make-lang.in gfortran texi
     184
     185    # gcc/java/gcj.texi
     186    crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi
     187
     188    # fastjar/fastjar.texi
     189    #crossgcc::fixinfo fastjar/ fastjar/Makefile.in fastjar texi
     190
     191    # gcc/doc/gccinstall.info
     192    crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccinstall info
     193
     194    # gettext stuff.
     195    crossgcc::fixgettext gcc
     196    crossgcc::fixgettext fastjar
    186197}
    187198
    188199pre-destroot {
    189         # gcc needs the cross directory structure to be present
    190         # in order to fill it during installation.
    191         file mkdir "${destroot}${prefix}/${crossgcc-target}/bin"
    192         file mkdir "${destroot}${prefix}/${crossgcc-target}/lib"
     200    # gcc needs the cross directory structure to be present
     201    # in order to fill it during installation.
     202    file mkdir "${destroot}${prefix}/${crossgcc-target}/bin"
     203    file mkdir "${destroot}${prefix}/${crossgcc-target}/lib"
    193204}
    194205
    195206post-destroot {
    196         namespace eval crossgcc {}
    197 
    198         # Rename a man page if it exists.
    199         #
    200         # section: section of the man page (e.g. 1)
    201         # manpage: name of the man page (e.g. cpp)
    202         proc crossgcc::rename_man_page { section manpage } {
    203                 global crossgcc-target destroot prefix
    204 
    205                 set manpage_path "${destroot}${prefix}/share/man/man${section}/${manpage}.${section}"
    206                 if { [ file exists ${manpage_path} ] } {
    207                         file rename ${manpage_path} \
    208                                 "${destroot}${prefix}/share/man/man${section}/${crossgcc-target}-${manpage}.${section}"
    209                 }
    210         }
    211 
    212         # Stuff I don't want (either because they're in the system
    213         # or because they would conflict with other FSF ports)
    214         # (it's easier for maintainability purposes to fix things here)
    215 
    216         # aliases for locales (should be on the system)
    217         file delete "${destroot}${prefix}/share/locale/locale.alias"
    218        
    219         # FSF propaganda (should already be there or would conflict)
    220         file delete -force "${destroot}${prefix}/share/man/man7"
    221 
    222         # (host) libiberty
    223         file delete "${destroot}${prefix}/lib/libiberty.a"
    224 
    225         # aliases for charsets (should already be there)
    226         file delete "${destroot}${prefix}/lib/charset.alias"
    227        
    228         # Remove man pages for tools that are not built as part of cross-gcc
    229         file delete "${destroot}${prefix}/share/man/man1/rmic.1"
    230         file delete "${destroot}${prefix}/share/man/man1/rmiregistry.1"
    231         file delete "${destroot}${prefix}/share/man/man1/jv-convert.1"
    232         file delete "${destroot}${prefix}/share/man/man1/gij.1"
    233        
    234         # For some reason, some man pages are not prefixed while they should have been
    235         # (to avoid conflicting).
    236         crossgcc::rename_man_page 1 cpp
    237         crossgcc::rename_man_page 1 gcjh
    238         crossgcc::rename_man_page 1 gcov
    239         crossgcc::rename_man_page 1 jcf-dump
    240         crossgcc::rename_man_page 1 jv-scan
    241        
    242         # There is a bug in gcc/Makefile::install-driver
    243         # For cross compilers, $(GCC_INSTALL_NAME) is equal to
    244         # $(target_noncanonical)-gcc-$(version)
    245         # and hence the driver isn't installed.
    246         xinstall -c "${workpath}/build/gcc/xgcc" \
    247                 "${destroot}${prefix}/bin/${crossgcc-target}-gcc-${version}"
    248 }
    249 
    250 livecheck.type  regex
    251 livecheck.url   http://gcc.gnu.org/releases.html
    252 livecheck.regex {<tr><td><a href="gcc-.*/">GCC (.*)</a></td>   <td>.*</td></tr>}
     207    namespace eval crossgcc {}
     208
     209    # Rename a man page if it exists.
     210    #
     211    # section: section of the man page (e.g. 1)
     212    # manpage: name of the man page (e.g. cpp)
     213    proc crossgcc::rename_man_page { section manpage } {
     214        global crossgcc-target destroot prefix
     215
     216        set manpage_path "${destroot}${prefix}/share/man/man${section}/${manpage}.${section}"
     217        if { [ file exists ${manpage_path} ] } {
     218            file rename ${manpage_path} \
     219                "${destroot}${prefix}/share/man/man${section}/${crossgcc-target}-${manpage}.${section}"
     220        }
     221    }
     222
     223    # Stuff I don't want (either because they're in the system
     224    # or because they would conflict with other FSF ports)
     225    # (it's easier for maintainability purposes to fix things here)
     226
     227    # aliases for locales (should be on the system)
     228    file delete "${destroot}${prefix}/share/locale/locale.alias"
     229
     230    # FSF propaganda (should already be there or would conflict)
     231    file delete -force "${destroot}${prefix}/share/man/man7"
     232
     233    # (host) libiberty
     234    file delete "${destroot}${prefix}/lib/${build_arch}/libiberty.a"
     235
     236    # aliases for charsets (should already be there)
     237    file delete "${destroot}${prefix}/lib/charset.alias"
     238
     239    # Remove man pages for tools that are not built as part of cross-gcc
     240    file delete "${destroot}${prefix}/share/man/man1/rmic.1"
     241    file delete "${destroot}${prefix}/share/man/man1/rmiregistry.1"
     242    file delete "${destroot}${prefix}/share/man/man1/jv-convert.1"
     243    file delete "${destroot}${prefix}/share/man/man1/gij.1"
     244
     245    # For some reason, some man pages are not prefixed while they should have been
     246    # (to avoid conflicting).
     247    crossgcc::rename_man_page 1 cpp
     248    crossgcc::rename_man_page 1 gcjh
     249    crossgcc::rename_man_page 1 gcov
     250    crossgcc::rename_man_page 1 jcf-dump
     251    crossgcc::rename_man_page 1 jv-scan
     252
     253    # There is a bug in gcc/Makefile::install-driver
     254    # For cross compilers, $(GCC_INSTALL_NAME) is equal to
     255    # $(target_noncanonical)-gcc-$(version)
     256    # and hence the driver isn't installed.
     257    xinstall -c "${workpath}/build/gcc/xgcc" \
     258        "${destroot}${prefix}/bin/${crossgcc-target}-gcc-${version}"
     259}
     260
     261livecheck.type  regex
     262livecheck.url   http://gcc.gnu.org/releases.html
     263livecheck.regex {<tr><td><a href="gcc-.*/">GCC (.*)</a></td>   <td>.*</td></tr>}
Note: See TracChangeset for help on using the changeset viewer.