Changeset 41427


Ignore:
Timestamp:
Nov 2, 2008, 11:57:14 AM (11 years ago)
Author:
pguyot@…
Message:

cross/mips-rtems-gcc: update to 4.2.3

Location:
trunk/dports/cross/mips-rtems-gcc
Files:
2 deleted
1 edited
1 copied

Legend:

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

    r30687 r41427  
    22
    33PortSystem                      1.0
     4
    45name                    mips-rtems-gcc
    5 version                 3.2.3
    6 revision                        1
     6version                 4.2.3
    77
    88# Parameters for this port.
    9 set newlibversion       1.11.0
     9set newlibversion       1.16.0
    1010set crossgcc-target mips-rtems
     11set rtemsversion        4.9
     12set default-languages --enable-languages="c,c++,objc"
    1113
    1214description             gcc cross-compilers for mips-rtems, with newlib runtime library.
     
    1719platforms               darwin
    1820categories              cross devel
    19 maintainers             pguyot@kallisys.net
     21maintainers             pguyot@kallisys.net openmaintainer
    2022master_sites            gnu:gcc/gcc-${version}/:gcc \
    2123                                        ftp://sources.redhat.com/pub/newlib/:newlib \
    2224                                        ftp://ftp.mirror.ac.uk/sites/sources.redhat.com/pub/newlib/:newlib \
    23                                         ftp://ftp.rtems.com/pub/rtems/snapshots/c_tools/source/:rtems \
    24                                         http://rtems.thehousleys.net/:rtems
    25 distfiles                       gcc-${version}.tar.gz:gcc \
     25                                        ftp://ftp.rtems.com/pub/rtems/SOURCES/${rtemsversion}/:rtems \
     26                                        freebsd::rtems
     27distfiles                       gcc-${version}.tar.bz2:gcc \
    2628                                        newlib-${newlibversion}.tar.gz:newlib \
    27                                         gcc-${version}-rtems-20030507a.diff:rtems \
    28                                         newlib-${newlibversion}-rtems-20030605.diff:rtems
     29                                        gcc-core-${version}-rtems4.9-20080205.diff:rtems \
     30                                        newlib-${newlibversion}-rtems4.9-20080302.diff:rtems
    2931extract.only            gcc-${version}.tar.gz newlib-${newlibversion}.tar.gz
    3032worksrcdir                      gcc-${version}
    31 checksums                       gcc-${version}.tar.gz md5 e951123b2dfd2288c3e9337024dc9e4c \
    32                                         newlib-${newlibversion}.tar.gz md5 74de7de0c9624cd757df63f2ed17a9b4 \
    33                                         gcc-${version}-rtems-20030507a.diff md5 d4adda8ccba7ad57ee36b7720eadf19c \
    34                                         newlib-${newlibversion}-rtems-20030605.diff md5 b1dfdabd92e241d835964c6ef86aa3c9
     33checksums                       gcc-${version}.tar.bz2 \
     34                    md5     ef2a4d9991b3644115456ea05b2b8163 \
     35                    sha1    80b0df13fc9e311868022a3e86e673177397a917 \
     36                    rmd160  70b589b79b97967857f2ec70ff8b2017c84c464d \
     37                                        newlib-${newlibversion}.tar.gz \
     38                    md5     bf8f1f9e3ca83d732c00a79a6ef29bc4 \
     39                    sha1    841edec33d19a9e549984982fb92445ee967e265 \
     40                    rmd160  fa40ff43e858da3093c9f3b5b203724b9b327696 \
     41                                        gcc-core-${version}-rtems4.9-20080205.diff \
     42                    md5     d5a6a8c5973024476f0df6356b5e0424 \
     43                    sha1    20d0ada57ad44d9f060e60e26acee57e46137ad6 \
     44                    rmd160  c87a5703959dc319fad8e8b4804b8d4803cddc99 \
     45                                        newlib-${newlibversion}-rtems4.9-20080302.diff \
     46                    md5     a227456d0850e24a839634096b879c30 \
     47                    sha1    4f8cd12ada4865b271eb4d4c7d80b520fb8d2bc6 \
     48                    rmd160  81c76c584a6c76c9ea706bf9f0f2ba149303b289
     49patchfiles                      patch-newlib-libc-configure.diff
    3550
    3651# All cross ports violate the mtree layout.
     
    3954# Download everything to gcc/
    4055dist_subdir                     gcc
    41 
    42 # Patches for info's dir.
    43 patchfiles                      patch-gcc-Makefile.in \
    44                                         patch-gcc-f-Make-lang.in
    4556
    4657depends_lib                     bin:${crossgcc-target}-ar:${crossgcc-target}-binutils \
     
    4859                                        bin:${crossgcc-target}-ld:${crossgcc-target}-binutils \
    4960                                        bin:${crossgcc-target}-nm:${crossgcc-target}-binutils \
    50                                         bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils \
    51                                         lib:libintl:gettext
    52 
    53 # Link newlib to gcc, so gcc will find its include files and this will also build newlib.
     61                                        bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils
     62depends_build           bin:msgfmt:gettext
     63
     64# gcc is .bz2, newlib is .gz.
     65# let's extract only gcc with DP infrastructure, we'll do newlib manually.
     66use_bzip2                       yes
     67extract.only            gcc-${version}.tar.bz2
     68
     69# Extract newlib and create a symlink of newlib/newlib in gcc directory.
    5470post-extract    {
    55         system "ln -s ${workpath}/newlib-${newlibversion}/newlib ${workpath}/gcc-${version}"
    56 }
     71        system "cd ${workpath} && gzip -dc ${distpath}/newlib-${newlibversion}.tar.gz | tar -xf -"
     72        system "ln -s ${workpath}/newlib-${newlibversion}/newlib ${workpath}/gcc-${version}/"
     73}
     74
     75# Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
     76# program names as gcc's name (add -${version} with ${version} being the version of gcc).
     77# But it won't work because binutils binaries don't have the ${version} suffix, and even if they
     78# had, they would actually have the binutils' version suffix (and not gcc's version).
     79# So let's tell gcc's Makefile not to do that mistake.
     80
     81set environment [list AR_FOR_TARGET=${crossgcc-target}-ar \
     82                                AS_FOR_TARGET=${crossgcc-target}-as \
     83                                LD_FOR_TARGET=${crossgcc-target}-ld \
     84                                NM_FOR_TARGET=${crossgcc-target}-nm \
     85                                RANLIB_FOR_TARGET=${crossgcc-target}-ranlib]
    5786
    5887# Build in a different directory, as advised in the README file.
    59 pre-configure   { system "cd ${workpath} && mkdir -p build"}
     88pre-configure   {
     89        file mkdir "${workpath}/build"
     90}
    6091configure.dir   ${workpath}/build
    6192configure.cmd   ${workpath}/gcc-${version}/configure
    6293configure.cc    "cc -no-cpp-precomp"
     94configure.env   ${environment}
    6395configure.args  --infodir='${prefix}/share/info' \
    6496                                --mandir='${prefix}/share/man' \
     
    6698                                --program-prefix=${crossgcc-target}- \
    6799                                --program-suffix=-${version} \
     100                                --with-included-gettext \
    68101                                --enable-obsolete \
    69                                 --enable-languages="c,c++,f77,objc" \
    70                                 --without-included-gettext \
    71                                 --with-gnu-as --with-gnu-ld \
    72102                                --with-newlib \
    73                                 --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/
     103                                --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/ \
     104                                ${default-languages}
     105
    74106build.dir       ${workpath}/build
    75 destroot.args   \
    76         --with-gxx-include-dir=${destroot}/${prefix}/${crossgcc-target}/include/c++/${version}/
    77 
    78 # Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
    79 # program names as gcc's name (add -${version} with ${version} being the version of gcc).
    80 # But it won't work because binutils binaries don't have the ${version} suffix, and even if they
    81 # had, they would actually have the binutils' version suffix (and not gcc's version).
    82 # So let's tell gcc's Makefile not to do that mistake.
    83 
    84 build.args              AR_FOR_TARGET=${crossgcc-target}-ar \
    85                                 AS_FOR_TARGET=${crossgcc-target}-as \
    86                                 LD_FOR_TARGET=${crossgcc-target}-ld \
    87                                 NM_FOR_TARGET=${crossgcc-target}-nm \
    88                                 RANLIB_FOR_TARGET=${crossgcc-target}-ranlib
    89 
    90 destroot.args   AR_FOR_TARGET=${crossgcc-target}-ar \
    91                                 AS_FOR_TARGET=${crossgcc-target}-as \
    92                                 LD_FOR_TARGET=${crossgcc-target}-ld \
    93                                 NM_FOR_TARGET=${crossgcc-target}-nm \
    94                                 RANLIB_FOR_TARGET=${crossgcc-target}-ranlib
     107
     108build.args              ${environment}
     109destroot.args   ${environment}
    95110
    96111pre-patch {
    97112        # Additional patches for rtems.
    98113        system "cd ${workpath}/gcc-${version} && \
    99                 patch -p1 < ${distpath}/gcc-${version}-rtems-20030507a.diff"
     114                patch -p1 < ${distpath}/gcc-core-${version}-rtems4.9-20080205.diff"
    100115        system "cd ${workpath}/newlib-${newlibversion} && \
    101                 patch -p1 < ${distpath}/newlib-${newlibversion}-rtems-20030605.diff"
     116                patch -p1 < ${distpath}/newlib-${newlibversion}-rtems4.9-20080302.diff"
    102117}
    103118
     
    106121
    107122        # Fix the info pages and related stuff.
    108         #       
     123        #
    109124        # path: path to the doc directory (e.g. gas/doc/)
    110125        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
     
    121136                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
    122137                        ${worksrcpath}/${path}/${name}.${suffix}
    123                
     138
    124139                # Fix the Makefile
    125                 reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
    126                         ${worksrcpath}/${makefile}
    127                 reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
    128                         ${worksrcpath}/${makefile}
    129                
     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}.info|${crossgcc-target}-${name}.info|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}.pod|${crossgcc-target}-${name}.pod|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" \
     155                        ${worksrcpath}/${makefile}
     156                reinplace "s|^${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
     157                        ${worksrcpath}/${makefile}
     158
    130159                # Rename the source
    131160                file rename ${worksrcpath}/${path}/${name}.${suffix} \
    132161                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
    133                
     162
    134163                # Fix install-info's dir.
    135164                # (note: this may be effectless if there was no info dir to be fixed)
    136                 reinplace "s|__TARGET|${crossgcc-target}|g" \
     165                reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-gcc-dir|g" \
    137166                        "${worksrcpath}/${makefile}"
    138167        }
    139168
    140169        # Fix the gettext files and related stuff.
    141         #       
     170        #
    142171        # module: name of the module (e.g. gas)
    143172        proc crossgcc::fixgettext { module } {
     
    171200
    172201        # gcc/f/g77.texi
    173         crossgcc::fixinfo gcc/f/ gcc/f/Make-lang.in g77 texi
     202        crossgcc::fixinfo gcc/fortran/ gcc/fortran/Make-lang.in gfortran texi
     203
     204        # gcc/java/gcj.texi
     205        crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi
     206
     207        # gcc/doc/gccinstall.info
     208        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccinstall info
    174209
    175210        # gettext stuff.
    176211        crossgcc::fixgettext gcc
     212        crossgcc::fixgettext libcpp
     213}
     214
     215pre-destroot {
     216        # gcc needs the cross directory structure to be present
     217        # in order to fill it during installation.
     218        file mkdir "${destroot}/${prefix}/${crossgcc-target}/bin"
     219        file mkdir "${destroot}/${prefix}/${crossgcc-target}/lib"
    177220}
    178221
    179222post-destroot {
     223        namespace eval crossgcc {}
     224
     225        # Rename a man page if it exists.
     226        #
     227        # section: section of the man page (e.g. 1)
     228        # manpage: name of the man page (e.g. cpp)
     229        proc crossgcc::rename_man_page { section manpage } {
     230                global crossgcc-target destroot prefix
     231
     232                set manpage_path "${destroot}/${prefix}/share/man/man${section}/${manpage}.${section}"
     233                if { [ file exists ${manpage_path} ] } {
     234                        file rename ${manpage_path} \
     235                                "${destroot}/${prefix}/share/man/man${section}/${crossgcc-target}-${manpage}.${section}"
     236                }
     237        }
     238
    180239        # Stuff I don't want (either because they're in the system
    181240        # or because they would conflict with other FSF ports)
     
    184243        # aliases for locales (should be on the system)
    185244        file delete "${destroot}/${prefix}/share/locale/locale.alias"
    186        
     245
    187246        # FSF propaganda (should already be there or would conflict)
    188247        file delete -force "${destroot}/${prefix}/share/man/man7"
     
    193252        # aliases for charsets (should already be there)
    194253        file delete "${destroot}/${prefix}/lib/charset.alias"
    195        
     254
     255        # Remove man pages for tools that are not built as part of cross-gcc
     256        file delete "${destroot}/${prefix}/share/man/man1/rmic.1"
     257        file delete "${destroot}/${prefix}/share/man/man1/rmiregistry.1"
     258        file delete "${destroot}/${prefix}/share/man/man1/jv-convert.1"
     259        file delete "${destroot}/${prefix}/share/man/man1/gij.1"
     260
    196261        # For some reason, some man pages are not prefixed while they should have been
    197262        # (to avoid conflicting).
    198         file rename "${destroot}/${prefix}/share/man/man1/cpp.1" \
    199                 "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-cpp.1"
    200         file rename "${destroot}/${prefix}/share/man/man1/gcov.1" \
    201                 "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-gcov.1"
     263        crossgcc::rename_man_page 1 cpp
     264        crossgcc::rename_man_page 1 gcjh
     265        crossgcc::rename_man_page 1 gcov
     266        crossgcc::rename_man_page 1 jcf-dump
     267        crossgcc::rename_man_page 1 jv-scan
     268
     269        # There is a bug in gcc/Makefile::install-driver
     270        # For cross compilers, $(GCC_INSTALL_NAME) is equal to
     271        # $(target_noncanonical)-gcc-$(version)
     272        # and hence the driver isn't installed.
     273        xinstall -c "${workpath}/build/gcc/xgcc" \
     274                "${destroot}/${prefix}/bin/${crossgcc-target}-gcc-${version}"
    202275}
    203276
Note: See TracChangeset for help on using the changeset viewer.