25
25
print 'Python 2.6 or above is required. Quit now.'
26
26
sys .exit (1 )
27
27
28
+ import multiprocessing
28
29
import os
29
30
import glob
30
31
import shutil
@@ -260,14 +261,17 @@ def build(self):
260
261
def get_make_path ():
261
262
return find_in_path ('make.exe' )
262
263
264
+ def concurrent_make ():
265
+ return '%s -j%s' % (get_make_path (), multiprocessing .cpu_count ())
266
+
263
267
class Libsearpc (Project ):
264
268
name = 'libsearpc'
265
269
266
270
def __init__ (self ):
267
271
Project .__init__ (self )
268
272
self .build_commands = [
269
273
'sh ./configure --prefix=%s --disable-compile-demo' % to_mingw_path (self .prefix ),
270
- get_make_path (),
274
+ concurrent_make (),
271
275
'%s install' % get_make_path (),
272
276
]
273
277
@@ -281,7 +285,7 @@ def __init__(self):
281
285
Project .__init__ (self )
282
286
self .build_commands = [
283
287
'sh ./configure --prefix=%s --disable-compile-demo' % to_mingw_path (self .prefix ),
284
- get_make_path (),
288
+ concurrent_make (),
285
289
'%s install' % get_make_path (),
286
290
]
287
291
@@ -305,7 +309,7 @@ def __init__(self):
305
309
enable_breakpad = ''
306
310
self .build_commands = [
307
311
'sh ./configure %s --prefix=%s' % (enable_breakpad , to_mingw_path (self .prefix )),
308
- get_make_path (),
312
+ concurrent_make (),
309
313
'%s install' % get_make_path (),
310
314
]
311
315
@@ -334,7 +338,7 @@ def __init__(self):
334
338
'CMAKE_EXE_LINKER_FLAGS_RELEASE' : '-L%s' % (os .path .join (seafile_prefix , 'lib' ) if ninja else to_mingw_path (os .path .join (seafile_prefix , 'lib' ))),
335
339
}
336
340
flags = ' ' .join (['-D%s=%s' % (k , v ) for k , v in flags .iteritems ()])
337
- make = ninja or get_make_path ()
341
+ make = ninja or concurrent_make ()
338
342
self .build_commands = [
339
343
'cmake -G "%s" %s -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%s .' % (generator , flags , to_mingw_path (self .prefix )),
340
344
make ,
0 commit comments