source: trunk/dports/cross/arm-none-linux-gnueabi-binutils/Portfile @ 26970

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

Fix dependencies

File size: 4.3 KB
RevLine 
[26855]1# $Id: Portfile 24064 2007-04-16 02:46:32Z pguyot@kallisys.net $
2
3PortSystem                      1.0
4name                            arm-none-linux-gnueabi-binutils
5version                         2005q3-2
6
7# Parameters for this port.
8set crossgcc-target arm-none-linux-gnueabi
9
10description                     FSF Binutils for arm-none-linux-gnueabi cross development, with Code Sourcery patches (for Nokia Internet Tablet)
11long_description        Free Software Foundation development toolchain ("binutils") for \
12                                        arm-none-linux-gnueabi cross development (for Nokia Internet Tablet).
13platforms                       darwin
14categories                      cross devel
15maintainers                     pguyot@kallisys.net
16homepage                        http://www.codesourcery.com/gnu_toolchains/arm
17master_sites                    macports:pguyot
18distname                        binutils-${version}
19worksrcdir                      binutils-2.17pre
20use_bzip2                       yes
21checksums                       md5 4c68f4c9b5623ddd5289cb223fac0be2 \
22                                        sha1 051e49e4b3e1b752beddb628ea9d4c2b5ed8edda \
23                                        rmd160 39bd5f92476daed7f0292e98449e7cfdc7d0910f
24
[26970]25# We need msgfmt
26depends_build           bin:msgfmt:gettext
27
[26855]28# Download everything to binutils/
29dist_subdir                     binutils
30
31# Build in a different directory, as advised in the README file.
32pre-configure           { system "cd ${workpath} && mkdir -p build"}
33configure.dir           ${workpath}/build
34configure.cmd           ${worksrcpath}/configure
35configure.env           CC="cc -no-cpp-precomp"
36configure.args          --infodir='${prefix}/share/info' --target=${crossgcc-target} \
37                        --program-prefix=${crossgcc-target}- --mandir='${prefix}/share/man' --with-sysroots
38build.dir               ${workpath}/build
39                                       
40# We don't want the etc module.
41post-extract {
42        system "rm -rf ${worksrcpath}/etc"
43}
44
45patch {
46        namespace eval crossgcc {}
47
48        # Fix the info pages and related stuff.
49        #       
50        # path: path to the doc directory (e.g. gas/doc/)
51        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
52        # name: name of the info page (e.g. as)
53        # suffix: suffix of the souce page (texinfo or texi)
54        proc crossgcc::fixinfo { path makefile name suffix } {
55                global crossgcc-target worksrcpath
56
57                # Fix the source
58                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
59                        ${worksrcpath}/${path}/${name}.${suffix}
60                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
61                        ${worksrcpath}/${path}/${name}.${suffix}
62                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
63                        ${worksrcpath}/${path}/${name}.${suffix}
64               
65                # Fix the Makefile
66                reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
67                        ${worksrcpath}/${makefile}
68                reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
69                        ${worksrcpath}/${makefile}
70               
71                # Rename the source
72                file rename ${worksrcpath}/${path}/${name}.${suffix} \
73                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
74               
75                # Fix install-info's dir.
76                # (note: this may be effectless if there was no info dir to be fixed)
77                reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-dir|g" \
78                        "${worksrcpath}/${makefile}"
79        }
80
81        # Fix the gettext files and related stuff.
82        #       
83        # module: name of the module (e.g. gas)
84        proc crossgcc::fixgettext { module } {
85                global crossgcc-target worksrcpath
86
87                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
88                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
89                                "${worksrcpath}/${module}/Makefile.in"
90                }
91                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
92                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
93                                "${worksrcpath}/${module}/doc/Makefile.in"
94                }
95                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
96                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
97                                "${worksrcpath}/${module}/po/Make-in"
98                }
99        }
100
101        # gas/doc/as.texinfo
102        crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
103
104        # bfd/doc/bfd.texinfo
105        crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
106
107        # binutils/doc/binutils.texi
108        crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
109
110        # gprof/gprof.texi
111        crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
112
113        # ld/ld.texinfo
114        crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
115       
116        # gettext stuff.
117        crossgcc::fixgettext bfd
118        crossgcc::fixgettext binutils
119        crossgcc::fixgettext gas
120        crossgcc::fixgettext gprof
121        crossgcc::fixgettext ld
122        crossgcc::fixgettext opcodes
123}
124
125post-destroot {
126        # Installing (host) libiberty was a mistake.
127        file delete "${destroot}/${prefix}/lib/libiberty.a"
128}
129
130livecheck.check freshmeat
131livecheck.name  binutils
Note: See TracBrowser for help on using the repository browser.