All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fathi Boudra <fathi.boudra@linaro.org>
To: linux-kselftest@vger.kernel.org, Shuah Khan <shuah@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Fathi Boudra <fathi.boudra@linaro.org>
Subject: [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS
Date: Thu, 29 Jun 2017 09:58:02 +0300	[thread overview]
Message-ID: <20170629065802.24062-1-fathi.boudra@linaro.org> (raw)

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 <fathi.boudra@linaro.org>
---
 tools/testing/selftests/gpio/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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
 
-- 
2.13.0

             reply	other threads:[~2017-06-29  6:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29  6:58 Fathi Boudra [this message]
2017-06-29  9:01 ` [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS Michael Ellerman
2017-06-29 11:39   ` Fathi Boudra
2017-06-30  2:20     ` Bamvor Zhang Jian
2017-06-30  5:53       ` Fathi Boudra
2017-07-01  1:48         ` Michael Ellerman
2017-07-03 11:23           ` Fathi Boudra
2017-06-30 11:01     ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170629065802.24062-1-fathi.boudra@linaro.org \
    --to=fathi.boudra@linaro.org \
    --cc=bamvor.zhangjian@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.