From patchwork Wed Apr 24 22:29:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 2486621 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 31B2B40208 for ; Wed, 24 Apr 2013 22:30:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758582Ab3DXWag (ORCPT ); Wed, 24 Apr 2013 18:30:36 -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 Received: by mail-we0-f173.google.com with SMTP id o7so1963205wea.4 for ; Wed, 24 Apr 2013 15:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references; bh=7F3VRA4z3a1CYG08YJj+7zrNk/kv3NrGHBdmgaYEd/Q=; b=hoyoPAZGZA01FyTir6lzgCK9lnE/8BTncELkZ4drgkgTwjoy/8QFxOLVi1tEFN5iAw 1VkFX59iTVoZcPm8XlAj9AJF6SziZloVhaBy944sfZ5aZscm1HWG2wrnWNOn40nGrMsJ iV5eGxywjIoLFloXjkrgUCNAj7Ah/hNrltH1O/yAj4JspMHX7gE/RtrkpVabnIol1jNy v17g5jIO4TNzFYIQ3HX0cWpn31lmX/X+gBKb65df1WYeYNR5sn7QjPDP+VuH4wioYbDw YoG/uz4Au/9X6PUAIt6qsKpePSZiMALftTmp6S2Xu1qAfIQ1QRVNf/ogEyOFyVQ3NhZJ s6lg== X-Received: by 10.181.11.196 with SMTP id ek4mr5252031wid.30.1366842623176; Wed, 24 Apr 2013 15:30:23 -0700 (PDT) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id t14sm35982534wib.0.2013.04.24.15.30.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Apr 2013 15:30:22 -0700 (PDT) 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-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org 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