summaryrefslogtreecommitdiff
path: root/acprep
diff options
context:
space:
mode:
Diffstat (limited to 'acprep')
-rwxr-xr-xacprep108
1 files changed, 73 insertions, 35 deletions
diff --git a/acprep b/acprep
index c790a903..f260edcb 100755
--- a/acprep
+++ b/acprep
@@ -209,7 +209,7 @@ class BoostInfo(object):
def dependencies(self, system):
if system == 'darwin':
- return [ 'boost-jam', 'boost', '+icu+python26+st+universal' ]
+ return [ 'boost-jam', 'boost', '+icu+python27+st+universal' ]
if system == 'centos':
return [ 'boost-devel' ]
@@ -239,14 +239,23 @@ class BoostInfo(object):
'libboost-filesystem-dev',
'libboost-iostreams-dev' ]
+ elif system == 'ubuntu-oneiric':
+ return [ 'libboost-dev',
+ 'libboost-python-dev',
+ 'libboost-regex-dev',
+ 'libboost-date-time-dev',
+ 'libboost-filesystem-dev',
+ 'libboost-iostreams-dev' ]
+
+
class CommandLineApp(object):
"Base class for building command line applications."
force_exit = True # If true, always ends run() with sys.exit()
log_handler = None
darwin_gcc = False
- boost_version = "1_46_1"
- boost_major = "1_46_1"
+ boost_version = "1_47_0"
+ boost_major = "1_47"
options = {
'debug': False,
@@ -338,7 +347,7 @@ class CommandLineApp(object):
self.log.setLevel(logging.DEBUG)
elif self.options.verbose:
self.log.setLevel(logging.INFO)
-
+
exit_code = 0
try:
# We could just call main() and catch a TypeError, but that would
@@ -400,8 +409,9 @@ class PrepareBuild(CommandLineApp):
self.LDFLAGS = []
self.envvars = {
+ 'PYTHON': '/usr/bin/python',
'PYTHON_HOME': '/usr',
- 'PYTHON_VERSION': '2.6',
+ 'PYTHON_VERSION': '2.7',
'LEDGER_PRODUCTS': None,
'CC': 'gcc',
'CPPFLAGS': '',
@@ -817,7 +827,7 @@ class PrepareBuild(CommandLineApp):
packages = [
'sudo', 'port', 'install', '-f',
'automake', 'autoconf', 'libtool',
- 'python26', '+universal',
+ 'python27', '+universal',
'libiconv', '+universal',
'zlib', '+universal',
'gmp' ,'+universal', 'mpfr', '+universal',
@@ -864,7 +874,7 @@ class PrepareBuild(CommandLineApp):
'lcov',
'sloccount'
] + self.boost_info.dependencies('ubuntu-karmic')
- else:
+ elif re.search('hardy', info):
self.log.info('Looks like you are using APT on Ubuntu Hardy')
packages = [
'sudo', 'apt-get', 'install',
@@ -888,6 +898,30 @@ class PrepareBuild(CommandLineApp):
'lcov',
'sloccount'
] + self.boost_info.dependencies('ubuntu-hardy')
+ elif re.search('oeneric', info):
+ self.log.info('Looks like you are using APT on Ubuntu Oeneric')
+ packages = [
+ 'sudo', 'apt-get', 'install',
+ 'build-essential',
+ 'libtool',
+ 'autoconf',
+ 'automake',
+ 'autopoint',
+ 'zlib1g-dev',
+ 'libbz2-dev',
+ 'python-dev',
+ 'cvs',
+ 'gettext',
+ 'libgmp3-dev',
+ 'libmpfr-dev',
+ 'libedit-dev',
+ #'texlive-full',
+ #'doxygen',
+ #'graphviz',
+ 'texinfo',
+ 'lcov',
+ 'sloccount'
+ ] + self.boost_info.dependencies('ubuntu-oeneric')
self.log.info('Executing: ' + string.join(packages, ' '))
self.execute(*packages)
@@ -928,8 +962,8 @@ class PrepareBuild(CommandLineApp):
def setup_system_directories(self):
boost_include = self.boost_info.include_directory()
boost_library = self.boost_info.library_directory()
-
- if re.match('/opt/local', self.boost_info.home_path):
+
+ if re.match('/(usr|opt)/local', self.boost_info.home_path):
self.log.debug("Setting Python home to /opt/local based on Boost's location")
self.envvars['PYTHON_HOME'] = '/opt/local'
@@ -946,6 +980,13 @@ class PrepareBuild(CommandLineApp):
self.log.info('Noticing include directory => ' + path)
self.sys_include_dirs.append(path)
+ includes = string.split(self.get_stdout('python-config',
+ '--includes'), '-I')
+ for include in includes:
+ include = include.strip()
+ if include and include not in self.sys_include_dirs:
+ self.sys_include_dirs.append(include)
+
# Each of these becomes '-L<name>'
for path in ['/usr/local/lib',
'%s/lib' % self.envvars['PYTHON_HOME'],
@@ -961,12 +1002,14 @@ class PrepareBuild(CommandLineApp):
self.sys_library_dirs.append(path)
def setup_for_johnw(self):
+ self.envvars['PYTHON'] = '/opt/local/bin/python'
+ self.envvars['PYTHON_HOME'] = '/opt/local'
+
if self.options.use_clang:
self.boost_inc_ident = "clang"
self.boost_lib_ident = "clang-darwin28"
self.log.debug("Setting Python home to /opt/local")
- self.envvars['PYTHON_HOME'] = '/opt/local'
self.log.debug('Using Clang ident: %s/%s' %
(self.boost_inc_ident, self.boost_lib_ident))
@@ -1040,28 +1083,21 @@ class PrepareBuild(CommandLineApp):
self.envvars['LD'] = '/usr/bin/g++-4.2'
self.darwin_gcc = True
elif exists('/opt/local/bin/g++-mp-4.6') and \
- not self.options.gcc45:
+ self.options.gcc46:
self.envvars['CC'] = '/opt/local/bin/gcc-mp-4.6'
#if exists('/Users/johnw/bin/gfilt'):
# self.envvars['CXX'] = '/Users/johnw/bin/gfilt'
#else:
self.envvars['CXX'] = '/opt/local/bin/g++-mp-4.6'
self.envvars['LD'] = '/opt/local/bin/g++-mp-4.6'
- elif exists('/opt/local/bin/g++-mp-4.5'):
+ elif exists('/opt/local/bin/g++-mp-4.5') and \
+ self.options.gcc45:
self.envvars['CC'] = '/opt/local/bin/gcc-mp-4.5'
if exists('/Users/johnw/bin/gfilt'):
self.envvars['CXX'] = '/Users/johnw/bin/gfilt'
else:
self.envvars['CXX'] = '/opt/local/bin/g++-mp-4.5'
self.envvars['LD'] = '/opt/local/bin/g++-mp-4.5'
- elif exists('/opt/local/bin/g++-mp-4.4'):
- self.envvars['CC'] = '/opt/local/bin/gcc-mp-4.4'
- self.envvars['CXX'] = '/opt/local/bin/g++-mp-4.4'
- self.envvars['LD'] = '/opt/local/bin/g++-mp-4.4'
- elif exists('/opt/local/bin/g++-mp-4.3'):
- self.envvars['CC'] = '/opt/local/bin/gcc-mp-4.3'
- self.envvars['CXX'] = '/opt/local/bin/g++-mp-4.3'
- self.envvars['LD'] = '/opt/local/bin/g++-mp-4.3'
elif exists('/usr/bin/g++-4.2'):
self.envvars['CC'] = '/usr/bin/gcc-4.2'
self.envvars['CXX'] = '/usr/bin/g++-4.2'
@@ -1252,7 +1288,7 @@ class PrepareBuild(CommandLineApp):
home_path = '/usr/local/stow/boost_%s-%s' % \
(self.boost_version, self.boost_inc_ident),
suffix = '-%s-sd-%s' % \
- (self.boost_lib_ident, self.boost_version),
+ (self.boost_lib_ident, self.boost_major),
file_suffix = '.dylib',
include_path = 'include/boost-%s' % self.boost_major):
pass
@@ -1260,7 +1296,7 @@ class PrepareBuild(CommandLineApp):
home_path = '/usr/local/stow/boost_%s-%s' % \
(self.boost_version, self.boost_inc_ident),
suffix = '-%s-d-%s' % \
- (self.boost_lib_ident, self.boost_version),
+ (self.boost_lib_ident, self.boost_major),
file_suffix = '.dylib',
include_path = 'include/boost-%s' % self.boost_major):
pass
@@ -1274,7 +1310,7 @@ class PrepareBuild(CommandLineApp):
home_path = '/usr/local/stow/boost_%s-%s' % \
(self.boost_version, self.boost_inc_ident),
suffix = '-%s-s-%s' % \
- (self.boost_lib_ident, self.boost_version),
+ (self.boost_lib_ident, self.boost_major),
file_suffix = '.dylib',
include_path = 'include/boost-%s' % self.boost_major):
pass
@@ -1282,7 +1318,7 @@ class PrepareBuild(CommandLineApp):
home_path = '/usr/local/stow/boost_%s-%s' % \
(self.boost_version, self.boost_inc_ident),
suffix = '-%s-%s' % \
- (self.boost_lib_ident, self.boost_version),
+ (self.boost_lib_ident, self.boost_major),
file_suffix = '.dylib',
include_path = 'include/boost-%s' % self.boost_major):
pass
@@ -1296,7 +1332,9 @@ class PrepareBuild(CommandLineApp):
if self.options.gcc45 or self.options.gcc46:
self.CXXFLAGS.append('-g2')
+ self.CXXFLAGS.append('-ggdb')
self.LDFLAGS.append('-g2')
+ self.LDFLAGS.append('-ggdb')
else:
self.CXXFLAGS.append('-g')
self.LDFLAGS.append('-g')
@@ -1518,7 +1556,7 @@ class PrepareBuild(CommandLineApp):
match = re.search('/opt/local/lib/(.+?)\.dylib', line)
if not match:
continue
-
+
lib = match.group(0)
base = basename(lib)
@@ -1587,7 +1625,7 @@ class PrepareBuild(CommandLineApp):
def phase_distcheck(self, *args):
self.log.info('Executing phase: distcheck')
-
+
self.configure_flavor('default', False)
environ, conf_args = self.configure_environment()
@@ -1621,7 +1659,7 @@ class PrepareBuild(CommandLineApp):
'%s/' % self.source_dir, '%s/' % source_copy_dir)
self.source_dir = source_copy_dir
-
+
def phase_proof(self, *args):
self.log.info('Executing phase: proof')
@@ -1633,15 +1671,15 @@ class PrepareBuild(CommandLineApp):
self.configure_flavor('opt', reset=False)
self.log.info('=== Testing opt ===')
self.phase_make('fullcheck')
-
+
self.configure_flavor('gcov', reset=False)
self.log.info('=== Testing gcov ===')
self.phase_make('check')
-
+
self.configure_flavor('debug', reset=False)
self.log.info('=== Testing debug ===')
self.phase_make('fullcheck')
-
+
self.configure_flavor('default', reset=False)
self.log.info('=== Testing default ===')
self.phase_make('fullcheck')
@@ -1654,14 +1692,14 @@ class PrepareBuild(CommandLineApp):
self.log.info('Executing phase: makeall')
self.configure_flavor('opt', reset)
-
+
system_hh_gch = join(self.source_dir, 'src', 'system.hh.gch')
if exists(system_hh_gch):
os.remove(system_hh_gch)
self.log.info('=== Building opt ===')
self.phase_make(*args)
-
+
self.configure_flavor('gcov', reset)
system_hh_gch = join(self.source_dir, 'src', 'system.hh.gch')
@@ -1670,7 +1708,7 @@ class PrepareBuild(CommandLineApp):
self.log.info('=== Building gcov ===')
self.phase_make(*args)
-
+
system_hh_gch = join(self.source_dir, 'src', 'system.hh.gch')
if exists(system_hh_gch):
os.remove(system_hh_gch)
@@ -1686,7 +1724,7 @@ class PrepareBuild(CommandLineApp):
self.log.info('=== Building debug ===')
self.phase_make(*args)
-
+
self.configure_flavor('default', reset)
#########################################################################
@@ -1696,7 +1734,7 @@ class PrepareBuild(CommandLineApp):
def phase_help(self, *args):
self.option_parser.print_help()
- print """
+ print """
Of the optional ARGS, the first is an optional build FLAVOR, with the default
being 'debug':