aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-05-30 08:30:30 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-05-30 08:30:30 -0700
commit70f2d8aba7cb8f5c4bb1e7084eefcab5c9c832d3 (patch)
tree2f7b8cbfdb8d38fff7f0d6fe5b852e36ff538bfa /tools/shared.py
parent731ae9d12985230ea05bf174c22771f52d453332 (diff)
try make twice, fixes some projects like poppler on ubuntu 12.04
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 85d89010..c8998b5a 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -510,13 +510,18 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e
if configure: # Useful in debugging sometimes to comment this out (and the lines below up to and including the |link| call)
Building.configure(configure + configure_args, stdout=open(os.path.join(project_dir, 'configure_'), 'w'),
stderr=open(os.path.join(project_dir, 'configure_err'), 'w'), env=env)
- Building.make(make + make_args, stdout=open(os.path.join(project_dir, 'make_'), 'w'),
- stderr=open(os.path.join(project_dir, 'make_err'), 'w'), env=env)
- if cache is not None:
- cache[cache_name] = []
- for f in generated_libs:
- basename = os.path.basename(f)
- cache[cache_name].append((basename, open(f, 'rb').read()))
+ for i in range(2): # workaround for some build systems that need to be run twice to succeed (e.g. poppler)
+ Building.make(make + make_args, stdout=open(os.path.join(project_dir, 'make_' + str(i)), 'w'),
+ stderr=open(os.path.join(project_dir, 'make_err' + str(i)), 'w'), env=env)
+ try:
+ if cache is not None:
+ cache[cache_name] = []
+ for f in generated_libs:
+ basename = os.path.basename(f)
+ cache[cache_name].append((basename, open(f, 'rb').read()))
+ break
+ except:
+ if i > 0: raise Exception('could not build library ' + name)
if old_dir:
os.chdir(old_dir)
return generated_libs