From patchwork Mon Apr 22 21:31:22 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: 2473951 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 E041540106 for ; Mon, 22 Apr 2013 21:31:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753480Ab3DVVbk (ORCPT ); Mon, 22 Apr 2013 17:31:40 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:55144 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753878Ab3DVVbk (ORCPT ); Mon, 22 Apr 2013 17:31:40 -0400 Received: by mail-wi0-f177.google.com with SMTP id hj19so5201043wib.4 for ; Mon, 22 Apr 2013 14:31:39 -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=rXZHEED40CsvMNxT7CQA8ncgGnnJar+HofhFjC8yB0JbWnji4Gyplf+vfTSY8XGmLj FqON6ebzYJ+8IB1lTxRjBzn6bl+NkqYf5FpJQPuX1plW95OuKUN4sde2+R8rdCvy1pX3 icn8OhWAnY8Lul8gupiblsC90MTxtHT1nW0v9FRcTyqRp+s3svUJpwpu9IyutnGZoq0U jZXZC/KflMHczPGQCYIiPw5ynmmXlSfliXr0LDAbHZFJwmP1/K93n2K0kBMddyfMWyqy CPdktmwT4HY2i+zBzxyhWJ50I55lSGocG+KjM26Et4BLBKjCWRxzPBPpgAxN3xCzxuzp EBZA== X-Received: by 10.194.5.196 with SMTP id u4mr56691177wju.54.1366666299036; Mon, 22 Apr 2013 14:31:39 -0700 (PDT) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPS id g9sm24821663wix.1.2013.04.22.14.31.37 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Apr 2013 14:31:38 -0700 (PDT) From: "Yann E. MORIN" To: linux-kbuild@vger.kernel.org Cc: Michal Marek , "Yann E. MORIN" Subject: [PATCH 3/6] kconfig/lxdialog: rationalise the include paths where to find {.n}curses{, w}.h Date: Mon, 22 Apr 2013 23:31:22 +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