202 # |
202 # |
203 # Can the C/C++ compiler use precompiled headers? |
203 # Can the C/C++ compiler use precompiled headers? |
204 # |
204 # |
205 AC_ARG_ENABLE([precompiled-headers], [AS_HELP_STRING([--disable-precompiled-headers], |
205 AC_ARG_ENABLE([precompiled-headers], [AS_HELP_STRING([--disable-precompiled-headers], |
206 [disable using precompiled headers when compiling C++ @<:@enabled@:>@])], |
206 [disable using precompiled headers when compiling C++ @<:@enabled@:>@])], |
207 [ENABLE_PRECOMPH=${enable_precompiled-headers}], [ENABLE_PRECOMPH=yes]) |
207 [ENABLE_PRECOMPH=${enable_precompiled_headers}], [ENABLE_PRECOMPH=yes]) |
208 |
208 |
209 USE_PRECOMPILED_HEADER=1 |
209 USE_PRECOMPILED_HEADER=1 |
210 if test "x$ENABLE_PRECOMPH" = xno; then |
210 if test "x$ENABLE_PRECOMPH" = xno; then |
211 USE_PRECOMPILED_HEADER=0 |
211 USE_PRECOMPILED_HEADER=0 |
212 fi |
212 fi |
213 |
213 |
214 if test "x$ENABLE_PRECOMPH" = xyes; then |
214 if test "x$ENABLE_PRECOMPH" = xyes; then |
215 # Check that the compiler actually supports precomp headers. |
215 # Check that the compiler actually supports precomp headers. |
216 if test "x$GCC" = xyes; then |
216 if test "x$GCC" = xyes; then |
217 AC_MSG_CHECKING([that precompiled headers work]) |
217 AC_MSG_CHECKING([that precompiled headers work]) |
218 echo "int alfa();" > conftest.h |
218 echo "int alfa();" > conftest.h |
219 $CXX -x c++-header conftest.h -o conftest.hpp.gch |
219 $CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD |
220 if test ! -f conftest.hpp.gch; then |
220 if test ! -f conftest.hpp.gch; then |
221 echo Precompiled header is not working! |
|
222 USE_PRECOMPILED_HEADER=0 |
221 USE_PRECOMPILED_HEADER=0 |
223 AC_MSG_RESULT([no]) |
222 AC_MSG_RESULT([no]) |
224 else |
223 else |
225 AC_MSG_RESULT([yes]) |
224 AC_MSG_RESULT([yes]) |
226 fi |
225 fi |
227 rm -f conftest.h |
226 rm -f conftest.h conftest.hpp.gch |
228 fi |
227 fi |
229 fi |
228 fi |
230 |
229 |
231 AC_SUBST(USE_PRECOMPILED_HEADER) |
230 AC_SUBST(USE_PRECOMPILED_HEADER) |
232 ]) |
231 ]) |