Fixed SQLite build on Linux.
This commit is contained in:
@@ -9,7 +9,7 @@ _BUILT_STAMPFILE = '.spp_built'
|
||||
|
||||
Import('env')
|
||||
|
||||
def _autotools_project(env: Environment, project_root: str, config_args: 'list[str]' = [], build_args : 'list[str]' = [], install_args : 'list[str]' = [], configure_script_path: str = 'configure') -> dict:
|
||||
def _autotools_project(env: Environment, project_root: str, config_args: 'list[str]' = [], build_args : 'list[str]' = [], install_args : 'list[str]' = [], configure_script_path: str = 'configure', skip_steps = ()) -> dict:
|
||||
config = env['BUILD_TYPE']
|
||||
build_dir = os.path.join(project_root, f'build_{config}')
|
||||
install_dir = os.path.join(project_root, f'install_{config}')
|
||||
@@ -32,9 +32,15 @@ def _autotools_project(env: Environment, project_root: str, config_args: 'list[s
|
||||
if not os.path.exists(config_script) and os.path.exists(f'{config_script}.ac'):
|
||||
subprocess.run(('autoreconf', '--install', '--force'), cwd=project_root)
|
||||
|
||||
subprocess.run((config_script, f'--prefix={install_dir}', *config_args), cwd=build_dir, env=env, stdout=sys.stdout, stderr=sys.stderr, check=True)
|
||||
subprocess.run(('make', f'-j{jobs}', *build_args), cwd=build_dir, stdout=sys.stdout, stderr=sys.stderr, check=True)
|
||||
subprocess.run(('make', 'install', *install_args), cwd=build_dir, stdout=sys.stdout, stderr=sys.stderr, check=True)
|
||||
if 'configure' not in skip_steps:
|
||||
subprocess.run((config_script, f'--prefix={install_dir}', *config_args), cwd=build_dir, env=env, stdout=sys.stdout, stderr=sys.stderr, check=True)
|
||||
if 'build' not in skip_steps:
|
||||
subprocess.run(('make', f'-j{jobs}', *build_args), cwd=build_dir, stdout=sys.stdout, stderr=sys.stderr, check=True)
|
||||
if 'install' not in skip_steps:
|
||||
subprocess.run(('make', 'install', *install_args), cwd=build_dir, stdout=sys.stdout, stderr=sys.stderr, check=True)
|
||||
else:
|
||||
# must still create the install dir for the stamp file
|
||||
os.makedirs(install_dir, exist_ok=True)
|
||||
pathlib.Path(install_dir, _BUILT_STAMPFILE).touch()
|
||||
|
||||
libpath = []
|
||||
@@ -44,6 +50,7 @@ def _autotools_project(env: Environment, project_root: str, config_args: 'list[s
|
||||
libpath.append(full_path)
|
||||
|
||||
return {
|
||||
'build_dir': build_dir,
|
||||
'install_dir': install_dir,
|
||||
'LIBPATH': libpath,
|
||||
'CPPPATH': [os.path.join(install_dir, 'include')]
|
||||
|
||||
Reference in New Issue
Block a user