Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752059AbdF2G6S (ORCPT ); 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 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1111 Lines: 29 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(-) 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