summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xacprep139
1 files changed, 70 insertions, 69 deletions
diff --git a/acprep b/acprep
index 0b7545a2..3c6c9ad3 100755
--- a/acprep
+++ b/acprep
@@ -42,6 +42,7 @@ class CommandLineApp(object):
force_exit = True # If true, always ends run() with sys.exit()
log_handler = None
+ darwin_gcc = False
options = {
'debug': False,
@@ -689,6 +690,11 @@ class PrepareBuild(CommandLineApp):
path)
return None
+ def inform_boost_location(self, text, suffix):
+ self.log.info('Boost %s here:' % text)
+ self.log.info('BOOST_HOME => ' + self.envvars['BOOST_HOME'])
+ self.log.info('BOOST_SUFFIX => ' + suffix)
+
def locate_boost(self):
if self.envvars['BOOST_SUFFIX']:
self.log.info(("Not looking for Boost, since " +
@@ -701,10 +707,7 @@ class PrepareBuild(CommandLineApp):
self.log.info('Looking for Boost in %s...' % path)
suffix = self.locate_boost_in_dir(path)
if suffix is not None:
- self.log.info('Boost is located here:')
- self.log.info('BOOST_HOME => ' +
- self.envvars['BOOST_HOME'])
- self.log.info('BOOST_SUFFIX => ' + suffix)
+ self.inform_boost_location('was found', suffix)
break
if suffix is None:
self.log.error("Boost could not be found.")
@@ -742,29 +745,25 @@ class PrepareBuild(CommandLineApp):
self.sys_library_dirs.append(path)
def setup_for_johnw(self):
- # jww (2009-03-09): Some peculiarities specific to my system
- if exists('/Users/johnw/Dropbox/Accounts/ledger.dat'):
- if self.current_flavor == 'debug':
- if exists('/usr/local/stow/cppunit/include'):
- self.sys_include_dirs.insert(0, '/usr/local/stow/cppunit/include')
- self.sys_library_dirs.insert(0, '/usr/local/stow/cppunit/lib')
-
- if exists('/usr/local/stow/icu/include'):
- self.sys_include_dirs.insert(0, '/usr/local/stow/icu/include')
- self.sys_library_dirs.insert(0, '/usr/local/stow/icu/lib')
+ if self.current_flavor == 'debug':
+ if exists('/usr/local/stow/cppunit/include'):
+ self.sys_include_dirs.insert(0, '/usr/local/stow/cppunit/include')
+ self.sys_library_dirs.insert(0, '/usr/local/stow/cppunit/lib')
- self.CPPFLAGS.append('-D_GLIBCXX_FULLY_DYNAMIC_STRING=1')
+ if exists('/usr/local/stow/icu/include'):
+ self.sys_include_dirs.insert(0, '/usr/local/stow/icu/include')
+ self.sys_library_dirs.insert(0, '/usr/local/stow/icu/lib')
- self.options.use_glibcxx_debug = True
+ self.CPPFLAGS.append('-D_GLIBCXX_FULLY_DYNAMIC_STRING=1')
- self.CXXFLAGS.append('-march=nocona')
- self.CXXFLAGS.append('-msse3')
+ self.options.use_glibcxx_debug = True
- self.configure_args.append('--disable-shared')
- self.configure_args.append('--enable-doxygen')
- self.configure_args.append('--enable-python')
+ self.CXXFLAGS.append('-march=nocona')
+ self.CXXFLAGS.append('-msse3')
- self.locate_my_libraries()
+ self.configure_args.append('--disable-shared')
+ self.configure_args.append('--enable-doxygen')
+ self.configure_args.append('--enable-python')
def setup_for_system(self):
self.setup_system_directories()
@@ -790,11 +789,18 @@ class PrepareBuild(CommandLineApp):
self.CXXFLAGS.append('-pthread')
elif system == 'Darwin':
- self.setup_for_johnw()
+ if exists('/Users/johnw/Dropbox/Accounts/ledger.dat'):
+ self.setup_for_johnw()
+
+ self.locate_darwin_libraries()
- # g++ 4.0.1 cannot use PCH headers on OS X 10.5, so we must use a
- # newer version.
- if exists('/opt/local/bin/g++-mp-4.4'):
+ if self.current_flavor == 'opt' and \
+ exists('/usr/bin/g++-4.2'):
+ self.envvars['CC'] = '/usr/bin/gcc-4.2'
+ self.envvars['CXX'] = '/usr/bin/g++-4.2'
+ self.envvars['LD'] = '/usr/bin/g++-4.2'
+ self.darwin_gcc = True
+ 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'
@@ -802,12 +808,13 @@ class PrepareBuild(CommandLineApp):
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 not self.options.use_glibcxx_debug and \
- exists('/usr/bin/g++-4.2'):
+ elif exists('/usr/bin/g++-4.2'):
self.envvars['CC'] = '/usr/bin/gcc-4.2'
self.envvars['CXX'] = '/usr/bin/g++-4.2'
self.envvars['LD'] = '/usr/bin/g++-4.2'
+ self.darwin_gcc = True
else:
+ # g++ 4.0.1 cannot use PCH headers on OS X 10.5
self.option_no_pch()
if '--enable-pch' not in self.configure_args and \
@@ -964,77 +971,71 @@ class PrepareBuild(CommandLineApp):
# The various build flavors #
#########################################################################
- def locate_my_libraries(self):
- if self.options.use_glibcxx_debug:
+ def locate_darwin_libraries(self):
+ if self.current_flavor == 'debug':
self.log.debug('We are using GLIBCXX_DEBUG, so setting up flags')
- self.CPPFLAGS.append('-D_GLIBCXX_DEBUG=1')
+ if self.options.use_glibcxx_debug:
+ self.CPPFLAGS.append('-D_GLIBCXX_DEBUG=1')
- if exists('/usr/local/stow/cppunit-debug/include'):
- if '/usr/local/stow/cppunit/include' in self.sys_include_dirs:
- self.sys_include_dirs.remove('/usr/local/stow/cppunit/include')
- self.sys_library_dirs.remove('/usr/local/stow/cppunit/lib')
+ if exists('/usr/local/stow/cppunit-debug/include'):
+ if '/usr/local/stow/cppunit/include' in self.sys_include_dirs:
+ self.sys_include_dirs.remove('/usr/local/stow/cppunit/include')
+ self.sys_library_dirs.remove('/usr/local/stow/cppunit/lib')
- self.sys_include_dirs.insert(0, '/usr/local/stow/cppunit-debug/include')
- self.sys_library_dirs.insert(0, '/usr/local/stow/cppunit-debug/lib')
+ self.sys_include_dirs.insert(0, '/usr/local/stow/cppunit-debug/include')
+ self.sys_library_dirs.insert(0, '/usr/local/stow/cppunit-debug/lib')
- if exists('/usr/local/stow/icu-debug/include'):
- if '/usr/local/stow/icu/include' in self.sys_include_dirs:
- self.sys_include_dirs.remove('/usr/local/stow/icu/include')
- self.sys_library_dirs.remove('/usr/local/stow/icu/lib')
+ if exists('/usr/local/stow/icu-debug/include'):
+ if '/usr/local/stow/icu/include' in self.sys_include_dirs:
+ self.sys_include_dirs.remove('/usr/local/stow/icu/include')
+ self.sys_library_dirs.remove('/usr/local/stow/icu/lib')
- self.sys_include_dirs.insert(0, '/usr/local/stow/icu-debug/include')
- self.sys_library_dirs.insert(0, '/usr/local/stow/icu-debug/lib')
-
- if exists('/opt/local/lib/libboost_regex-d.a'):
- self.envvars['BOOST_HOME'] = '/opt/local'
- self.envvars['BOOST_SUFFIX'] = '-d'
-
- self.log.info('Setting BOOST_SUFFIX => %s' %
- self.envvars['BOOST_SUFFIX'])
-
- self.sys_include_dirs.append('/opt/local/include/boost')
+ self.sys_include_dirs.insert(0, '/usr/local/stow/icu-debug/include')
+ self.sys_library_dirs.insert(0, '/usr/local/stow/icu-debug/lib')
- elif exists('/usr/local/lib/libboost_regex-xgcc44-sd-1_40.a'):
+ if exists('/usr/local/lib/libboost_regex-xgcc44-sd-1_40.a'):
self.envvars['BOOST_HOME'] = '/usr/local'
self.envvars['BOOST_SUFFIX'] = '-xgcc44-sd-1_40'
- self.log.info('Setting BOOST_SUFFIX => %s' %
- self.envvars['BOOST_SUFFIX'])
-
self.sys_include_dirs.append('/usr/local/include/boost-1_40')
+ self.inform_boost_location('is really located',
+ self.envvars['BOOST_SUFFIX'])
elif exists('/usr/local/lib/libboost_regex-xgcc44-d-1_40.a'):
self.envvars['BOOST_HOME'] = '/usr/local'
self.envvars['BOOST_SUFFIX'] = '-xgcc44-d-1_40'
- self.log.info('Setting BOOST_SUFFIX => %s' %
- self.envvars['BOOST_SUFFIX'])
-
self.sys_include_dirs.append('/usr/local/include/boost-1_40')
+ self.inform_boost_location('is really located',
+ self.envvars['BOOST_SUFFIX'])
+
+ elif exists('/opt/local/lib/libboost_regex-d.a'):
+ self.envvars['BOOST_HOME'] = '/opt/local'
+ self.envvars['BOOST_SUFFIX'] = '-d'
+ self.sys_include_dirs.append('/opt/local/include/boost')
+ self.inform_boost_location('is really located',
+ self.envvars['BOOST_SUFFIX'])
+
else:
if exists('/opt/local/lib/libboost_regex.a'):
self.envvars['BOOST_HOME'] = '/opt/local'
self.envvars['BOOST_SUFFIX'] = ''
-
- self.log.info('Setting BOOST_SUFFIX => %s' %
- self.envvars['BOOST_SUFFIX'])
-
self.sys_include_dirs.append('/opt/local/include/boost')
+ self.inform_boost_location('is really located',
+ self.envvars['BOOST_SUFFIX'])
elif exists('/usr/local/lib/libboost_regex-xgcc44-s-1_40.a'):
self.envvars['BOOST_HOME'] = '/usr/local'
self.envvars['BOOST_SUFFIX'] = '-xgcc44-s-1_40'
- self.log.info('Setting BOOST_SUFFIX => %s' %
- self.envvars['BOOST_SUFFIX'])
-
self.sys_include_dirs.append('/usr/local/include/boost-1_40')
+ self.inform_boost_location('is really located',
+ self.envvars['BOOST_SUFFIX'])
elif exists('/usr/local/lib/libboost_regex-xgcc44-1_40.a'):
self.envvars['BOOST_HOME'] = '/usr/local'
self.envvars['BOOST_SUFFIX'] = '-xgcc44-1_40'
- self.log.info('Setting BOOST_SUFFIX => %s' %
- self.envvars['BOOST_SUFFIX'])
-
self.sys_include_dirs.append('/usr/local/include/boost-1_40')
+ self.inform_boost_location('is really located',
+ self.envvars['BOOST_SUFFIX'])
def setup_flavor_default(self):
pass