From patchwork Sun Mar 3 19:48:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wessel X-Patchwork-Id: 2208711 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 C00DE3FC8F for ; Sun, 3 Mar 2013 19:49:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751462Ab3CCTtp (ORCPT ); Sun, 3 Mar 2013 14:49:45 -0500 Received: from mail1.windriver.com ([147.11.146.13]:57745 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751115Ab3CCTto (ORCPT ); Sun, 3 Mar 2013 14:49:44 -0500 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.14.5/8.14.3) with ESMTP id r23Jn1OU009845 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Sun, 3 Mar 2013 11:49:01 -0800 (PST) Received: from ord-jrw.wrs.com (172.25.32.35) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.2.342.3; Sun, 3 Mar 2013 11:48:59 -0800 From: Jason Wessel To: CC: , Subject: [PATCH] menuconfig, check-lxdiaglog.sh: Allow specification of ncurses location Date: Sun, 3 Mar 2013 13:48:44 -0600 Message-ID: <1362340124-2768-1-git-send-email-jason.wessel@windriver.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org In some cross build environments such as the Yocto Project build environment it provides an ncurses library that is compiled differently than the host's version. This causes display corruption problems when the host's curses includes are used instead of the includes from the provided compiler are overridden. There is a second case where there is no curses libraries at all on the host system and menuconfig will just fail entirely. The solution is simply to allow an override variable in check-lxdialog.sh for environments such as the Yocto Project. Adding a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing compiling and linking against the right headers and libraries. Signed-off-by: Jason Wessel cc: Michal Marek cc: linux-kbuild@vger.kernel.org --- scripts/kconfig/lxdialog/check-lxdialog.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh index 8078813..99473e4 100644 --- a/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -4,6 +4,10 @@ # What library to link ldflags() { + if [ x"$CROSS_CURSES_LIB" != x ]; then + echo "$CROSS_CURSES_LIB" + exit + fi for ext in so a dll.a dylib ; do for lib in ncursesw ncurses curses ; do $cc -print-file-name=lib${lib}.${ext} | grep -q / @@ -19,6 +23,10 @@ ldflags() # Where is ncurses.h? ccflags() { + if [ x"$CROSS_CURSES_INC" != x ]; then + echo "$CROSS_CURSES_INC" + exit + fi if [ -f /usr/include/ncursesw/curses.h ]; then echo '-I/usr/include/ncursesw -DCURSES_LOC=""' echo ' -DNCURSES_WIDECHAR=1'