summaryrefslogtreecommitdiff
path: root/homebrew/gccat6/.make.sh-auto
blob: 078772cc87abb78bcfefe27bbb6bd0037dcb330f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
pkg:setup
ENV.delete "LD"
languages = %w[c c++ objc obj-c++ fortran]
version_suffix = version.to_s.slice(/\d/)
ENV["gcc_cv_prog_makeinfo_modern"] = "no"
osmajor = `uname -r`.chomp
args = [
"--build=x86_64-apple-darwin#{osmajor}", "--prefix=#{prefix}", "--libdir=#{lib}/gcc/#{version_suffix}", "--enable-languages=#{languages.join(",")}", "--program-suffix=-#{version_suffix}", "--with-gmp=#{Formula["gmp"].opt_prefix}", "--with-mpfr=#{Formula["mpfr"].opt_prefix}", "--with-mpc=#{Formula["libmpc"].opt_prefix}", "--with-isl=#{Formula["isl"].opt_prefix}", "--with-system-zlib", "--enable-stage1-checking", "--enable-checking=release", "--enable-lto", "--with-build-config=bootstrap-debug", "--disable-werror", "--with-pkgversion=Homebrew GCC #{pkg_version} #{build.used_options*" "}".strip, "--with-bugurl=https://github.com/Homebrew/homebrew-core/issues", "--disable-nls", ]
args << "--disable-multilib" if DevelopmentTools.clang_build_version >= 1000
inreplace "libgcc/config/t-slibgcc-darwin", "@shlib_slibdir@", "#{HOMEBREW_PREFIX}/lib/gcc/#{version_suffix}"
mkdir "build" && cd build
if !MacOS::CLT.installed?
args << "--with-native-system-header-dir=/usr/include"
args << "--with-sysroot=#{MacOS.sdk_path}"
elsif MacOS.version >= :mojave
args << "--with-native-system-header-dir=/usr/include"
args << "--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
end
PKG_CONF=../configure pkg:configure *args
make bootstrap
make DESTDIR=${PKG_DEST} install