Changeset 41413 for trunk/dports/cross


Ignore:
Timestamp:
Nov 2, 2008, 9:15:30 AM (11 years ago)
Author:
pguyot@…
Message:

cross/arm-rtems-gcc: update to 4.2.3 (fixes #14088)

Location:
trunk/dports/cross/arm-rtems-gcc
Files:
1 added
2 deleted
1 edited

Legend:

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

    r30687 r41413  
    33PortSystem                      1.0
    44name                    arm-rtems-gcc
    5 version                 3.2.3
    6 revision                        1
     5version                 4.2.3
    76
    87# Parameters for this port.
    9 set newlibversion       1.11.0
     8set newlibversion       1.16.0
    109set crossgcc-target arm-rtems
     10set rtemsversion        4.9
     11set default-languages --enable-languages="c,c++,objc"
    1112
    1213description             gcc cross-compilers for arm-rtems, with newlib runtime library.
     
    1617platforms               darwin
    1718categories              cross devel
    18 maintainers             pguyot@kallisys.net
     19maintainers             pguyot@kallisys.net openmaintainer
    1920master_sites            gnu:gcc/gcc-${version}/:gcc \
    2021                                        ftp://sources.redhat.com/pub/newlib/:newlib \
    2122                                        ftp://ftp.mirror.ac.uk/sites/sources.redhat.com/pub/newlib/:newlib \
    22                                         ftp://ftp.rtems.com/pub/rtems/snapshots/c_tools/source/:rtems \
    23                                         http://rtems.thehousleys.net/:rtems
    24 distfiles                       gcc-${version}.tar.gz:gcc \
     23                                        ftp://ftp.rtems.com/pub/rtems/SOURCES/${rtemsversion}/:rtems \
     24                                        freebsd::rtems
     25distfiles                       gcc-${version}.tar.bz2:gcc \
    2526                                        newlib-${newlibversion}.tar.gz:newlib \
    26                                         gcc-${version}-rtems-20030507a.diff:rtems \
    27                                         newlib-${newlibversion}-rtems-20030605.diff:rtems
     27                                        gcc-core-${version}-rtems4.9-20080205.diff:rtems \
     28                                        newlib-${newlibversion}-rtems4.9-20080302.diff:rtems
    2829extract.only            gcc-${version}.tar.gz newlib-${newlibversion}.tar.gz
    2930worksrcdir                      gcc-${version}
    30 checksums                       gcc-${version}.tar.gz md5 e951123b2dfd2288c3e9337024dc9e4c \
    31                                         newlib-${newlibversion}.tar.gz md5 74de7de0c9624cd757df63f2ed17a9b4 \
    32                                         gcc-${version}-rtems-20030507a.diff md5 d4adda8ccba7ad57ee36b7720eadf19c \
    33                                         newlib-${newlibversion}-rtems-20030605.diff md5 b1dfdabd92e241d835964c6ef86aa3c9
     31checksums                       gcc-${version}.tar.bz2 \
     32                    md5     ef2a4d9991b3644115456ea05b2b8163 \
     33                    sha1    80b0df13fc9e311868022a3e86e673177397a917 \
     34                    rmd160  70b589b79b97967857f2ec70ff8b2017c84c464d \
     35                                        newlib-${newlibversion}.tar.gz \
     36                    md5     bf8f1f9e3ca83d732c00a79a6ef29bc4 \
     37                    sha1    841edec33d19a9e549984982fb92445ee967e265 \
     38                    rmd160  fa40ff43e858da3093c9f3b5b203724b9b327696 \
     39                                        gcc-core-${version}-rtems4.9-20080205.diff \
     40                    md5     d5a6a8c5973024476f0df6356b5e0424 \
     41                    sha1    20d0ada57ad44d9f060e60e26acee57e46137ad6 \
     42                    rmd160  c87a5703959dc319fad8e8b4804b8d4803cddc99 \
     43                                        newlib-${newlibversion}-rtems4.9-20080302.diff \
     44                    md5     a227456d0850e24a839634096b879c30 \
     45                    sha1    4f8cd12ada4865b271eb4d4c7d80b520fb8d2bc6 \
     46                    rmd160  81c76c584a6c76c9ea706bf9f0f2ba149303b289
     47patchfiles                      patch-newlib-libc-configure.diff
    3448
    3549# All cross ports violate the mtree layout.
     
    3852# Download everything to gcc/
    3953dist_subdir                     gcc
    40 
    41 # Patches for info's dir.
    42 patchfiles                      patch-gcc-Makefile.in \
    43                                         patch-gcc-f-Make-lang.in
    4454
    4555depends_lib                     bin:${crossgcc-target}-ar:${crossgcc-target}-binutils \
     
    4757                                        bin:${crossgcc-target}-ld:${crossgcc-target}-binutils \
    4858                                        bin:${crossgcc-target}-nm:${crossgcc-target}-binutils \
    49                                         bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils \
    50                                         lib:libintl:gettext
    51 
    52 # Link newlib to gcc, so gcc will find its include files and this will also build newlib.
     59                                        bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils
     60depends_build           bin:msgfmt:gettext
     61
     62# gcc is .bz2, newlib is .gz.
     63# let's extract only gcc with DP infrastructure, we'll do newlib manually.
     64use_bzip2                       yes
     65extract.only            gcc-${version}.tar.bz2
     66
     67# Extract newlib and create a symlink of newlib/newlib in gcc directory.
    5368post-extract    {
    54         system "ln -s ${workpath}/newlib-${newlibversion}/newlib ${workpath}/gcc-${version}"
    55 }
     69        system "cd ${workpath} && gzip -dc ${distpath}/newlib-${newlibversion}.tar.gz | tar -xf -"
     70        system "ln -s ${workpath}/newlib-${newlibversion}/newlib ${workpath}/gcc-${version}/"
     71}
     72
     73# Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
     74# program names as gcc's name (add -${version} with ${version} being the version of gcc).
     75# But it won't work because binutils binaries don't have the ${version} suffix, and even if they
     76# had, they would actually have the binutils' version suffix (and not gcc's version).
     77# So let's tell gcc's Makefile not to do that mistake.
     78
     79set environment [list AR_FOR_TARGET=${crossgcc-target}-ar \
     80                                AS_FOR_TARGET=${crossgcc-target}-as \
     81                                LD_FOR_TARGET=${crossgcc-target}-ld \
     82                                NM_FOR_TARGET=${crossgcc-target}-nm \
     83                                RANLIB_FOR_TARGET=${crossgcc-target}-ranlib]
    5684
    5785# Build in a different directory, as advised in the README file.
    58 pre-configure   { system "cd ${workpath} && mkdir -p build"}
     86pre-configure   {
     87        file mkdir "${workpath}/build"
     88}
    5989configure.dir   ${workpath}/build
    6090configure.cmd   ${workpath}/gcc-${version}/configure
    6191configure.cc    "cc -no-cpp-precomp"
     92configure.env   ${environment}
    6293configure.args  --infodir='${prefix}/share/info' \
    6394                                --mandir='${prefix}/share/man' \
     
    6596                                --program-prefix=${crossgcc-target}- \
    6697                                --program-suffix=-${version} \
     98                                --with-included-gettext \
    6799                                --enable-obsolete \
    68                                 --enable-languages="c,c++,f77,objc" \
    69                                 --without-included-gettext \
    70                                 --with-gnu-as --with-gnu-ld \
    71100                                --with-newlib \
    72                                 --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/
     101                                --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/ \
     102                                ${default-languages}
     103
    73104build.dir       ${workpath}/build
    74 destroot.args   \
    75         --with-gxx-include-dir=${destroot}/${prefix}/${crossgcc-target}/include/c++/${version}/
    76 
    77 # Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
    78 # program names as gcc's name (add -${version} with ${version} being the version of gcc).
    79 # But it won't work because binutils binaries don't have the ${version} suffix, and even if they
    80 # had, they would actually have the binutils' version suffix (and not gcc's version).
    81 # So let's tell gcc's Makefile not to do that mistake.
    82 
    83 build.args              AR_FOR_TARGET=${crossgcc-target}-ar \
    84                                 AS_FOR_TARGET=${crossgcc-target}-as \
    85                                 LD_FOR_TARGET=${crossgcc-target}-ld \
    86                                 NM_FOR_TARGET=${crossgcc-target}-nm \
    87                                 RANLIB_FOR_TARGET=${crossgcc-target}-ranlib
    88 
    89 destroot.args   AR_FOR_TARGET=${crossgcc-target}-ar \
    90                                 AS_FOR_TARGET=${crossgcc-target}-as \
    91                                 LD_FOR_TARGET=${crossgcc-target}-ld \
    92                                 NM_FOR_TARGET=${crossgcc-target}-nm \
    93                                 RANLIB_FOR_TARGET=${crossgcc-target}-ranlib
     105
     106build.args              ${environment}
     107destroot.args   ${environment}
    94108
    95109pre-patch {
    96110        # Additional patches for rtems.
    97111        system "cd ${workpath}/gcc-${version} && \
    98                 patch -p1 < ${distpath}/gcc-${version}-rtems-20030507a.diff"
     112                patch -p1 < ${distpath}/gcc-core-${version}-rtems4.9-20080205.diff"
    99113        system "cd ${workpath}/newlib-${newlibversion} && \
    100                 patch -p1 < ${distpath}/newlib-${newlibversion}-rtems-20030605.diff"
     114                patch -p1 < ${distpath}/newlib-${newlibversion}-rtems4.9-20080302.diff"
    101115}
    102116
     
    122136               
    123137                # Fix the Makefile
    124                 reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
    125                         ${worksrcpath}/${makefile}
    126                 reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
     138                reinplace "s| ${name}.info| ${crossgcc-target}-${name}.info|g" \
     139                        ${worksrcpath}/${makefile}
     140                reinplace "s|/${name}.info|/${crossgcc-target}-${name}.info|g" \
     141                        ${worksrcpath}/${makefile}
     142                reinplace "s|^${name}.info|${crossgcc-target}-${name}.info|g" \
     143                        ${worksrcpath}/${makefile}
     144                reinplace "s| ${name}.pod| ${crossgcc-target}-${name}.pod|g" \
     145                        ${worksrcpath}/${makefile}
     146                reinplace "s|/${name}.pod|/${crossgcc-target}-${name}.pod|g" \
     147                        ${worksrcpath}/${makefile}
     148                reinplace "s|^${name}.pod|${crossgcc-target}-${name}.pod|g" \
     149                        ${worksrcpath}/${makefile}
     150                reinplace "s| ${name}.${suffix}| ${crossgcc-target}-${name}.${suffix}|g" \
     151                        ${worksrcpath}/${makefile}
     152                reinplace "s|/${name}.${suffix}|/${crossgcc-target}-${name}.${suffix}|g" \
     153                        ${worksrcpath}/${makefile}
     154                reinplace "s|^${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
    127155                        ${worksrcpath}/${makefile}
    128156               
     
    133161                # Fix install-info's dir.
    134162                # (note: this may be effectless if there was no info dir to be fixed)
    135                 reinplace "s|__TARGET|${crossgcc-target}|g" \
     163                reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-gcc-dir|g" \
    136164                        "${worksrcpath}/${makefile}"
    137165        }
     
    170198
    171199        # gcc/f/g77.texi
    172         crossgcc::fixinfo gcc/f/ gcc/f/Make-lang.in g77 texi
     200        crossgcc::fixinfo gcc/fortran/ gcc/fortran/Make-lang.in gfortran texi
     201
     202        # gcc/java/gcj.texi
     203        crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi
     204
     205        # gcc/doc/gccinstall.info
     206        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccinstall info
    173207
    174208        # gettext stuff.
    175209        crossgcc::fixgettext gcc
     210        crossgcc::fixgettext libcpp
     211}
     212
     213pre-destroot {
     214        # gcc needs the cross directory structure to be present
     215        # in order to fill it during installation.
     216        file mkdir "${destroot}/${prefix}/${crossgcc-target}/bin"
     217        file mkdir "${destroot}/${prefix}/${crossgcc-target}/lib"
    176218}
    177219
    178220post-destroot {
     221        namespace eval crossgcc {}
     222
     223        # Rename a man page if it exists.
     224        #
     225        # section: section of the man page (e.g. 1)
     226        # manpage: name of the man page (e.g. cpp)
     227        proc crossgcc::rename_man_page { section manpage } {
     228                global crossgcc-target destroot prefix
     229
     230                set manpage_path "${destroot}/${prefix}/share/man/man${section}/${manpage}.${section}"
     231                if { [ file exists ${manpage_path} ] } {
     232                        file rename ${manpage_path} \
     233                                "${destroot}/${prefix}/share/man/man${section}/${crossgcc-target}-${manpage}.${section}"
     234                }
     235        }
     236
    179237        # Stuff I don't want (either because they're in the system
    180238        # or because they would conflict with other FSF ports)
     
    193251        file delete "${destroot}/${prefix}/lib/charset.alias"
    194252       
     253        # Remove man pages for tools that are not built as part of cross-gcc
     254        file delete "${destroot}/${prefix}/share/man/man1/rmic.1"
     255        file delete "${destroot}/${prefix}/share/man/man1/rmiregistry.1"
     256        file delete "${destroot}/${prefix}/share/man/man1/jv-convert.1"
     257        file delete "${destroot}/${prefix}/share/man/man1/gij.1"
     258       
    195259        # For some reason, some man pages are not prefixed while they should have been
    196260        # (to avoid conflicting).
    197         file rename "${destroot}/${prefix}/share/man/man1/cpp.1" \
    198                 "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-cpp.1"
    199         file rename "${destroot}/${prefix}/share/man/man1/gcov.1" \
    200                 "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-gcov.1"
     261        crossgcc::rename_man_page 1 cpp
     262        crossgcc::rename_man_page 1 gcjh
     263        crossgcc::rename_man_page 1 gcov
     264        crossgcc::rename_man_page 1 jcf-dump
     265        crossgcc::rename_man_page 1 jv-scan
     266       
     267        # There is a bug in gcc/Makefile::install-driver
     268        # For cross compilers, $(GCC_INSTALL_NAME) is equal to
     269        # $(target_noncanonical)-gcc-$(version)
     270        # and hence the driver isn't installed.
     271        xinstall -c "${workpath}/build/gcc/xgcc" \
     272                "${destroot}/${prefix}/bin/${crossgcc-target}-gcc-${version}"
    201273}
    202274
Note: See TracChangeset for help on using the changeset viewer.