Changeset 81851


Ignore:
Timestamp:
Aug 6, 2011, 1:21:39 AM (8 years ago)
Author:
raimue@…
Message:

cross/arm-none-eabi-gcc:
Simplify port by using the new crossgcc port group.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/cross/arm-none-eabi-gcc/Portfile

    r81601 r81851  
    11# $Id$
    22
    3 PortSystem       1.0
     3PortSystem      1.0
     4PortGroup       crossgcc 1.0
    45
    5 name            arm-none-eabi-gcc
    6 version         4.6.1
    7 set branch      [join [lrange [split ${version} .] 0 1] .]
     6crossgcc.setup      arm-none-eabi 4.6.1
     7crossgcc.setup_libc newlib 1.19.0
    88
    9 categories      cross devel
    10 platforms       darwin
    11 license         GPL-3
    12 maintainers     nomaintainer
    13 description     The GNU compiler collection for arm-none-eabi
    14 long_description \
    15     The GNU compiler collection, including front ends for C, C++, Objective-C \
    16     and Objective-C++ for arm-none-eabi.
    17 homepage        http://gcc.gnu.org/
    18 
    19 set newlibversion       1.19.0
    20 set crossgcc-target     arm-none-eabi
    21 
    22 set dcore       gcc-core-${version}.tar.bz2
    23 #set dfort      gcc-fortran-${version}.tar.bz2
    24 set dcxx        gcc-g++-${version}.tar.bz2
    25 #set djava      gcc-java-${version}.tar.bz2
    26 set dobjc       gcc-objc-${version}.tar.bz2
    27 #set ecj        ecj-4.5.jar
    28 set dnewlib     newlib-${newlibversion}.tar.gz
    29 
    30 master_sites    gnu:gcc/gcc-${version}/:gcc \
    31                 ftp://sources.redhat.com/pub/newlib/:newlib
    32 distfiles       ${dcore}:gcc \
    33                 ${dcxx}:gcc \
    34                 ${dobjc}:gcc \
    35                 ${dnewlib}:newlib
    36 dist_subdir     gcc
    37 checksums       ${dcore} \
     9checksums       gcc-core-${version}.tar.bz2 \
    3810                sha1    9b766705f051ffb7321de58f247688b0ae661b98 \
    3911                rmd160  bbe0b5127e584ad92516aff79bfa74ec30db2be4 \
    40                 ${dcxx} \
     12                gcc-g++-${version}.tar.bz2 \
    4113                sha1    043aa427ede603196588c2a2737c22e0d241ceca \
    4214                rmd160  857253c13eb4177512fc1bc6d797af28dde60eeb \
    43                 ${dobjc} \
     15                gcc-objc-${version}.tar.bz2 \
    4416                sha1    ed6f640b62465999eb1439a4db6dda3c35b6d19d \
    4517                rmd160  728e7ea55a04f28c6c3556c56213b2d9f023a0be \
    46                 ${dnewlib} \
     18                newlib-${crossgcc.libc_version}.tar.gz \
    4719                sha1    b2269d30ce7b93b7c714b90ef2f40221c2df0fcd \
    4820                rmd160  a28bd656ec895da0738dac3fb367851a2992d724
    49 use_bzip2 yes
    50 worksrcdir      build
    51 
    52 depends_lib     port:${crossgcc-target}-binutils \
    53                 port:gmp \
    54                 port:mpfr \
    55                 port:libiconv \
    56                 port:libmpc
    57 
    58 extract.only    ${dcore} ${dcxx} ${dobjc}
    59 post-extract {
    60         system -W ${workpath} "tar -xzf ${distpath}/newlib-${newlibversion}.tar.gz"
    61         ln -s ${workpath}/newlib-${newlibversion}/newlib ${workpath}/gcc-${version}/
    62 }
    63 
    64 post-patch {
    65         namespace eval crossgcc {}
    66 
    67         # Fix the info pages and related stuff.
    68         #
    69         # path: path to the doc directory (e.g. gas/doc/)
    70         # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
    71         # name: name of the info page (e.g. as)
    72         # suffix: suffix of the source page (texinfo or texi)
    73         proc crossgcc::fixinfo { path makefile name suffix } {
    74                 global crossgcc-target workpath version
    75 
    76                 # Fix the source
    77                 reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
    78                         ${workpath}/gcc-${version}/${path}/${name}.${suffix}
    79                 reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
    80                         ${workpath}/gcc-${version}/${path}/${name}.${suffix}
    81                 reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
    82                         ${workpath}/gcc-${version}/${path}/${name}.${suffix}
    83 
    84                 # Fix the Makefile
    85                 reinplace "s| ${name}.info| ${crossgcc-target}-${name}.info|g" \
    86                         ${workpath}/gcc-${version}/${makefile}
    87                 reinplace "s|/${name}.info|/${crossgcc-target}-${name}.info|g" \
    88                         ${workpath}/gcc-${version}/${makefile}
    89                 reinplace "s|^${name}.info|${crossgcc-target}-${name}.info|g" \
    90                         ${workpath}/gcc-${version}/${makefile}
    91                 reinplace "s| ${name}.pod| ${crossgcc-target}-${name}.pod|g" \
    92                         ${workpath}/gcc-${version}/${makefile}
    93                 reinplace "s|/${name}.pod|/${crossgcc-target}-${name}.pod|g" \
    94                         ${workpath}/gcc-${version}/${makefile}
    95                 reinplace "s|^${name}.pod|${crossgcc-target}-${name}.pod|g" \
    96                         ${workpath}/gcc-${version}/${makefile}
    97                 reinplace "s| ${name}.${suffix}| ${crossgcc-target}-${name}.${suffix}|g" \
    98                         ${workpath}/gcc-${version}/${makefile}
    99                 reinplace "s|/${name}.${suffix}|/${crossgcc-target}-${name}.${suffix}|g" \
    100                         ${workpath}/gcc-${version}/${makefile}
    101                 reinplace "s|^${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
    102                         ${workpath}/gcc-${version}/${makefile}
    103 
    104                 # Rename the source
    105                 file rename ${workpath}/gcc-${version}/${path}/${name}.${suffix} \
    106                         ${workpath}/gcc-${version}/${path}/${crossgcc-target}-${name}.${suffix}
    107 
    108                 # Fix install-info's dir.
    109                 # (note: this may be effectless if there was no info dir to be fixed)
    110                 reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-gcc-dir|g" \
    111                         ${workpath}/gcc-${version}/${makefile}
    112         }
    113 
    114         # gcc/doc/cpp.texi
    115         crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cpp texi
    116 
    117         # gcc/doc/cppinternals.texi
    118         crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cppinternals texi
    119 
    120         # gcc/doc/gcc.texi
    121         crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gcc texi
    122 
    123         # gcc/doc/gccint.texi
    124         crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccint texi
    125 
    126         # # gcc/fortran/gfortran.texi
    127         # crossgcc::fixinfo gcc/fortran/ gcc/fortran/Make-lang.in gfortran texi
    128 
    129         # # gcc/java/gcj.texi
    130         # crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi
    131 
    132         # gcc/doc/gccinstall.info
    133         crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccinstall info
    134 
    135         # libquadmath/libquadmath.info
    136         crossgcc::fixinfo libquadmath libquadmath/Makefile.in libquadmath info
    137 }
    138 
    139 # the generated compiler doesn't accept -arch
    140 configure.cc_archflags
    141 configure.cxx_archflags
    142 configure.objc_archflags
    143 configure.ld_archflags
    144 platform darwin {
    145     configure.args-append --build=${build_arch}-apple-darwin${os.major}
    146 }
    147 
    148 pre-configure   {
    149     file mkdir ${worksrcpath}
    150 }
    151 
    152 configure.cmd   ../gcc-${version}/configure
    153 configure.args  --target=${crossgcc-target} \
    154                 --enable-languages="c,objc,c++,obj-c++" \
    155                 --infodir=${prefix}/share/info \
    156                 --mandir=${prefix}/share/man \
    157                 --datarootdir=${prefix}/share/${name} \
    158                 --with-system-zlib \
    159                 --disable-nls \
    160                 --with-gmp=${prefix} \
    161                 --with-mpfr=${prefix} \
    162                 --with-mpc=${prefix} \
    163                 --enable-stage1-checking \
    164                 --enable-multilib
    16521
    16622# specific to ARM
    167 configure.args-append \
    168                 --enable-interwork
    169 
    170 configure.env-append \
    171     AR_FOR_TARGET=${crossgcc-target}-ar \
    172     AS_FOR_TARGET=${crossgcc-target}-as \
    173     LD_FOR_TARGET=${crossgcc-target}-ld \
    174     NM_FOR_TARGET=${crossgcc-target}-nm \
    175     OBJDUMP_FOR_TARGET=${crossgcc-target}-objdump \
    176     RANLIB_FOR_TARGET=${crossgcc-target}-ranlib \
    177     STRIP_FOR_TARGET=${crossgcc-target}-strip
    178 
    179 # http://trac.macports.org/ticket/29104
    180 if {${configure.compiler} == "llvm-gcc-4.2"} {
    181    configure.compiler clang
    182 }
    183 
    184 destroot.violate_mtree yes
    185 
    186 pre-destroot {
    187         # gcc needs the cross directory structure to be present
    188         # in order to fill it during installation.
    189         file mkdir "${destroot}/${prefix}/${crossgcc-target}/bin"
    190         file mkdir "${destroot}/${prefix}/${crossgcc-target}/lib"
    191 }
    192 
    193 post-destroot {
    194         # Stuff we don't want (either because they're in the system
    195         # or because they would conflict with other FSF ports)
    196         # (it's easier for maintainability purposes to fix things here)
    197 
    198         # FSF propaganda (should already be there or would conflict)
    199         file delete -force "${destroot}/${prefix}/share/man/man7"
    200 
    201         # (host) libiberty
    202         file delete "${destroot}/${prefix}/lib/${build_arch}/libiberty.a"
    203 }
    204 
    205 livecheck.type  regex
    206 livecheck.url   http://gcc.gnu.org/releases.html
    207 livecheck.regex {<tr><td><a href="gcc-.*/">GCC (.*)</a></td>   <td>.*</td></tr>}
     23configure.args-append --enable-interwork
Note: See TracChangeset for help on using the changeset viewer.