diff options
Diffstat (limited to 'indra/develop.py')
-rwxr-xr-x | indra/develop.py | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/indra/develop.py b/indra/develop.py index 39bb48dfa5..b2b494d1b3 100755 --- a/indra/develop.py +++ b/indra/develop.py @@ -76,6 +76,7 @@ class PlatformSetup(object): build_type = build_types['relwithdebinfo'] standalone = 'OFF' unattended = 'OFF' + universal = 'OFF' project_name = 'SecondLife' distcc = True cmake_opts = [] @@ -419,7 +420,7 @@ class DarwinSetup(UnixSetup): return 'darwin' def arch(self): - if self.unattended == 'ON': + if self.universal == 'ON': return 'universal' else: return UnixSetup.arch(self) @@ -433,11 +434,12 @@ class DarwinSetup(UnixSetup): word_size=self.word_size, unattended=self.unattended, project_name=self.project_name, - universal='', + universal=self.universal, type=self.build_type.upper(), ) - if self.unattended == 'ON': + if self.universal == 'ON': args['universal'] = '-DCMAKE_OSX_ARCHITECTURES:STRING=\'i386;ppc\'' + pass #if simple: # return 'cmake %(opts)s %(dir)r' % args return ('cmake -G %(generator)r ' @@ -577,19 +579,23 @@ class WindowsSetup(PlatformSetup): return ('"%sdevenv.com" %s.sln /build %s' % (self.find_visual_studio(), self.project_name, self.build_type)) - def run(self, command, name=None): + def run(self, command, name=None, retry_on=None, retries=1): '''Run a program. If the program fails, raise an exception.''' - ret = os.system(command) - if ret: - if name is None: - name = command.split(None, 1)[0] - path = self.find_in_path(name) - if not path: - ret = 'was not found' - else: - ret = 'exited with status %d' % ret - raise CommandError('the command %r %s' % - (name, ret)) + while retries: + retries = retries - 1 + ret = os.system(command) + if ret: + if name is None: + name = command.split(None, 1)[0] + path = self.find_in_path(name) + if not path: + error = 'was not found' + else: + error = 'exited with status %d' % ret + if retry_on is not None and retry_on == ret: + print "Retrying... the command %r %s" % (name, error) + else: + raise CommandError('the command %r %s' % (name, error)) def run_cmake(self, args=[]): '''Override to add the vstool.exe call after running cmake.''' @@ -627,11 +633,11 @@ class WindowsSetup(PlatformSetup): for t in targets: cmd = '%s /project %s %s' % (build_cmd, t, ' '.join(opts)) print 'Running %r in %r' % (cmd, d) - self.run(cmd) + self.run(cmd, retry_on=4, retries=3) else: cmd = '%s %s' % (build_cmd, ' '.join(opts)) print 'Running %r in %r' % (cmd, d) - self.run(cmd) + self.run(cmd, retry_on=4, retries=3) finally: os.chdir(cwd) @@ -676,6 +682,7 @@ Options: --standalone build standalone, without Linden prebuild libraries --unattended build unattended, do not invoke any tools requiring a human response + --universal build a universal binary on Mac OS X (unsupported) -t | --type=NAME build type ("Debug", "Release", or "RelWithDebInfo") -m32 | -m64 build architecture (32-bit or 64-bit) -N | --no-distcc disable use of distcc @@ -721,7 +728,7 @@ def main(arguments): opts, args = getopt.getopt( arguments, '?hNt:p:G:m:', - ['help', 'standalone', 'no-distcc', 'unattended', 'type=', 'incredibuild', 'generator=', 'project=']) + ['help', 'standalone', 'no-distcc', 'unattended', 'universal', 'type=', 'incredibuild', 'generator=', 'project=']) except getopt.GetoptError, err: print >> sys.stderr, 'Error:', err print >> sys.stderr, """ @@ -738,6 +745,8 @@ For example: develop.py configure -DSERVER:BOOL=OFF""" setup.standalone = 'ON' elif o in ('--unattended',): setup.unattended = 'ON' + elif o in ('--universal',): + setup.universal = 'ON' elif o in ('-m',): if a in ('32', '64'): setup.word_size = int(a) |