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

Last change on this file since 69904 was 69904, checked in by jmr@…, 9 years ago

multiple ports: remove adding of -no-cpp-precomp, which has done nothing since gcc 3.3

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.7 KB
Line 
1# $Id: Portfile 69904 2010-07-21 04:39:28Z jmr@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             nomaintainer
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.args  --infodir='${prefix}/share/info' \
62                                --mandir='${prefix}/share/man' \
63                                --target=${crossgcc-target} \
64                                --program-prefix=${crossgcc-target}- \
65                                --program-suffix=-${version} \
66                                --enable-obsolete \
67                                --enable-languages="c,c++,f77,objc" \
68                                --without-included-gettext \
69                                --with-gnu-as --with-gnu-ld \
70                                --with-newlib \
71                                --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/
72build.dir       ${workpath}/build
73destroot.args   \
74        --with-gxx-include-dir=${destroot}/${prefix}/${crossgcc-target}/include/c++/${version}/
75
76# Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
77# program names as gcc's name (add -${version} with ${version} being the version of gcc).
78# But it won't work because binutils binaries don't have the ${version} suffix, and even if they
79# had, they would actually have the binutils' version suffix (and not gcc's version).
80# So let's tell gcc's Makefile not to do that mistake.
81
82build.args              AR_FOR_TARGET=${crossgcc-target}-ar \
83                                AS_FOR_TARGET=${crossgcc-target}-as \
84                                LD_FOR_TARGET=${crossgcc-target}-ld \
85                                NM_FOR_TARGET=${crossgcc-target}-nm \
86                                RANLIB_FOR_TARGET=${crossgcc-target}-ranlib
87
88destroot.args   AR_FOR_TARGET=${crossgcc-target}-ar \
89                                AS_FOR_TARGET=${crossgcc-target}-as \
90                                LD_FOR_TARGET=${crossgcc-target}-ld \
91                                NM_FOR_TARGET=${crossgcc-target}-nm \
92                                RANLIB_FOR_TARGET=${crossgcc-target}-ranlib
93
94pre-patch {
95        # Additional patches for rtems.
96        system "cd ${workpath}/gcc-${version} && \
97                patch -p1 < ${distpath}/gcc-${version}-rtems-20030507a.diff"
98        system "cd ${workpath}/newlib-${newlibversion} && \
99                patch -p1 < ${distpath}/newlib-${newlibversion}-rtems-20030605.diff"
100}
101
102post-patch {
103        namespace eval crossgcc {}
104
105        # Fix the info pages and related stuff.
106        #       
107        # path: path to the doc directory (e.g. gas/doc/)
108        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
109        # name: name of the info page (e.g. as)
110        # suffix: suffix of the souce page (texinfo or texi)
111        proc crossgcc::fixinfo { path makefile name suffix } {
112                global crossgcc-target worksrcpath
113
114                # Fix the source
115                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
116                        ${worksrcpath}/${path}/${name}.${suffix}
117                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
118                        ${worksrcpath}/${path}/${name}.${suffix}
119                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
120                        ${worksrcpath}/${path}/${name}.${suffix}
121               
122                # Fix the Makefile
123                reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
124                        ${worksrcpath}/${makefile}
125                reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
126                        ${worksrcpath}/${makefile}
127               
128                # Rename the source
129                file rename ${worksrcpath}/${path}/${name}.${suffix} \
130                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
131               
132                # Fix install-info's dir.
133                # (note: this may be effectless if there was no info dir to be fixed)
134                reinplace "s|__TARGET|${crossgcc-target}|g" \
135                        "${worksrcpath}/${makefile}"
136        }
137
138        # Fix the gettext files and related stuff.
139        #       
140        # module: name of the module (e.g. gas)
141        proc crossgcc::fixgettext { module } {
142                global crossgcc-target worksrcpath
143
144                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
145                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
146                                "${worksrcpath}/${module}/Makefile.in"
147                }
148                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
149                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
150                                "${worksrcpath}/${module}/doc/Makefile.in"
151                }
152                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
153                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
154                                "${worksrcpath}/${module}/po/Make-in"
155                }
156        }
157
158        # gcc/doc/cpp.texi
159        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cpp texi
160
161        # gcc/doc/cppinternals.texi
162        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cppinternals texi
163
164        # gcc/doc/gcc.texi
165        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gcc texi
166
167        # gcc/doc/gccint.texi
168        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccint texi
169
170        # gcc/f/g77.texi
171        crossgcc::fixinfo gcc/f/ gcc/f/Make-lang.in g77 texi
172
173        # gettext stuff.
174        crossgcc::fixgettext gcc
175}
176
177post-destroot {
178        # Stuff I don't want (either because they're in the system
179        # or because they would conflict with other FSF ports)
180        # (it's easier for maintainability purposes to fix things here)
181
182        # aliases for locales (should be on the system)
183        file delete "${destroot}/${prefix}/share/locale/locale.alias"
184       
185        # FSF propaganda (should already be there or would conflict)
186        file delete -force "${destroot}/${prefix}/share/man/man7"
187
188        # (host) libiberty
189        file delete "${destroot}/${prefix}/lib/libiberty.a"
190
191        # aliases for charsets (should already be there)
192        file delete "${destroot}/${prefix}/lib/charset.alias"
193       
194        # For some reason, some man pages are not prefixed while they should have been
195        # (to avoid conflicting).
196        file rename "${destroot}/${prefix}/share/man/man1/cpp.1" \
197                "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-cpp.1"
198        file rename "${destroot}/${prefix}/share/man/man1/gcov.1" \
199                "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-gcov.1"
200}
201
202# This target has been abandonned upstream.
203pre-fetch {
204        if {${os.platform} == "darwin" && [rpm-vercomp 9.0 ${os.version}] < 0} {
205                error "This port does not build on darwin 9+ (Mac OS X 10.5+) and it has been abandonned upstream."
206        }
207}
208
209# livecheck.type        regex
210# livecheck.url http://gcc.gnu.org/releases.html
211# livecheck.regex       {<tr><td><a href="gcc-.*/">GCC (.*)</a></td>   <td>.*</td></tr>}
Note: See TracBrowser for help on using the repository browser.