From patchwork Thu May 8 21:58:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Martin X-Patchwork-Id: 347260 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 9FC5C1400B7 for ; Fri, 9 May 2014 07:59:20 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 172868C45A; Thu, 8 May 2014 21:59:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2kYpMZswnW9f; Thu, 8 May 2014 21:59:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 1E1B78C482; Thu, 8 May 2014 21:59:17 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 8C89A1BF970 for ; Thu, 8 May 2014 21:59:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 881948C3AA for ; Thu, 8 May 2014 21:59:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nLdadFGrJRDo for ; Thu, 8 May 2014 21:59:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by whitealder.osuosl.org (Postfix) with ESMTPS id B8A768C3A6 for ; Thu, 8 May 2014 21:59:14 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id y10so3071575wgg.13 for ; Thu, 08 May 2014 14:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=fhrFVZUFZoAhBiguQ2OzovSEXsQbNiD9sgPp8Q7U/Go=; b=cm2xBnj39cf0veDtxNykqZn7DXT++V7jZwyiFResfnaj2n6s6I5q3dgq+r69q6oxoP 1iQ/k3zUm8x2u73vEAxCABAbvmksXLSnTQooCd13Q6NkYw2AKSrxvDB+xoxk3DXrFuh8 Sc8w0xImbdIzUWJjStdj0dnUJqnng7lNi5QQv18YRib7e4juhL/DQ5GrGIM5d2jyBaH2 BWlKRuyoEIge/czvBLn8e3wtJlK2Lif/ZgKhJn2cvJ9Sa3ROIg/9padTXtAxqMBNc0t4 Ny8dVYuC3mLCH/qP2a1EHky29iS3vIFI65RHn4qXQ+MRNfNqLyu8Jdxxv4m/zPfC8rFU gTAw== X-Received: by 10.194.62.210 with SMTP id a18mr5257115wjs.4.1399586353185; Thu, 08 May 2014 14:59:13 -0700 (PDT) Received: from localhost.localdomain (ANantes-655-1-216-199.w81-50.abo.wanadoo.fr. [81.50.167.199]) by mx.google.com with ESMTPSA id dn1sm1521993wid.6.2014.05.08.14.59.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 May 2014 14:59:12 -0700 (PDT) From: Samuel Martin To: buildroot@buildroot.net Date: Thu, 8 May 2014 23:58:55 +0200 Message-Id: <1399586335-22928-1-git-send-email-s.martin49@gmail.com> X-Mailer: git-send-email 1.9.2 Cc: Luca Ceresoli Subject: [Buildroot] [PATCH] cmake: forward HOST_{C, LD}FLAGS as cmake flags X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net During the CMake bootstrap phase, the {C,LD}FLAGS set in the bootstrap environment are not forwarded/converted as CMake flags. The CMake build contains a bootstrap phase building a minimal CMake program using a standard Makfile, then reconfigures itself with this minimal program. On system with no ncurses installed, and because the prefix option points to $(HOST_DIR)/usr, if host-cmake was built after host-ncurses, then ncurses libraries and headers are correctly find (in the host tree) during the second configuration (because of the prefix). However, it fails at building ccmake (the curses interface) because the CMAKE_C_FLAGS, CMAKE_CXX_FLAGS and CMAKE_EXE_LINKER_FLAGS do not point to the host tree. Because these flags are needed when running the bootstrap script, this patch makes sure the same flags are set when running the second configuration. Reported-by: Fabio Porcedda Signed-off-by: Samuel Martin Cc: Fabio Porcedda Cc: Luca Ceresoli --- package/cmake/cmake.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/cmake/cmake.mk b/package/cmake/cmake.mk index d45c642..1240895 100644 --- a/package/cmake/cmake.mk +++ b/package/cmake/cmake.mk @@ -14,7 +14,9 @@ define HOST_CMAKE_CONFIGURE_CMDS (cd $(@D); \ LDFLAGS="$(HOST_LDFLAGS)" \ CFLAGS="$(HOST_CFLAGS)" \ - ./bootstrap --prefix=$(HOST_DIR)/usr --parallel=$(PARALLEL_JOBS) \ + ./bootstrap --prefix=$(HOST_DIR)/usr --parallel=$(PARALLEL_JOBS) -- \ + -DCMAKE_C_FLAGS="$(HOST_CFLAGS)" -DCMAKE_CXX_FLAGS="$(HOST_CFLAGS)" \ + -DCMAKE_EXE_LINKER_FLAGS="$(HOST_LDFLAGS)" \ ) endef