source: trunk/dports/cross/arm-none-linux-gnueabi-gcc/Portfile @ 59969

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

Dropping maintainship

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.2 KB
Line 
1# $Id: Portfile 59969 2009-10-28 06:52:19Z pguyot@kallisys.net $
2
3PortSystem                      1.0
4name                    arm-none-linux-gnueabi-gcc
5version                 2005q3-2
6
7# Parameters for this port.
8set gccversion          2005q3
9set scratchboxversion   1.0.5
10set crossgcc-target arm-none-linux-gnueabi
11set default-languages --enable-languages="c,c++,objc"
12
13description             gcc 3.x cross-compilers for arm-none-linux-gnueabi.
14long_description        gnu compilers collection version 3.x (including c++ and objc) for \
15                                        arm-none-linux-gnueabi, Nokia Internet Tablet version from Code Sourcery
16homepage                        http://www.codesourcery.com/gnu_toolchains/arm
17platforms               darwin
18categories              cross devel
19maintainers             nomaintainer
20master_sites            macports:pguyot
21distfiles                       gcc-${version}.tar.bz2
22worksrcdir                      gcc-${gccversion}
23checksums                       gcc-${version}.tar.bz2 \
24                                                md5 8fb231e1d8573b9e14e4d518a1c781a2 \
25                                                sha1 99334733b0e0b2befd7f5eb9c6fac407a71f563e \
26                                                rmd160 8d08aa976a84e9058ae95616c25e2c5a00ac9b4c
27
28# All cross ports violate the mtree layout.
29destroot.violate_mtree  yes
30
31# Download everything to gcc/
32dist_subdir                     gcc
33
34depends_lib                     bin:${crossgcc-target}-ar:${crossgcc-target}-binutils \
35                                bin:${crossgcc-target}-as:${crossgcc-target}-binutils \
36                                        bin:${crossgcc-target}-ld:${crossgcc-target}-binutils \
37                                        bin:${crossgcc-target}-nm:${crossgcc-target}-binutils \
38                                        bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils \
39                                        port:${crossgcc-target}-runtime
40depends_build           bin:msgfmt:gettext
41
42use_bzip2                       yes
43
44# Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
45# program names as gcc's name (add -${version} with ${version} being the version of gcc).
46# But it won't work because binutils binaries don't have the ${version} suffix, and even if they
47# had, they would actually have the binutils' version suffix (and not gcc's version).
48# So let's tell gcc's Makefile not to do that mistake.
49
50set environment [list AR_FOR_TARGET=${crossgcc-target}-ar \
51                                AS_FOR_TARGET=${crossgcc-target}-as \
52                                LD_FOR_TARGET=${crossgcc-target}-ld \
53                                NM_FOR_TARGET=${crossgcc-target}-nm \
54                                RANLIB_FOR_TARGET=${crossgcc-target}-ranlib]
55
56# Build in a different directory, as advised in the README file.
57pre-configure   {
58        file mkdir "${workpath}/build"
59}
60configure.dir   ${workpath}/build
61configure.cmd   ${worksrcpath}/configure
62configure.cc    "cc -no-cpp-precomp"
63configure.env   ${environment}
64configure.args  --infodir='${prefix}/share/info' \
65                                --mandir='${prefix}/share/man' \
66                                --target=${crossgcc-target} \
67                                --program-prefix=${crossgcc-target}- \
68                                --program-suffix=-${gccversion} \
69                                --with-included-gettext \
70                                --with-headers=${prefix}/${crossgcc-target}/usr/include \
71                                --with-libs=${prefix}/${crossgcc-target}/usr/lib \
72                                --enable-shared \
73                                --enable-threads \
74                                --disable-checking \
75                                --enable-symvers=gnu \
76                                --enable-__cxa_atexit \
77                                --disable-libssp \
78                                --disable-libstdcxx-pch \
79                                --with-cpu= \
80                                --enable-interwork \
81                                --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/ \
82                                ${default-languages}
83
84build.dir       ${workpath}/build
85
86build.args              ${environment}
87destroot.args   ${environment}
88
89# Variant to include java tools.
90# I'm not exactly sure what the interest of this variant is except to measure
91# the speed of your Xserve G5 farm. Or your patience if you don't have such
92# a farm.
93variant java {
94        configure.args-delete ${default-languages}
95}
96
97patch {
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                if { [ file exists ${worksrcpath}/${path}/${name}.${suffix} ] } {
111                        reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
112                                ${worksrcpath}/${path}/${name}.${suffix}
113                        reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
114                                ${worksrcpath}/${path}/${name}.${suffix}
115                        reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
116                                ${worksrcpath}/${path}/${name}.${suffix}
117                        # Rename the source
118                        file rename ${worksrcpath}/${path}/${name}.${suffix} \
119                                ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
120                }
121               
122                # Fix the Makefile
123                reinplace "s| ${name}.info| ${crossgcc-target}-${name}.info|g" \
124                        ${worksrcpath}/${makefile}
125                reinplace "s|/${name}.info|/${crossgcc-target}-${name}.info|g" \
126                        ${worksrcpath}/${makefile}
127                reinplace "s|/${name}.1|/${crossgcc-target}-${name}.1|g" \
128                        ${worksrcpath}/${makefile}
129                reinplace "s|^${name}.info|${crossgcc-target}-${name}.info|g" \
130                        ${worksrcpath}/${makefile}
131                reinplace "s| ${name}.pod| ${crossgcc-target}-${name}.pod|g" \
132                        ${worksrcpath}/${makefile}
133                reinplace "s|/${name}.pod|/${crossgcc-target}-${name}.pod|g" \
134                        ${worksrcpath}/${makefile}
135                reinplace "s|^${name}.pod|${crossgcc-target}-${name}.pod|g" \
136                        ${worksrcpath}/${makefile}
137                reinplace "s| ${name}.${suffix}| ${crossgcc-target}-${name}.${suffix}|g" \
138                        ${worksrcpath}/${makefile}
139                reinplace "s|/${name}.${suffix}|/${crossgcc-target}-${name}.${suffix}|g" \
140                        ${worksrcpath}/${makefile}
141                reinplace "s|^${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
142                        ${worksrcpath}/${makefile}
143               
144                # Fix install-info's dir.
145                # (note: this may be effectless if there was no info dir to be fixed)
146                reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-gcc-dir|g" \
147                        "${worksrcpath}/${makefile}"
148        }
149
150        # Fix the gettext files and related stuff.
151        #       
152        # module: name of the module (e.g. gas)
153        proc crossgcc::fixgettext { module } {
154                global crossgcc-target worksrcpath
155
156                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
157                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
158                                "${worksrcpath}/${module}/Makefile.in"
159                }
160                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
161                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
162                                "${worksrcpath}/${module}/doc/Makefile.in"
163                }
164                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
165                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
166                                "${worksrcpath}/${module}/po/Make-in"
167                }
168        }
169
170        # gcc/doc/cpp.texi
171        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cpp texi
172
173        # gcc/doc/cppinternals.texi
174        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cppinternals texi
175
176        # gcc/doc/gcc.texi
177        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gcc texi
178        crossgcc::fixinfo gcc/cp/ gcc/cp/Make-lang.in gcc texi
179        crossgcc::fixinfo gcc/cp/ gcc/cp/Make-lang.in g++ texi
180
181        # gcc/doc/gccint.texi
182        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccint texi
183
184        # gcc/f/g77.texi
185        crossgcc::fixinfo gcc/f/ gcc/f/Make-lang.in g77 texi
186
187        # gcc/java/gcj.texi
188        crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi
189
190        # fastjar/fastjar.texi
191        crossgcc::fixinfo fastjar/ fastjar/Makefile.in fastjar texi
192       
193        # gettext stuff.
194        crossgcc::fixgettext gcc
195        crossgcc::fixgettext fastjar
196}
197
198pre-destroot {
199        # gcc needs the cross directory structure to be present
200        # in order to fill it during installation.
201        file mkdir "${destroot}/${prefix}/${crossgcc-target}/bin"
202        file mkdir "${destroot}/${prefix}/${crossgcc-target}/lib"
203}
204
205post-destroot {
206        namespace eval crossgcc {}
207
208        # Rename a man page if it exists.
209        #
210        # section: section of the man page (e.g. 1)
211        # manpage: name of the man page (e.g. cpp)
212        proc crossgcc::rename_man_page { section manpage } {
213                global crossgcc-target destroot prefix
214
215                set manpage_path "${destroot}/${prefix}/share/man/man${section}/${manpage}.${section}"
216                if { [ file exists ${manpage_path} ] } {
217                        file rename ${manpage_path} \
218                                "${destroot}/${prefix}/share/man/man${section}/${crossgcc-target}-${manpage}.${section}"
219                }
220        }
221
222        # Stuff I don't want (either because they're in the system
223        # or because they would conflict with other FSF ports)
224        # (it's easier for maintainability purposes to fix things here)
225
226        # aliases for locales (should be on the system)
227        file delete "${destroot}/${prefix}/share/locale/locale.alias"
228       
229        # FSF propaganda (should already be there or would conflict)
230        file delete -force "${destroot}/${prefix}/share/man/man7"
231
232        # (host) libiberty
233        file delete "${destroot}/${prefix}/lib/libiberty.a"
234
235        # aliases for charsets (should already be there)
236        file delete "${destroot}/${prefix}/lib/charset.alias"
237       
238        # Remove man pages for tools that are not built as part of cross-gcc
239        file delete "${destroot}/${prefix}/share/man/man1/rmic.1"
240        file delete "${destroot}/${prefix}/share/man/man1/rmiregistry.1"
241        file delete "${destroot}/${prefix}/share/man/man1/jv-convert.1"
242        file delete "${destroot}/${prefix}/share/man/man1/gij.1"
243       
244        # For some reason, some man pages are not prefixed while they should have been
245        # (to avoid conflicting).
246        crossgcc::rename_man_page 1 cpp
247        crossgcc::rename_man_page 1 gcjh
248        crossgcc::rename_man_page 1 gcov
249        crossgcc::rename_man_page 1 jcf-dump
250        crossgcc::rename_man_page 1 jv-scan
251       
252        # There is a bug in gcc/Makefile::install-driver
253        # For cross compilers, $(GCC_INSTALL_NAME) is equal to
254        # $(target_noncanonical)-gcc-$(version)
255        # and hence the driver isn't installed.
256        xinstall -c "${workpath}/build/gcc/xgcc" \
257                "${destroot}/${prefix}/bin/${crossgcc-target}-gcc-${version}"
258}
Note: See TracBrowser for help on using the repository browser.