aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure.py57
-rw-r--r--doc/download.txt5
-rw-r--r--doc/log.txt13
-rw-r--r--src/build-data/cc/gcc.txt3
-rw-r--r--src/utils/cpuid.cpp2
5 files changed, 56 insertions, 24 deletions
diff --git a/configure.py b/configure.py
index 2920becb6..bb0dbc192 100755
--- a/configure.py
+++ b/configure.py
@@ -5,15 +5,16 @@ Configuration program for botan (http://botan.randombit.net/)
(C) 2009-2011 Jack Lloyd
Distributed under the terms of the Botan license
-Tested with
- CPython 2.5, 2.6, 2.7 - OK
- Jython 2.5 - Target detection does not work (use --os and --cpu)
+Tested with CPython 2.6, 2.7, 3.1 and PyPy 1.5
- CPython 2.4 and earlier are not supported
+Python 2.5 works if you change the exception catching syntax:
+ perl -pi -e 's/except (.*) as (.*):/except $1, $2:/g' configure.py
- Use the 2to3 script to use with Python 3
+Jython - Target detection does not work (use --os and --cpu)
- Has not been tested with IronPython or PyPy
+CPython 2.4 and earlier are not supported
+
+Has not been tested with IronPython
"""
import sys
@@ -41,17 +42,23 @@ def flatten(l):
return sum(l, [])
def get_vc_revision():
- mtn = subprocess.Popen(['mtn', 'automate', 'heads'],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ try:
+ mtn = subprocess.Popen(['mtn', 'automate', 'heads'],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
- (stdout, stderr) = mtn.communicate()
+ (stdout, stderr) = mtn.communicate()
- if(stderr != ''):
- #logging.debug('Error getting rev from monotone - %s' % (stderr))
- return 'unknown'
+ if(stderr != ''):
+ logging.debug('Error getting rev from monotone - %s' % (stderr))
+ return 'unknown'
+
+ logging.debug('Monotone reported revision ' + stdout.strip())
- return 'mtn:' + stdout.strip()
+ return 'mtn:' + stdout.strip()
+ except OSError as e:
+ logging.debug('Error getting rev from monotone - %s' % (e[1]))
+ return 'unknown'
class BuildConfigurationInformation(object):
@@ -65,7 +72,7 @@ class BuildConfigurationInformation(object):
version_datestamp = botan_version.release_datestamp
- version_vc_rev = botan_version.release_vc_rev or get_vc_revision()
+ version_vc_rev = botan_version.release_vc_rev
version_string = '%d.%d.%d' % (version_major, version_minor, version_patch)
"""
@@ -73,6 +80,9 @@ class BuildConfigurationInformation(object):
"""
def __init__(self, options, modules):
+ if self.version_vc_rev is None:
+ self.version_vc_rev = get_vc_revision()
+
self.build_dir = os.path.join(options.with_build_dir, 'build')
self.checkobj_dir = os.path.join(self.build_dir, 'checks')
@@ -945,7 +955,7 @@ def process_template(template_file, variables):
try:
template = PercentSignTemplate(slurp_file(template_file))
return template.substitute(variables)
- except KeyError, e:
+ except KeyError as e:
raise Exception('Unbound var %s in template %s' % (e, template_file))
"""
@@ -1383,14 +1393,14 @@ def setup_build(build_config, options, template_vars):
try:
if options.clean_build_tree:
shutil.rmtree(build_config.build_dir)
- except OSError, e:
+ except OSError as e:
if e.errno != errno.ENOENT:
logging.error('Problem while removing build dir: %s' % (e))
for dir in build_config.build_dirs:
try:
os.makedirs(dir)
- except OSError, e:
+ except OSError as e:
if e.errno != errno.EEXIST:
logging.error('Error while creating "%s": %s' % (dir, e))
@@ -1441,7 +1451,7 @@ def setup_build(build_config, options, template_vars):
for header_file in header_list:
try:
portable_symlink(header_file, dir, link_method)
- except OSError, e:
+ except OSError as e:
if e.errno != errno.EEXIST:
logging.error('Error linking %s into %s: %s' % (
header_file, dir, e))
@@ -1702,10 +1712,13 @@ def main(argv = None):
def get_gcc_version(gcc_bin):
try:
- gcc_version = ''.join(subprocess.Popen(
+ subproc_result = subprocess.Popen(
gcc_bin.split(' ') + ['-dumpversion'],
stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).communicate()).strip()
+ stderr=subprocess.PIPE).communicate()
+
+ gcc_version = ''.join(map(str, subproc_result)).strip()
+
logging.info('Detected gcc version %s' % (gcc_version))
return gcc_version
except OSError:
@@ -1768,7 +1781,7 @@ def main(argv = None):
if __name__ == '__main__':
try:
main()
- except Exception, e:
+ except Exception as e:
logging.error(str(e))
#import traceback
#traceback.print_exc(file=sys.stderr)
diff --git a/doc/download.txt b/doc/download.txt
index 4e8ccd156..b8d3e75b3 100644
--- a/doc/download.txt
+++ b/doc/download.txt
@@ -68,8 +68,9 @@ Botan's development occurs using a distributed version control system
called `Monotone <http://www.monotone.ca>`_.
The main branch of development occurs on the branch named
-``net.randombit.botan``; this is probably the branch you want. To
-download that branch and set up a new workspace, run::
+``net.randombit.botan``; this is probably the branch you want (for
+1.8, use ``net.randombit.botan.1_8`` instead). To download that branch
+and set up a new workspace, run::
$ mtn db init --db=botan.mtn
$ mtn pull --db=botan.mtn randombit.net 'net.randombit.botan'
diff --git a/doc/log.txt b/doc/log.txt
index 4c4215067..696fa4ac9 100644
--- a/doc/log.txt
+++ b/doc/log.txt
@@ -10,6 +10,19 @@ Series 1.10
Version 1.10.2, Not Yet Released
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+* The exception catching syntax of configure.py has been changed to
+ the Python 3.x syntax. This syntax also works with Python 2.6 and
+ 2.7, but not with any earlier Python 2 release. A simple search and
+ replace will allow running it under Python 2.5::
+ perl -pi -e 's/except (.*) as (.*):/except $1, $2:/g' configure.py
+
+* Add AltiVec detection for IBM POWER7 processors.
+
+* Don't set a soname on OpenBSD, as it doesn't support it (PR 158)
+
+* Fix a configure.py incompatability with the subprocess module
+ included in Python 3.1 (PR 157)
+
* A bug in configure.py would cause it to interpret `--cpu=s390x` as
`s390`. This may have affected other CPUs as well. Now configure.py
searches for an exact match, and only if no exact match is found
diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt
index c7e4a3c14..dbf892dcf 100644
--- a/src/build-data/cc/gcc.txt
+++ b/src/build-data/cc/gcc.txt
@@ -31,6 +31,9 @@ default -> "$(CXX) -shared -fPIC -Wl,-soname,$(SONAME)"
# AIX doesn't seem to have soname support (weird...)
aix -> "$(CXX) -shared -fPIC"
+# OpenBSD doesn't use soname
+openbsd -> "$(CXX) -shared -fPIC"
+
darwin -> "$(CXX) -dynamiclib -fPIC -install_name $(LIBDIR)/$(SONAME)"
hpux -> "$(CXX) -shared -fPIC -Wl,+h,$(SONAME)"
solaris -> "$(CXX) -shared -fPIC -Wl,-h,$(SONAME)"
diff --git a/src/utils/cpuid.cpp b/src/utils/cpuid.cpp
index cb6fdaba5..917789f65 100644
--- a/src/utils/cpuid.cpp
+++ b/src/utils/cpuid.cpp
@@ -128,6 +128,7 @@ bool altivec_check_pvr_emul()
const u16bit PVR_G5_970MP = 0x0044;
const u16bit PVR_G5_970GX = 0x0045;
const u16bit PVR_POWER6 = 0x003E;
+ const u16bit PVR_POWER7 = 0x003F;
const u16bit PVR_CELL_PPU = 0x0070;
// Motorola produced G4s with PVR 0x800[0123C] (at least)
@@ -147,6 +148,7 @@ bool altivec_check_pvr_emul()
altivec_capable |= (pvr == PVR_G5_970MP);
altivec_capable |= (pvr == PVR_G5_970GX);
altivec_capable |= (pvr == PVR_POWER6);
+ altivec_capable |= (pvr == PVR_POWER7);
altivec_capable |= (pvr == PVR_CELL_PPU);
#endif