Only use precompiled headers with gcc 4.4 or newer

See bug repoert http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13675
This commit is contained in:
Moritz Bunkus 2010-03-15 09:29:56 +01:00
parent cad27a0b4c
commit 1e211901ba
4 changed files with 32 additions and 0 deletions

View File

@ -96,6 +96,7 @@ PROFILING_CFLAGS = @PROFILING_CFLAGS@
PROFILING_LIBS = @PROFILING_LIBS@
QT_CFLAGS = @QT_CFLAGS@
QT_LIBS = @QT_LIBS@
USE_PRECOMPILED_HEADERS = @USE_PRECOMPILED_HEADERS@
USER_CPPFLAGS = @USER_CPPFLAGS@
USER_CXXFLAGS = @USER_CXXFLAGS@
USER_CFLAGS = @USER_CFLAGS@
@ -333,7 +334,9 @@ endif
@echo ' WINDRES ' $<
$(Q)$(RCCOMPILE) -o $@ $<
ifeq (yes,$(USE_PRECOMPILED_HEADERS))
$(ALL_OBJECTS): src/common/common.h.gch
endif
%.h.gch: %.h
@echo ' CXX ' $<

4
ac/gcc_version.m4 Normal file
View File

@ -0,0 +1,4 @@
AC_CACHE_CHECK(
[gcc version],
[ac_cv_gcc_version],
[ac_cv_gcc_version=`$ac_cv_prog_CXX -dumpversion | sed -e 's/[[^0-9\.]]//g'`])

23
ac/precompiled_headers.m4 Normal file
View File

@ -0,0 +1,23 @@
dnl
dnl Precompiled headers
dnl
AC_ARG_ENABLE([precompiled_headers],
AC_HELP_STRING([--enable-precompiled-headers],[enable the generation and use of precompiled headers (auto)]),
[enable_precompiled_headers=yes],
[enable_precompiled_headers=auto])
if test x"$enable_precompiled_headers" = x"auto"; then
if ! check_version 4.4.0 $ac_cv_gcc_version ; then
enable_precompiled_headers=no
else
enable_precompiled_headers=yes
fi
fi
if test x"$enable_precompiled_headers" = x"yes"; then
AC_DEFINE(USE_PRECOMPILED_HEADERS, 1, [Define if precompiled headers are generated and used])
USE_PRECOMPILED_HEADERS=yes
fi
AC_SUBST(USE_PRECOMPILED_HEADERS)

View File

@ -14,10 +14,12 @@ opt_features_no=""
m4_include(ac/initialization.m4)
m4_include(ac/check_version.m4)
m4_include(ac/gcc_version.m4)
m4_include(ac/endianess.m4)
m4_include(ac/mingw.m4)
m4_include(ac/extra_inc_lib.m4)
m4_include(ac/debugging_profiling.m4)
m4_include(ac/precompiled_headers.m4)
m4_include(ac/build_timestamp_in_version.m4)
m4_include(ac/inttypes.m4)
m4_include(ac/pri64d.m4)