17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From be8af2d54a66911693eddc556e4f7a866670082b Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
  3. Date: Sun, 14 Sep 2014 12:57:50 +0200
  4. Subject: [PATCH] kconfig/lxdialog: get ncurses CFLAGS with pkg-config
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. This makes "make menuconfig" also work on systems where ncurses is not
  9. installed in a standard location (such as on NixOS).
  10. This patch changes ccflags() so that it tries pkg-config first, and only
  11. if pkg-config fails does it go back to the fallback/manual checks. This
  12. is the same algorithm that ldflags() already uses.
  13. Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
  14. Signed-off-by: Michal Marek <mmarek@suse.cz>
  15. ---
  16. [This patch is already applied upstream (is part of linux v3.18):
  17. https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=be8af2d54a66911693eddc556e4f7a866670082b
  18. I'm adding this instead of doing a full upstream kconfig sync because
  19. there was a conflict in one of the Buildroot kconfig patches (against
  20. linux 3.18-rc1), which I was unable to resolve. Just drop this patch next time
  21. Buildroot kconfig is synced against upstream.
  22. ]
  23. scripts/kconfig/lxdialog/check-lxdialog.sh | 6 +++++-
  24. 1 file changed, 5 insertions(+), 1 deletion(-)
  25. diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
  26. index 9d2a4c5..5075ebf 100755
  27. --- a/lxdialog/check-lxdialog.sh
  28. +++ b/lxdialog/check-lxdialog.sh
  29. @@ -21,7 +21,11 @@ ldflags()
  30. # Where is ncurses.h?
  31. ccflags()
  32. {
  33. - if [ -f /usr/include/ncursesw/curses.h ]; then
  34. + if pkg-config --cflags ncursesw 2>/dev/null; then
  35. + echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1'
  36. + elif pkg-config --cflags ncurses 2>/dev/null; then
  37. + echo '-DCURSES_LOC="<ncurses.h>"'
  38. + elif [ -f /usr/include/ncursesw/curses.h ]; then
  39. echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
  40. echo ' -DNCURSES_WIDECHAR=1'
  41. elif [ -f /usr/include/ncurses/ncurses.h ]; then
  42. --
  43. 2.1.3