source: trunk/dports/cross/arm-aout-gcc/Portfile

Last change on this file was 124612, checked in by jmr@…, 3 years ago

arm-aout-gcc: license

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