From patchwork Thu Mar 5 07:54:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 446639 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 E383514015A for ; Thu, 5 Mar 2015 18:54:26 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=PNCF0M+A; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CB02C91FE6; Thu, 5 Mar 2015 07:54:25 +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 7dJqZMD2qlIl; Thu, 5 Mar 2015 07:54:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 332AF9113B; Thu, 5 Mar 2015 07:54:24 +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 BD7751C277D for ; Thu, 5 Mar 2015 07:54:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B850291111 for ; Thu, 5 Mar 2015 07:54:22 +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 WpdwuX-gYOwp for ; Thu, 5 Mar 2015 07:54:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by whitealder.osuosl.org (Postfix) with ESMTPS id 040519110B for ; Thu, 5 Mar 2015 07:54:22 +0000 (UTC) Received: by pdbnh10 with SMTP id nh10so40733447pdb.3 for ; Wed, 04 Mar 2015 23:54:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=mlRrrFXASYMcgX1NKCZCxPOsgRVWM526yTBcTk9FQ/w=; b=PNCF0M+AlxcMsfayP4mdoc388DM+Lu6n0a4cZvBOzigGTk/fD2oet9U5/bXCv5U7ed 3qX4aL2HeR6gM57QZgGcDjXpS+2Uv4UtndOFs6hNVHaKpA0ph3a7D2fJpD3u3UvyfrP/ BLv2WEYcrzKzZegTyWj21y9v0F7R9ItwJiuX9+kunXBAEGkAYhdFAPxTnvU0NmtPH13S KUAHVpCJTc4CycGXS00q9ga3bH9jow++qhLJuv8jY2nICZGyc/Bg0GqFHmzRIo0bubRW 9/XMgU3Uq+d+SCz7AGegdzEADU+15ZLW9xRmNItmt/ZSuZsBQ7jR88P4HBlY65GtetSx lwPw== X-Received: by 10.66.132.6 with SMTP id oq6mr13974229pab.29.1425542061631; Wed, 04 Mar 2015 23:54:21 -0800 (PST) Received: from ld2077.tmt.telital.com ([213.205.6.118]) by mx.google.com with ESMTPSA id br15sm6047927pdb.76.2015.03.04.23.54.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 23:54:20 -0800 (PST) From: Fabio Porcedda To: buildroot@uclibc.org Date: Thu, 5 Mar 2015 08:54:13 +0100 Message-Id: <1425542053-5741-1-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 2.3.1 MIME-Version: 1.0 Cc: Thomas Petazzoni Subject: [Buildroot] [PATCH] cmake: don't use any header available in $(HOST_DIR)/usr/include X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The -I options added to CMAKE_C_FLAGS are passed to the compiler before the -I options of the cmake internal headers, so when the host-xz package was already built, a #include directive loads the host-xz header instead of the cmake internal one. Because we don't want to use any header avaiable in -I$(HOST_DIR)/usr/include, just get rid of the -I options in the HOST_CFLAGS. Fix build failure: .../output/build/host-cmake-3.1.3/Utilities/cmliblzma/liblzma/common/block_buffer_decoder.c:17:1: error: conflicting types for ‘lzma_block_buffer_decode’ lzma_block_buffer_decode(lzma_block *block, lzma_allocator *allocator, ^ In file included from /home/tetsuya/buildroot/br2/output/host/usr/include/lzma.h:296:0, from /home/tetsuya/buildroot/br2/output/build/host-cmake-3.1.3/Utilities/cmliblzma/liblzma/common/common.h:34, from /home/tetsuya/buildroot/br2/output/build/host-cmake-3.1.3/Utilities/cmliblzma/liblzma/common/block_decoder.h:16, from /home/tetsuya/buildroot/br2/output/build/host-cmake-3.1.3/Utilities/cmliblzma/liblzma/common/block_buffer_decoder.c:13: /home/tetsuya/buildroot/br2/output/host/usr/include/lzma/block.h:577:27: note: previous declaration of ‘lzma_block_buffer_decode’ was here extern LZMA_API(lzma_ret) lzma_block_buffer_decode( ^ Utilities/cmliblzma/CMakeFiles/cmliblzma.dir/build.make:261: recipe for target 'Utilities/cmliblzma/CMakeFiles/cmliblzma.dir/liblzma/common/block_buffer_decoder.c.o' failed make[3]: *** [Utilities/cmliblzma/CMakeFiles/cmliblzma.dir/liblzma/common/block_buffer_decoder.c.o] Error 1 Fixes: http://autobuild.buildroot.org/results/4edf6e169dc4a00d8a8bd16a86eba2316cbbd9e5 http://autobuild.buildroot.org/results/a9ff38b22a36a2f8427d33085d3263a8cbfbd746 http://autobuild.buildroot.org/results/ecaa0227249207b5450519832a193c1585ac8177 Signed-off-by: Fabio Porcedda Cc: Thomas Petazzoni Cc: Baruch Siach --- Notes: v3: - Use filter-out instead of sed (Baruch) v2: - Instead of tring to use the system lzma library when avaiable, just always use the internal one (Thomas P.). package/cmake/cmake.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/package/cmake/cmake.mk b/package/cmake/cmake.mk index 8c64b58..90175a6 100644 --- a/package/cmake/cmake.mk +++ b/package/cmake/cmake.mk @@ -12,13 +12,18 @@ CMAKE_LICENSE_FILES = Copyright.txt HOST_CMAKE_DEPENDENCIES = host-pkgconf +# Get rid of -I* options to prevent that a header avaiable in +# $(HOST_DIR)/usr/include is used instead of a cmake one, e.g. lzma* +# headers of the xz package +HOST_CMAKE_CFLAGS = $(filter-out -I%,$(HOST_CFLAGS)) + define HOST_CMAKE_CONFIGURE_CMDS (cd $(@D); \ LDFLAGS="$(HOST_LDFLAGS)" \ - CFLAGS="$(HOST_CFLAGS)" \ + CFLAGS="$(HOST_CMAKE_CFLAGS)" \ ./bootstrap --prefix=$(HOST_DIR)/usr \ --parallel=$(PARALLEL_JOBS) -- \ - -DCMAKE_C_FLAGS="$(HOST_CFLAGS)" \ + -DCMAKE_C_FLAGS="$(HOST_CMAKE_CFLAGS)" \ -DCMAKE_CXX_FLAGS="$(HOST_CXXFLAGS)" \ -DCMAKE_EXE_LINKER_FLAGS="$(HOST_LDFLAGS)" \ -DBUILD_CursesDialog=OFF \