Commit a102c852 authored by Geoff Simmons's avatar Geoff Simmons

configure --enable-stack-protector works with C++ sources as well

parent c341d11a
......@@ -89,7 +89,7 @@ PKG_CHECK_MODULES([RE2], [re2])
# df7a2dc in re2, the pointer may be NULL, if we just want to know
# whether there was a match. This check tests for that feature.
# Note: the test may cause a core dump if it fails.
AC_LANG(C++)
AC_LANG_PUSH(C++)
SAVE_CXXFLAGS="$CXXFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
CXXFLAGS+=" -std=c++11"
......@@ -109,7 +109,7 @@ main() {
)
CXXFLAGS="$SAVE_CXXFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
AC_LANG(C)
AC_LANG_POP()
# --enable-stack-protector
AC_ARG_ENABLE(stack-protector,
......@@ -122,6 +122,12 @@ if test "x$enable_stack_protector" != "xno"; then
AX_CHECK_LINK_FLAG([-fstack-protector],
[CFLAGS="${CFLAGS} -fstack-protector"], [], []),
[], [])
AC_LANG_PUSH(C++)
AX_CHECK_COMPILE_FLAG([-fstack-protector],
AX_CHECK_LINK_FLAG([-fstack-protector],
[CXXFLAGS="${CXXFLAGS} -fstack-protector"], [], []),
[], [])
AC_LANG_POP()
fi
# --enable-debugging
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment