source: trunk/dports/cross/i386-elf-binutils/Portfile @ 52972

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

buildfix

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.4 KB
Line 
1# $Id: Portfile 52972 2009-06-26 20:01:18Z toby@macports.org $
2
3PortSystem                      1.0
4name                            i386-elf-binutils
5version                         2.18.50.0.9
6
7# Parameters for this port.
8set crossgcc-target i386-elf
9
10description                     FSF Binutils for i386-elf cross development
11long_description        Free Software Foundation development toolchain ("binutils") for \
12                                        i386-elf cross development.
13platforms                       darwin
14categories                      cross devel
15maintainers                     coresystems.de:stepan kallisys.net:pguyot openmaintainer
16homepage                        http://www.gnu.org/software/binutils/binutils.html
17master_sites            ftp://ftp.kernel.org/pub/linux/devel/binutils/ \
18                                        http://ftp.kernel.org/pub/linux/devel/binutils/
19distname                        binutils-${version}
20use_bzip2                       yes
21checksums                       md5     68e3510d9c790b134450c0a243c251cd \
22                                        sha1    369b21b07e06ec44005603acaa046b2ea69831bd \
23                                        rmd160  edbb31cfd6e0c1756618532064a46d03779bfadb
24
25depends_lib                     port:gettext
26
27# All cross ports violate the mtree layout.
28destroot.violate_mtree  yes
29
30# Download everything to binutils/
31dist_subdir                     binutils
32
33patchfiles                      patch-binutils__dwarf.c patch-gas__listing.c
34
35platform darwin 10 {
36        patchfiles-append       patch-binutils__strings.c
37}
38
39# Build in a different directory, as advised in the README file.
40pre-configure           { system "cd ${workpath} && mkdir -p build"}
41configure.dir           ${workpath}/build
42configure.cmd           ${worksrcpath}/configure
43configure.cc            "cc -no-cpp-precomp -I${prefix}/include"
44configure.args          --infodir='${prefix}/share/info' --target=${crossgcc-target} \
45                                        --program-prefix=${crossgcc-target}- --mandir='${prefix}/share/man'
46build.dir               ${workpath}/build
47                                       
48# We don't want the etc module.
49post-extract {
50        system "rm -rf ${worksrcpath}/etc"
51}
52
53post-patch {
54        namespace eval crossgcc {}
55
56        # Fix the info pages and related stuff.
57        #       
58        # path: path to the doc directory (e.g. gas/doc/)
59        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
60        # name: name of the info page (e.g. as)
61        # suffix: suffix of the souce page (texinfo or texi)
62        proc crossgcc::fixinfo { path makefile name suffix } {
63                global crossgcc-target worksrcpath
64
65                # Fix the source
66                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
67                        ${worksrcpath}/${path}/${name}.${suffix}
68                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
69                        ${worksrcpath}/${path}/${name}.${suffix}
70                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
71                        ${worksrcpath}/${path}/${name}.${suffix}
72               
73                # Fix the Makefile
74                reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
75                        ${worksrcpath}/${makefile}
76                reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
77                        ${worksrcpath}/${makefile}
78               
79                # Rename the source
80                file rename ${worksrcpath}/${path}/${name}.${suffix} \
81                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
82               
83                # Fix install-info's dir.
84                # (note: this may be effectless if there was no info dir to be fixed)
85                reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-dir|g" \
86                        "${worksrcpath}/${makefile}"
87        }
88
89        # Fix the gettext files and related stuff.
90        #       
91        # module: name of the module (e.g. gas)
92        proc crossgcc::fixgettext { module } {
93                global crossgcc-target worksrcpath
94
95                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
96                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
97                                "${worksrcpath}/${module}/Makefile.in"
98                }
99                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
100                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
101                                "${worksrcpath}/${module}/doc/Makefile.in"
102                }
103                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
104                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
105                                "${worksrcpath}/${module}/po/Make-in"
106                }
107        }
108
109        # gas/doc/as.texinfo
110        crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
111
112        # bfd/doc/bfd.texinfo
113        crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
114
115        # binutils/doc/binutils.texi
116        crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
117
118        # gprof/gprof.texi
119        crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
120
121        # ld/ld.texinfo
122        crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
123       
124        # gettext stuff.
125        crossgcc::fixgettext bfd
126        crossgcc::fixgettext binutils
127        crossgcc::fixgettext gas
128        crossgcc::fixgettext gprof
129        crossgcc::fixgettext ld
130        crossgcc::fixgettext opcodes
131}
132
133post-destroot {
134        # Installing (host) libiberty was a mistake.
135        file delete "${destroot}/${prefix}/lib/libiberty.a"
136}
137
138livecheck.check freshmeat
139livecheck.name  binutils
Note: See TracBrowser for help on using the repository browser.