OSDN Git Service

minigbm: cros_gralloc: Use pkg-config
authorLuis Hector Chavez <lhchavez@google.com>
Wed, 3 May 2017 22:14:41 +0000 (15:14 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Mon, 8 May 2017 19:40:51 +0000 (12:40 -0700)
This change uses pkg-config to find the libdrm headers instead of
relying on the arc-toolchain sysroot.

BUG=b:26864637
TEST=reef compiles, surfaceflinger is happy
CQ-DEPEND=CL:494886

Change-Id: Ic6142424ff5593ab5552dd61b8ae4b7dc38497fc
Reviewed-on: https://chromium-review.googlesource.com/495267
Commit-Ready: Luis Hector Chavez <lhchavez@chromium.org>
Tested-by: Luis Hector Chavez <lhchavez@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
cros_gralloc/Makefile

index 2798355..98b14ee 100644 (file)
@@ -7,12 +7,15 @@ GRALLOC = gralloc.cros.so
 SRCS    = $(wildcard *.cc)
 SRCS   += $(wildcard ../*.c)
 SOURCES = $(filter-out ../gbm%, $(SRCS))
+PKG_CONFIG ?= pkg-config
 
 VPATH = $(dir $(SOURCES))
+LIBDRM_CFLAGS := $(shell $(PKG_CONFIG) --cflags libdrm)
 
-CPPFLAGS += -Wall -fPIC -Werror -flto
+CPPFLAGS += -Wall -fPIC -Werror -flto $(LIBDRM_CFLAGS)
 CXXFLAGS += -std=c++11
 CFLAGS   += -std=c99
+# TODO(gurchetansingh): Switch to pkg-config.
 LIBS     += -shared -lcutils -lhardware -ldrm
 
 OBJS =  $(foreach source, $(SOURCES), $(addsuffix .o, $(basename $(source))))