Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10053208imu; Wed, 5 Dec 2018 15:16:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/W/AE4cd9Iomd8s/8B5hKhL18+COf1k9X/oQuUZutx0eji7a0iQFzsQYhglR8EiWt01GuzQ X-Received: by 2002:a62:16d6:: with SMTP id 205mr26160109pfw.256.1544051783406; Wed, 05 Dec 2018 15:16:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544051783; cv=none; d=google.com; s=arc-20160816; b=nV6+2Gs2FO5O4MUxedcvWm2BOXFa9tJXy9vdh3mryRueihM8qRRr77Tla9LwZPorle L9L/1UnEGTuPI9z7FluHB6XlW4+oHu+5cIBrRaLZabrRfHsWmOfBkNQ5zyNqVu4RhXwK r4Z2zY+q00nxPROLFoLzQIP11A4tcwVHEdCTXlSfEFOlhaJbbgH5BbJvtJx63Lgc/saw OBHUoQLyvnSV9vkQa6eNc2TDbUQ9PRG3b4CDXKA49SYGYAWW4ZDdSfGYU2+eYs8jOiWO 16k/OOO7LwUD8afronPodHgUzO8XE1HC1Ss+/35CUknFDAvkNQxV/rHVgIIEuJHzKSU8 THfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=q2R0m24oFnAZmIpW8nY7qH30mlpFRtxLS3H0jRxzw44=; b=yDkac/VcEvKlmIJOLaP4ruGauTmzMxfJ6LZ5C77Sj/+waJEZ9WWX3MhSJO+NjOT+aO bTHJ8YNJnPw/M4Hc482BCxMU/12S9WCWDhLxkQgRPZL8NrgJdrHMWviySfpOImpWvr9x npVcx0P7QubVplMkzGScHlSBn6KptLs7SwMMD6B0mCwmLsc7nU1y7LcTLEBy3teKWU7p QVunCx18Lc5eDY4a/dqcf9ILRwlbctvqxGiiZT99fZtRdAdI1sFUaQ9Gq/8r06fdfyT8 56uVmvh1KNkTUi+xLhZAhbHpDLSAVSlrP3kc4vzU1SRZn5xZd9w70Nc/YlrmYFM8AAN/ Js6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HZOO/QEc"; 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 d4si21016455pls.348.2018.12.05.15.16.07; Wed, 05 Dec 2018 15:16:23 -0800 (PST) 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.s=google header.b="HZOO/QEc"; 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 S1728755AbeLEXP0 (ORCPT + 99 others); Wed, 5 Dec 2018 18:15:26 -0500 Received: from mail-yb1-f194.google.com ([209.85.219.194]:39701 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727940AbeLEXP0 (ORCPT ); Wed, 5 Dec 2018 18:15:26 -0500 Received: by mail-yb1-f194.google.com with SMTP id s15so1120927ybk.6 for ; Wed, 05 Dec 2018 15:15:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=q2R0m24oFnAZmIpW8nY7qH30mlpFRtxLS3H0jRxzw44=; b=HZOO/QEc4CbuCJabibFDOGaLVdhdXw4y6mvvt94KQaO6ll48yCFfGcfXh46QMmo4KR K71puDb+a6dBwBZT7M/AKH/2jwhZqfu1EsuADdsH3XGsqPc+T5UdXEUKm9HJa6mVd3bZ Z9TqFxFnbOA7m3UlZETVF5j+w+oG/CP7E6ECA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=q2R0m24oFnAZmIpW8nY7qH30mlpFRtxLS3H0jRxzw44=; b=eqkXiS0WiGSgKaoQ+ms3VYcnN9uJ+psNtJc77Axd15vU3g0ZedrNjVTtqwLX4SGfPN UvX+OoSLMCD+oGcBpijaJlrnkWCNxiebx36drDVDbfp0s2opExArMPtKjTUHrbNXrnHd C4xszor9rXi9rd3BV0DIqS3p+l40l/u7Ux04AmFK3vn8QZIuvrW+XNlRDTScP/CCJEdO e6f8UmIzMUlZq8xF0KbOfSXuwPOCz8bnOlJ7y8XNNovCgtNCqzizcdSOLbxuy6XwiKZx cfAojMgIRaf8A6gswYivdxaQZWR/R3NcgPUfM4+S+o/VjtzBqpiFoW3ywXT0ecKa4a6L /Kbg== X-Gm-Message-State: AA+aEWYyg8W/VOAsbnAzGH9HFmWkfIhl4AEckCXIUk87OA2hCWZULOEI r9hEr1g0yElYV4abrbHsMrkqePBbCCYq+oGQyoBLkg== X-Received: by 2002:a81:e40b:: with SMTP id r11mr25889426ywl.56.1544051724628; Wed, 05 Dec 2018 15:15:24 -0800 (PST) MIME-Version: 1.0 References: <20181016214659.22362-1-daniel.diaz@linaro.org> In-Reply-To: From: Anders Roxell Date: Thu, 6 Dec 2018 00:15:13 +0100 Message-ID: Subject: Re: [PATCH] selftests: gpio: Find libmount with pkg-config if available To: Linus Walleij Cc: =?UTF-8?B?RGFuaWVsIETDrWF6?= , Shuah Khan , "open list:KERNEL SELFTEST FRAMEWORK" , Bamvor Zhang , brgl@bgdev.pl, linux-gpio@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 5 Dec 2018 at 22:50, Linus Walleij wrote= : > > Sorry for top-posting, > > I don't understand the selftest environment very well so I do not know > if this is the right thing to do. > > I can merge the patch through the GPIO tree but I need a nod from > someone wise, like Shuah Khan or Anders Roxell (Anders has been > using the GPIO selftests) that this is the direction we want to go. Yes this makes sense and its already in linux-next. Cheers, Anders > > Yours, > Linus Walleij > > On Tue, Oct 16, 2018 at 11:47 PM Daniel D=C3=ADaz wrote: > > > If pkg-config is available, use it to define the CFLAGS and > > LDLIBS needed for libmount; else, use the current hard-coded > > paths and options. > > > > Using pkg-config is very helpful for cross-compilation > > environments, and is sometimes readily available on developer > > boxes to ensure we get the right compiler/linker options for > > the given package. > > > > Signed-off-by: Daniel D=C3=ADaz > > --- > > tools/testing/selftests/gpio/Makefile | 10 ++++++++-- > > 1 file changed, 8 insertions(+), 2 deletions(-) > > > > diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/self= tests/gpio/Makefile > > index 46648427d537..f22b22aef7bf 100644 > > --- a/tools/testing/selftests/gpio/Makefile > > +++ b/tools/testing/selftests/gpio/Makefile > > @@ -1,7 +1,13 @@ > > # SPDX-License-Identifier: GPL-2.0 > > > > -CFLAGS +=3D -O2 -g -std=3Dgnu99 -Wall -I../../../../usr/include/ > > -LDLIBS +=3D -lmount -I/usr/include/libmount > > +MOUNT_CFLAGS :=3D $(shell pkg-config --cflags mount 2>/dev/null) > > +MOUNT_LDLIBS :=3D $(shell pkg-config --libs mount 2>/dev/null) > > +ifeq ($(MOUNT_LDLIBS),) > > +MOUNT_LDLIBS :=3D -lmount -I/usr/include/libmount > > +endif > > + > > +CFLAGS +=3D -O2 -g -std=3Dgnu99 -Wall -I../../../../usr/include/ $(MOU= NT_CFLAGS) > > +LDLIBS +=3D $(MOUNT_LDLIBS) > > > > TEST_PROGS :=3D gpio-mockup.sh > > TEST_FILES :=3D gpio-mockup-sysfs.sh > > -- > > 2.17.1 > >