source: trunk/dports/cross/m68k-elf-binutils/Portfile @ 6122

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

New port: x-mips-elf and x-m68k-elf with newlib runtime.
You will need your own crt0.o.

Requested by Michel Lynch.

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