From fcd05632e0fa8798dc7d284609fc9ee88cabf4b8 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 27 Apr 2012 15:48:00 -0500 Subject: Fixes to the proofing process --- tools/proof | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/proof b/tools/proof index 00c7f7d1..c4d3c9f1 100755 --- a/tools/proof +++ b/tools/proof @@ -48,8 +48,8 @@ EOF else echo $VERSION > $DEST/last-proofed - cd $DEST/ledger-proof/debug; make docs - cd $DEST/ledger-proof/gcov; make report + cd $DEST/ledger-proof-python-gcc47/debug; make docs + cd $DEST/ledger-proof-python-gcc47/gcov; make report mutt -s '[ledger] Proof build succeeded' johnw@newartisans.com < Date: Sat, 28 Apr 2012 05:23:36 -0500 Subject: Added support for building with Clang and libc++ in C++11 --- acprep | 4 +--- src/pyutils.h | 2 ++ src/utils.cc | 4 ++-- src/utils.h | 8 ++++---- tools/configure.ac | 28 ++++++++++++++++++++++++++++ 5 files changed, 37 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/acprep b/acprep index e303ea61..463f028d 100755 --- a/acprep +++ b/acprep @@ -1022,14 +1022,11 @@ class PrepareBuild(CommandLineApp): 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') self.log.debug('Using Clang ident: %s/%s' % @@ -1231,6 +1228,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') diff --git a/src/pyutils.h b/src/pyutils.h index 44bb6d90..2c7dfaeb 100644 --- a/src/pyutils.h +++ b/src/pyutils.h @@ -180,7 +180,9 @@ namespace boost { namespace python { BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(T,expr, pytype) \ BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE(T,expr) +#if !defined(HAVE_CPP11) && (defined(VERIFY_ON) || defined(HAVE_BOOST_PYTHON)) BOOST_PYTHON_TO_PYTHON_BY_VALUE(ledger::string, ::PyUnicode_FromEncodedObject(::PyString_FromString(x.c_str()), "UTF-8", NULL), &PyUnicode_Type) +#endif } } // namespace boost::python diff --git a/src/utils.cc b/src/utils.cc index 17118904..ada6b600 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -489,7 +489,7 @@ void report_memory(std::ostream& out, bool report_all) namespace ledger { -#if defined(VERIFY_ON) || defined(HAVE_BOOST_PYTHON) +#if !defined(HAVE_CPP11) && (defined(VERIFY_ON) || defined(HAVE_BOOST_PYTHON)) string::string() : std::string() { TRACE_CTOR(string, ""); @@ -527,7 +527,7 @@ string::~string() throw() { TRACE_DTOR(string); } -#endif // defined(VERIFY_ON) || defined(HAVE_BOOST_PYTHON) +#endif // !defined(HAVE_CPP11) && (defined(VERIFY_ON) || defined(HAVE_BOOST_PYTHON)) string empty_string(""); diff --git a/src/utils.h b/src/utils.h index 8f11f75a..34011e3f 100644 --- a/src/utils.h +++ b/src/utils.h @@ -72,7 +72,7 @@ namespace ledger { using namespace boost; -#if defined(VERIFY_ON) || defined(HAVE_BOOST_PYTHON) +#if !defined(HAVE_CPP11) && (defined(VERIFY_ON) || defined(HAVE_BOOST_PYTHON)) class string; #else typedef std::string string; @@ -93,7 +93,7 @@ namespace ledger { } #if BOOST_FILESYSTEM_VERSION == 3 -#if defined(VERIFY_ON) || defined(HAVE_BOOST_PYTHON) +#if !defined(HAVE_CPP11) && (defined(VERIFY_ON) || defined(HAVE_BOOST_PYTHON)) namespace boost { namespace filesystem3 { namespace path_traits { template<> struct is_pathable { static const bool value = true; }; }}} @@ -193,7 +193,7 @@ void report_memory(std::ostream& out, bool report_all = false); namespace ledger { -#if defined(VERIFY_ON) || defined(HAVE_BOOST_PYTHON) +#if !defined(HAVE_CPP11) && (defined(VERIFY_ON) || defined(HAVE_BOOST_PYTHON)) class string : public std::string { @@ -272,7 +272,7 @@ inline bool operator!=(const char* __lhs, const string& __rhs) inline bool operator!=(const string& __lhs, const char* __rhs) { return __lhs.compare(__rhs) != 0; } -#endif // defined(VERIFY_ON) || defined(HAVE_BOOST_PYTHON) +#endif // !defined(HAVE_CPP11) && (defined(VERIFY_ON) || defined(HAVE_BOOST_PYTHON)) extern string empty_string; diff --git a/tools/configure.ac b/tools/configure.ac index f7623f62..99eb7df5 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -527,6 +527,34 @@ AC_CACHE_CHECK( AM_CONDITIONAL(HAVE_BOOST_TEST, test x$boost_test_avail_cv_ = xtrue) +# check for C++11 and libc++ +AC_CACHE_CHECK( + [if C++11 and libc++ are available], + [cpp11_avail_cv_], + [cpp11_save_cxxflags=$CXXFLAGS + cpp11_save_ldflags=$LDFLAGS + CXXFLAGS="-std=c++11 -stdlib=libc++ $CXXFLAGS" + LDFLAGS="-stdlib=libc++ $LDFLAGS" + AC_LANG_PUSH(C++) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include ]], + [[boost::regex foo_regexp("Hello, world!"); + for (auto i : "Hello, world") + std::cout << i << std::endl;]])], + [cpp11_avail_cv_=true], + [cpp11_avail_cv_=false]) + AC_LANG_POP + CXXFLAGS="$cpp11_save_cxxflags" + LDFLAGS="$cpp11_save_ldflags"]) + +if [test x$cpp11_avail_cv_ = xtrue]; then + AC_DEFINE([HAVE_CPP11], [1], [Whether C++11 and libc++ are available]) + CXXFLAGS="-std=c++11 -stdlib=libc++ $CXXFLAGS" + LDFLAGS="-stdlib=libc++ $LDFLAGS" +fi + # Checks for header files. AC_HEADER_STDC AC_HEADER_STAT -- cgit v1.2.3 From 3122182c48f5fb3da437860440bb7ab1b64cc32b Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 7 May 2012 01:55:52 -0500 Subject: Don't run the proof build against Clang for now --- tools/proof | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tools') diff --git a/tools/proof b/tools/proof index c4d3c9f1..33f825de 100755 --- a/tools/proof +++ b/tools/proof @@ -20,19 +20,19 @@ ledger_proof() { time nice -n 20 \ ./acprep --debug --enable-doxygen --universal --gcc47 -j16 proof 2>&1 | \ - tee -a $LOGDIR/ledger-proof.log + tee -a $LOGDIR/ledger-proof-gcc47.log time nice -n 20 \ ./acprep --debug --enable-doxygen --universal --python --gcc47 -j16 proof 2>&1 | \ - tee -a $LOGDIR/ledger-proof.log - - time nice -n 20 \ - ./acprep --debug --enable-doxygen --universal --clang -j16 proof 2>&1 | \ - tee -a $LOGDIR/ledger-proof.log - - time nice -n 20 \ - ./acprep --debug --enable-doxygen --universal --python --clang -j16 proof 2>&1 | \ - tee -a $LOGDIR/ledger-proof.log + tee -a $LOGDIR/ledger-proof-gcc47-python.log + + #time nice -n 20 \ + # ./acprep --debug --enable-doxygen --universal --clang -j16 proof 2>&1 | \ + # tee -a $LOGDIR/ledger-proof-clang.log + # + #time nice -n 20 \ + # ./acprep --debug --enable-doxygen --universal --python --clang -j16 proof 2>&1 | \ + # tee -a $LOGDIR/ledger-proof-clang-python.log if egrep -q '(ERROR|CRITICAL)' $LOGDIR/ledger-proof.log; then mutt -a $LOGDIR/ledger-proof.log \ -- cgit v1.2.3 From b898d40a81167113b7c235b9458636b29f90fd86 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 10 May 2012 16:30:32 -0500 Subject: More configuration fixes --- acprep | 6 +++++- tools/configure.ac | 52 ++++++++++++++++++++++++++-------------------------- 2 files changed, 31 insertions(+), 27 deletions(-) (limited to 'tools') diff --git a/acprep b/acprep index b4e0b979..ea3583c4 100755 --- a/acprep +++ b/acprep @@ -539,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') @@ -1080,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() diff --git a/tools/configure.ac b/tools/configure.ac index 99eb7df5..418ffd7d 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -528,32 +528,32 @@ AC_CACHE_CHECK( AM_CONDITIONAL(HAVE_BOOST_TEST, test x$boost_test_avail_cv_ = xtrue) # check for C++11 and libc++ -AC_CACHE_CHECK( - [if C++11 and libc++ are available], - [cpp11_avail_cv_], - [cpp11_save_cxxflags=$CXXFLAGS - cpp11_save_ldflags=$LDFLAGS - CXXFLAGS="-std=c++11 -stdlib=libc++ $CXXFLAGS" - LDFLAGS="-stdlib=libc++ $LDFLAGS" - AC_LANG_PUSH(C++) - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include - #include ]], - [[boost::regex foo_regexp("Hello, world!"); - for (auto i : "Hello, world") - std::cout << i << std::endl;]])], - [cpp11_avail_cv_=true], - [cpp11_avail_cv_=false]) - AC_LANG_POP - CXXFLAGS="$cpp11_save_cxxflags" - LDFLAGS="$cpp11_save_ldflags"]) - -if [test x$cpp11_avail_cv_ = xtrue]; then - AC_DEFINE([HAVE_CPP11], [1], [Whether C++11 and libc++ are available]) - CXXFLAGS="-std=c++11 -stdlib=libc++ $CXXFLAGS" - LDFLAGS="-stdlib=libc++ $LDFLAGS" -fi +#AC_CACHE_CHECK( +# [if C++11 and libc++ are available], +# [cpp11_avail_cv_], +# [cpp11_save_cxxflags=$CXXFLAGS +# cpp11_save_ldflags=$LDFLAGS +# CXXFLAGS="-std=c++11 -stdlib=libc++ $CXXFLAGS" +# LDFLAGS="-stdlib=libc++ $LDFLAGS" +# AC_LANG_PUSH(C++) +# AC_LINK_IFELSE( +# [AC_LANG_PROGRAM( +# [[#include +# #include ]], +# [[boost::regex foo_regexp("Hello, world!"); +# for (auto i : "Hello, world") +# std::cout << i << std::endl;]])], +# [cpp11_avail_cv_=true], +# [cpp11_avail_cv_=false]) +# AC_LANG_POP +# CXXFLAGS="$cpp11_save_cxxflags" +# LDFLAGS="$cpp11_save_ldflags"]) +# +#if [test x$cpp11_avail_cv_ = xtrue]; then +# AC_DEFINE([HAVE_CPP11], [1], [Whether C++11 and libc++ are available]) +# CXXFLAGS="-std=c++11 -stdlib=libc++ $CXXFLAGS" +# LDFLAGS="-stdlib=libc++ $LDFLAGS" +#fi # Checks for header files. AC_HEADER_STDC -- cgit v1.2.3