diff options
Diffstat (limited to 'acprep')
-rwxr-xr-x | acprep | 162 |
1 files changed, 37 insertions, 125 deletions
@@ -46,6 +46,7 @@ class BoostInfo(object): include_path = "include" library_path = "lib" configured = False + no_includes = False def __init__(self, log): self.log = log @@ -538,6 +539,9 @@ class PrepareBuild(CommandLineApp): op.add_option('', '--cpp11', action='store_true', dest='use_cpp11', default=False, help='Use C++11 extensions (requires Clang or gcc 4.6/7/8)') + op.add_option('', '--plain', action='store_true', + dest='use_plain', default=False, + help="Don't customize for my private environment") op.add_option('', '--output', metavar='DIR', action="callback", callback=self.option_output, help='Build in the specified directory') @@ -970,8 +974,12 @@ class PrepareBuild(CommandLineApp): ######################################################################### def setup_system_directories(self): - boost_include = self.boost_info.include_directory() - boost_library = self.boost_info.library_directory() + if not self.boost_info.no_includes: + boost_include = self.boost_info.include_directory() + boost_library = self.boost_info.library_directory() + else: + boost_include = None + boost_library = None 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") @@ -985,7 +993,7 @@ class PrepareBuild(CommandLineApp): self.envvars['PYTHON_VERSION'].strip()), '/opt/local/include', '/sw/include']: - if exists(path) and isdir(path) and \ + if path and exists(path) and isdir(path) and \ path != '/usr/include': self.log.info('Noticing include directory => ' + path) self.sys_include_dirs.append(path) @@ -1006,7 +1014,7 @@ class PrepareBuild(CommandLineApp): '/opt/local/lib', boost_library, '/sw/lib']: - if exists(path) and isdir(path) and \ + if path and exists(path) and isdir(path) and \ path not in self.sys_library_dirs: self.log.info('Noticing library directory => ' + path) self.sys_library_dirs.append(path) @@ -1015,39 +1023,16 @@ class PrepareBuild(CommandLineApp): self.envvars['PYTHON'] = '/opt/local/bin/python' self.envvars['PYTHON_HOME'] = '/opt/local' - if self.options.use_clang: - self.log.info('Setting up for using Clang') - - self.boost_inc_ident = "clang31" - self.boost_lib_ident = "clang-darwin" - - if self.options.use_cpp11: - self.CXXFLAGS.append('-std=c++11') - self.CXXFLAGS.append('-stdlib=libc++') - self.CXXFLAGS.append('-nostdlibinc') - self.CXXFLAGS.append('-isystem /usr/local/include') - self.CXXFLAGS.append('-isystem /usr/local/include/c++/v1') - self.CXXFLAGS.append('-isystem /usr/include') - - self.LDFLAGS.append('-stdlib=libc++') - self.LDFLAGS.append('/usr/local/lib/libc++.dylib') - else: - global search_prefixes - search_prefixes = [ '/opt/local', '/usr/local', '/sw', '/usr' ] + self.boost_info.configured = True # cxx does all this work for me + self.boost_info.no_includes = True - self.log.debug('Using Clang ident: %s/%s' % - (self.boost_inc_ident, self.boost_lib_ident)) - else: - match = re.search('gcc-mp-([0-9]+)\.([0-9]+)', self.envvars['CC']) - if match: - self.boost_inc_ident = "gcc" + match.group(1) + match.group(2) - self.boost_lib_ident = "x" + self.boost_inc_ident - else: - self.boost_inc_ident = "gcc42" - self.boost_lib_ident = "xgcc42" + if self.options.use_cpp11: + self.CXXFLAGS.append('-std=c++11') + self.envvars['CXX'] = '/Users/johnw/bin/cxx' + self.envvars['LD'] = '/Users/johnw/bin/cxx' - self.log.debug('Using Boost ident: %s/%s' % - (self.boost_inc_ident, self.boost_lib_ident)) + #if not self.options.use_clang: + # self.CXXFLAGS.append('--gcc47') if self.current_flavor == 'debug': self.configure_args.append('--disable-shared') @@ -1059,8 +1044,6 @@ class PrepareBuild(CommandLineApp): self.CXXFLAGS.append('-DDOCUMENT_MODEL=1') - self.locate_darwin_libraries() - def setup_for_system(self): system = self.get_stdout('uname', '-s') @@ -1084,59 +1067,9 @@ class PrepareBuild(CommandLineApp): elif system == 'Darwin': if self.options.use_clang: - if exists('/usr/local/bin/clang++'): - self.envvars['CC'] = '/usr/local/bin/clang' - self.envvars['CXX'] = '/usr/local/bin/clang++' - self.envvars['LD'] = '/usr/local/bin/clang++' - elif exists('/opt/local/bin/clang++-mp-3.1'): - self.envvars['CC'] = '/opt/local/bin/clang-mp-3.1' - self.envvars['CXX'] = '/opt/local/bin/clang++-mp-3.1' - self.envvars['LD'] = '/opt/local/bin/clang++-mp-3.1' - else: - self.envvars['CC'] = 'clang' - self.envvars['CXX'] = 'clang++' - self.envvars['LD'] = 'llvm-ld' - elif (self.current_flavor == 'opt' or \ - self.current_flavor == 'default') and \ - not self.options.gcc45 and \ - not self.options.gcc46 and \ - not self.options.gcc47 and \ - not self.options.gcc48 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('/usr/local/bin/g++-mp-4.8') and \ - self.options.gcc47: - self.envvars['CC'] = '/usr/local/bin/gcc-mp-4.8' - self.envvars['CXX'] = '/usr/local/bin/g++-mp-4.8' - self.envvars['LD'] = '/usr/local/bin/g++-mp-4.8' - elif exists('/usr/local/bin/g++-mp-4.7') and \ - self.options.gcc47: - self.envvars['CC'] = '/usr/local/bin/gcc-mp-4.7' - self.envvars['CXX'] = '/usr/local/bin/g++-mp-4.7' - self.envvars['LD'] = '/usr/local/bin/g++-mp-4.7' - elif exists('/opt/local/bin/g++-mp-4.7') and \ - self.options.gcc47: - self.envvars['CC'] = '/opt/local/bin/gcc-mp-4.7' - self.envvars['CXX'] = '/opt/local/bin/g++-mp-4.7' - self.envvars['LD'] = '/opt/local/bin/g++-mp-4.7' - elif exists('/opt/local/bin/g++-mp-4.6') and \ - self.options.gcc46: - self.envvars['CC'] = '/opt/local/bin/gcc-mp-4.6' - 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') and \ - self.options.gcc45: - self.envvars['CC'] = '/opt/local/bin/gcc-mp-4.5' - self.envvars['CXX'] = '/opt/local/bin/g++-mp-4.5' - self.envvars['LD'] = '/opt/local/bin/g++-mp-4.5' - 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 + self.envvars['CC'] = 'clang' + self.envvars['CXX'] = 'clang++' + self.envvars['LD'] = 'llvm-ld' else: # g++ 4.0.1 cannot use PCH headers on OS X 10.5 self.option_no_pch() @@ -1150,7 +1083,8 @@ class PrepareBuild(CommandLineApp): if self.options.no_python: self.configure_args.remove('--enable-python') - if exists('/Users/johnw/Projects/ledger/plan/TODO'): + if not self.options.use_plain and \ + exists('/Users/johnw/Projects/ledger/plan/TODO'): self.setup_for_johnw() self.setup_system_directories() @@ -1232,6 +1166,7 @@ class PrepareBuild(CommandLineApp): self.CXXFLAGS.append('-Wno-missing-noreturn') self.CXXFLAGS.append('-Wno-disabled-macro-expansion') self.CXXFLAGS.append('-Wno-unused-parameter') + self.CXXFLAGS.append('-Wno-c++98-compat') self.CXXFLAGS.append('-fno-limit-debug-info') #self.CXXFLAGS.append('-Wold-style-cast') @@ -1325,33 +1260,6 @@ class PrepareBuild(CommandLineApp): # The various build flavors # ######################################################################### - def locate_darwin_libraries(self): - if self.current_flavor == 'debug': - if (not self.options.use_clang or self.options.use_cpp11) and \ - self.boost_info.configure( - 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_major), - file_suffix = '.dylib', - include_path = 'include/boost-%s' % self.boost_major): - pass - elif self.boost_info.configure(suffix = '-d', file_suffix = '.dylib'): - pass - - else: - if self.boost_info.configure(): - pass - elif (not self.options.use_clang or self.options.use_cpp11) and \ - self.boost_info.configure( - home_path = '/usr/local/stow/boost_%s-%s' % \ - (self.boost_version, self.boost_inc_ident), - suffix = '-%s-%s' % \ - (self.boost_lib_ident, self.boost_major), - file_suffix = '.dylib', - include_path = 'include/boost-%s' % self.boost_major): - pass - def setup_flavor_default(self): if self.darwin_gcc: self.option_no_pch() @@ -1706,8 +1614,10 @@ class PrepareBuild(CommandLineApp): source_copy_dir = join(self.ensure(self.products_directory()), proof_dir) - self.execute('rsync', '-a', '--delete', + self.execute('rsync', '-a', '--delete', '--exclude=/dist/', '--exclude=.git/', '--exclude=b/', + '--exclude=/lib/boost-release/', + '--exclude=/archive/', '--exclude=/build/', '%s/' % self.source_dir, '%s/' % source_copy_dir) self.source_dir = source_copy_dir @@ -1724,9 +1634,10 @@ class PrepareBuild(CommandLineApp): self.log.info('=== Testing opt ===') self.phase_make('fullcheck') - self.configure_flavor('gcov', reset=False) - self.log.info('=== Testing gcov ===') - self.phase_make('check') + if not self.options.use_clang: + 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 ===') @@ -1748,10 +1659,11 @@ class PrepareBuild(CommandLineApp): self.log.info('=== Building opt ===') self.phase_make(*args) - self.configure_flavor('gcov', reset) + if not self.options.use_clang: + self.configure_flavor('gcov', reset) - self.log.info('=== Building gcov ===') - self.phase_make(*args) + self.log.info('=== Building gcov ===') + self.phase_make(*args) self.log.info('=== Building default ===') self.phase_make(*args) |