Build fixes to acprep and build.sh

This commit is contained in:
John Wiegley 2012-05-25 04:13:03 -05:00
parent ed150182fb
commit 98df1296fe
2 changed files with 35 additions and 11 deletions

31
acprep
View file

@ -296,6 +296,9 @@ class PrepareBuild(CommandLineApp):
op.add_option('', '--compiler', metavar='COMPILER',
action="store", dest="compiler",
help='Use the Clang C++ compiler')
op.add_option('', '--cxx', metavar='COMPILER',
action="store", dest="compiler",
help='Use the Clang C++ compiler')
op.add_option('', '--no-git', action='store_true', dest='no_git',
default=False,
@ -654,8 +657,11 @@ class PrepareBuild(CommandLineApp):
#########################################################################
def setup_for_johnw(self):
if not self.options.compiler or self.options.compiler == "clang-3.1":
self.envvars['CXX'] = '/usr/local/stow/clang-3.1/bin/clang++'
self.configure_args.append('-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON')
self.configure_args.append('-DBoost_USE_MULTITHREADED:BOOL=OFF')
if not self.options.compiler:
self.configure_args.append('-DCMAKE_CXX_COMPILER:PATH=/usr/local/stow/clang-3.1/bin/clang++')
self.CXXFLAGS.append('-Qunused-arguments')
self.CXXFLAGS.append('-nostdlibinc')
@ -667,17 +673,32 @@ class PrepareBuild(CommandLineApp):
self.CXXFLAGS.append('-Wl,/usr/local/lib/libc++.dylib')
self.CXXFLAGS.append('-Wno-disabled-macro-expansion')
if self.current_flavor == 'opt':
self.configure_args.append('-DCMAKE_CXX_FLAGS:STRING=-O4')
self.configure_args.append('-DCMAKE_CXX_LINK_FLAGS:STRING=-O4')
self.configure_args.append('-DCMAKE_INCLUDE_PATH:STRING=/usr/local/include;/opt/local/include')
self.configure_args.append('-DCMAKE_LIBRARY_PATH:STRING=/usr/local/lib;/opt/local/lib')
self.configure_args.append('-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON')
self.configure_args.append('-DBOOST_ROOT=/usr/local')
self.configure_args.append('-DBOOST_INCLUDEDIR=/usr/local/include/boost-1_49')
self.configure_args.append('-DBoost_COMPILER=-clang-darwin')
self.configure_args.append(self.source_dir)
elif self.options.compiler == "g=++-4.7":
self.envvars['CXX'] = '/opt/local/bin/g++-mp-4.7'
elif self.options.compiler == "icc":
self.configure_args.append('-DCMAKE_AR:PATH=/opt/intel/bin/xiar')
self.configure_args.append('-DCMAKE_CXX_COMPILER:PATH=/opt/intel/bin/icc')
if self.current_flavor == 'opt':
self.configure_args.append('-DCMAKE_CXX_FLAGS:STRING=-fast')
self.configure_args.append('-DCMAKE_CXX_LINK_FLAGS:STRING=-fast')
self.configure_args.append('-DCMAKE_INCLUDE_PATH:STRING=/opt/local/include')
self.configure_args.append('-DCMAKE_LIBRARY_PATH:STRING=/opt/local/lib')
self.configure_args.append('-DBOOST_ROOT=/opt/local')
self.configure_args.append(self.source_dir)
else:
self.configure_args.append('-DCMAKE_CXX_COMPILER:PATH=' + self.options.compiler)
self.configure_args.append('-DCMAKE_INCLUDE_PATH:STRING=/opt/local/include')
self.configure_args.append('-DCMAKE_LIBRARY_PATH:STRING=/opt/local/lib')
self.configure_args.append('-DBOOST_ROOT=/opt/local')

View file

@ -1,9 +1,12 @@
#!/bin/sh
time ( \
cd ~/src/ledger ; \
PATH=/usr/local/bin:/opt/local/bin:$PATH \
nice -n 20 ./acprep --debug --python --doxygen make -j20 && \
PATH=/usr/local/bin:/opt/local/bin:$PATH \
nice -n 20 ./acprep --debug --python --doxygen check -j20 \
flavor=$1
shift 1
time ( \
cd ~/src/ledger ; \
PATH=/usr/local/bin:/opt/local/bin:$PATH \
nice -n 20 ./acprep $flavor --debug --python --doxygen make "$@" && \
PATH=/usr/local/bin:/opt/local/bin:$PATH \
nice -n 20 ./acprep $flavor --debug --python --doxygen check "$@" \
)