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

Last change on this file since 30687 was 30687, checked in by pguyot@…, 12 years ago

All cross ports violate the layout

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