summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2022-07-08 15:34:01 +0200
committerIlya Maximets <i.maximets@ovn.org>2022-07-12 15:45:42 +0200
commit23d496ac50d49870881e91cd1e58dcb7e303d319 (patch)
tree9ff39da28e8b6b523c5a17c8a7a29427d0067840 /acinclude.m4
parente773140ec3f6d296e4a3877d709fb26fb51bc6ee (diff)
downloadopenvswitch-23d496ac50d49870881e91cd1e58dcb7e303d319.tar.gz
acinclude: Fix double -Werror.
We're adding -Werror argument twice to every compiler invocation, if configured with --enable-Werror. The reason is the double expansion of the OVS_ENABLE_WERROR macro. It's called once from the top level in configure.ac and the second time from the AC_REQUIRE while checking CXX compatibility. AC_REQUIRE by itself protects from double expansion, but it can't protect from top level calls and it can not be used outside of AC_DEFUN. One way to fix that is to use AC_DEFUN_ONCE for OVS_ENABLE_WERROR, but it's not available in older autoconf < 2.64. So, creating a separate macro with AC_REQUIRE inside for the top level invocation to make it expanded only once. Acked-by: Ales Musil <amusil@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m44
1 files changed, 4 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index b518aa624..d15f11a4e 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -111,6 +111,10 @@ AC_DEFUN([OVS_ENABLE_WERROR],
fi
AC_SUBST([SPARSE_WERROR])])
+dnl Version for a top level invocation, since AC_REQUIRE can not be used
+dnl outside of AC_DEFUN, but needed to protect against double expansion.
+AC_DEFUN([OVS_ENABLE_WERROR_TOP], [AC_REQUIRE([OVS_ENABLE_WERROR])])
+
dnl OVS_CHECK_LINUX
dnl
dnl Configure linux kernel source tree