source: trunk/dports/cross/arm-none-eabi-gdb/Portfile @ 89695

Last change on this file since 89695 was 89695, checked in by ryandesign@…, 5 years ago

arm-none-eabi-gdb: add cross primary category; see #33170

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 89695 2012-02-07 02:01:16Z ryandesign@macports.org $
3
4PortSystem      1.0
5
6name            arm-none-eabi-gdb
7version         7.3
8categories      cross devel
9platforms       darwin
10license         GPL-3+
11maintainers     nomaintainer
12description     GDB: The GNU Project Debugger for arm-none-eabi
13
14long_description \
15GDB, the GNU Project Debugger, for arm-none-eabi cross development.
16
17homepage        http://www.gnu.org/software/gdb/
18master_sites    gnu
19distname        gdb-${version}
20dist_subdir     gdb
21use_bzip2       yes
22
23checksums       sha1    fefd90275d6decdca00c5c29c533e2ef3d439664 \
24                rmd160  3df9a15e2d276f4f7f30e5d2a7d86a8c63f30a34
25
26set crossgdb-target     arm-none-eabi
27
28if {${configure.compiler} == "clang"} {
29    configure.compiler llvm-gcc-4.2
30}
31
32if {${configure.build_arch} == "ppc" || ${configure.build_arch} == "ppc64"} {
33    notes "${name} does not support building on ${configure.build_arch}."
34    pre-fetch {
35        ui_error "${name} does not support building on ${configure.build_arch}."
36        return -code error "Unsupported architecture."
37    }
38}
39
40depends_build   port:${crossgdb-target}-gcc \
41                port:gettext
42
43post-patch {
44        namespace eval crossgdb {}
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 source page (texinfo or texi)
52        proc crossgdb::fixinfo { path makefile name suffix } {
53                global crossgdb-target workpath version
54
55                # Fix the source
56                reinplace "s|setfilename ${name}.info|setfilename ${crossgdb-target}-${name}.info|g" \
57                        ${workpath}/gdb-${version}/${path}/${name}.${suffix}
58                reinplace "s|(${name})|(${crossgdb-target}-${name})|g" \
59                        ${workpath}/gdb-${version}/${path}/${name}.${suffix}
60                reinplace "s|@file{${name}}|@file{${crossgdb-target}-${name}}|g" \
61                        ${workpath}/gdb-${version}/${path}/${name}.${suffix}
62
63                # Fix the Makefile
64                reinplace -E "s:^${name}\\.(info|pod|${suffix}):${crossgdb-target}-${name}.\\1:g" \
65                        ${workpath}/gdb-${version}/${makefile}
66                reinplace -E "s:(\[ /'`\])${name}\\.(info|pod|${suffix}):\\1${crossgdb-target}-${name}.\\2:g" \
67                        ${workpath}/gdb-${version}/${makefile}
68
69                # Rename the source
70                file rename ${workpath}/gdb-${version}/${path}/${name}.${suffix} \
71                        ${workpath}/gdb-${version}/${path}/${crossgdb-target}-${name}.${suffix}
72
73                reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgdb-target}-gdb-dir|g" \
74                        ${workpath}/gdb-${version}/${makefile}
75        }
76
77        crossgdb::fixinfo bfd/doc/ bfd/doc/Makefile.in bfd texinfo
78        crossgdb::fixinfo etc/ etc/Makefile.in configure texi
79        crossgdb::fixinfo etc/ etc/Makefile.in standards texi
80        crossgdb::fixinfo gdb/doc/ gdb/doc/Makefile.in annotate texinfo
81        crossgdb::fixinfo gdb/doc/ gdb/doc/Makefile.in gdb texinfo
82        crossgdb::fixinfo gdb/doc/ gdb/doc/Makefile.in gdbint texinfo
83        crossgdb::fixinfo gdb/doc/ gdb/doc/Makefile.in stabs texinfo
84}
85
86configure.args  --target=${crossgdb-target} \
87                --infodir=${prefix}/share/info \
88                --mandir=${prefix}/share/man \
89                --with-docdir=${prefix}/share/doc \
90                --with-gdb-datadir=${prefix}/share/${name} \
91                --disable-nls \
92                --enable-multilib
93
94# specific to ARM
95configure.args-append \
96                --enable-interwork
97
98post-destroot {
99        # (host) libiberty
100        file delete "${destroot}${prefix}/lib/${build_arch}/libiberty.a"
101
102        # avoid conflicts with arm-none-eabi-binutils port
103        file delete ${destroot}${prefix}/share/info/arm-none-eabi-bfd.info
104}
105
106livecheck.type  regex
107livecheck.url   http://ftp.gnu.org/gnu/gdb/
108livecheck.regex gdb-(\\d+(?:\\.\\d+)+)\\.tar
Note: See TracBrowser for help on using the repository browser.