source: trunk/dports/cross/i386-mingw32-gcc/Portfile

Last change on this file was 142698, checked in by landonf@…, 22 months ago

Drop maintainership of (almost) all my ports, as I'm no longer using Mac OS X as my desktop OS.

The dict port here dates back to ~2002; it was the first port used as a test case when we were developing MacPorts.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.6 KB
Line 
1# $Id: Portfile 142698 2015-11-20 16:55:09Z ryandesign@macports.org $
2PortSystem                      1.0
3
4name                    i386-mingw32-gcc
5version                 3.4.5-20060117-2
6revision                1
7set gnu_version         3.4.5
8maintainers             nomaintainer
9description             Mingw32 cross-compiler for i386-Win32
10long_description        Mingw32 GNU Compiler for i386-Win32. \
11                        Supports C, C++, Objective-C and Java.
12homepage                http://www.mingw.org
13platforms               darwin
14categories              cross devel
15
16# Parameters for this port.
17set crossgcc-target i386-mingw32
18
19master_sites            sourceforge:mingw
20distfiles               gcc-core-${version}-src.tar.gz \
21                        gcc-g%2B%2B-${version}-src.tar.gz \
22                        gcc-g77-${version}-src.tar.gz \
23                        gcc-java-${version}-src.tar.gz \
24                        gcc-objc-${version}-src.tar.gz
25
26checksums               gcc-core-${version}-src.tar.gz \
27                                md5     d0dc9d57d493889bc1ca88b127290b9d \
28                                sha1    75d59049f26dc62f3732d11abbf056efc7bc8e95 \
29                                rmd160  624dd55ac00fba15269f1b3b3bbd6c383cc20827 \
30                        gcc-g%2B%2B-${version}-src.tar.gz \
31                                md5     ca81c8420ab9d1d05ff9c73a9d4f7d63 \
32                                sha1    edafa412d86085cf39f0db1c19a6ea2890d05946 \
33                                rmd160  7e3341c6ef1494462dfd3f682ad4cc6871b73e98 \
34                        gcc-g77-${version}-src.tar.gz \
35                                md5     57d489658743f0d9048e440b312740c8 \
36                                sha1    156baeb2bd0dbbd15ed397b0a609e7e7cdbdab4b \
37                                rmd160  3c0ac52b0c18712a29219803c95399dfce53e461 \
38                        gcc-java-${version}-src.tar.gz \
39                                md5     96b039f4e11bff4d3d8a4e7da6e3998d \
40                                sha1    a9152dd7ffa35fc028fcca369a729ec2bbad55e7 \
41                                rmd160  4971ce8ffa01292567f36983101d4b99901da50d \
42                        gcc-objc-${version}-src.tar.gz \
43                                md5     2bffc1e314f2efb1034b3d3ea1ce2f7d \
44                                sha1    c96f1531d9d73e9279e0b6faf085deec5c2bda7b \
45                                rmd160  a02ad94da674760799ec945c7ff75ed99f9e8c3a
46worksrcdir              gcc-${version}
47
48# Patches for infodir
49patchfiles              patch-gcc-Makefile.in \
50                        patch-fastjar-Makefile.in
51
52depends_lib             port:i386-mingw32-w32api \
53                        port:i386-mingw32-runtime \
54                        port:i386-mingw32-binutils \
55                        port:gettext
56
57# segfault when built with llvm on lion: #30349
58compiler.blacklist *llvm-gcc-4.2 *clang*
59
60# Build in a different directory, as advised in the README file.
61pre-configure   { system "cd ${workpath} && mkdir -p build" }
62configure.dir   ${workpath}/build
63configure.cmd   ${workpath}/gcc-${version}/configure
64configure.args  --infodir='${prefix}/share/info' \
65                --mandir='${prefix}/share/man' \
66                --target=${crossgcc-target} \
67                --without-newlib \
68                --disable-nls \
69                --with-gnu-as \
70                --with-gnu-ld \
71                --disable-multilib \
72                --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${gnu_version}/ \
73                --enable-sjlj-exceptions
74if {${build_arch} ne ""} {
75    configure.cc_archflags
76    configure.cxx_archflags
77    configure.objc_archflags
78    if {${os.platform} eq "darwin"} {
79        configure.args-append --build=${build_arch}-apple-darwin${os.major} \
80                              --host=${build_arch}-apple-darwin${os.major}
81    }
82}
83
84build.dir       ${workpath}/build
85
86post-patch {
87        namespace eval crossgcc {}
88
89        # Fix the info pages and related stuff.
90        #       
91        # path: path to the doc directory (e.g. gas/doc/)
92        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
93        # name: name of the info page (e.g. as)
94        # suffix: suffix of the souce page (texinfo or texi)
95        proc crossgcc::fixinfo { path makefile name suffix } {
96                global crossgcc-target worksrcpath
97
98                # Fix the source
99                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
100                        ${worksrcpath}/${path}/${name}.${suffix}
101                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
102                        ${worksrcpath}/${path}/${name}.${suffix}
103                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
104                        ${worksrcpath}/${path}/${name}.${suffix}
105               
106                # Fix the Makefile
107                reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
108                        ${worksrcpath}/${makefile}
109                reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
110                        ${worksrcpath}/${makefile}
111               
112                # Rename the source
113                file rename ${worksrcpath}/${path}/${name}.${suffix} \
114                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
115               
116                # Fix install-info's dir.
117                # (note: this may be effectless if there was no info dir to be fixed)
118                reinplace "s|__TARGET|${crossgcc-target}|g" \
119                        "${worksrcpath}/${makefile}"
120        }
121
122        # Fix the gettext files and related stuff.
123        #       
124        # module: name of the module (e.g. gas)
125        proc crossgcc::fixgettext { module } {
126                global crossgcc-target worksrcpath
127
128                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
129                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
130                                "${worksrcpath}/${module}/Makefile.in"
131                }
132                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
133                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
134                                "${worksrcpath}/${module}/doc/Makefile.in"
135                }
136                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
137                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
138                                "${worksrcpath}/${module}/po/Make-in"
139                }
140        }
141
142        # gcc/doc/cpp.texi
143        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cpp texi
144
145        # gcc/doc/cppinternals.texi
146        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cppinternals texi
147
148        # gcc/doc/gcc.texi
149        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gcc texi
150        # XXX: Gross hack
151        # Clean up the mess in gcc/Makefile.in
152        reinplace s|lib${crossgcc-target}-gcc.texi|libgcc.texi|g ${worksrcpath}/gcc/Makefile.in
153
154        # gcc/doc/gccint.texi
155        crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccint texi
156
157        # gcc/f/g77.texi
158        crossgcc::fixinfo gcc/f/ gcc/f/Make-lang.in g77 texi
159
160        # gcc/java/gcj.texi
161        crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi
162
163        # fastjar/fastjar.texi
164        crossgcc::fixinfo fastjar/ fastjar/Makefile.in fastjar texi
165       
166        # gettext stuff.
167        crossgcc::fixgettext gcc
168        crossgcc::fixgettext fastjar
169
170}
171
172destroot.violate_mtree  yes
173post-destroot {
174        # Stuff I don't want (either because they're in the system
175        # or because they would conflict with other FSF ports)
176        # (it's easier for maintainability purposes to fix things here)
177
178        # aliases for locales (should be on the system)
179        file delete "${destroot}${prefix}/share/locale/locale.alias"
180       
181        # FSF propaganda (should already be there or would conflict)
182        file delete -force "${destroot}${prefix}/share/man/man7"
183
184        # (host) libiberty
185        foreach f [glob -directory "${destroot}${prefix}/lib" libiberty.a */libiberty.a] {
186        file delete $f
187    }
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        # There is no need for documentation on installing gcc
199        # given that this port just installed gcc.
200        file delete "${destroot}${prefix}/share/info/gccinstall.info"
201}
Note: See TracBrowser for help on using the repository browser.