Skip to content

Commit cdf0c2c

Browse files
kconfig/lxdialog: rationalise the include paths where to find {.n}curses{,w}.h
The current code does this: if [ -f /usr/include/ncursesw/curses.h ]; then echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"' 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>"' [...] This is merely inconsistent: - adding the full path to the directory in the -I directive, - especially since that path is already a sub-path of the system include path, - and then repeating the sub-path in the #include directive. Rationalise each include directive: - only use the filename in the #include directive, - keep the -I directives: they are always searched for before the system include path; this ensures the correct header is used. Using the -I directives and the filename-only in #include is more in line with how pkg-config behaves, eg.: $ pkg-config --cflags ncursesw -I/usr/include/ncursesw This paves the way for using pkg-config for CFLAGS, too, now we use it to find the libraries. Signed-off-by: "Yann E. MORIN" <[email protected]>
1 parent 9a69abf commit cdf0c2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/kconfig/lxdialog/check-lxdialog.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ ldflags()
2222
ccflags()
2323
{
2424
if [ -f /usr/include/ncursesw/curses.h ]; then
25-
echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"'
25+
echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
2626
echo ' -DNCURSES_WIDECHAR=1'
2727
elif [ -f /usr/include/ncurses/ncurses.h ]; then
2828
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
2929
elif [ -f /usr/include/ncurses/curses.h ]; then
30-
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"'
30+
echo '-I/usr/include/ncurses -DCURSES_LOC="<curses.h>"'
3131
elif [ -f /usr/include/ncurses.h ]; then
3232
echo '-DCURSES_LOC="<ncurses.h>"'
3333
else

0 commit comments

Comments
 (0)