source: trunk/dports/cross/i960-rtems-binutils/Portfile @ 72086

Last change on this file since 72086 was 72086, checked in by jmr@…, 9 years ago

cross ports: delete lib/$arch/libiberty.a as well as lib/libiberty.a

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