2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 01:51:26 +00:00

configure: Avoid deprecated AC_PROG_CC_C99 if possible.

autoconf 2.70 deprecated the AC_PROG_CC_C99 macro and the AC_PROG_CC
was recommended for use instead.  However, older versions of that
suggested macro do not attempt enabling C99, so it is not a direct
replacement.  Autoconf 2.69 and older are still widely used in many
distributions.

Another difference is that AC_PROG_CC attempts to enable C11 in new
versions of autoconf.  But since we have CI jobs that check -std=c99
builds now, we can afford enabling C11 by default without risking
compatibility issues.

Fix a deprecation warning by using a new AC_PROG_CC macro with
autoconf 2.70+.  AC_PROG_CC and AC_PROG_CC_C99 seems to produce the
same configuration script in autoconf 2.70+ anyway, so we're already
kind of using a new macro on systems with a new autoconf.

Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Ilya Maximets 2023-08-28 19:12:25 +02:00
parent d3bdc7c913
commit 28c0cec406

View File

@ -21,7 +21,11 @@ AC_CONFIG_HEADERS([config.h])
AC_CONFIG_TESTDIR([tests])
AM_INIT_AUTOMAKE([tar-pax])
AC_PROG_CC_C99
# AC_PROG_CC doesn't try enabling C99 in autoconf 2.69 and below, but
# AC_PROG_CC_C99 is deprecated in newer ones. In autoconf 2.70+ both
# will try enabling features up to C11.
m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_C99])
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_CPP