diff options
Diffstat (limited to 'acprep')
-rwxr-xr-x | acprep | 143 |
1 files changed, 78 insertions, 65 deletions
@@ -188,7 +188,7 @@ class PrepareBuild(CommandLineApp): self.sys_library_dirs = [] self.CPPFLAGS = [] - self.CCFLAGS = [] + self.CFLAGS = [] self.CXXFLAGS = [] self.LDFLAGS = [] @@ -200,7 +200,7 @@ class PrepareBuild(CommandLineApp): 'LEDGER_PRODUCTS': None, 'CC': 'gcc', 'CPPFLAGS': '', - 'CCFLAGS': '', + 'CFLAGS': '', 'CXX': 'g++', 'CXXFLAGS': '', 'LD': 'g++', @@ -554,7 +554,7 @@ class PrepareBuild(CommandLineApp): 'automake', 'autoconf', 'libtool', - 'python26', + 'python26', '+universal', 'libiconv', '+universal', 'zlib', '+universal', 'gmp' ,'+universal', @@ -564,8 +564,8 @@ class PrepareBuild(CommandLineApp): 'gettext' ,'+universal', 'libedit' ,'+universal', 'boost-jam', - 'boost', '+st+python26+icu', - 'cppunit', + 'boost', '+icu+python26+st+universal', + 'cppunit', '+universal', #'texlive', #'doxygen', #'graphviz', @@ -605,7 +605,7 @@ class PrepareBuild(CommandLineApp): 'libboost1.40-dev', 'libboost-regex1.40-dev', 'libboost-date-time1.40-dev', - 'libboost-filesystem1.40-dev' + 'libboost-filesystem1.40-dev', 'libboost-python1.40-dev', 'libedit-dev', 'libcppunit-dev', @@ -636,7 +636,7 @@ class PrepareBuild(CommandLineApp): 'libboost-python1.35-dev', 'libboost-regex1.35-dev', 'libboost-date-time1.35-dev', - 'libboost-filesystem1.35-dev' + 'libboost-filesystem1.35-dev', 'libedit-dev', 'libcppunit-dev', #'texlive-full', @@ -654,16 +654,29 @@ class PrepareBuild(CommandLineApp): if release.readline().startswith('CentOS'): self.log.info('Looks like you are using YUM on CentOS') packages = [ - 'sudo', 'yum', 'install', 'gcc', 'gcc-c++', - 'compat-gcc-*', 'make', 'libtool', 'autoconf', - 'automake', 'zlib-devel', 'bzip2-devel', - 'python-devel', 'bboost-devel', - 'gmp-devel', 'gettext-devel', - #'mpfr-devel' - 'libedit-devel', 'cppunit-devel', - #'texlive-full', - #'doxygen', 'graphviz', 'texinfo', - #'lcov', 'sloccount' + 'sudo', 'yum', 'install', + 'gcc', + 'gcc-c++', + 'compat-gcc-*', + 'make', + 'libtool', + 'autoconf', + 'automake', + 'zlib-devel', + 'bzip2-devel', + 'python-devel', + 'bboost-devel', + 'gmp-devel', + 'gettext-devel', + #'mpfr-devel' + 'libedit-devel', + 'cppunit-devel', + #'texlive-full', + #'doxygen', + #'graphviz', + 'texinfo', + #'lcov', + #'sloccount' ] self.log.info('Executing: ' + string.join(packages, ' ')) self.execute(*packages) @@ -676,15 +689,15 @@ class PrepareBuild(CommandLineApp): environ, conf_args = self.configure_environment() - boost = 'boost_1_40_0' - tarball = boost + '.tar.bz2' + boost = 'boost_1_41_0' + tarball = boost + '.7z' if not exists(boost): if not exists(tarball): self.log.info('Downloading Boost source tarball ...') self.execute('curl', '-L', '-o', tarball, 'http://downloads.sourceforge.net/boost/' + - boost + '.tar.bz2?use_mirror=ufpr') + boost + '.7z?use_mirror=ufpr') if not exists(tarball): self.log.error('Failed to locate the Boost source tarball') @@ -699,12 +712,12 @@ class PrepareBuild(CommandLineApp): fd.close() digest = csum.hexdigest() - if digest != 'a17281fd88c48e0d866e1a12deecbcc0': + if digest != 'b74ee2f0f46cef601544dd4ac2d7dec4': self.log.error('Boost source tarball fails to match checksum') sys.exit(1) self.log.info('Extracting Boost source tarball ...') - self.execute('tar', 'xjf', tarball) + self.execute('7za', 'x', tarball) if not exists(boost): self.log.error('Failed to locate the Boost sources') @@ -804,7 +817,7 @@ class PrepareBuild(CommandLineApp): self.sys_library_dirs.append(path) def setup_for_johnw(self): - if self.current_flavor != 'opt': + if self.current_flavor == 'debug' or self.current_flavor == 'gcov': 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') @@ -814,13 +827,13 @@ class PrepareBuild(CommandLineApp): self.sys_library_dirs.insert(0, '/usr/local/stow/icu/lib') self.CPPFLAGS.append('-D_GLIBCXX_FULLY_DYNAMIC_STRING=1') + self.configure_args.append('--disable-shared') self.options.use_glibcxx_debug = True + else: + self.CXXFLAGS.append('-march=nocona') + self.CXXFLAGS.append('-msse3') - self.CXXFLAGS.append('-march=nocona') - self.CXXFLAGS.append('-msse3') - - self.configure_args.append('--disable-shared') self.configure_args.append('--enable-doxygen') self.configure_args.append('--enable-python') @@ -853,7 +866,8 @@ class PrepareBuild(CommandLineApp): self.locate_darwin_libraries() - if self.current_flavor == 'opt' and \ + if (self.current_flavor == 'opt' or \ + self.current_flavor == 'default') and \ exists('/usr/bin/g++-4.2'): self.envvars['CC'] = '/usr/bin/gcc-4.2' self.envvars['CXX'] = '/usr/bin/g++-4.2' @@ -912,7 +926,7 @@ class PrepareBuild(CommandLineApp): def finalize_config(self): self.setup_flavor() - for var in ('CPPFLAGS', 'CCFLAGS', 'CXXFLAGS', 'LDFLAGS'): + for var in ('CPPFLAGS', 'CFLAGS', 'CXXFLAGS', 'LDFLAGS'): value = self.__dict__[var] if value: first = not self.envvars[var] @@ -1031,39 +1045,23 @@ class PrepareBuild(CommandLineApp): ######################################################################### def locate_darwin_libraries(self): - if self.current_flavor != 'opt': + if self.current_flavor == 'debug' or self.current_flavor == 'gcov': self.log.debug('We are using GLIBCXX_DEBUG, so setting up flags') 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') - - 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') - - 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('/usr/local/lib/libboost_regex-xgcc44-sd-1_40.a'): + if exists('/usr/local/lib/libboost_regex-xgcc44-sd-1_41.a'): self.envvars['BOOST_HOME'] = '/usr/local' - self.envvars['BOOST_SUFFIX'] = '-xgcc44-sd-1_40' - self.sys_include_dirs.append('/usr/local/include/boost-1_40') + self.envvars['BOOST_SUFFIX'] = '-xgcc44-sd-1_41' + self.sys_include_dirs.append('/usr/local/include/boost-1_41') self.inform_boost_location('is really located', self.envvars['BOOST_SUFFIX']) - elif exists('/usr/local/lib/libboost_regex-xgcc44-d-1_40.a'): + elif exists('/usr/local/lib/libboost_regex-xgcc44-d-1_41.a'): self.envvars['BOOST_HOME'] = '/usr/local' - self.envvars['BOOST_SUFFIX'] = '-xgcc44-d-1_40' - self.sys_include_dirs.append('/usr/local/include/boost-1_40') + self.envvars['BOOST_SUFFIX'] = '-xgcc44-d-1_41' + self.sys_include_dirs.append('/usr/local/include/boost-1_41') self.inform_boost_location('is really located', self.envvars['BOOST_SUFFIX']) @@ -1082,17 +1080,17 @@ class PrepareBuild(CommandLineApp): self.inform_boost_location('is really located', self.envvars['BOOST_SUFFIX']) - elif exists('/usr/local/lib/libboost_regex-xgcc44-s-1_40.a'): + elif exists('/usr/local/lib/libboost_regex-xgcc44-s-1_41.a'): self.envvars['BOOST_HOME'] = '/usr/local' - self.envvars['BOOST_SUFFIX'] = '-xgcc44-s-1_40' - self.sys_include_dirs.append('/usr/local/include/boost-1_40') + self.envvars['BOOST_SUFFIX'] = '-xgcc44-s-1_41' + self.sys_include_dirs.append('/usr/local/include/boost-1_41') self.inform_boost_location('is really located', self.envvars['BOOST_SUFFIX']) - elif exists('/usr/local/lib/libboost_regex-xgcc44-1_40.a'): + elif exists('/usr/local/lib/libboost_regex-xgcc44-1_41.a'): self.envvars['BOOST_HOME'] = '/usr/local' - self.envvars['BOOST_SUFFIX'] = '-xgcc44-1_40' - self.sys_include_dirs.append('/usr/local/include/boost-1_40') + self.envvars['BOOST_SUFFIX'] = '-xgcc44-1_41' + self.sys_include_dirs.append('/usr/local/include/boost-1_41') self.inform_boost_location('is really located', self.envvars['BOOST_SUFFIX']) @@ -1107,13 +1105,23 @@ class PrepareBuild(CommandLineApp): def setup_flavor_opt(self): if self.darwin_gcc: - self.CXXFLAGS.append('-fast') - self.LDFLAGS.append('-fast') + self.option_no_pch() + if '--disable-shared' in self.configure_args: + self.configure_args.remove('--disable-shared') + self.configure_args.append('--disable-dependency-tracking') + for i in ['-fast']: + self.CXXFLAGS.append(i) + self.CFLAGS.append(i) + self.LDFLAGS.append(i) + for i in ['-arch', 'i386', '-arch', 'x86_64']: + self.CXXFLAGS.append(i) + self.CFLAGS.append(i) + self.LDFLAGS.append(i) else: - self.CXXFLAGS.append('-O3') - self.LDFLAGS.append('-O3') - self.CXXFLAGS.append('-fomit-frame-pointer') - self.LDFLAGS.append('-fomit-frame-pointer') + for i in ['-O3', '-fomit-frame-pointer']: + self.CXXFLAGS.append(i) + self.CFLAGS.append(i) + self.LDFLAGS.append(i) def setup_flavor_gcov(self): self.CXXFLAGS.append('-g') @@ -1180,7 +1188,7 @@ class PrepareBuild(CommandLineApp): conf_args = ['sh', join(self.source_dir, 'configure'), '--srcdir', self.source_dir] - for var in ('CC', 'CPPFLAGS', 'CCFLAGS', 'CXX', 'CXXFLAGS', + for var in ('CC', 'CPPFLAGS', 'CFLAGS', 'CXX', 'CXXFLAGS', 'LD', 'LDFLAGS'): if self.envvars.has_key(var) and self.envvars[var] and \ (var.endswith('FLAGS') or exists(self.envvars[var])): @@ -1237,6 +1245,11 @@ class PrepareBuild(CommandLineApp): if not self.options.no_patch: self.phase_patch() + + # Wipe the pre-compiled header, if there is one + pch = join(self.build_directory(), 'system.hh.gch') + if exists(pch): + os.remove(pch) else: if not self.options.no_patch and \ self.isnewer('Makefile', '.timestamp'): |