Skip to content

Commit

Permalink
Enabled use of pre-compiled headers by default
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiegley committed Mar 10, 2009
1 parent 4f62bb1 commit 110f0b8
Show file tree
Hide file tree
Showing 71 changed files with 170 additions and 27 deletions.
56 changes: 31 additions & 25 deletions acprep
Original file line number Diff line number Diff line change
Expand Up @@ -657,41 +657,26 @@ class PrepareBuild(CommandLineApp):
def setup_for_johnw(self):
# jww (2009-03-09): Some peculiarities specific to my system
if exists('/usr/local/stow/cppunit/include'):
self.sys_include_dirs.append('/usr/local/stow/cppunit/include')
self.sys_library_dirs.append('/usr/local/stow/cppunit/lib')

self.option_pch()
self.option_warn()
self.sys_include_dirs.insert(0, '/usr/local/stow/cppunit/include')
self.sys_library_dirs.insert(0, '/usr/local/stow/cppunit/lib')

if '-march=native' in self.configure_args:
self.CXXFLAGS.remove('-march=native')
self.CXXFLAGS.append('-march=nocona')
self.CXXFLAGS.append('-msse3')

# g++ 4.0.1 cannot use PCH headers on OS X 10.5, so we must use a
# newer version. However, it also means I can't use GLIBCXX_DEBUG.
if '--enable-pch' not in self.configure_args and \
exists('/opt/local/bin/g++-mp-4.4'):
self.envvars['CC'] = '/opt/local/bin/gcc-mp-4.4'
self.envvars['CXX'] = '/opt/local/bin/g++-mp-4.4'
self.envvars['LD'] = '/opt/local/bin/g++-mp-4.4'
elif '--enable-pch' not in self.configure_args and \
exists('/opt/local/bin/g++-mp-4.3'):
self.envvars['CC'] = '/opt/local/bin/gcc-mp-4.3'
self.envvars['CXX'] = '/opt/local/bin/g++-mp-4.3'
self.envvars['LD'] = '/opt/local/bin/g++-mp-4.3'
elif exists('/usr/bin/g++-4.2'):
self.envvars['CC'] = '/usr/bin/gcc-4.2'
self.envvars['CXX'] = '/usr/bin/g++-4.2'
self.envvars['LD'] = '/usr/bin/g++-4.2'

def setup_for_system(self):
self.setup_system_directories()

system = self.get_stdout('uname', '-s')

self.log.debug('System type is => ' + system)

# These options are global defaults at the moment
self.option_warn()
if not self.no_pch:
self.option_pch()

if system == 'Linux':
arch = self.get_stdout('uname', '-m')
if arch == 'x86_64':
Expand All @@ -712,8 +697,29 @@ class PrepareBuild(CommandLineApp):

self.setup_for_johnw()

# g++ 4.0.1 cannot use PCH headers on OS X 10.5, so we must use a
# newer version.
if exists('/opt/local/bin/g++-mp-4.4'):
self.envvars['CC'] = '/opt/local/bin/gcc-mp-4.4'
self.envvars['CXX'] = '/opt/local/bin/g++-mp-4.4'
self.envvars['LD'] = '/opt/local/bin/g++-mp-4.4'
elif exists('/opt/local/bin/g++-mp-4.3'):
self.envvars['CC'] = '/opt/local/bin/gcc-mp-4.3'
self.envvars['CXX'] = '/opt/local/bin/g++-mp-4.3'
self.envvars['LD'] = '/opt/local/bin/g++-mp-4.3'
elif exists('/usr/bin/g++-4.2'):
self.envvars['CC'] = '/usr/bin/gcc-4.2'
self.envvars['CXX'] = '/usr/bin/g++-4.2'
self.envvars['LD'] = '/usr/bin/g++-4.2'

if '--enable-pch' in self.configure_args:
self.options.use_glibcxx_debug = False
else:
self.option_no_pch()

if '--enable-pch' not in self.configure_args and \
exists('/opt/local/bin/ccache') or exists('/usr/local/bin/ccache'):
exists('/opt/local/bin/ccache') or \
exists('/usr/local/bin/ccache'):
self.envvars['CC'] = 'ccache ' + self.envvars['CC']
self.envvars['CXX'] = 'ccache ' + self.envvars['CXX']
self.envvars['LD'] = 'ccache ' + self.envvars['LD']
Expand Down Expand Up @@ -887,8 +893,8 @@ class PrepareBuild(CommandLineApp):
self.sys_include_dirs.remove('/usr/local/stow/cppunit/include')
self.sys_library_dirs.remove('/usr/local/stow/cppunit/lib')

