lldpd: fix autoreconf failure
[openwrt/openwrt.git] / package / network / services / lldpd / patches / 002-fix-AX_LIB_READLINE-macro-conflict.patch
1 From 23509dc05b24a28fb46022800e0e271ae0118de2 Mon Sep 17 00:00:00 2001
2 From: Jo-Philipp Wich <jo@mein.io>
3 Date: Wed, 9 Dec 2020 12:04:04 +0100
4 Subject: [PATCH] build: prevent conflict with official AX_LIB_READLINE macro
5
6 On systems where the official AX_LIB_READLINE (ax_lib_readline.m4) is
7 present in a globally shared autoconf include directory, auto(re)conf
8 will prefer including that offical version over the local variant due
9 to the offical macro having a higher serial number.
10
11 As a consequence, @READLINE_LIBS@ will not be substituted in *.in files,
12 eventually failing the compilation with errors similar to:
13
14 gcc: error: READLINE_LIBS@: No such file or directory
15
16 Avoid this problem by renaming the incompatible local macro to
17 AX_LIB_READLINE_LLDPD which is sufficient to prevent any clashes.
18
19 We encountered this problem on OpenWrt which uses GNU autoconf-archive
20 to provide commonly used M4 macros through a global include directory,
21 which happens to ship AX_LIB_READLINE as well.
22
23 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
24 ---
25 configure.ac | 2 +-
26 m4/ax_lib_readline.m4 | 6 +++---
27 2 files changed, 4 insertions(+), 4 deletions(-)
28
29 --- a/configure.ac
30 +++ b/configure.ac
31 @@ -273,7 +273,7 @@ AC_ARG_WITH([readline],
32 [],
33 [with_readline=auto])
34 if test x"$with_readline" != x"no"; then
35 - AX_LIB_READLINE
36 + AX_LIB_READLINE_LLDPD
37 if test x"$with_readline" != x"check" -a x"$with_readline" != x"auto"; then
38 if test x"$ax_cv_lib_readline" = x"no"; then
39 AC_MSG_FAILURE([*** no readline support found])
40 --- a/m4/ax_lib_readline.m4
41 +++ b/m4/ax_lib_readline.m4
42 @@ -4,7 +4,7 @@
43 #
44 # SYNOPSIS
45 #
46 -# AX_LIB_READLINE
47 +# AX_LIB_READLINE_LLDPD
48 #
49 # DESCRIPTION
50 #
51 @@ -66,8 +66,8 @@
52
53 #serial 6
54
55 -AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE])
56 -AC_DEFUN([AX_LIB_READLINE], [
57 +AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE_LLDPD])
58 +AC_DEFUN([AX_LIB_READLINE_LLDPD], [
59 AC_CACHE_CHECK([for a readline compatible library],
60 ax_cv_lib_readline, [
61 _save_LIBS="$LIBS"