Fix: configure: support Autoconf 2.70
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 26 Jan 2021 16:42:30 +0000 (11:42 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 26 Jan 2021 19:29:37 +0000 (14:29 -0500)
commitb877064fe33379dead96059345812e94f6bb2371
tree5fb9c9060b296739670ad15f18f1f5088aceed51
parentd6eb67a4d190822cac3d6f9c9e4b91a04a590426
Fix: configure: support Autoconf 2.70

This patch is stolen and adapted from lttng-tools' patch:

  https://git.lttng.org/?p=lttng-tools.git;a=commit;h=faa88ea855741f5c356d223011ff4b347576c7d2

The newly-released autoconf 2.70 introduces a number of breaking
changes [1] and is being rolled-out by some distros.

Amongst those changes, the AC_PROG_CC_STDC macro is marked as obsolete
and was merged into AC_PROG_CC, which we already use. On 2.70, this
results in a warning which we handle as an error.

A version check is added to invoke the AC_PROG_CC_STDC macro only when
running a pre-2.70 version of autoconf, fixing the issue.

The AC_PROG_LEX now takes an argument, and the argument-less version is
marked as obsolete. The macro is invoked with the `noyywrap` option, as
recommended in the documentation.

Also, the AX_PTHREAD macro makes use of the $as_echo built-in shell
variable which no longer exists in 2.70. A patch was submitted to the
GNU Autoconf archive in March, but there have been no signs of life
given since then [2].

As such, our local copy is updated to the latest version and the patch
(which looks fairly straight-forward / safe) is applied. This should
minimize changes once we go back to an "official" version of the macro.

Some issues with glib2 remain:

    configure.ac:264: warning: The macro `AC_TRY_RUN' is obsolete.
    configure.ac:264: You should run autoupdate.
    ./lib/autoconf/general.m4:2996: AC_TRY_RUN is expanded from...
    /usr/share/aclocal/glib-2.0.m4:11: AM_PATH_GLIB_2_0 is expanded from...
    configure.ac:264: the top level
    configure.ac:264: warning: The macro `AC_TRY_LINK' is obsolete.
    configure.ac:264: You should run autoupdate.
    ./lib/autoconf/general.m4:2919: AC_TRY_LINK is expanded from...
    /usr/share/aclocal/glib-2.0.m4:11: AM_PATH_GLIB_2_0 is expanded from...
    configure.ac:264: the top level

Those have been fixed upstream:

  https://gitlab.gnome.org/GNOME/glib/-/commit/6f26637e83727b05f865389937bb07c761c13c12

so it's always possible to get the modifications from there for local
development.

[1] https://lwn.net/Articles/839395/
[2] https://savannah.gnu.org/patch/?9906

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-by: Michael Jeanson <michael.jeanson@efficios.com>
Change-Id: Ia9f5ac6721a556238e84bee64d57e04bf378fee9
Reviewed-on: https://review.lttng.org/c/babeltrace/+/4743
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
configure.ac
m4/ax_pthread.m4
This page took 0.024576 seconds and 4 git commands to generate.