# # add_file "pch.hh" # # patch "ChangeLog" # from [6d6babd353a051b7b5d6028319c3c98c8d81f7b2] # to [d6b3f4aecd0536850ba3737b3e5254f922616169] # # patch "Makefile.am" # from [7bcbc664b0c5f2a68e783a01b9b25f6615c06e6d] # to [7390ccacbb02e3119bdf55fbb5155221ca72cd52] # # patch "configure.ac" # from [6b50b307f85eccc907f7d983675590c3bc18d481] # to [aa779314f87ea2b5a7ee729ecd928888e0c0d903] # # patch "pch.hh" # from [] # to [c321bf3d348009cd9eedc4807a113483687b2941] # ======================================================================== --- ChangeLog 6d6babd353a051b7b5d6028319c3c98c8d81f7b2 +++ ChangeLog d6b3f4aecd0536850ba3737b3e5254f922616169 @@ -1,3 +1,10 @@ +2005-11-27 Matt Johnston + + * Makefile.am, configure.ac, pch.hh: add --enable-pch configure + flag to enable precompiled boost headers. Based on LyX automake/autoconf + rules, Zbynek Winkler suggested that just boost headers would be + beneficial. + 2005-11-26 Nathaniel Smith * UPGRADE: Add note about serve changing syntax. ======================================================================== --- Makefile.am 7bcbc664b0c5f2a68e783a01b9b25f6615c06e6d +++ Makefile.am 7390ccacbb02e3119bdf55fbb5155221ca72cd52 @@ -233,9 +233,36 @@ # flags +if BUILD_PCH + +PCH_SOURCE = $(srcdir)/pch.hh +# the .gch file only will be seen if it's in the same dir as the .hh file, +# so need to copy it for separate build directories +PCH_BUILD = pch-build.hh +PCH_FLAGS = -Winvalid-pch -include $(PCH_BUILD) +PCH_FILE = ./pch-build.hh.gch +sinclude $(PCH_FILE).dep + +*.o *.lo *.obj: $(PCH_FILE) + +$(PCH_BUILD): $(PCH_SOURCE) + cp $(PCH_SOURCE) $(PCH_BUILD) + +$(PCH_FILE): $(PCH_BUILD) + $(MAKE) PCH_FLAGS= pch-file + +pch-file: + $(CXXCOMPILE) -x c++-header $(PCH_BUILD) -o $(PCH_FILE) \ + -MT $(PCH_FILE) -MD -MP -MF "./$(PCH_FILE).Tdep" \ + && mv "./$(PCH_FILE).Tdep" "./$(PCH_FILE).dep" \ + || rm "./$(PCH_FILE).Tdep" +endif + +SUFFIXES = .gch + AM_CPPFLAGS = AM_CFLAGS = $(AM_CPPFLAGS) -DTEMP_STORE=1 -DNDEBUG -DBOOST_DISABLE_THREADS -DBOOST_SP_DISABLE_THREADS -DSQLITE_OMIT_CURSOR $(SQLITE_CPPFLAGS) -AM_CXXFLAGS = $(AM_CPPFLAGS) -DNDEBUG -DBOOST_DISABLE_THREADS -DBOOST_SP_DISABLE_THREADS +AM_CXXFLAGS = $(AM_CPPFLAGS) $(PCH_FLAGS) -DNDEBUG -DBOOST_DISABLE_THREADS -DBOOST_SP_DISABLE_THREADS AM_LDFLAGS = lib3rdparty_a_CPPFLAGS = @@ -400,7 +427,7 @@ mostlyclean-local: rm -rf testsuite.dir testsuite.log package_full_revision_dist.txt -DISTCLEANFILES = tests/atconfig mt-stdint.h xgettext.opts +DISTCLEANFILES = tests/atconfig mt-stdint.h xgettext.opts pch-build.hh.gch.dep # distcheck stuff @@ -432,10 +459,11 @@ BUILT_SOURCES_CLEAN = std_hooks.h test_hooks.h schema.h views.h \ package_revision.txt package_revision.c \ - package_full_revision.txt package_full_revision.c + package_full_revision.txt package_full_revision.c \ + pch-build.hh.gch pch-build.hh BUILT_SOURCES_NOCLEAN = package_revision.txt package_full_revision_dist.txt BUILT_SOURCES = $(BUILT_SOURCES_CLEAN) $(BUILT_SOURCES_NOCLEAN) -CLEANFILES = $(BUILT_SOURCES_CLEAN) $(EPS_FIGURES) +CLEANFILES = $(BUILT_SOURCES_CLEAN) $(EPS_FIGURES) txt2c: txt2c.cc Makefile $(CXX) $(CXXFLAGS) -o $@ $< ======================================================================== --- configure.ac 6b50b307f85eccc907f7d983675590c3bc18d481 +++ configure.ac aa779314f87ea2b5a7ee729ecd928888e0c0d903 @@ -268,6 +268,26 @@ fi fi +# check for precompiled headers option +AC_ARG_ENABLE(pch, +AS_HELP_STRING([--enable-pch], + [use precompiled boost headers])) +AM_CONDITIONAL(BUILD_PCH, false) +if test x"${enable_pch}" == x"yes" +then + AC_MSG_CHECKING(for gcc with precompiled header support) + gxx_version=`${CXX} -dumpversion` + case $gxx_version in + 4.0*) + AC_MSG_RESULT(found) + AM_CONDITIONAL(BUILD_PCH, true) + ;; + *) + AC_MSG_RESULT(not found) + ;; + esac +fi + AC_CACHE_CHECK([if this is Windows], ac_win32, [ AC_TRY_RUN([ ======================================================================== --- pch.hh +++ pch.hh c321bf3d348009cd9eedc4807a113483687b2941 @@ -0,0 +1,29 @@ +#ifdef WIN32 +#define BOOST_NO_STDC_NAMESPACE +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include