Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752626AbdC1EQg (ORCPT ); Tue, 28 Mar 2017 00:16:36 -0400 Received: from mail-wr0-f181.google.com ([209.85.128.181]:34882 "EHLO mail-wr0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827AbdC1EQe (ORCPT ); Tue, 28 Mar 2017 00:16:34 -0400 MIME-Version: 1.0 In-Reply-To: <87efxiayw2.fsf@concordia.ellerman.id.au> References: <20170324115527.26472-1-fathi.boudra@linaro.org> <87efxiayw2.fsf@concordia.ellerman.id.au> From: Fathi Boudra Date: Tue, 28 Mar 2017 07:15:34 +0300 Message-ID: Subject: Re: [PATCH] selftests: gpio: fix Makefile To: Michael Ellerman Cc: linux-kselftest@vger.kernel.org, Shuah Khan , "linux-kernel@vger.kernel.org" , Bamvor Jian Zhang Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1329 Lines: 37 On 28 March 2017 at 06:00, Michael Ellerman wrote: > Fathi Boudra writes: >> diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile >> index 205e4d10e085..714f1f7df04d 100644 >> --- a/tools/testing/selftests/gpio/Makefile >> +++ b/tools/testing/selftests/gpio/Makefile >> @@ -1,23 +1,24 @@ >> +CFLAGS += -O2 -g -std=gnu99 -Wall >> +CFLAGS += -I../../../../include/uapi/ -I../../../../include/ > > Those are kernel headers, they *might* work in userspace but they're not > designed to. except some tests are using uapi and some others are using the generated headers inconsistently, so it looks like using uapi directly is allowed. Do you suggest to fix the tests to only use the exported headers consistently across selftests and add the dependency to headers_install when necessary? > Use the exported headers: > > CFLAGS += -I../../../../usr/include > > > If they're not there, then the user can install them, or fall back to > the system headers. > >> +CFLAGS += $(shell pkg-config --cflags mount) >> +LDLIBS += $(shell pkg-config --libs mount) > > What 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. > cheers