Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From e6ebc8e654bba53f28af5229a1069fc74fa58b7b Mon Sep 17 00:00:00 2001 |
| 2 | From: Jason Wessel <jason.wessel@windriver.com> |
| 3 | Date: Thu, 25 Sep 2014 11:26:49 -0700 |
| 4 | Subject: [PATCH] menuconfig,check-lxdiaglog.sh: Allow specification of ncurses |
| 5 | location |
| 6 | |
| 7 | In some cross build environments such as the Yocto Project build |
| 8 | environment it provides an ncurses library that is compiled |
| 9 | differently than the host's version. This causes display corruption |
| 10 | problems when the host's curses includes are used instead of the |
| 11 | includes from the provided compiler are overridden. There is a second |
| 12 | case where there is no curses libraries at all on the host system and |
| 13 | menuconfig will just fail entirely. |
| 14 | |
| 15 | The solution is simply to allow an override variable in |
| 16 | check-lxdialog.sh for environments such as the Yocto Project. Adding |
| 17 | a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing |
| 18 | compiling and linking against the right headers and libraries. |
| 19 | |
| 20 | Upstream-Status: submitted [https://lkml.org/lkml/2013/3/3/103] |
| 21 | |
| 22 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> |
| 23 | cc: Michal Marek <mmarek@suse.cz> |
| 24 | cc: linux-kbuild@vger.kernel.org |
| 25 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> |
| 26 | Signed-off-by: California Sullivan <california.l.sullivan@intel.com> |
| 27 | --- |
| 28 | scripts/kconfig/lxdialog/check-lxdialog.sh | 8 ++++++++ |
| 29 | 1 file changed, 8 insertions(+) |
| 30 | mode change 100755 => 100644 scripts/kconfig/lxdialog/check-lxdialog.sh |
| 31 | |
| 32 | diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh |
| 33 | old mode 100755 |
| 34 | new mode 100644 |
| 35 | index 5075ebf2d3b9..ba9242101190 |
| 36 | --- a/scripts/kconfig/lxdialog/check-lxdialog.sh |
| 37 | +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh |
| 38 | @@ -4,6 +4,10 @@ |
| 39 | # What library to link |
| 40 | ldflags() |
| 41 | { |
| 42 | + if [ "$CROSS_CURSES_LIB" != "" ]; then |
| 43 | + echo "$CROSS_CURSES_LIB" |
| 44 | + exit |
| 45 | + fi |
| 46 | pkg-config --libs ncursesw 2>/dev/null && exit |
| 47 | pkg-config --libs ncurses 2>/dev/null && exit |
| 48 | for ext in so a dll.a dylib ; do |
| 49 | @@ -21,6 +25,10 @@ ldflags() |
| 50 | # Where is ncurses.h? |
| 51 | ccflags() |
| 52 | { |
| 53 | + if [ x"$CROSS_CURSES_INC" != x ]; then |
| 54 | + echo "$CROSS_CURSES_INC" |
| 55 | + exit |
| 56 | + fi |
| 57 | if pkg-config --cflags ncursesw 2>/dev/null; then |
| 58 | echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1' |
| 59 | elif pkg-config --cflags ncurses 2>/dev/null; then |
| 60 | -- |
| 61 | 2.14.3 |
| 62 | |