diff options
author | John Wiegley <johnw@newartisans.com> | 2012-04-25 03:08:03 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-04-25 03:09:56 -0500 |
commit | 72d10112512278b219220458a13dbc53f5b646f5 (patch) | |
tree | 4898807e5f9f2415fe2f967fb7f38b820359fff3 | |
parent | 6af3f0448fe8b3bf3472504a3ee547a816ab381a (diff) | |
download | fork-ledger-72d10112512278b219220458a13dbc53f5b646f5.tar.gz fork-ledger-72d10112512278b219220458a13dbc53f5b646f5.tar.bz2 fork-ledger-72d10112512278b219220458a13dbc53f5b646f5.zip |
Build-related changes
-rwxr-xr-x | acprep | 48 | ||||
-rw-r--r-- | lib/Makefile | 3 | ||||
-rwxr-xr-x | lib/build.sh | 12 |
3 files changed, 34 insertions, 29 deletions
@@ -535,9 +535,9 @@ class PrepareBuild(CommandLineApp): op.add_option('', '--gcc48', action='store_true', dest='gcc48', default=False, help='Require the use of gcc 4.8') - op.add_option('', '--cpp0x', action='store_true', - dest='cpp0x', default=False, - help='Use C++0x extensions (requires Clang or gcc 4.6/7/8)') + 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('', '--output', metavar='DIR', action="callback", callback=self.option_output, help='Build in the specified directory') @@ -1019,14 +1019,21 @@ class PrepareBuild(CommandLineApp): self.log.info('Setting up for using Clang') self.boost_inc_ident = "clang31" - self.boost_lib_ident = "clang-darwin42" - - #self.CXXFLAGS.append('-std=c++11') - #self.CXXFLAGS.append('-stdlib=libc++') - #self.LDFLAGS.append('-stdlib=libc++') - - global search_prefixes - search_prefixes = [ '/opt/local', '/usr/local', '/sw', '/usr' ] + 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.log.debug('Using Clang ident: %s/%s' % (self.boost_inc_ident, self.boost_lib_ident)) @@ -1077,14 +1084,14 @@ class PrepareBuild(CommandLineApp): elif system == 'Darwin': if self.options.use_clang: - if 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' - elif exists('/usr/local/bin/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++' @@ -1143,9 +1150,6 @@ class PrepareBuild(CommandLineApp): if self.options.no_python: self.configure_args.remove('--enable-python') - if self.options.cpp0x: - self.CXXFLAGS.append('-std=c++0x') - if exists('/Users/johnw/Projects/ledger/plan/TODO'): self.setup_for_johnw() self.setup_system_directories() @@ -1323,7 +1327,8 @@ class PrepareBuild(CommandLineApp): def locate_darwin_libraries(self): if self.current_flavor == 'debug': - if not self.options.use_clang and self.boost_info.configure( + 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' % \ @@ -1337,7 +1342,8 @@ class PrepareBuild(CommandLineApp): else: if self.boost_info.configure(): pass - elif not self.options.use_clang and self.boost_info.configure( + 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' % \ diff --git a/lib/Makefile b/lib/Makefile index ba7f5ffa..cb05e44d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -49,12 +49,11 @@ all: boost-build #icu-build boost-icu-build prepare-boost: perl -i -pe 's/local command = \[ common\.get-invocation-command darwin : g\+\+ : .*/local command = [ common.get-invocation-command darwin : g++ : $(CXX) ] ;/;' $(BOOST_SOURCE)/tools/build/v2/tools/darwin.jam perl -i -pe 's/flags darwin\.compile OPTIONS : -no-cpp-precomp -gdwarf-2 (-fexceptions )?;/flags darwin\.compile OPTIONS : -gdwarf-2 \1;/;' $(BOOST_SOURCE)/tools/build/v2/tools/darwin.jam - perl -i -pe 's/command = \[ common\.get-invocation-command clang-darwin : clang\+\+ $$/command = [ common.get-invocation-command clang-darwin : clang++-mp-3.1/;' $(BOOST_SOURCE)/tools/build/v2/tools/clang-darwin.jam boost-build: prepare-boost (cd $(BOOST_SOURCE) && \ sh bootstrap.sh && \ - ./b2 $(OPTJ) debug --prefix=$(BOOST_STOW) \ + ./b2 $(OPTJ) debug release --prefix=$(BOOST_STOW) \ --build-dir=$(BOOST_BUILD) $(BOOST_FLAGS) install) icu-build: diff --git a/lib/build.sh b/lib/build.sh index 2d18dc58..28408d73 100755 --- a/lib/build.sh +++ b/lib/build.sh @@ -7,11 +7,11 @@ export PATH=$PATH:/opt/local/lib/openmpi/bin cat > ~/user-config.jam <<EOF -using clang-darwin : : "/opt/local/bin/clang++-mp-3.1" : <cxxflags>-std=c++11 ; +using clang-darwin : : "/usr/local/bin/clang++" : <cxxflags>-std=c++11 <include>/usr/local/include ; EOF -make CXX=clang++-mp-3.1 LD=clang++-mp-3.1 CC=clang-mp-3.1 OPTJ=-j16 \ - CXXFLAGS="-g -std=c++11 -stdlib=libc++" \ - LDFLAGS="-g -stdlib=libc++" \ - BOOST_TOOLSET=clang DIR_SUFFIX=clang31 \ - BOOST_DEFINES="include=/opt/local/include -sICU_PATH=/opt/local -sICONV_PATH=/opt/local cxxflags=\"-g -std=c++11 -stdlib=libc++\" linkflags=\"-g -stdlib=libc++\""
\ No newline at end of file +# jww (2012-04-24): This is still linking against /usr/lib/libc++.1.dylib +# instead of /usr/local/lib/libc++.1.dylib +make CXX=clang++ LD=clang++ CC=clang OPTJ=-j20 \ + BOOST_TOOLSET=clang-darwin DIR_SUFFIX=clang31 \ + BOOST_DEFINES="-sICU_PATH=/usr/local cxxflags=\"-g -std=c++11 -nostdlibinc -I/usr/local/include -I/usr/local/include/c++/v1 -I/opt/local/include -I/usr/include -stdlib=libc++\" linkflags=\"-g -Z -L/usr/local/lib -L/opt/local/lib -L/usr/lib /usr/local/lib/libc++.dylib -stdlib=libc++\"" |