From: Bamvor Jian Zhang <bamvor.zhangjian@xxxxxxxxxx> Gpio tools require linux/gpio.h which may be only exist in kernel source code in a cross compile environment. Add such header to CFLAGS to avoid compiling failure. Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@xxxxxxxxxx> --- tools/gpio/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile index 4d198d5..6b8804f 100644 --- a/tools/gpio/Makefile +++ b/tools/gpio/Makefile @@ -1,5 +1,11 @@ +ifneq ($(INSTALL_HDR_PATH),) +KERNEL_HEADERS := $(INSTALL_HDR_PATH)/include +else +KERNEL_HEADERS ?= $(abspath ../../usr/include) +endif + CC = $(CROSS_COMPILE)gcc -CFLAGS += -Wall -g -D_GNU_SOURCE +CFLAGS += -Wall -g -D_GNU_SOURCE -I $(KERNEL_HEADERS) all: lsgpio -- 2.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html