precompiledheader.m4 revision 8cfa702f803c5ef6a2b062a489a1b2cf66b45b5e
1dnl AX_CXXFLAGS_OPTIONS(var-name, option)
2dnl add option to var-name if $CXX support it.
3AC_DEFUN([AX_CHECK_PRECOMPILED_HEADER], [
4AC_MSG_CHECKING([whether ${CXX} support precompiled header])
5AC_LANG_SAVE
6AC_LANG_CPLUSPLUS
7SAVE_CXXFLAGS=$CXXFLAGS
8dnl we consider than if -Winvalid-pch is accepted pch will works ...
9CXXFLAGS=-Winvalid-pch
10dnl but we don't want -Winvalid-pch else compilation will fail due -Werror and
11dnl the fact than some pch will be invalid for the given compilation option
12AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} -include bits/stdc++.h", AC_MSG_RESULT([no]))
13CXXFLAGS=$SAVE_CXXFLAGS
14AC_LANG_RESTORE
15])
16