[Intel-gfx] [PATCH i-g-t 08/13] Android.mk: Fix libkmod use
Arkadiusz Hiler
arkadiusz.hiler at intel.com
Tue May 16 13:24:57 UTC 2017
On Android libkmod.h is nested under libkmod directory, so we should
include appropriately.
Also we need to link with it.
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
---
benchmarks/Android.mk | 2 ++
lib/Android.mk | 1 +
lib/igt_kmod.h | 4 ++++
tests/Android.mk | 4 ++--
tools/Android.mk | 2 ++
5 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk
index c0fa09f..faa73b7 100644
--- a/benchmarks/Android.mk
+++ b/benchmarks/Android.mk
@@ -18,6 +18,7 @@ define add_benchmark
LOCAL_CFLAGS += -Wno-error=return-type
# Excessive complaining for established cases. Rely on the Linux version warnings.
LOCAL_CFLAGS += -Wno-sign-compare
+ LOCAL_LDFLAGS += -lkmod
LOCAL_MODULE := $1_benchmark
LOCAL_MODULE_TAGS := optional
@@ -26,6 +27,7 @@ define add_benchmark
LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libkmod \
libdrm \
libdrm_intel
diff --git a/lib/Android.mk b/lib/Android.mk
index eb72f84..0596e4a 100644
--- a/lib/Android.mk
+++ b/lib/Android.mk
@@ -29,6 +29,7 @@ LOCAL_CFLAGS += -std=gnu99 -UNDEBUG
LOCAL_MODULE:= libintel_gpu_tools
LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libkmod \
libdrm \
libdrm_intel
diff --git a/lib/igt_kmod.h b/lib/igt_kmod.h
index fd307a4..6a7584f 100644
--- a/lib/igt_kmod.h
+++ b/lib/igt_kmod.h
@@ -24,7 +24,11 @@
#ifndef IGT_KMOD_H
#define IGT_KMOD_H
+#ifdef ANDROID
+#include <libkmod/libkmod.h>
+#else
#include <libkmod.h>
+#endif
#include "igt_aux.h"
diff --git a/tests/Android.mk b/tests/Android.mk
index c67ddbd..b664dff 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -19,7 +19,7 @@ define add_test
LOCAL_MODULE_TAGS := optional
# ask linker to define a specific symbol; we use this to identify IGT tests
- LOCAL_LDFLAGS := -Wl,--defsym=$2=0
+ LOCAL_LDFLAGS := -Wl,--defsym=$2=0 -lkmod
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/intel/validation/core/igt
include $(BUILD_EXECUTABLE)
@@ -45,7 +45,7 @@ IGT_LOCAL_C_INCLUDES += ${ANDROID_BUILD_TOP}/external/PRIVATE/drm/include/drm
# set local libraries
IGT_LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
-IGT_LOCAL_SHARED_LIBRARIES := libpciaccess libdrm libdrm_intel
+IGT_LOCAL_SHARED_LIBRARIES := libpciaccess libkmod libdrm libdrm_intel
# handle cairo requirements if it is enabled
ifeq ("${ANDROID_HAS_CAIRO}", "1")
diff --git a/tools/Android.mk b/tools/Android.mk
index 0602e8c..a8e649b 100644
--- a/tools/Android.mk
+++ b/tools/Android.mk
@@ -23,6 +23,7 @@ define add_tool
LOCAL_CFLAGS += -Wno-error=return-type
# Excessive complaining for established cases. Rely on the Linux version warnings.
LOCAL_CFLAGS += -Wno-sign-compare
+ LOCAL_LDFLAGS += -lkmod
ifeq ($($(1)_LDFLAGS),)
else
LOCAL_LDFLAGS += $($(1)_LDFLAGS)
@@ -38,6 +39,7 @@ define add_tool
LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libkmod \
libdrm \
libdrm_intel
--
2.9.3
More information about the Intel-gfx
mailing list