diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x[-rw-r--r--] | scripts/kconfig/lxdialog/check-lxdialog.sh | 17 | ||||
-rwxr-xr-x | scripts/trylink | 2 |
2 files changed, 13 insertions, 6 deletions
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh index d34dfd46d..5075ebf2d 100644..100755 --- a/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh | |||
@@ -4,7 +4,9 @@ | |||
4 | # What library to link | 4 | # What library to link |
5 | ldflags() | 5 | ldflags() |
6 | { | 6 | { |
7 | for ext in so a dylib ; do | 7 | pkg-config --libs ncursesw 2>/dev/null && exit |
8 | pkg-config --libs ncurses 2>/dev/null && exit | ||
9 | for ext in so a dll.a dylib ; do | ||
8 | for lib in ncursesw ncurses curses ; do | 10 | for lib in ncursesw ncurses curses ; do |
9 | $cc -print-file-name=lib${lib}.${ext} | grep -q / | 11 | $cc -print-file-name=lib${lib}.${ext} | grep -q / |
10 | if [ $? -eq 0 ]; then | 12 | if [ $? -eq 0 ]; then |
@@ -19,14 +21,17 @@ ldflags() | |||
19 | # Where is ncurses.h? | 21 | # Where is ncurses.h? |
20 | ccflags() | 22 | ccflags() |
21 | { | 23 | { |
22 | if [ -f /usr/include/ncursesw/ncurses.h ]; then | 24 | if pkg-config --cflags ncursesw 2>/dev/null; then |
23 | echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncurses.h>"' | 25 | echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1' |
26 | elif pkg-config --cflags ncurses 2>/dev/null; then | ||
27 | echo '-DCURSES_LOC="<ncurses.h>"' | ||
24 | elif [ -f /usr/include/ncursesw/curses.h ]; then | 28 | elif [ -f /usr/include/ncursesw/curses.h ]; then |
25 | echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"' | 29 | echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"' |
30 | echo ' -DNCURSES_WIDECHAR=1' | ||
26 | elif [ -f /usr/include/ncurses/ncurses.h ]; then | 31 | elif [ -f /usr/include/ncurses/ncurses.h ]; then |
27 | echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' | 32 | echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' |
28 | elif [ -f /usr/include/ncurses/curses.h ]; then | 33 | elif [ -f /usr/include/ncurses/curses.h ]; then |
29 | echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"' | 34 | echo '-I/usr/include/ncurses -DCURSES_LOC="<curses.h>"' |
30 | elif [ -f /usr/include/ncurses.h ]; then | 35 | elif [ -f /usr/include/ncurses.h ]; then |
31 | echo '-DCURSES_LOC="<ncurses.h>"' | 36 | echo '-DCURSES_LOC="<ncurses.h>"' |
32 | else | 37 | else |
@@ -40,7 +45,7 @@ trap "rm -f $tmp" 0 1 2 3 15 | |||
40 | 45 | ||
41 | # Check if we can link to ncurses | 46 | # Check if we can link to ncurses |
42 | check() { | 47 | check() { |
43 | $cc -xc - -o $tmp 2>/dev/null <<'EOF' | 48 | $cc -x c - -o $tmp 2>/dev/null <<'EOF' |
44 | #include CURSES_LOC | 49 | #include CURSES_LOC |
45 | main() {} | 50 | main() {} |
46 | EOF | 51 | EOF |
diff --git a/scripts/trylink b/scripts/trylink index 3c431edc3..15435f009 100755 --- a/scripts/trylink +++ b/scripts/trylink | |||
@@ -140,6 +140,8 @@ try $CC $CFLAGS $LDFLAGS \ | |||
140 | || { | 140 | || { |
141 | echo "Failed: $l_list" | 141 | echo "Failed: $l_list" |
142 | cat $EXE.out | 142 | cat $EXE.out |
143 | echo 'Note: if build needs additional libraries, put them in CONFIG_EXTRA_LDLIBS.' | ||
144 | echo 'Example: CONFIG_EXTRA_LDLIBS="pthread dl tirpc audit pam"' | ||
143 | exit 1 | 145 | exit 1 |
144 | } | 146 | } |
145 | 147 | ||