0001-configure.ac-fix-static-build-with-readline.patch 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. From 358e0755c3a434d7a815519b8c10ae5d347caad0 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Wed, 16 Dec 2020 07:51:04 +0100
  4. Subject: [PATCH] configure.ac: fix static build with readline
  5. Retrieve the dependencies of readline through pkg-config (and fallback
  6. to -lreadline) to avoid the following build failure:
  7. /nvme/rc-buildroot-test/scripts/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-uclibc/8.3.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: /nvme/rc-buildroot-test/scripts/instance-0/output-1/host/bin/../x86_64-buildroot-linux-uclibc/sysroot/usr/lib/libreadline.a(display.o): in function `cr':
  8. display.c:(.text+0x1ab): undefined reference to `tputs'
  9. Fixes:
  10. - http://autobuild.buildroot.org/results/8fb1341f2f5094c346456b43b4fc04996c2e1485
  11. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  12. [Upstream status:
  13. https://lists.01.org/hyperkitty/list/iwd@lists.01.org/thread/NFI4P52Y65T6XX7S7DGIVDMZISNQWUUC/]
  14. ---
  15. Makefile.am | 4 ++--
  16. configure.ac | 3 +++
  17. 2 files changed, 5 insertions(+), 2 deletions(-)
  18. diff --git a/Makefile.am b/Makefile.am
  19. index 3cd7eaa6..493d06cc 100644
  20. --- a/Makefile.am
  21. +++ b/Makefile.am
  22. @@ -288,7 +288,7 @@ client_iwctl_SOURCES = client/main.c \
  23. client/network.h client/network.c \
  24. client/properties.h client/properties.c \
  25. client/wsc.c client/station.c
  26. -client_iwctl_LDADD = $(ell_ldadd) -lreadline
  27. +client_iwctl_LDADD = $(ell_ldadd) $(READLINE_LIBS)
  28. if MANUAL_PAGES
  29. man_MANS += client/iwctl.1
  30. @@ -504,7 +504,7 @@ unit_test_client_SOURCES = unit/test-client.c \
  31. client/display.h client/display.c \
  32. client/network.h client/network.c \
  33. client/properties.h client/properties.c
  34. -unit_test_client_LDADD = $(ell_ldadd) -lreadline
  35. +unit_test_client_LDADD = $(ell_ldadd) $(READLINE_LIBS)
  36. endif
  37. unit_test_sae_SOURCES = unit/test-sae.c \
  38. diff --git a/configure.ac b/configure.ac
  39. index 7bd917a4..52f27ed9 100644
  40. --- a/configure.ac
  41. +++ b/configure.ac
  42. @@ -154,6 +154,9 @@ AC_ARG_ENABLE([client], AC_HELP_STRING([--disable-client],
  43. if (test "${enable_client}" != "no"); then
  44. AC_CHECK_HEADERS(readline/readline.h, enable_readline=yes,
  45. AC_MSG_ERROR(readline header files are required))
  46. + PKG_CHECK_MODULES(READLINE, readline, dummy=yes, READLINE_LIBS=-lreadline)
  47. + AC_SUBST(READLINE_CFLAGS)
  48. + AC_SUBST(READLINE_LIBS)
  49. fi
  50. AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
  51. --
  52. 2.29.2