self.sys_include_dirs.append('/usr/local/stow/cppunit-debug/include')
self.sys_library_dirs.append('/usr/local/stow/cppunit-debug/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/lib/libboost_regex-xgcc40-d-1_38.a'):
self.envvars['BOOST_HOME'] = '/usr/local'
Expand Down
2 changes: 2 additions & 0 deletions src/account.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "account.h"
#include "post.h"
#include "xact.h"
Expand Down
2 changes: 2 additions & 0 deletions src/accum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "utils.h"

namespace ledger {
Expand Down
2 changes: 2 additions & 0 deletions src/amount.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "amount.h"
#include "commodity.h"

Expand Down
2 changes: 2 additions & 0 deletions src/balance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "balance.h"
#include "commodity.h"
#include "unistring.h" // for justify()
Expand Down
2 changes: 2 additions & 0 deletions src/chain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "chain.h"
#include "predicate.h"
#include "filters.h"
Expand Down
2 changes: 2 additions & 0 deletions src/commodity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "amount.h"
#include "commodity.h"

Expand Down
2 changes: 2 additions & 0 deletions src/compare.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "compare.h"
#include "op.h"
#include "post.h"
Expand Down
2 changes: 2 additions & 0 deletions src/derive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "derive.h"
#include "xact.h"
#include "post.h"
Expand Down
2 changes: 2 additions & 0 deletions src/emacs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "emacs.h"
#include "xact.h"
#include "post.h"
Expand Down
2 changes: 2 additions & 0 deletions src/error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "utils.h"

namespace ledger {
Expand Down
2 changes: 2 additions & 0 deletions src/expr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "expr.h"
#include "parser.h"

Expand Down
2 changes: 2 additions & 0 deletions src/filters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "filters.h"
#include "iterators.h"
#include "journal.h"
Expand Down
2 changes: 2 additions & 0 deletions src/format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "format.h"
#include "scope.h"
#include "unistring.h"
Expand Down
2 changes: 2 additions & 0 deletions src/generate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "generate.h"
#include "session.h"

Expand Down
2 changes: 2 additions & 0 deletions src/global.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "global.h"
#if defined(HAVE_BOOST_PYTHON)
#include "pyinterp.h"
Expand Down
2 changes: 2 additions & 0 deletions src/interactive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "interactive.h"

namespace ledger {
Expand Down
2 changes: 2 additions & 0 deletions src/item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "item.h"

namespace ledger {
Expand Down
2 changes: 2 additions & 0 deletions src/iterators.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "iterators.h"
#include "journal.h"
#include "compare.h"
Expand Down
2 changes: 2 additions & 0 deletions src/journal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "journal.h"
#include "xact.h"
#include "account.h"
Expand Down
2 changes: 2 additions & 0 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "global.h" // This is where the meat of main() is, which
// was moved there for the sake of clarity here
#include "session.h"
Expand Down
2 changes: 2 additions & 0 deletions src/mask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "mask.h"

namespace ledger {
Expand Down
2 changes: 2 additions & 0 deletions src/op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "op.h"
#include "scope.h"
#include "commodity.h"
Expand Down
2 changes: 2 additions & 0 deletions src/option.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "option.h"

namespace ledger {
Expand Down
2 changes: 2 additions & 0 deletions src/output.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "output.h"
#include "xact.h"
#include "post.h"
Expand Down
2 changes: 2 additions & 0 deletions src/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "parser.h"

namespace ledger {
Expand Down
2 changes: 2 additions & 0 deletions src/post.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "post.h"
#include "xact.h"
#include "account.h"
Expand Down
2 changes: 2 additions & 0 deletions src/precmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "precmd.h"
#include "xact.h"
#include "post.h"
Expand Down
2 changes: 2 additions & 0 deletions src/predicate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "predicate.h"

namespace ledger {
Expand Down
2 changes: 2 additions & 0 deletions src/py_amount.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "pyinterp.h"
#include "pyutils.h"
#include "pyfstream.h"
Expand Down
2 changes: 2 additions & 0 deletions src/py_balance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "pyinterp.h"

namespace ledger {
Expand Down
2 changes: 2 additions & 0 deletions src/py_chain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "pyinterp.h"

namespace ledger {
Expand Down
2 changes: 2 additions & 0 deletions src/py_commodity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "pyinterp.h"
#include "commodity.h"

Expand Down
2 changes: 2 additions & 0 deletions src/py_expr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "pyinterp.h"

namespace ledger {
Expand Down
2 changes: 2 additions & 0 deletions src/py_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <system.hh>

#include "pyinterp.h"

namespace ledger {
Expand Down
Loading

0 comments on commit 110f0b8

Please sign in to comment.