summaryrefslogtreecommitdiff
path: root/acprep
diff options
context:
space:
mode:
Diffstat (limited to 'acprep')
-rwxr-xr-xacprep100
1 files changed, 58 insertions, 42 deletions
diff --git a/acprep b/acprep
index 114857c7..badf8425 100755
--- a/acprep
+++ b/acprep
@@ -461,6 +461,9 @@ class PrepareBuild(CommandLineApp):
op.add_option('', '--force', action="callback",
callback=self.option_force,
help="Perform every action, without checking")
+ op.add_option('', '--clang', action='store_true',
+ dest='use_clang', default=False,
+ help='Use the Clang C++ compiler')
op.add_option('', '--glibcxx-debug', action='store_true',
dest='use_glibcxx_debug', default=False,
help='Define _GLIBCXX_DEBUG=1 during compilation')
@@ -678,7 +681,8 @@ class PrepareBuild(CommandLineApp):
self.log.info("Need to run configure => " +
str(self.need_to_run_configure()))
self.log.info("Use _GLIBCXX_DEBUG => " +
- str(self.options.use_glibcxx_debug))
+ str(self.options.use_glibcxx_debug
+ and not self.options.use_clang))
self.log.info("Use pre-compiled headers => " +
str('--enable-pch' in conf_args))
@@ -949,31 +953,44 @@ class PrepareBuild(CommandLineApp):
self.sys_library_dirs.append(path)
def setup_for_johnw(self):
- match = re.search('gcc-mp-([0-9]+)\.([0-9]+)', self.envvars['CC'])
- if match:
- gcc_version = match.group(1) + match.group(2)
+ if self.options.use_clang:
+ self.boost_inc_ident = "clang"
+ self.boost_lib_ident = "29"
+
+ self.log.debug('Using Clang ident: %s/%s' %
+ (self.boost_inc_ident, self.boost_lib_ident))
else:
- gcc_version = "42"
+ 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"
+
+ self.log.debug('Using Boost ident: %s/%s' %
+ (self.boost_inc_ident, self.boost_lib_ident))
- if gcc_version != "42":
+ if self.boost_lib_ident != "xgcc42":
self.CPPFLAGS.append('-D_GLIBCXX_FULLY_DYNAMIC_STRING=1')
if self.current_flavor == 'debug':
- if exists('/usr/local/stow/cppunit-gcc%s/include' % gcc_version):
+ if exists('/usr/local/stow/cppunit-%s/include' % self.boost_inc_ident):
self.sys_include_dirs.insert(
- 0, '/usr/local/stow/cppunit-gcc%s/include' % gcc_version)
+ 0, '/usr/local/stow/cppunit-%s/include' % self.boost_inc_ident)
self.sys_library_dirs.insert(
- 0, '/usr/local/stow/cppunit-gcc%s/lib' % gcc_version)
+ 0, '/usr/local/stow/cppunit-%s/lib' % self.boost_inc_ident)
- if exists('/usr/local/stow/icu-gcc%s/include' % gcc_version):
+ if exists('/usr/local/stow/icu-%s/include' % self.boost_inc_ident):
self.sys_include_dirs.insert(
- 0, '/usr/local/stow/icu-gcc%s/include' % gcc_version)
+ 0, '/usr/local/stow/icu-%s/include' % self.boost_inc_ident)
self.sys_library_dirs.insert(
- 0, '/usr/local/stow/icu-gcc%s/lib' % gcc_version)
+ 0, '/usr/local/stow/icu-%s/lib' % self.boost_inc_ident)
self.configure_args.append('--disable-shared')
- self.options.use_glibcxx_debug = True
+ if not self.options.use_clang:
+ self.options.use_glibcxx_debug = True
elif self.current_flavor == 'gcov':
self.configure_args.append('--disable-shared')
else:
@@ -1004,7 +1021,11 @@ class PrepareBuild(CommandLineApp):
self.CXXFLAGS.append('-pthread')
elif system == 'Darwin':
- if (self.current_flavor == 'opt' or \
+ if self.options.use_clang:
+ 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 \
exists('/usr/bin/g++-4.2'):
@@ -1014,7 +1035,10 @@ class PrepareBuild(CommandLineApp):
self.darwin_gcc = True
elif exists('/opt/local/bin/g++-mp-4.5'):
self.envvars['CC'] = '/opt/local/bin/gcc-mp-4.5'
- self.envvars['CXX'] = '/opt/local/bin/g++-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'
@@ -1106,7 +1130,7 @@ class PrepareBuild(CommandLineApp):
self.configure_args.append('--enable-pch')
- self.CXXFLAGS.append('-fpch-deps')
+ self.LDFLAGS.append('-fpch-deps')
self.CXXFLAGS.append('-Wconversion')
#self.CXXFLAGS.append('-Wold-style-cast')
@@ -1152,7 +1176,7 @@ class PrepareBuild(CommandLineApp):
self.CXXFLAGS.append('-Woverloaded-virtual')
self.CXXFLAGS.append('-Wsign-compare')
self.CXXFLAGS.append('-Wsign-promo')
- self.CXXFLAGS.append('-Wstrict-null-sentinel')
+ #self.CXXFLAGS.append('-Wstrict-null-sentinel')
self.CXXFLAGS.append('-Wwrite-strings')
self.CXXFLAGS.append('-Wno-old-style-cast')
self.CXXFLAGS.append('-Wno-deprecated')
@@ -1197,32 +1221,24 @@ class PrepareBuild(CommandLineApp):
#########################################################################
def locate_darwin_libraries(self):
- match = re.search('gcc-mp-([0-9]+)\.([0-9]+)', self.envvars['CC'])
- if match:
- gcc_version = match.group(1) + match.group(2)
- else:
- gcc_version = "42"
-
- self.log.debug('Using gcc version: %s' % gcc_version)
-
if self.current_flavor == 'debug':
- if self.options.use_glibcxx_debug:
+ if self.options.use_glibcxx_debug and not self.options.use_clang:
self.log.debug('We are using GLIBCXX_DEBUG, so setting up flags')
self.CPPFLAGS.append('-D_GLIBCXX_DEBUG=1')
if self.boost_info.configure(
- home_path = '/usr/local/stow/boost_%s_0-gcc%s' % \
- (self.boost_version, gcc_version),
- suffix = '-xgcc%s-sd-%s' % \
- (gcc_version, self.boost_version),
+ home_path = '/usr/local/stow/boost_%s_0-%s' % \
+ (self.boost_version, self.boost_inc_ident),
+ suffix = '-%s-sd-%s' % \
+ (self.boost_lib_ident, self.boost_version),
file_suffix = '.dylib',
include_path = 'include/boost-%s' % self.boost_version):
pass
elif self.boost_info.configure(
- home_path = '/usr/local/stow/boost_%s_0-gcc%s' % \
- (self.boost_version, gcc_version),
- suffix = '-xgcc%s-d-%s' % \
- (gcc_version, self.boost_version),
+ home_path = '/usr/local/stow/boost_%s_0-%s' % \
+ (self.boost_version, self.boost_inc_ident),
+ suffix = '-%s-d-%s' % \
+ (self.boost_lib_ident, self.boost_version),
file_suffix = '.dylib',
include_path = 'include/boost-%s' % self.boost_version):
pass
@@ -1233,18 +1249,18 @@ class PrepareBuild(CommandLineApp):
if self.boost_info.configure():
pass
elif self.boost_info.configure(
- home_path = '/usr/local/stow/boost_%s_0-gcc%s' % \
- (self.boost_version, gcc_version),
- suffix = '-xgcc%s-s-%s' % \
- (gcc_version, self.boost_version),
+ home_path = '/usr/local/stow/boost_%s_0-%s' % \
+ (self.boost_version, self.boost_inc_ident),
+ suffix = '-%s-s-%s' % \
+ (self.boost_lib_ident, self.boost_version),
file_suffix = '.dylib',
include_path = 'include/boost-%s' % self.boost_version):
pass
elif self.boost_info.configure(
- home_path = '/usr/local/stow/boost_%s_0-gcc%s' % \
- (self.boost_version, gcc_version),
- suffix = '-xgcc%s-%s' % \
- (gcc_version, self.boost_version),
+ home_path = '/usr/local/stow/boost_%s_0-%s' % \
+ (self.boost_version, self.boost_inc_ident),
+ suffix = '-%s-%s' % \
+ (self.boost_lib_ident, self.boost_version),
file_suffix = '.dylib',
include_path = 'include/boost-%s' % self.boost_version):
pass