source: trunk/dports/cross/i960-rtems-gcc/Portfile @ 50984

Last change on this file since 50984 was 50984, checked in by and.damore@…, 10 years ago

Maintainer email change, second batch, mail without @macports.org domain are put in domain:user form.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.8 KB
Line 
1# $Id: Portfile 50984 2009-05-14 21:08:43Z and.damore@macports.org $
2
3PortSystem                      1.0
4name                    i960-rtems-gcc
5version                 3.2.3
6revision                        1
7
8# Parameters for this port.
9set newlibversion       1.11.0
10set crossgcc-target i960-rtems
11
12description             gcc cross-compilers for i960-rtems, with newlib runtime library.
13long_description        gnu compilers collection (c, c++, fortran and objc) for \
14                                        i960-rtems cross development (Intel i960 family).
15homepage                        http://gcc.gnu.org/
16platforms               darwin
17categories              cross devel
18maintainers             kallisys.net:pguyot openmaintainer
19master_sites            gnu:gcc/gcc-${version}/:gcc \
20                                        ftp://sources.redhat.com/pub/newlib/:newlib \
21                                        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
24distfiles                       gcc-${version}.tar.gz:gcc \
25                                        newlib-${newlibversion}.tar.gz:newlib \
26                                        gcc-${version}-rtems-20030507a.diff:rtems \
27                                        newlib-${newlibversion}-rtems-20030605.diff:rtems
28extract.only            gcc-${version}.tar.gz newlib-${newlibversion}.tar.gz
29worksrcdir                      gcc-${version}
30checksums                       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
34
35# All cross ports violate the mtree layout.
36destroot.violate_mtree  yes
37
38# Download everything to gcc/
39dist_subdir                     gcc
40
41# Patches for info's dir.
42patchfiles                      patch-gcc-Makefile.in \
43                                        patch-gcc-f-Make-lang.in
44
45depends_lib                     bin:${crossgcc-target}-ar:${crossgcc-target}-binutils \
46                                        bin:${crossgcc-target}-as:${crossgcc-target}-binutils \
47                                        bin:${crossgcc-target}-ld:${crossgcc-target}-binutils \
48                                        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.
53post-extract    {
54        system "ln -s ${workpath}/newlib-${newlibversion}/newlib ${workpath}/gcc-${version}"
55}
56
57# Build in a different directory, as advised in the README file.
58pre-configure   { system "cd ${workpath} && mkdir -p build"}
59configure.dir   ${workpath}/build
60configure.cmd   ${workpath}/gcc-${version}/configure
61configure.cc    "cc -no-cpp-precomp"
62configure.args  --infodir='${prefix}/share/info' \
63                                --mandir='${prefix}/share/man' \
64                                --target=${crossgcc-target} \
65                                --program-prefix=${crossgcc-target}- \
66                                --program-suffix=-${version} \
67                                --enable-obsolete \
68                                --enable-languages="c,c++,f77,objc" \
69                                --without-included-gettext \
70                                --with-gnu-as --with-gnu-ld \
71                                --with-newlib \
72                                --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/
73build.dir       ${workpath}/build
74destroot.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
83build.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
89destroot.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
94
95pre-patch {
96        # Additional patches for rtems.
97        system "cd ${workpath}/gcc-${version} && \
98                patch -p1 < ${distpath}/gcc-${version}-rtems-20030507a.diff"
99        system "cd ${workpath}/newlib-${newlibversion} && \
100                patch -p1 < ${distpath}/newlib-${newlibversion}-rtems-20030605.diff"
101}
102
103post-patch {
104        namespace eval crossgcc {}
105
106        # Fix the info pages and related stuff.
107        #       
108        # path: path to the doc directory (e.g. gas/doc/)
109        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
110        # name: name of the info page (e.g. as)
111        # suffix: suffix of the souce page (texinfo or texi)
112        proc crossgcc::fixinfo { path makefile name suffix } {
113                global crossgcc-target worksrcpath
114
115                # Fix the source
116                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
117                        ${worksrcpath}/${path}/${name}.${suffix}
118                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
119                        ${worksrcpath}/${path}/${name}.${suffix}
120                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
121                        ${worksrcpath}/${path}/${name}.${suffix}
122               
123                # 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" \
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|__TARGET|${crossgcc-target}|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/f/ gcc/f/Make-lang.in g77 texi
173
174        # gettext stuff.
175        crossgcc::fixgettext gcc
176}
177
178post-destroot {
179        # Stuff I don't want (either because they're in the system
180        # or because they would conflict with other FSF ports)
181        # (it's easier for maintainability purposes to fix things here)
182
183        # aliases for locales (should be on the system)
184        file delete "${destroot}/${prefix}/share/locale/locale.alias"
185       
186        # FSF propaganda (should already be there or would conflict)
187        file delete -force "${destroot}/${prefix}/share/man/man7"
188
189        # (host) libiberty
190        file delete "${destroot}/${prefix}/lib/libiberty.a"
191
192        # aliases for charsets (should already be there)
193        file delete "${destroot}/${prefix}/lib/charset.alias"
194       
195        # For some reason, some man pages are not prefixed while they should have been
196        # (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"
201}
202
203# This target has been abandonned upstream.
204pre-fetch {
205        if {${os.platform} == "darwin" && [rpm-vercomp 9.0 ${os.version}] < 0} {
206                error "This port does not build on darwin 9+ (MacOS X 10.5+) and it has been abandonned upstream."
207        }
208}
209
210# livecheck.check       regex
211# livecheck.url http://gcc.gnu.org/releases.html
212# livecheck.regex       {<tr><td><a href="gcc-.*/">GCC (.*)</a></td>   <td>.*</td></tr>}
Note: See TracBrowser for help on using the repository browser.