forked from jaredjones/homebrew-gcc_cross_compilers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
i586-elf-gcc.rb
37 lines (32 loc) · 1.16 KB
/
i586-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
37
require 'formula'
class I586ElfGcc < 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 'i586-elf-binutils'
def install
binutils = Formula.factory 'i586-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=i586-elf',
'--disable-werror',
"--prefix=#{prefix}",
"--enable-languages=c",
"--without-headers"
system 'make all-gcc'
system 'make install-gcc'
FileUtils.ln_sf binutils.prefix/"i586-elf", prefix/"i586-elf"
system 'make all-target-libgcc'
system 'make install-target-libgcc'
FileUtils.rm_rf share/"man"/"man7"
end
end
end