diff options
author | lloyd <[email protected]> | 2009-07-02 21:15:43 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-07-02 21:15:43 +0000 |
commit | beca095a59c314725042f1f493fe37ef18ea0dc0 (patch) | |
tree | 1408d83735ebe0c3f4f4969096dfe5f9edf930cc /configure.py | |
parent | 1b41df24702852f185eeffa1097a99a3b060c446 (diff) |
Document that Python 2.5 is needed (for optparse's append_const)
Enable use of symlinks/hardlinks if available.
Enable printing exception tracebacks (will be good for field debugging)
Rewrite portable_symlink:count_dirs in a functional style
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/configure.py b/configure.py index 442072140..1b11c1a45 100755 --- a/configure.py +++ b/configure.py @@ -3,7 +3,7 @@ """ Configuration program for botan -Python 2.4 or higher required +Python 2.5 or higher required (C) 2009 Jack Lloyd Distributed under the terms of the Botan license @@ -160,10 +160,7 @@ def process_command_line(args): parser.add_option_group(mods_group) parser.add_option_group(install_group) - - """ - These exist only for autoconf compatability (requested by zw for monotone) - """ + # These exist only for autoconf compatability (requested by zw for monotone) compat_with_autoconf_options = [ 'bindir', 'datadir', @@ -323,8 +320,6 @@ class ArchInfo(object): elif self.endian != None: macros.append('TARGET_CPU_IS_%s_ENDIAN' % (self.endian.upper())) - print macros - macros.append('TARGET_UNALIGNED_LOADSTORE_OK %d' % (self.unaligned_ok)) return macros @@ -803,19 +798,18 @@ def setup_build(build_config, options, template_vars): build_config.headers.append(os.path.join(build_config.build_dir, 'build.h')) def portable_symlink(filename, target_dir): - if False and 'symlink' in os.__dict__: - def count_dirs(dir): + if 'symlink' in os.__dict__: + def count_dirs(dir, accum = 0): + if dir == '': + return accum (dir,basename) = os.path.split(dir) - cnt = 1 - while dir != '': - (dir,basename) = os.path.split(dir) - cnt += 1 - return cnt + return accum + 1 + count_dirs(dir) dirs_up = count_dirs(target_dir) + print dirs_up target = os.path.join(os.path.join(*[os.path.pardir]*dirs_up), filename) os.symlink(target, os.path.join(target_dir, os.path.basename(filename))) - elif False and 'link' in os.__dict__: + elif 'link' in os.__dict__: os.link(filename, os.path.join(target_dir, os.path.basename(filename))) else: shutil.copy(filename, target_dir) @@ -875,7 +869,9 @@ def main(argv = None): if __name__ == '__main__': try: sys.exit(main()) + except SystemExit: + pass except Exception, e: print >>sys.stderr, e - #import traceback - #traceback.print_exc(file=sys.stderr) + import traceback + traceback.print_exc(file=sys.stderr) |