Make sure JE_CXXFLAGS_ADD uses CPP compiler
All the invocations of AC_COMPILE_IFELSE inside JE_CXXFLAGS_ADD were running 'the compiler and compilation flags of the current language' which was always the C compiler and the CXXFLAGS were never being tested against a C++ compiler. This patch fixes this issue by temporarily changing the chosen compiler to C++ by pushing it over the stack and popping it immediately after the compilation check.
This commit is contained in:
parent
433c2edabc
commit
78a87e4a80
@ -76,6 +76,7 @@ AC_MSG_CHECKING([whether compiler supports $1])
|
|||||||
T_CONFIGURE_CXXFLAGS="${CONFIGURE_CXXFLAGS}"
|
T_CONFIGURE_CXXFLAGS="${CONFIGURE_CXXFLAGS}"
|
||||||
JE_APPEND_VS(CONFIGURE_CXXFLAGS, $1)
|
JE_APPEND_VS(CONFIGURE_CXXFLAGS, $1)
|
||||||
JE_CONCAT_VVV(CXXFLAGS, CONFIGURE_CXXFLAGS, SPECIFIED_CXXFLAGS)
|
JE_CONCAT_VVV(CXXFLAGS, CONFIGURE_CXXFLAGS, SPECIFIED_CXXFLAGS)
|
||||||
|
AC_LANG_PUSH([C++])
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
||||||
[[
|
[[
|
||||||
]], [[
|
]], [[
|
||||||
@ -87,6 +88,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
|||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
[CONFIGURE_CXXFLAGS="${T_CONFIGURE_CXXFLAGS}"]
|
[CONFIGURE_CXXFLAGS="${T_CONFIGURE_CXXFLAGS}"]
|
||||||
)
|
)
|
||||||
|
AC_LANG_POP([C++])
|
||||||
JE_CONCAT_VVV(CXXFLAGS, CONFIGURE_CXXFLAGS, SPECIFIED_CXXFLAGS)
|
JE_CONCAT_VVV(CXXFLAGS, CONFIGURE_CXXFLAGS, SPECIFIED_CXXFLAGS)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user