forked from tduehr/homebrew-msp430-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
msp430-gdb.rb
61 lines (49 loc) · 1.93 KB
/
msp430-gdb.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
require 'formula'
class Msp430Gdb < Formula
homepage 'http://mspgcc.sourceforge.net/'
url 'http://ftpmirror.gnu.org/gdb/gdb-7.2a.tar.bz2'
version '20111205'
sha256 '3c24dde332e33bfe2d5980c726d76224ebf8304278112a07bf701f8d2145d9bc'
head 'git://mspgcc.git.sourceforge.net/gitroot/mspgcc/gdb'
depends_on 'olafland/msp430/msp430mcu'
depends_on 'olafland/msp430/msp430-gcc'
depends_on 'olafland/msp430/msp430-binutils' => :build
# --enable-build-with-cxx build with C++ compiler instead of C compiler
option 'enable-build-with-cxx', 'build with C++ compiler instead of C compiler [untested]'
def patches
if !build.head?
{:p1 => 'http://sourceforge.net/projects/mspgcc/files/Patches/gdb-7.2a/msp430-gdb-7.2a-20111205.patch'}
end
end
def install
gmp = Formula.factory 'gmp'
mpfr = Formula.factory 'mpfr'
libmpc = Formula.factory 'libmpc'
args = [
"--target=msp430",
# Sandbox everything...
"--prefix=#{prefix}",
"--with-gmp=#{gmp.prefix}",
"--with-mpfr=#{mpfr.prefix}",
"--with-mpc=#{libmpc.prefix}",
# ...except the stuff in share...
# "--datarootdir=#{share}",
# ...and the binaries...
# "--bindir=#{bin}",
# This shouldn't be necessary
# "--with-as=/usr/local/bin/msp430-as"
]
args << '--enable-build-with-cxx' if build.include? 'enable-build-with-cxx'
mkdir 'build'
cd 'build' do
system '../configure', *args
system 'make'
system 'make install'
multios = `gcc --print-multi-os-dir`.chomp
# binutils already has a libiberty.a. We remove ours, because
# otherwise, the symlinking of the keg fails
ohai "checking...", HOMEBREW_PREFIX + 'lib' + multios + 'libiberty.a'
File.unlink "#{lib}/#{multios}/libiberty.a" if File.exist? HOMEBREW_PREFIX + 'lib' + multios + 'libiberty.a'
end
end
end