openocd: avoid documentation rebuild to fix build issues
[buildroot-gz.git] / package / lttng-babeltrace / 0002-m4-ax_lib_elfutils.m4-add-cache-variable.patch
blobb16781419a92e70e830f8510235c35138e6368f0
1 From 697ab0905c59561562dc52cd3b925781e07814f3 Mon Sep 17 00:00:00 2001
2 From: Philippe Proulx <eeppeliteloop@gmail.com>
3 Date: Wed, 2 Nov 2016 01:40:12 -0400
4 Subject: [PATCH] m4/ax_lib_elfutils.m4: add cache variable
6 This patch adds an autoconf cache variable to override the
7 AC_RUN_IFELSE() test result when cross-compiling.
9 Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
10 [Philippe: grabbed from this pull request:
11 https://github.com/efficios/babeltrace/pull/52
13 ---
14 m4/ax_lib_elfutils.m4 | 32 +++++++++++++++++---------------
15 1 file changed, 17 insertions(+), 15 deletions(-)
17 diff --git a/m4/ax_lib_elfutils.m4 b/m4/ax_lib_elfutils.m4
18 index fcfe06b..f4fcb0d 100644
19 --- a/m4/ax_lib_elfutils.m4
20 +++ b/m4/ax_lib_elfutils.m4
21 @@ -21,7 +21,9 @@
22 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 # Check the currently installed version of elfutils by using the
25 -# _ELFUTILS_PREREQ macro defined in elfutils/version.h.
26 +# `_ELFUTILS_PREREQ` macro defined in <elfutils/version.h>.
28 +# The cache variable for this test is `bt_cv_lib_elfutils`.
30 # AX_LIB_ELFUTILS(MAJOR_VERSION, MINOR_VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
31 # ---------------------------------------------------------------------------
32 @@ -29,7 +31,6 @@ AC_DEFUN([AX_LIB_ELFUTILS], [
33 m4_pushdef([major_version], [$1])
34 m4_pushdef([minor_version], [$2])
36 - AC_MSG_CHECKING([for elfutils version >= major_version.minor_version])
37 m4_if([$#], 3, [
38 m4_pushdef([true_action], [$3])
39 ], [
40 @@ -43,20 +44,21 @@ AC_DEFUN([AX_LIB_ELFUTILS], [
41 AC_MSG_ERROR(elfutils >= major_version.minor_version is required)])
44 - AC_RUN_IFELSE([
45 - AC_LANG_SOURCE([
46 - #include <stdlib.h>
47 - #include <elfutils/version.h>
48 + AC_CACHE_CHECK(
49 + [for elfutils version >= major_version.minor_version],
50 + [bt_cv_lib_elfutils], [
51 + AC_RUN_IFELSE([AC_LANG_SOURCE([
52 + #include <stdlib.h>
53 + #include <elfutils/version.h>
55 + int main(void) {
56 + return _ELFUTILS_PREREQ(major_version, minor_version) ? EXIT_SUCCESS : EXIT_FAILURE;
57 + }
58 + ])], [bt_cv_lib_elfutils=yes], [bt_cv_lib_elfutils=no])
59 + ]
60 + )
62 - int main(void) {
63 - return _ELFUTILS_PREREQ(major_version, minor_version) ? EXIT_SUCCESS : EXIT_FAILURE;
64 - }
65 - ])
66 - ],
67 - echo yes
68 - true_action,
69 - echo no
70 - false_action)
71 + AS_IF([test "x$bt_cv_lib_elfutils" = "xyes"], [true_action], [false_action])
73 m4_popdef([false_action])
74 m4_popdef([true_action])
75 --
76 2.9.3