summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-12-21 07:19:51 -0500
committerColin Walters <walters@verbum.org>2010-12-21 07:19:51 -0500
commitbd24bc06e958cca88af7d6799478683ae25cb195 (patch)
treedab0666223e86d5aa467a5e18616ff3ef08347b1
parent9700ff720116cdb7de8d61acfb7ba22dfa413089 (diff)
downloadhomegit-MOVED-TO-GNOME-bd24bc06e958cca88af7d6799478683ae25cb195.zip
homegit-MOVED-TO-GNOME-bd24bc06e958cca88af7d6799478683ae25cb195.tar.gz
homegit-MOVED-TO-GNOME-bd24bc06e958cca88af7d6799478683ae25cb195.tar.xz
metabuild: Clean up default Make handling code
-rwxr-xr-xbin/metabuild34
1 files 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:")