summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/mconf-cfg.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/mconf-cfg.sh')
-rwxr-xr-xscripts/kconfig/mconf-cfg.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh
new file mode 100755
index 000000000000..e6f9facd0077
--- /dev/null
+++ b/scripts/kconfig/mconf-cfg.sh
@@ -0,0 +1,44 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4PKG="ncursesw"
5PKG2="ncurses"
6
7if pkg-config --exists $PKG; then
8 echo cflags=\"$(pkg-config --cflags $PKG)\"
9 echo libs=\"$(pkg-config --libs $PKG)\"
10 exit 0
11fi
12
13if pkg-config --exists $PKG2; then
14 echo cflags=\"$(pkg-config --cflags $PKG2)\"
15 echo libs=\"$(pkg-config --libs $PKG2)\"
16 exit 0
17fi
18
19# Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses
20# by pkg-config.
21if [ -f /usr/include/ncursesw/ncurses.h ]; then
22 echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\"
23 echo libs=\"-lncursesw\"
24 exit 0
25fi
26
27if [ -f /usr/include/ncurses/ncurses.h ]; then
28 echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncurses\"
29 echo libs=\"-lncurses\"
30 exit 0
31fi
32
33if [ -f /usr/include/ncurses.h ]; then
34 echo cflags=\"-D_GNU_SOURCE\"
35 echo libs=\"-lncurses\"
36 exit 0
37fi
38
39echo >&2 "*"
40echo >&2 "* Unable to find the ncurses package."
41echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
42echo >&2 "* depending on your distribution)."
43echo >&2 "*"
44exit 1