forked from jaredjones/homebrew-gcc_cross_compilers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
arm-elf-gcc.rb
36 lines (31 loc) · 1.14 KB
/
arm-elf-gcc.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
require 'formula'
class ArmElfGcc < Formula
homepage 'http://gcc.gnu.org'
url 'http://ftpmirror.gnu.org/gcc/gcc-4.8.0/gcc-4.8.0.tar.bz2'
mirror 'http://ftp.gnu.org/gnu/gcc/gcc-4.8.0/gcc-4.8.0.tar.bz2'
sha1 'b4ee6e9bdebc65223f95067d0cc1a634b59dad72'
depends_on 'gmp'
depends_on 'libmpc'
depends_on 'mpfr'
depends_on 'arm-elf-binutils'
def install
binutils = Formula.factory 'arm-elf-binutils'
ENV['CC'] = '/usr/local/bin/gcc-4.2'
ENV['CXX'] = '/usr/local/bin/g++-4.2'
ENV['CPP'] = '/usr/local/bin/cpp-4.2'
ENV['LD'] = '/usr/local/bin/gcc-4.2'
ENV['PATH'] += ":#{binutils.prefix/"bin"}"
mkdir 'build' do
system '../configure', '--disable-nls', '--target=arm-elf-eabi', '--disable-werror',
"--prefix=#{prefix}",
"--enable-languages=c",
"--without-headers"
system 'make all-gcc'
system 'make install-gcc'
FileUtils.ln_sf binutils.prefix/"arm-elf-eabi", prefix/"arm-elf-eabi"
system 'make all-target-libgcc'
system 'make install-target-libgcc'
FileUtils.rm_rf share/"man"/"man7"
end
end
end