mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-29 15:11:58 +00:00
build script: add platform support to configure+make target
This commit is contained in:
parent
23456eaaf7
commit
ed46fee736
1 changed files with 25 additions and 11 deletions
34
build.py
34
build.py
|
@ -26,6 +26,7 @@ if sys.hexversion < 0x3070000:
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import collections
|
import collections
|
||||||
|
import copy
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -273,8 +274,6 @@ class ConfigureMakeTarget(Target):
|
||||||
|
|
||||||
def initialize(self, builder: 'Builder'):
|
def initialize(self, builder: 'Builder'):
|
||||||
super().initialize(builder)
|
super().initialize(builder)
|
||||||
self.options['--prefix'] = self.prefix
|
|
||||||
|
|
||||||
self.make.initialize(builder)
|
self.make.initialize(builder)
|
||||||
|
|
||||||
def configure(self, builder: 'Builder'):
|
def configure(self, builder: 'Builder'):
|
||||||
|
@ -284,17 +283,32 @@ class ConfigureMakeTarget(Target):
|
||||||
work_path = builder.build_path + self.src_root
|
work_path = builder.build_path + self.src_root
|
||||||
configure_path = work_path + os.sep + 'configure'
|
configure_path = work_path + os.sep + 'configure'
|
||||||
|
|
||||||
args = [configure_path]
|
common_args = [
|
||||||
args += self.options.to_list()
|
configure_path,
|
||||||
|
'--prefix=' + self.prefix,
|
||||||
|
]
|
||||||
|
common_args += self.options.to_list()
|
||||||
|
|
||||||
# Detect dependency tracking support, and disable it
|
disable_dependency_tracking = '--disable-dependency-tracking'
|
||||||
with open(configure_path) as f:
|
host = '--host=' + builder.host()
|
||||||
for line in f.readlines():
|
|
||||||
if 'dependency_tracking' in line:
|
|
||||||
args.append('--disable-dependency-tracking')
|
|
||||||
break
|
|
||||||
|
|
||||||
|
args = copy.copy(common_args)
|
||||||
|
args.append(host)
|
||||||
|
args.append(disable_dependency_tracking)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Try with host and disabled dependency tracking first
|
||||||
subprocess.check_call(args, cwd=work_path, env=self.environment)
|
subprocess.check_call(args, cwd=work_path, env=self.environment)
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
# If it fails, try with disabled dependency tracking only
|
||||||
|
args = copy.copy(common_args)
|
||||||
|
args.append(disable_dependency_tracking)
|
||||||
|
|
||||||
|
try:
|
||||||
|
subprocess.check_call(args, cwd=work_path, env=self.environment)
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
# Use only common command line arguments
|
||||||
|
subprocess.check_call(common_args, cwd=work_path, env=self.environment)
|
||||||
|
|
||||||
def build(self, builder: 'Builder'):
|
def build(self, builder: 'Builder'):
|
||||||
assert not builder.xcode
|
assert not builder.xcode
|
||||||
|
|
Loading…
Reference in a new issue