]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: prevent conflict with official AX_LIB_READLINE macro 423/head
authorJo-Philipp Wich <jo@mein.io>
Wed, 9 Dec 2020 11:04:04 +0000 (12:04 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 9 Dec 2020 11:12:25 +0000 (12:12 +0100)
On systems where the official AX_LIB_READLINE (ax_lib_readline.m4) is
present in a globally shared autoconf include directory, auto(re)conf
will prefer including that offical version over the local variant due
to the offical macro having a higher serial number.

As a consequence, @READLINE_LIBS@ will not be substituted in *.in files,
eventually failing the compilation with errors similar to:

    gcc: error: READLINE_LIBS@: No such file or directory

Avoid this problem by renaming the incompatible local macro to
AX_LIB_READLINE_LLDPD which is sufficient to prevent any clashes.

We encountered this problem on OpenWrt which uses GNU autoconf-archive
to provide commonly used M4 macros through a global include directory,
which happens to ship AX_LIB_READLINE as well.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
configure.ac
m4/ax_lib_readline.m4

index a248c27d2477207f8bf0b9edcad6c8c9b9279b46..627eab45d2346febf598f8ed03031ee6ed07a273 100644 (file)
@@ -267,7 +267,7 @@ AC_ARG_WITH([readline],
   [],
   [with_readline=auto])
 if test x"$with_readline" != x"no"; then
-   AX_LIB_READLINE
+   AX_LIB_READLINE_LLDPD
    if test x"$with_readline" != x"check" -a x"$with_readline" != x"auto"; then
      if test x"$ax_cv_lib_readline" = x"no"; then
        AC_MSG_FAILURE([*** no readline support found])
index 9da90e64569878439b32c4898a38311dab4e6e84..352c55af0045d348ddb4a387a34073e57f5cd0cd 100644 (file)
@@ -4,7 +4,7 @@
 #
 # SYNOPSIS
 #
-#   AX_LIB_READLINE
+#   AX_LIB_READLINE_LLDPD
 #
 # DESCRIPTION
 #
@@ -66,8 +66,8 @@
 
 #serial 6
 
-AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE])
-AC_DEFUN([AX_LIB_READLINE], [
+AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE_LLDPD])
+AC_DEFUN([AX_LIB_READLINE_LLDPD], [
   AC_CACHE_CHECK([for a readline compatible library],
                  ax_cv_lib_readline, [
     _save_LIBS="$LIBS"