summaryrefslogtreecommitdiff
path: root/util/kconfig/lxdialog/check-lxdialog.sh
diff options
context:
space:
mode:
Diffstat (limited to 'util/kconfig/lxdialog/check-lxdialog.sh')
-rw-r--r--util/kconfig/lxdialog/check-lxdialog.sh21
1 files changed, 14 insertions, 7 deletions
diff --git a/util/kconfig/lxdialog/check-lxdialog.sh b/util/kconfig/lxdialog/check-lxdialog.sh
index 4184418183..2b845e6dd8 100644
--- a/util/kconfig/lxdialog/check-lxdialog.sh
+++ b/util/kconfig/lxdialog/check-lxdialog.sh
@@ -4,9 +4,11 @@
# What library to link
ldflags()
{
- for ext in so a dylib ; do
+ pkg-config --libs ncursesw 2>/dev/null && exit
+ pkg-config --libs ncurses 2>/dev/null && exit
+ for ext in so a dll.a dylib ; do
for lib in ncursesw ncurses curses pdcursesw pdcurses; do
- $cc -print-file-name=lib${lib}.${ext} | grep / >/dev/null
+ $cc -print-file-name=lib${lib}.${ext} | grep -q /
if [ $? -eq 0 ]; then
echo "-l${lib}"
exit
@@ -19,10 +21,13 @@ ldflags()
# Where is ncurses.h?
ccflags()
{
- if [ -f /usr/include/ncurses/ncurses.h ]; then
+ if [ -f /usr/include/ncursesw/curses.h ]; then
+ echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
+ echo ' -DNCURSES_WIDECHAR=1'
+ elif [ -f /usr/include/ncurses/ncurses.h ]; then
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
elif [ -f /usr/include/ncurses/curses.h ]; then
- echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"'
+ echo '-I/usr/include/ncurses -DCURSES_LOC="<curses.h>"'
elif [ -f /usr/include/ncurses.h ]; then
echo '-DCURSES_LOC="<ncurses.h>"'
else
@@ -36,8 +41,10 @@ trap "rm -f $tmp" 0 1 2 3 15
# Check if we can link to ncurses
check() {
- echo -e " #include CURSES_LOC \n main() {}" |
- $cc -xc - -o $tmp 2> /dev/null
+ $cc -x c - -o $tmp 2>/dev/null <<'EOF'
+#include CURSES_LOC
+main() {}
+EOF
if [ $? != 0 ]; then
echo " *** Unable to find the ncurses libraries or the" 1>&2
echo " *** required header files." 1>&2
@@ -50,7 +57,7 @@ check() {
}
usage() {
- printf "Usage: $0 [-check compiler options|-header|-library]\n"
+ printf "Usage: $0 [-check compiler options|-ccflags|-ldflags compiler options]\n"
}
if [ $# -eq 0 ]; then