This repository was archived by the owner on Sep 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathavr-binutils.rb
More file actions
63 lines (49 loc) · 1.6 KB
/
avr-binutils.rb
File metadata and controls
63 lines (49 loc) · 1.6 KB
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
62
63
require 'formula'
class AvrBinutils < Formula
url 'http://ftpmirror.gnu.org/binutils/binutils-2.23.1.tar.bz2'
mirror 'http://ftp.gnu.org/gun/binutils/binutils-2.23.1.tar.bz2'
homepage 'http://www.gnu.org/software/binutils/binutils.html'
#sha1 '587fca86f6c85949576f4536a90a3c76ffc1a3e1'
sha256 '2ab2e5b03e086d12c6295f831adad46b3e1410a3a234933a2e8fac66cb2e7a19'
option 'disable-libbfd', 'Disable installation of libbfd.'
def install
if MacOS.version == :lion
ENV['CC'] = ENV.cc
end
ENV['CPPFLAGS'] = "-I#{include}"
args = ["--prefix=#{prefix}",
"--infodir=#{info}",
"--mandir=#{man}",
"--disable-werror",
"--disable-nls",
"--disable-install-libiberty",
]
unless build.include? 'disable-libbfd'
Dir.chdir "bfd" do
ohai "building libbfd"
system "./configure", "--enable-install-libbfd", *args
system "make"
system "make install"
end
end
# brew's build environment is in our way
ENV.delete 'CFLAGS'
ENV.delete 'CXXFLAGS'
ENV.delete 'LD'
ENV.delete 'CC'
ENV.delete 'CXX'
if MacOS.version == :lion
ENV['CC'] = ENV.cc
end
system "./configure", "--target=avr", *args
system "make"
system "make install"
# Removes stupid libiberty.a
FileUtils.rm_rf prefix/"lib/x86_64"
end
def patches
# Support for -C in avr-size. See issue
# https://github.com/larsimmisch/homebrew-avr/issues/9
{ :p0 => "https://gist.github.com/larsimmisch/4190960/raw/b36f3d6d086980006f097ae0acc80b3ada7bb7b1/avr-binutils-size.patch" }
end
end