diff --git a/configure.ac b/configure.ac index fdbf5be26..c97081168 100644 --- a/configure.ac +++ b/configure.ac @@ -190,6 +190,19 @@ AC_ARG_ENABLE(profile, AC_HELP_STRING([--enable-profile], [Enable profiling]), ]) +AC_MSG_CHECKING(if you want to disable precompiled headers) +AC_ARG_ENABLE(pch, AC_HELP_STRING([--disable-pch], [Disable precompiled header generation]), +[ + build_pch="no" + AC_MSG_RESULT([no]) +], [ + build_pch="yes" + AC_MSG_RESULT([yes]) +]) + +AM_CONDITIONAL([BUILD_PCH], [[[[ "$build_pch" = "yes" ]]]]) + + CWARNS="" AC_MSG_CHECKING(if you want to disable warnings) AC_ARG_ENABLE(warnings, @@ -1247,6 +1260,7 @@ echo "Compiler .......................... $CXX" echo "Compiler flags (CXXFLAGS) ......... $CXXFLAGS" echo "Building boost .................... $with_included_boost" echo "Building libltdl .................. $with_included_ltdl" +echo "Precompiled headers ............... $build_pch" echo "Developer debug ................... $debug" echo "IPv6 support ...................... $ipv6" echo "SSL type........................... $SSL_TYPE" diff --git a/include/rb/Makefile.am b/include/rb/Makefile.am index f2412c1a1..3d1513c31 100644 --- a/include/rb/Makefile.am +++ b/include/rb/Makefile.am @@ -6,7 +6,9 @@ if GCC AM_CXXFLAGS = -fpch-deps endif +if BUILD_PCH BUILT_SOURCES = rb.h.gch +endif rb.h.gch: $(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) -o rb.h.gch $(DEFS) $(CPPFLAGS) $(AM_CPPFLAGS) rb.h