@@ -97,6 +97,7 @@ CC_VERSION_PATCH=$(echo $CC_VERSION | cut -d'.' -f3)
# Default warning setup
##########################################################################
ODP_CFLAGS="$ODP_CFLAGS -W -Wall -Werror"
+ODP_CXXFLAGS="$ODP_CXXFLAGS -W -Wall -Werror"
ODP_CHECK_CFLAG([-Wstrict-prototypes])
ODP_CHECK_CFLAG([-Wmissing-prototypes])
@@ -5,8 +5,22 @@ dnl an error when it encounters an unknown warning option.
# ---------------------
# Add FLAG to ODP_CFLAGS if compiler supports that option
AC_DEFUN([ODP_CHECK_CFLAG],
- [AX_CHECK_COMPILE_FLAG([$1],
+ [AC_LANG_PUSH([C])
+ AX_CHECK_COMPILE_FLAG([$1],
[ODP_CFLAGS="$ODP_CFLAGS $1"],
[], [-W -Wall -Werror],
[AC_LANG_SOURCE([int main(void)
- {return 0;}])])])
+ {return 0;}])])
+ AC_LANG_POP([C])])
+
+# ODP_CHECK_CXXFLAG(FLAG)
+# ---------------------
+# Add FLAG to ODP_CFLAGS if compiler supports that option
+AC_DEFUN([ODP_CHECK_CXXFLAG],
+ [AC_LANG_PUSH([C++])
+ AX_CHECK_COMPILE_FLAG([$1],
+ [ODP_CXXFLAGS="$ODP_CXXFLAGS $1"],
+ [], [-W -Wall -Werror],
+ [AC_LANG_SOURCE([int main(void)
+ {return 0;}])])
+ AC_LANG_POP([C++])])