forked from sevki/homebrew-gcc_cross_compilers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
x64-elf-gcc.rb
36 lines (31 loc) · 1.12 KB
/
x64-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 X64ElfGcc < 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 'x64-elf-binutils'
def install
binutils = Formula.factory 'x64-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=x86_64-elf',
"--prefix=#{prefix}",
"--enable-languages=c",
"--without-headers"
system 'make all-gcc'
system 'make install-gcc'
FileUtils.ln_sf binutils.prefix/"x86_64-elf", prefix/"x86_64-elf"
system 'make all-target-libgcc'
system 'make install-target-libgcc'
FileUtils.rm_rf share/"man"/"man7"
end
end
end