diff --git a/configure b/configure
index 9848d58..9b98c83 100755
--- a/configure
+++ b/configure
@@ -15114,7 +15114,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test "$ac_test_CXXFLAGS" = set; then
# The user specified `CXXFLAGS', so do nothing.
CXXFLAGS="$CXXFLAGS"
-elif test "$GXX" = yes; then
+elif test "$GXX" = yes -o "$CXX" = "clang++"; then
CXXFLAGS="-g -O3 -Wall -Wextra -Wno-long-long"
fi
diff --git a/configure.ac b/configure.ac
index cddd706..c312121 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,7 +63,7 @@ dnl AX_BOOST_PROGRAM_OPTIONS
if test "$ac_test_CXXFLAGS" = set; then
# The user specified `CXXFLAGS', so do nothing.
CXXFLAGS="$CXXFLAGS"
-elif test "$GXX" = yes; then
+elif test "$GXX" = yes -o "$CXX" = "clang++"; then
CXXFLAGS="-g -O3 -Wall -Wextra -Wno-long-long"
fi
--