diff mbox series

[v1,4/6] configure: add ODP_CHECK_CXXFLAG

Message ID 1517403609-12603-5-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v1,1/6] configure: set ODP_ABI_COMPAT before descending into platform | expand

Commit Message

Github ODP bot Jan. 31, 2018, 1 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 440 (lumag:build-fixes)
 ** https://github.com/Linaro/odp/pull/440
 ** Patch: https://github.com/Linaro/odp/pull/440.patch
 ** Base sha: b95ccd3db6eeb7358a877541747e06354429acdd
 ** Merge commit sha: 6f20299f993632a4dda987a31b37160d80c25279
 **/
 configure.ac         |  1 +
 m4/odp_check_flag.m4 | 18 ++++++++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/configure.ac b/configure.ac
index 01fdc5a8c..7b90b2127 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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])
diff --git a/m4/odp_check_flag.m4 b/m4/odp_check_flag.m4
index e3c8ef714..827f9f011 100644
--- a/m4/odp_check_flag.m4
+++ b/m4/odp_check_flag.m4
@@ -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++])])