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

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

New port: cross/arm-none-linux-gnueabi-binutils (binutils for Nokia Internet Tablet 770/800)

File size: 4.2 KB
Line 
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
25# Download everything to binutils/
26dist_subdir                     binutils
27
28# Build in a different directory, as advised in the README file.
29pre-configure           { system "cd ${workpath} && mkdir -p build"}
30configure.dir           ${workpath}/build
31configure.cmd           ${worksrcpath}/configure
32configure.env           CC="cc -no-cpp-precomp"
33configure.args          --infodir='${prefix}/share/info' --target=${crossgcc-target} \
34                        --program-prefix=${crossgcc-target}- --mandir='${prefix}/share/man' --with-sysroots
35build.dir               ${workpath}/build
36                                       
37# We don't want the etc module.
38post-extract {
39        system "rm -rf ${worksrcpath}/etc"
40}
41
42patch {
43        namespace eval crossgcc {}
44
45        # Fix the info pages and related stuff.
46        #       
47        # path: path to the doc directory (e.g. gas/doc/)
48        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
49        # name: name of the info page (e.g. as)
50        # suffix: suffix of the souce page (texinfo or texi)
51        proc crossgcc::fixinfo { path makefile name suffix } {
52                global crossgcc-target worksrcpath
53
54                # Fix the source
55                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
56                        ${worksrcpath}/${path}/${name}.${suffix}
57                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
58                        ${worksrcpath}/${path}/${name}.${suffix}
59                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
60                        ${worksrcpath}/${path}/${name}.${suffix}
61               
62                # Fix the Makefile
63                reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
64                        ${worksrcpath}/${makefile}
65                reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
66                        ${worksrcpath}/${makefile}
67               
68                # Rename the source
69                file rename ${worksrcpath}/${path}/${name}.${suffix} \
70                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
71               
72                # Fix install-info's dir.
73                # (note: this may be effectless if there was no info dir to be fixed)
74                reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-dir|g" \
75                        "${worksrcpath}/${makefile}"
76        }
77
78        # Fix the gettext files and related stuff.
79        #       
80        # module: name of the module (e.g. gas)
81        proc crossgcc::fixgettext { module } {
82                global crossgcc-target worksrcpath
83
84                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
85                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
86                                "${worksrcpath}/${module}/Makefile.in"
87                }
88                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
89                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
90                                "${worksrcpath}/${module}/doc/Makefile.in"
91                }
92                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
93                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
94                                "${worksrcpath}/${module}/po/Make-in"
95                }
96        }
97
98        # gas/doc/as.texinfo
99        crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
100
101        # bfd/doc/bfd.texinfo
102        crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
103
104        # binutils/doc/binutils.texi
105        crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
106
107        # gprof/gprof.texi
108        crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
109
110        # ld/ld.texinfo
111        crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
112       
113        # gettext stuff.
114        crossgcc::fixgettext bfd
115        crossgcc::fixgettext binutils
116        crossgcc::fixgettext gas
117        crossgcc::fixgettext gprof
118        crossgcc::fixgettext ld
119        crossgcc::fixgettext opcodes
120}
121
122post-destroot {
123        # Installing (host) libiberty was a mistake.
124        file delete "${destroot}/${prefix}/lib/libiberty.a"
125}
126
127livecheck.check freshmeat
128livecheck.name  binutils
Note: See TracBrowser for help on using the repository browser.