source: trunk/dports/cross/arm-rtems-binutils/Portfile @ 5235

Last change on this file since 5235 was 5235, checked in by pguyot (Paul Guyot), 17 years ago

binutils for RTEMS cross targets available in FreeBSD ports.
We're lacking:
# c4x - Texas Instruments C3x and C4x DSPs
# h8300 - Hitachi H8 family
# hppa1.1 - Hewlett-Packard PA-RISC
# or32 - OpenCores OpenRisc32 CPU

They could easily be added, RTEMS is an easy runtime since we just build
with newlib, so it's just a matter of testing them first.

I'll add *-gcc ports once I'll have made sure they compile fine.

  • Property svn:eol-style set to native
File size: 4.2 KB
Line 
1# $Id: Portfile,v 1.1 2004/02/06 05:57:31 pguyot Exp $
2
3PortSystem                      1.0
4name                            arm-rtems-binutils
5version                         2.14
6
7# Parameters for this port.
8set crossgcc-target arm-rtems
9
10description                     FSF Binutils for arm-rtems cross development
11long_description        Free Software Foundation development toolchain ("binutils") for \
12                                        arm-rtems cross development (ARM v7 and above).
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 2da8def15d28af3ec6af0982709ae90a
21
22# Download everything to binutils/
23dist_subdir                     binutils
24
25# Build in a different directory, as advised in the README file.
26pre-configure           { system "cd ${workpath} && mkdir -p build"}
27configure.dir           ${workpath}/build
28configure.cmd           ${worksrcpath}/configure
29configure.env           CC="cc -no-cpp-precomp"
30configure.args          --infodir='${prefix}/share/info' --target=${crossgcc-target} \
31                                        --program-prefix=${crossgcc-target}-
32build.dir               ${workpath}/build
33
34# Patches to make sure that message files are destrooted and to use
35# ${crossgcc-target}-dir as the info-dir
36patchfiles                      patch-bfd-po-Make-in \
37                                        patch-binutils-po-Make-in \
38                                        patch-gas-po-Make-in \
39                                        patch-gprof-po-Make-in \
40                                        patch-ld-po-Make-in \
41                                        patch-opcodes-po-Make-in \
42                                        patch-bfd-doc-Makefile.in \
43                                        patch-binutils-doc-Makefile.in \
44                                        patch-gas-doc-Makefile.in \
45                                        patch-ld-Makefile.in
46
47# We don't want the etc module.
48post-extract {
49        system "rm -rf ${worksrcpath}/etc"
50}
51
52post-patch {
53        namespace eval crossgcc {}
54
55        # Fix the info pages and related stuff.
56        #       
57        # path: path to the doc directory (e.g. gas/doc/)
58        # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
59        # name: name of the info page (e.g. as)
60        # suffix: suffix of the souce page (texinfo or texi)
61        proc crossgcc::fixinfo { path makefile name suffix } {
62                global crossgcc-target worksrcpath
63
64                # Fix the source
65                reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
66                        ${worksrcpath}/${path}/${name}.${suffix}
67                reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
68                        ${worksrcpath}/${path}/${name}.${suffix}
69                reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
70                        ${worksrcpath}/${path}/${name}.${suffix}
71               
72                # Fix the Makefile
73                reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
74                        ${worksrcpath}/${makefile}
75                reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
76                        ${worksrcpath}/${makefile}
77               
78                # Rename the source
79                file rename ${worksrcpath}/${path}/${name}.${suffix} \
80                        ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
81               
82                # Fix install-info's dir.
83                # (note: this may be effectless if there was no info dir to be fixed)
84                reinplace "s|__TARGET|${crossgcc-target}|g" \
85                        "${worksrcpath}/${makefile}"
86        }
87
88        # Fix the gettext files and related stuff.
89        #       
90        # module: name of the module (e.g. gas)
91        proc crossgcc::fixgettext { module } {
92                global crossgcc-target worksrcpath
93
94                if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
95                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
96                                "${worksrcpath}/${module}/Makefile.in"
97                }
98                if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
99                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
100                                "${worksrcpath}/${module}/doc/Makefile.in"
101                }
102                if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
103                        reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \
104                                "${worksrcpath}/${module}/po/Make-in"
105                }
106        }
107
108        # gas/doc/as.texinfo
109        crossgcc::fixinfo gas/doc/ gas/doc/Makefile.in as texinfo
110
111        # bfd/doc/bfd.texinfo
112        crossgcc::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
113
114        # binutils/doc/binutils.texi
115        crossgcc::fixinfo binutils/doc/ binutils/doc/Makefile.in binutils texi
116
117        # gprof/gprof.texi
118        crossgcc::fixinfo gprof/ gprof/Makefile.in gprof texi
119
120        # ld/ld.texinfo
121        crossgcc::fixinfo ld/ ld/Makefile.in ld texinfo
122       
123        # gettext stuff.
124        crossgcc::fixgettext bfd
125        crossgcc::fixgettext binutils
126        crossgcc::fixgettext gas
127        crossgcc::fixgettext gprof
128        crossgcc::fixgettext ld
129        crossgcc::fixgettext opcodes
130}
131
132post-destroot {
133        # Installing (host) libiberty was a mistake.
134        file delete "${destroot}/${prefix}/lib/libiberty.a"
135}
Note: See TracBrowser for help on using the repository browser.