source: trunk/dports/cross/arm-aout-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.9 KB
Line 
1# $Id: Portfile 69904 2010-07-21 04:39:28Z jmr@macports.org $
2
3PortSystem                      1.0
4name                    arm-aout-gcc
5version                 3.3.6
6
7# Parameters for this port.
8set newlibversion       1.14.0
9set crossgcc-target arm-aout
10
11description             gcc cross-compilers for arm-aout, with newlib runtime library.
12long_description        gnu compilers collection (including c++, fortran and java) for \
13                                        arm-aout, with newlib runtime library.
14homepage                        http://gcc.gnu.org/
15platforms               darwin
16categories              cross devel
17maintainers             nomaintainer
18master_sites            gnu:gcc/gcc-${version}/:gcc \
19                                        ftp://sources.redhat.com/pub/newlib/:newlib \
20                                        ftp://ftp.mirror.ac.uk/sites/sources.redhat.com/pub/newlib/:newlib
21distfiles                       gcc-${version}.tar.gz:gcc newlib-${newlibversion}.tar.gz:newlib
22worksrcdir                      gcc-${version}
23checksums                       gcc-${version}.tar.gz \
24                                                md5 22c911f0a10275a0035d6004b9d68b63 \
25                                                sha1 7c713380dc7eed4bf95e158118b555fc68031c73 \
26                                                rmd160 aa9bdc4d7549fc586684c4e6da90df68a1c191ff \
27                                        newlib-${newlibversion}.tar.gz \
28                                                md5 3fa663f131b355d3adb24ead4df678f2 \
29                                                sha1 edc50f5cda734b50c5431a2b8d1e579ac82ce3f9 \
30                                                rmd160 6f2b3f32759925142421ddc069229eff857dd106
31
32# All cross ports violate the mtree layout.
33destroot.violate_mtree  yes
34
35# Download everything to gcc/
36dist_subdir                     gcc
37
38# Patches for info's dir and bugs that gcc 4.x doesn't like.
39patchfiles                      patch-gcc-Makefile.in \
40                                        patch-gcc-f-com.h \
41                                        patch-gcc-f-Make-lang.in \
42                                        patch-gcc-java-Make-lang.in \
43                                        patch-gcc-java-gjavah.c \
44                                        patch-fastjar-Makefile.in
45
46depends_lib                     bin:${crossgcc-target}-ar:${crossgcc-target}-binutils \
47                                        bin:${crossgcc-target}-as:${crossgcc-target}-binutils \
48                                        bin:${crossgcc-target}-ld:${crossgcc-target}-binutils \
49                                        bin:${crossgcc-target}-nm:${crossgcc-target}-binutils \
50                                        bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils
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                                --with-gnu-as --with-gnu-ld \
68                                --with-newlib \
69                                --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/
70build.dir       ${workpath}/build
71destroot.args   \
72        --with-gxx-include-dir=${destroot}/${prefix}/${crossgcc-target}/include/c++/${version}/
73
74# Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
75# program names as gcc's name (add -${version} with ${version} being the version of gcc).
76# But it won't work because binutils binaries don't have the ${version} suffix, and even if they
77# had, they would actually have the binutils' version suffix (and not gcc's version).
78# So let's tell gcc's Makefile it not to do that.
79
80build.args              AR_FOR_TARGET=${crossgcc-target}-ar \
81                                AS_FOR_TARGET=${crossgcc-target}-as \
82                                LD_FOR_TARGET=${crossgcc-target}-ld \
83                                NM_FOR_TARGET=${crossgcc-target}-nm \
84                                RANLIB_FOR_TARGET=${crossgcc-target}-ranlib
85
86destroot.args   AR_FOR_TARGET=${crossgcc-target}-ar \
87                                AS_FOR_TARGET=${crossgcc-target}-as \
88                                LD_FOR_TARGET=${crossgcc-target}-ld \
89                                NM_FOR_TARGET=${crossgcc-target}-nm \
90                                RANLIB_FOR_TARGET=${crossgcc-target}-ranlib
91
92post-patch {
93        namespace eval crossgcc {}
94
95        # Fix the info pages and related stuff.
96        #       
97        # path: path to the doc directory (e.g. gas/doc/)
98        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
99        # name: name of the info page (e.g. as)
100        # suffix: suffix of the souce page (texinfo or texi)
101        proc crossgcc::fixinfo { path makefile name suffix } {
102                global crossgcc-target worksrcpath
103
104                # Fix the source
105                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
106                        ${worksrcpath}/${path}/${name}.${suffix}
107                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
108                        ${worksrcpath}/${path}/${name}.${suffix}
109                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
110                        ${worksrcpath}/${path}/${name}.${suffix}
111               
112                # Fix the Makefile
113                reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
114                        ${worksrcpath}/${makefile}
115                reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
116                        ${worksrcpath}/${makefile}
117               
118                # Rename the source
119                file rename ${worksrcpath}/${path}/${name}.${suffix} \
120                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
121               
122                # Fix install-info's dir.
123                # (note: this may be effectless if there was no info dir to be fixed)
124                reinplace "s|__TARGET|${crossgcc-target}|g" \
125                        "${worksrcpath}/${makefile}"
126        }
127
128        # Fix the gettext files and related stuff.
129        #       
130        # module: name of the module (e.g. gas)
131        proc crossgcc::fixgettext { module } {
132                global crossgcc-target worksrcpath
133
134                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
135                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
136                                "${worksrcpath}/${module}/Makefile.in"
137                }
138                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
139                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
140                                "${worksrcpath}/${module}/doc/Makefile.in"
141                }
142                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
143                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
144                                "${worksrcpath}/${module}/po/Make-in"
145                }
146        }
147
148        # gcc/doc/cpp.texi
149        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cpp texi
150
151        # gcc/doc/cppinternals.texi
152        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cppinternals texi
153
154        # gcc/doc/gcc.texi
155        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gcc texi
156
157        # gcc/doc/gccint.texi
158        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccint texi
159
160        # gcc/f/g77.texi
161        crossgcc::fixinfo gcc/f/ gcc/f/Make-lang.in g77 texi
162
163        # gcc/java/gcj.texi
164        crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi
165
166        # fastjar/fastjar.texi
167        crossgcc::fixinfo fastjar/ fastjar/Makefile.in fastjar texi
168       
169        # gettext stuff.
170        crossgcc::fixgettext gcc
171        crossgcc::fixgettext fastjar
172}
173
174post-destroot {
175        # Stuff I don't want (either because they're in the system
176        # or because they would conflict with other FSF ports)
177        # (it's easier for maintainability purposes to fix things here)
178
179        # aliases for locales (should be on the system)
180        file delete "${destroot}/${prefix}/share/locale/locale.alias"
181       
182        # FSF propaganda (should already be there or would conflict)
183        file delete -force "${destroot}/${prefix}/share/man/man7"
184
185        # (host) libiberty
186        file delete "${destroot}/${prefix}/lib/libiberty.a"
187
188        # aliases for charsets (should already be there)
189        file delete "${destroot}/${prefix}/lib/charset.alias"
190       
191        # Remove man pages for tools that are not built as part of cross-gcc
192        file delete "${destroot}/${prefix}/share/man/man1/rmic.1"
193        file delete "${destroot}/${prefix}/share/man/man1/rmiregistry.1"
194        file delete "${destroot}/${prefix}/share/man/man1/jv-convert.1"
195        file delete "${destroot}/${prefix}/share/man/man1/gij.1"
196       
197        # For some reason, some man pages are not prefixed while they should have been
198        # (to avoid conflicting).
199        file rename "${destroot}/${prefix}/share/man/man1/cpp.1" \
200                "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-cpp.1"
201        file rename "${destroot}/${prefix}/share/man/man1/gcjh.1" \
202                "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-gcjh.1"
203        file rename "${destroot}/${prefix}/share/man/man1/gcov.1" \
204                "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-gcov.1"
205        file rename "${destroot}/${prefix}/share/man/man1/jcf-dump.1" \
206                "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-jcf-dump.1"
207        file rename "${destroot}/${prefix}/share/man/man1/jv-scan.1" \
208                "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-jv-scan.1"
209}
210
211livecheck.type  regex
212livecheck.url   http://gcc.gnu.org/releases.html
213livecheck.regex {<tr><td><a href="gcc-.*/">GCC (.*)</a></td>   <td>.*</td></tr>}
Note: See TracBrowser for help on using the repository browser.