forked from zihao-fan/homebrew-gcc_cross_compilers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathi386-elf-gcc.rb
40 lines (35 loc) · 1.39 KB
/
i386-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
38
39
40
require 'formula'
class I386ElfGcc < Formula
homepage 'http://gcc.gnu.org'
url 'http://ftpmirror.gnu.org/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2'
mirror 'http://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2'
sha256 '2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e'
revision 1
depends_on 'gmp'
depends_on 'libmpc'
depends_on 'mpfr'
depends_on 'i386-elf-binutils'
def install
binutils = Formulary.factory 'i386-elf-binutils'
ENV['CC'] = '/usr/local/bin/gcc-4.9'
ENV['CXX'] = '/usr/local/bin/g++-4.9'
ENV['CPP'] = '/usr/local/bin/cpp-4.9'
ENV['LD'] = '/usr/local/bin/gcc-4.9'
ENV['PATH'] += ":#{binutils.prefix/"bin"}"
mkdir 'build' do
system '../configure', '--disable-nls', '--target=i386-elf', '--disable-werror',
"--prefix=#{prefix}",
"--enable-languages=c",
"--without-headers",
"--with-gmp=#{Formula["gmp"].opt_prefix}",
"--with-mpfr=#{Formula["mpfr"].opt_prefix}",
"--with-mpc=#{Formula["libmpc"].opt_prefix}"
system 'make all-gcc'
system 'make install-gcc'
FileUtils.ln_sf binutils.prefix/"i386-elf", prefix/"i386-elf"
system 'make all-target-libgcc'
system 'make install-target-libgcc'
FileUtils.rm_rf share/"man"/"man7"
end
end
end