From bd24bc06e958cca88af7d6799478683ae25cb195 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 21 Dec 2010 07:19:51 -0500 Subject: metabuild: Clean up default Make handling code --- bin/metabuild | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/bin/metabuild b/bin/metabuild index fb816ba..c0cd08d 100755 --- a/bin/metabuild +++ b/bin/metabuild @@ -48,7 +48,6 @@ if os.uname()[0] == 'Linux': subprocess_nice_args = ['chrt', '--idle', '0'] + subprocess_nice_args default_make_parallel = ['-j', '%d' % (cpu_count() * 6, )] -user_specified_jobs = False configargs = ['--prefix=' + root, '--libdir=' + libdir] makeargs = ['make'] @@ -56,11 +55,7 @@ for arg in sys.argv[1:]: if arg.startswith('--'): configargs.append(arg) else: - if arg == '-j': - user_specified_jobs = True makeargs.append(arg) -if not user_specified_jobs: - makeargs.extend(default_make_parallel) loop = glib.MainLoop() @@ -264,16 +259,29 @@ def phase_configure(): build_status = False +def _phase_build_makefile(): + log("Detected Makefile, using it") + args = makeargs + user_specified_jobs = False + for arg in args: + if arg == '-j': + user_specified_jobs = True + + need_v1 = BuildSystemScanner.get_make_requires_v1() + if need_v1: + log("Detected AM_SILENT_RULES, overriding it with V=1") + args.append('V=1') + + if not user_specified_jobs: + log("No jobs specified; overriding to be default parallel") + args.extend(default_make_parallel) + + make = BuildProcess(args) + make.run_async(phase_complete) + def phase_build(): if os.path.exists('Makefile'): - log("Detected Makefile, using it") - need_v1 = BuildSystemScanner.get_make_requires_v1() - args = makeargs - if need_v1: - log("Detected AM_SILENT_RULES, overriding it with V=1") - args.append('V=1') - make = BuildProcess(makeargs) - make.run_async(phase_complete) + _phase_build_makefile() else: log("Couldn't find supported build system") log("Known systems:") -- cgit