-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathavr-binutils.rb
55 lines (46 loc) · 1.41 KB
/
avr-binutils.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
require 'formula'
class AvrBinutils < Formula
homepage 'http://www.gnu.org/software/binutils/binutils.html'
url 'http://ftpmirror.gnu.org/binutils/binutils-2.24.tar.gz'
mirror 'http://ftp.gnu.org/gnu/binutils/binutils-2.24.tar.gz'
sha1 '1b2bc33003f4997d38fadaa276c1f0321329ec56'
option 'without-libbfd', 'Disable installation of libbfd.'
def install
if MacOS.version == :lion
ENV['CC'] = ENV.cc
end
args = %W[
--prefix=#{prefix}
--disable-debug
--disable-dependency-tracking
--target=avr
--disable-nls
]
if build.include? 'libbfd'
chdir "bfd" do
ohai "building libbfd"
system "./configure", "--enable-install-libbfd", *args
system "make"
system "make install"
end
end
if MacOS.version == :lion
ENV['CC'] = ENV.cc
end
mkdir "build" do
system "../configure", *args
system "make"
system "make install"
end
# taken from the gcc formula...
# Even when suffixes are appended, the info pages conflict when
# install-info is run. TODO fix this.
info.rmtree
end
patch :p0 do
# Support for -C in avr-size. See issue
# https://github.com/larsimmisch/homebrew-avr/issues/9
url "https://gist.github.com/larsimmisch/4190960/raw/b36f3d6d086980006f097ae0acc80b3ada7bb7b1/avr-binutils-size.patch"
sha1 "b6d1ff7084b1f0a3fd2dee5383019ffb202e6c9a"
end
end