source: trunk/dports/cross/sh-rtems-binutils/Portfile @ 24073

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

cross/sh-rtems-binutils: update to 2.17, add livecheck

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