From patchwork Thu Jun 29 06:58:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fathi Boudra X-Patchwork-Id: 106608 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp761763qge; Wed, 28 Jun 2017 23:58:32 -0700 (PDT) X-Received: by 10.84.141.3 with SMTP id 3mr13765110plu.227.1498719512046; Wed, 28 Jun 2017 23:58:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498719512; cv=none; d=google.com; s=arc-20160816; b=lxUdnliDa56GZUwwEZ08P8B0UcbpTh4wnMnoBWpoajbtDieqlCSBLYmDnEenlgNNaZ kXJl69C3ijBOS6pRLhnF29TEivVNR/8tUzT+fcNgut5/nQ8m8LyL4m4FJq2g5KdXqv/V a1mBSHM+CCex2qXQRh02daP0budSIt2gQ779FSnjzkD/yuOHT/uo++4zdNdoXzhW3pYE B4Sal9DBAtOJpjAmGh9XIipmPJU7Tu/DnrsP44Kj7RqDjACiUoDMwjH/irdaMDfxtSJc FSzKE6z0tGe+XdRblbm3yTgM9WclV+XxW5MfsLSlIMxaw7hZAHvG9Nju56k+sQ9EVm+p 7CDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=izfEG7yNCX/XORvwWiOyXgTcHjYcl4HuEsa5onAm8+w=; b=siInGXdOOu+sfuXqlAaMlqZnyPSfK3D/LqPe2SXjooUfLWaBP2JF1f4VCQ8NJD2N1x UHjt4A/tDuYUA4GP2028qbx8doglommBGbOsmIKFb8Jkz4QcYh4BQP+HB9LzMHbDFvXb Iez3YRpBoskcQE+jMGCAGjuJfFjq1vrYn2da0p5WtYRuYFeYIrO1W3Xo6UYlhpVjxTMK KeKqiRrgZhx+S6Gxry7RDhf3yB8Ok7VQc/F5dSbLAjSoXUTElyixDc5eNXcg0wTjTwlt LXNC0wMO6qbrfDaKpI26WhGKXEBekI90oRj2HXKUYmCxRF32VHmZ0S8s75UM6PAK77xu hZqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=SchdyG9b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1si3462844pld.215.2017.06.28.23.58.31; Wed, 28 Jun 2017 23:58:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=SchdyG9b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752060AbdF2G6S (ORCPT + 25 others); Thu, 29 Jun 2017 02:58:18 -0400 Received: from mail-lf0-f47.google.com ([209.85.215.47]:34183 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751612AbdF2G6K (ORCPT ); Thu, 29 Jun 2017 02:58:10 -0400 Received: by mail-lf0-f47.google.com with SMTP id l13so47223914lfl.1 for ; Wed, 28 Jun 2017 23:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=izfEG7yNCX/XORvwWiOyXgTcHjYcl4HuEsa5onAm8+w=; b=SchdyG9bxaryOdmYO84gyZN2ibrx2p6PTbUKd1WDizmI+3NNuh+2qP+t8NXbc82jaX IMpcuh87NCyf4kynFxV3eWzWNQlf3f9qh4wm/slzX3tpiHK/efX2aYdsp6nGqFbEDzlK opD98ANP1An6CEQ/QrTEvxeeG0rC+PtV57WPo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=izfEG7yNCX/XORvwWiOyXgTcHjYcl4HuEsa5onAm8+w=; b=qh6ZAa4GyhZJfpiTHzkbx5/ILFYTZGlH7tSfjBd09KVHbrGcxx8ylZUWA33bZ+vGqo TUspzSVz//OBk/z6fbDME7prAgJkzeq9R+OPuPuemalRIAMFyhs6l3VOm2AaV7vnaQwo WvIjC3nOaC0d9p8ptc7BaLqqZChMYdG5xxLVf8jzsSWWdDEz8/7cRxGE6FCh0LlsxxUY +HkJnw5OYQBQ+FGJjFy14ogMRDEM2XMfY8UsHp60JFzVHD6J8ZUvxxcR2QAr1pFX6Zdr J/vtEc0keL8y3VlrzMWpCEHybd5Sd/HLQVMRJjOkfmCQthZ3mA4vTpneCRFZJtfB5xna 1irQ== X-Gm-Message-State: AKS2vOwpY7KumXDvnfxVrFl1kpXbUSGkSahwuiu8kR6gOtK83BY7nWm5 c+wkiUS77pdb8qFO X-Received: by 10.46.82.199 with SMTP id n68mr3762710lje.99.1498719484025; Wed, 28 Jun 2017 23:58:04 -0700 (PDT) Received: from localhost.localdomain (a91-156-68-101.elisa-laajakaista.fi. [91.156.68.101]) by smtp.gmail.com with ESMTPSA id o9sm1051386lfo.48.2017.06.28.23.58.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Jun 2017 23:58:03 -0700 (PDT) From: Fathi Boudra To: linux-kselftest@vger.kernel.org, Shuah Khan Cc: linux-kernel@vger.kernel.org, Bamvor Jian Zhang , Michael Ellerman , Fathi Boudra Subject: [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS Date: Thu, 29 Jun 2017 09:58:02 +0300 Message-Id: <20170629065802.24062-1-fathi.boudra@linaro.org> X-Mailer: git-send-email 2.13.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix hardcoded and misplaced libmount headers. Use pkg-config instead to figure out CFLAGS/LDLIBS, fixing also their value for cross-compilation. If pkg-config isn't installed, it gives an error (command not found) and gpio test will fail to build because it won't be able to find the headers or link to libmount library. Signed-off-by: Fathi Boudra --- tools/testing/selftests/gpio/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.13.0 diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile index 298929df97e6..11eed0cdec2a 100644 --- a/tools/testing/selftests/gpio/Makefile +++ b/tools/testing/selftests/gpio/Makefile @@ -17,8 +17,8 @@ override define CLEAN $(RM) -r $(EXTRA_DIRS) endef -CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ -LDLIBS += -lmount -I/usr/include/libmount +CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ $(shell pkg-config --cflags mount) +LDLIBS += $(shell pkg-config --libs mount) $(BINARIES): ../../../gpio/gpio-utils.o ../../../../usr/include/linux/gpio.h