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

Last change on this file since 7247 was 7247, checked in by pguyot (Paul Guyot), 16 years ago

Version bump to 3.3.3.
Probably the last version of this port since arm-aout is not supported in gcc 3.4.

  • Property svn:eol-style set to native
File size: 7.5 KB
Line 
1# $Id: Portfile,v 1.5 2004/05/26 19:05:30 pguyot Exp $
2
3PortSystem                      1.0
4name                    arm-aout-gcc
5version                 3.3.3
6
7# Parameters for this port.
8set newlibversion       1.11.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/releases/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 md5 9615e03f5f4f00bf550ef8d340b5f4d2 \
24                                        newlib-${newlibversion}.tar.gz md5 74de7de0c9624cd757df63f2ed17a9b4
25
26# Download everything to gcc/
27dist_subdir                     gcc
28
29# Patches for info's dir
30patchfiles                      patch-gcc-Makefile.in \
31                                        patch-gcc-f-Make-lang.in \
32                                        patch-gcc-java-Make-lang.in \
33                                        patch-fastjar-Makefile.in
34
35depends_lib                     bin:${crossgcc-target}-ar:${crossgcc-target}-binutils \
36                                        bin:${crossgcc-target}-as:${crossgcc-target}-binutils \
37                                        bin:${crossgcc-target}-ld:${crossgcc-target}-binutils \
38                                        bin:${crossgcc-target}-nm:${crossgcc-target}-binutils \
39                                        bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils
40
41# Link newlib to gcc, so gcc will find its include files and this will also build newlib.
42post-extract    {
43        system "ln -s ${workpath}/newlib-${newlibversion}/newlib ${workpath}/gcc-${version}"
44}
45
46# Build in a different directory, as advised in the README file.
47pre-configure   { system "cd ${workpath} && mkdir -p build"}
48configure.dir   ${workpath}/build
49configure.cmd   ${workpath}/gcc-${version}/configure
50configure.env   CC="cc -no-cpp-precomp"
51configure.args  --infodir='${prefix}/share/info' \
52                                --mandir='${prefix}/share/man' \
53                                --target=${crossgcc-target} \
54                                --program-prefix=${crossgcc-target}- \
55                                --program-suffix=-${version} \
56                                --enable-obsolete \
57                                --with-gnu-as --with-gnu-ld \
58                                --with-newlib \
59                                --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/
60build.dir       ${workpath}/build
61destroot.args   \
62        --with-gxx-include-dir=${destroot}/${prefix}/${crossgcc-target}/include/c++/${version}/
63
64# Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
65# program names as gcc's name (add -${version} with ${version} being the version of gcc).
66# But it won't work because binutils binaries don't have the ${version} suffix, and even if they
67# had, they would actually have the binutils' version suffix (and not gcc's version).
68# So let's tell gcc's Makefile it not to do that.
69
70build.args              AR_FOR_TARGET=${crossgcc-target}-ar \
71                                AS_FOR_TARGET=${crossgcc-target}-as \
72                                LD_FOR_TARGET=${crossgcc-target}-ld \
73                                NM_FOR_TARGET=${crossgcc-target}-nm \
74                                RANLIB_FOR_TARGET=${crossgcc-target}-ranlib
75
76destroot.args   AR_FOR_TARGET=${crossgcc-target}-ar \
77                                AS_FOR_TARGET=${crossgcc-target}-as \
78                                LD_FOR_TARGET=${crossgcc-target}-ld \
79                                NM_FOR_TARGET=${crossgcc-target}-nm \
80                                RANLIB_FOR_TARGET=${crossgcc-target}-ranlib
81
82post-patch {
83        namespace eval crossgcc {}
84
85        # Fix the info pages and related stuff.
86        #       
87        # path: path to the doc directory (e.g. gas/doc/)
88        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
89        # name: name of the info page (e.g. as)
90        # suffix: suffix of the souce page (texinfo or texi)
91        proc crossgcc::fixinfo { path makefile name suffix } {
92                global crossgcc-target worksrcpath
93
94                # Fix the source
95                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
96                        ${worksrcpath}/${path}/${name}.${suffix}
97                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
98                        ${worksrcpath}/${path}/${name}.${suffix}
99                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
100                        ${worksrcpath}/${path}/${name}.${suffix}
101               
102                # Fix the Makefile
103                reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
104                        ${worksrcpath}/${makefile}
105                reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
106                        ${worksrcpath}/${makefile}
107               
108                # Rename the source
109                file rename ${worksrcpath}/${path}/${name}.${suffix} \
110                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
111               
112                # Fix install-info's dir.
113                # (note: this may be effectless if there was no info dir to be fixed)
114                reinplace "s|__TARGET|${crossgcc-target}|g" \
115                        "${worksrcpath}/${makefile}"
116        }
117
118        # Fix the gettext files and related stuff.
119        #       
120        # module: name of the module (e.g. gas)
121        proc crossgcc::fixgettext { module } {
122                global crossgcc-target worksrcpath
123
124                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
125                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
126                                "${worksrcpath}/${module}/Makefile.in"
127                }
128                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
129                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
130                                "${worksrcpath}/${module}/doc/Makefile.in"
131                }
132                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
133                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
134                                "${worksrcpath}/${module}/po/Make-in"
135                }
136        }
137
138        # gcc/doc/cpp.texi
139        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cpp texi
140
141        # gcc/doc/cppinternals.texi
142        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cppinternals texi
143
144        # gcc/doc/gcc.texi
145        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gcc texi
146
147        # gcc/doc/gccint.texi
148        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccint texi
149
150        # gcc/f/g77.texi
151        crossgcc::fixinfo gcc/f/ gcc/f/Make-lang.in g77 texi
152
153        # gcc/java/gcj.texi
154        crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi
155
156        # fastjar/fastjar.texi
157        crossgcc::fixinfo fastjar/ fastjar/Makefile.in fastjar texi
158       
159        # gettext stuff.
160        crossgcc::fixgettext gcc
161        crossgcc::fixgettext fastjar
162}
163
164post-destroot {
165        # Stuff I don't want (either because they're in the system
166        # or because they would conflict with other FSF ports)
167        # (it's easier for maintainability purposes to fix things here)
168
169        # aliases for locales (should be on the system)
170        file delete "${destroot}/${prefix}/share/locale/locale.alias"
171       
172        # FSF propaganda (should already be there or would conflict)
173        file delete -force "${destroot}/${prefix}/share/man/man7"
174
175        # (host) libiberty
176        file delete "${destroot}/${prefix}/lib/libiberty.a"
177
178        # aliases for charsets (should already be there)
179        file delete "${destroot}/${prefix}/lib/charset.alias"
180       
181        # Remove man pages for tools that are not built as part of cross-gcc
182        file delete "${destroot}/${prefix}/share/man/man1/rmic.1"
183        file delete "${destroot}/${prefix}/share/man/man1/rmiregistry.1"
184        file delete "${destroot}/${prefix}/share/man/man1/jv-convert.1"
185        file delete "${destroot}/${prefix}/share/man/man1/gij.1"
186       
187        # For some reason, some man pages are not prefixed while they should have been
188        # (to avoid conflicting).
189        file rename "${destroot}/${prefix}/share/man/man1/cpp.1" \
190                "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-cpp.1"
191        file rename "${destroot}/${prefix}/share/man/man1/gcjh.1" \
192                "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-gcjh.1"
193        file rename "${destroot}/${prefix}/share/man/man1/gcov.1" \
194                "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-gcov.1"
195        file rename "${destroot}/${prefix}/share/man/man1/jcf-dump.1" \
196                "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-jcf-dump.1"
197        file rename "${destroot}/${prefix}/share/man/man1/jv-scan.1" \
198                "${destroot}/${prefix}/share/man/man1/${crossgcc-target}-jv-scan.1"
199}
Note: See TracBrowser for help on using the repository browser.