source: trunk/dports/cross/m68k-rtems-binutils/Portfile @ 10673

Last change on this file since 10673 was 5459, checked in by pguyot (Paul Guyot), 16 years ago

Fixed man pages to share/man/

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