Update the build for MacOS 15
This commit is contained in:
@@ -16,7 +16,7 @@ def gcc_verbose(gcc_binary)
|
|||||||
output
|
output
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_build_target(gcc_version)
|
def find_build_target
|
||||||
gcc_verbose('gcc')
|
gcc_verbose('gcc')
|
||||||
.lines
|
.lines
|
||||||
.find { |line| line.start_with? 'Target: ' }
|
.find { |line| line.start_with? 'Target: ' }
|
||||||
@@ -61,6 +61,7 @@ namespace :boot do
|
|||||||
# Dependencies.
|
# Dependencies.
|
||||||
GCC_VERSION = "15.1.0"
|
GCC_VERSION = "15.1.0"
|
||||||
HOST_GCC = TMP + 'host/gcc'
|
HOST_GCC = TMP + 'host/gcc'
|
||||||
|
GCC_PATCH = 'https://raw.githubusercontent.com/Homebrew/formula-patches/575ffcaed6d3112916fed77d271dd3799a7255c4/gcc/gcc-15.1.0.diff'
|
||||||
|
|
||||||
directory HOST_GCC
|
directory HOST_GCC
|
||||||
directory(TMP + 'tools')
|
directory(TMP + 'tools')
|
||||||
@@ -68,30 +69,32 @@ namespace :boot do
|
|||||||
desc 'Download and configure the bootstrap compiler'
|
desc 'Download and configure the bootstrap compiler'
|
||||||
task configure: [TMP + 'tools', HOST_GCC, HOST_INSTALL] do
|
task configure: [TMP + 'tools', HOST_GCC, HOST_INSTALL] do
|
||||||
url = URI.parse "https://gcc.gnu.org/pub/gcc/releases/gcc-#{GCC_VERSION}/gcc-#{GCC_VERSION}.tar.xz"
|
url = URI.parse "https://gcc.gnu.org/pub/gcc/releases/gcc-#{GCC_VERSION}/gcc-#{GCC_VERSION}.tar.xz"
|
||||||
build_target = find_build_target GCC_VERSION
|
build_target = find_build_target
|
||||||
source_directory = TMP + "tools/gcc-#{GCC_VERSION}"
|
source_directory = TMP + "tools/gcc-#{GCC_VERSION}"
|
||||||
frontend_link = source_directory + 'gcc'
|
frontend_link = source_directory + 'gcc'
|
||||||
|
|
||||||
download_and_pipe url, source_directory.dirname, ['tar', '-Jxv']
|
download_and_pipe url, source_directory.dirname, ['tar', '-Jxv']
|
||||||
|
download_and_pipe URI.parse(GCC_PATCH), source_directory, ['patch', '-p1']
|
||||||
|
|
||||||
sh 'contrib/download_prerequisites', chdir: source_directory.to_path
|
sh 'contrib/download_prerequisites', chdir: source_directory.to_path
|
||||||
File.symlink Pathname.new('.').relative_path_from(frontend_link), (frontend_link + 'elna')
|
File.symlink Pathname.new('.').relative_path_from(frontend_link), (frontend_link + 'elna')
|
||||||
|
|
||||||
configure_options = [
|
configure_options = [
|
||||||
"--prefix=#{HOST_INSTALL.realpath}",
|
"--prefix=#{HOST_INSTALL.realpath}",
|
||||||
'--with-sysroot=/',
|
'--enable-languages=c,c++,elna',
|
||||||
'--enable-languages=c,c++,m2,elna',
|
|
||||||
'--disable-bootstrap',
|
'--disable-bootstrap',
|
||||||
'--disable-multilib',
|
'--disable-multilib',
|
||||||
|
'--with-system-zlib',
|
||||||
"--target=#{build_target}",
|
"--target=#{build_target}",
|
||||||
"--build=#{build_target}",
|
"--build=#{build_target}",
|
||||||
"--host=#{build_target}"
|
"--host=#{build_target}"
|
||||||
]
|
]
|
||||||
flags = '-O0 -g -fPIC'
|
if File.symlink? '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
|
||||||
env = {
|
configure_options << '--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
|
||||||
'CFLAGS' => flags,
|
end
|
||||||
'CXXFLAGS' => flags,
|
env = ENV.slice 'CC', 'CXX'
|
||||||
}
|
env['CFLAGS'] = env['CXXFLAGS'] = '-O0 -g -fPIC -I/opt/homebrew/opt/flex/include'
|
||||||
|
|
||||||
configure = source_directory.relative_path_from(HOST_GCC) + 'configure'
|
configure = source_directory.relative_path_from(HOST_GCC) + 'configure'
|
||||||
sh env, configure.to_path, *configure_options, chdir: HOST_GCC
|
sh env, configure.to_path, *configure_options, chdir: HOST_GCC
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user