diff options
author | Yann E. MORIN <yann.morin.1998@free.fr> | 2013-03-22 23:12:16 +0100 |
---|---|---|
committer | Yann E. MORIN <yann.morin.1998@free.fr> | 2013-04-16 22:00:32 +0200 |
commit | cdf0c2cfd75c6c2f2a6eee5e21ff0e8271bd0660 (patch) | |
tree | 645a713add19da6cc257d06d56cef1a0a059c32b | |
parent | 9a69abf80edf2ea0dac058cab156879d29362788 (diff) |
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" <yann.morin.1998@free.fr>
-rw-r--r-- | scripts/kconfig/lxdialog/check-lxdialog.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh index 782d20085e1c..9d2a4c585ee1 100644 --- a/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -22,12 +22,12 @@ ldflags() ccflags() { if [ -f /usr/include/ncursesw/curses.h ]; then - echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"' + 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 |