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

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

arm-aout-gcc: avoid unsuccessful attempt to opportunistically use the gettext port, only depend on binutils once, use -std=gnu89

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.8 KB
Line 
1# $Id: Portfile 94938 2012-07-02 14:47:10Z jmr@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
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
22distfiles                       gcc-${version}.tar.gz:gcc newlib-${newlibversion}.tar.gz:newlib
23worksrcdir                      gcc-${version}
24checksums                       gcc-${version}.tar.gz \
25                                                md5 22c911f0a10275a0035d6004b9d68b63 \
26                                                sha1 7c713380dc7eed4bf95e158118b555fc68031c73 \
27                                                rmd160 aa9bdc4d7549fc586684c4e6da90df68a1c191ff \
28                                        newlib-${newlibversion}.tar.gz \
29                                                md5 3fa663f131b355d3adb24ead4df678f2 \
30                                                sha1 edc50f5cda734b50c5431a2b8d1e579ac82ce3f9 \
31                                                rmd160 6f2b3f32759925142421ddc069229eff857dd106
32
33# All cross ports violate the mtree layout.
34destroot.violate_mtree  yes
35
36# Download everything to gcc/
37dist_subdir                     gcc
38
39# Patches for info's dir and bugs that gcc 4.x doesn't like.
40patchfiles                      patch-gcc-Makefile.in \
41                                        patch-gcc-f-com.h \
42                                        patch-gcc-f-Make-lang.in \
43                                        patch-gcc-java-Make-lang.in \
44                                        patch-gcc-java-gjavah.c \
45                                        patch-fastjar-Makefile.in
46
47depends_lib                     port:${crossgcc-target}-binutils
48
49# Link newlib to gcc, so gcc will find its include files and this will also build newlib.
50post-extract    {
51        system "ln -s ${workpath}/newlib-${newlibversion}/newlib ${workpath}/gcc-${version}"
52}
53
54# Build in a different directory, as advised in the README file.
55pre-configure   { system "cd ${workpath} && mkdir -p build"}
56configure.dir   ${workpath}/build
57configure.cmd   ${workpath}/gcc-${version}/configure
58configure.args  --infodir='${prefix}/share/info' \
59                                --mandir='${prefix}/share/man' \
60                                --target=${crossgcc-target} \
61                                --program-prefix=${crossgcc-target}- \
62                                --program-suffix=-${version} \
63                                --enable-obsolete \
64                                --with-gnu-as --with-gnu-ld \
65                                --with-newlib \
66                                --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/ \
67                                --with-included-gettext
68
69configure.cflags-append -std=gnu89
70configure.cppflags
71configure.ldflags
72configure.cc_archflags
73configure.cxx_archflags
74configure.objc_archflags
75configure.ld_archflags
76build.dir       ${workpath}/build
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 it not to do that.
83
84build.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
90destroot.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
95
96post-patch {
97        namespace eval crossgcc {}
98
99        # Fix the info pages and related stuff.
100        #       
101        # path: path to the doc directory (e.g. gas/doc/)
102        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
103        # name: name of the info page (e.g. as)
104        # suffix: suffix of the souce page (texinfo or texi)
105        proc crossgcc::fixinfo { path makefile name suffix } {
106                global crossgcc-target worksrcpath
107
108                # Fix the source
109                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
110                        ${worksrcpath}/${path}/${name}.${suffix}
111                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
112                        ${worksrcpath}/${path}/${name}.${suffix}
113                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
114                        ${worksrcpath}/${path}/${name}.${suffix}
115               
116                # Fix the Makefile
117                reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
118                        ${worksrcpath}/${makefile}
119                reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
120                        ${worksrcpath}/${makefile}
121               
122                # Rename the source
123                file rename ${worksrcpath}/${path}/${name}.${suffix} \
124                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
125               
126                # Fix install-info's dir.
127                # (note: this may be effectless if there was no info dir to be fixed)
128                reinplace "s|__TARGET|${crossgcc-target}|g" \
129                        "${worksrcpath}/${makefile}"
130        }
131
132        # Fix the gettext files and related stuff.
133        #       
134        # module: name of the module (e.g. gas)
135        proc crossgcc::fixgettext { module } {
136                global crossgcc-target worksrcpath
137
138                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
139                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
140                                "${worksrcpath}/${module}/Makefile.in"
141                }
142                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
143                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
144                                "${worksrcpath}/${module}/doc/Makefile.in"
145                }
146                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
147                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
148                                "${worksrcpath}/${module}/po/Make-in"
149                }
150        }
151
152        # gcc/doc/cpp.texi
153        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cpp texi
154
155        # gcc/doc/cppinternals.texi
156        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cppinternals texi
157
158        # gcc/doc/gcc.texi
159        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gcc texi
160
161        # gcc/doc/gccint.texi
162        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccint texi
163
164        # gcc/f/g77.texi
165        crossgcc::fixinfo gcc/f/ gcc/f/Make-lang.in g77 texi
166
167        # gcc/java/gcj.texi
168        crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi
169
170        # fastjar/fastjar.texi
171        crossgcc::fixinfo fastjar/ fastjar/Makefile.in fastjar texi
172       
173        # gettext stuff.
174        crossgcc::fixgettext gcc
175        crossgcc::fixgettext fastjar
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        foreach f [glob -directory "${destroot}${prefix}/lib" libiberty.a */libiberty.a] {
191        file delete $f
192    }
193
194        # aliases for charsets (should already be there)
195        file delete "${destroot}${prefix}/lib/charset.alias"
196       
197        # Remove man pages for tools that are not built as part of cross-gcc
198        file delete "${destroot}${prefix}/share/man/man1/rmic.1"
199        file delete "${destroot}${prefix}/share/man/man1/rmiregistry.1"
200        file delete "${destroot}${prefix}/share/man/man1/jv-convert.1"
201        file delete "${destroot}${prefix}/share/man/man1/gij.1"
202       
203        # For some reason, some man pages are not prefixed while they should have been
204        # (to avoid conflicting).
205        file rename "${destroot}${prefix}/share/man/man1/cpp.1" \
206                "${destroot}${prefix}/share/man/man1/${crossgcc-target}-cpp.1"
207        file rename "${destroot}${prefix}/share/man/man1/gcjh.1" \
208                "${destroot}${prefix}/share/man/man1/${crossgcc-target}-gcjh.1"
209        file rename "${destroot}${prefix}/share/man/man1/gcov.1" \
210                "${destroot}${prefix}/share/man/man1/${crossgcc-target}-gcov.1"
211        file rename "${destroot}${prefix}/share/man/man1/jcf-dump.1" \
212                "${destroot}${prefix}/share/man/man1/${crossgcc-target}-jcf-dump.1"
213        file rename "${destroot}${prefix}/share/man/man1/jv-scan.1" \
214                "${destroot}${prefix}/share/man/man1/${crossgcc-target}-jv-scan.1"
215}
216
217livecheck.type  regex
218livecheck.url   http://gcc.gnu.org/releases.html
219livecheck.regex {<tr><td><a href="gcc-.*/">GCC (.*)</a></td>   <td>.*</td></tr>}
Note: See TracBrowser for help on using the repository browser.