Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758625Ab3DXWal (ORCPT ); Wed, 24 Apr 2013 18:30:41 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:63375 "EHLO mail-we0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758519Ab3DXWaY (ORCPT ); Wed, 24 Apr 2013 18:30:24 -0400 From: "Yann E. MORIN" To: linux-kbuild@vger.kernel.org Cc: Michal Marek , linux-kernel@vger.kernel.org, "Yann E. MORIN" Subject: [PATCH 3/8] kconfig/lxdialog: rationalise the include paths where to find {.n}curses{,w}.h Date: Thu, 25 Apr 2013 00:29:50 +0200 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2471 Lines: 63 From: "Yann E. MORIN" The current code does this: if [ -f /usr/include/ncursesw/curses.h ]; then echo '-I/usr/include/ncursesw -DCURSES_LOC=""' elif [ -f /usr/include/ncurses/ncurses.h ]; then echo '-I/usr/include/ncurses -DCURSES_LOC=""' elif [ -f /usr/include/ncurses/curses.h ]; then echo '-I/usr/include/ncurses -DCURSES_LOC=""' [...] 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" --- scripts/kconfig/lxdialog/check-lxdialog.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh index 782d200..9d2a4c5 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=""' + echo '-I/usr/include/ncursesw -DCURSES_LOC=""' echo ' -DNCURSES_WIDECHAR=1' elif [ -f /usr/include/ncurses/ncurses.h ]; then echo '-I/usr/include/ncurses -DCURSES_LOC=""' elif [ -f /usr/include/ncurses/curses.h ]; then - echo '-I/usr/include/ncurses -DCURSES_LOC=""' + echo '-I/usr/include/ncurses -DCURSES_LOC=""' elif [ -f /usr/include/ncurses.h ]; then echo '-DCURSES_LOC=""' else -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/