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

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

Add livecheck to my cross-gcc ports.

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