mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 05:02:12 +00:00
067c650c45
Using Makefile's wildcard with absolute path to detect the presence of libyaml results in false-positive detection when cross-compiling e.g. in yocto environment. The latter results in build error: | scripts/dtc/yamltree.o: In function `yaml_propval_int': | yamltree.c: undefined reference to `yaml_sequence_start_event_initialize' | yamltree.c: undefined reference to `yaml_emitter_emit' | yamltree.c: undefined reference to `yaml_scalar_event_initialize' ... Use pkg-config to locate libyaml to address this scenario. Signed-off-by: Pavel Modilaynen <pavel.modilaynen@axis.com> [robh: silence stderr] Signed-off-by: Rob Herring <robh@kernel.org>
31 lines
1018 B
Makefile
31 lines
1018 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# scripts/dtc makefile
|
|
|
|
hostprogs-$(CONFIG_DTC) := dtc
|
|
always := $(hostprogs-y)
|
|
|
|
dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
|
|
srcpos.o checks.o util.o
|
|
dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
|
|
|
|
# Source files need to get at the userspace version of libfdt_env.h to compile
|
|
HOST_EXTRACFLAGS := -I $(srctree)/$(src)/libfdt
|
|
|
|
ifeq ($(shell pkg-config --exists yaml-0.1 2>/dev/null && echo yes),)
|
|
ifneq ($(CHECK_DTBS),)
|
|
$(error dtc needs libyaml for DT schema validation support. \
|
|
Install the necessary libyaml development package.)
|
|
endif
|
|
HOST_EXTRACFLAGS += -DNO_YAML
|
|
else
|
|
dtc-objs += yamltree.o
|
|
HOSTLDLIBS_dtc := $(shell pkg-config yaml-0.1 --libs)
|
|
endif
|
|
|
|
# Generated files need one more search path to include headers in source tree
|
|
HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
|
|
HOSTCFLAGS_dtc-parser.tab.o := -I $(srctree)/$(src)
|
|
|
|
# dependencies on generated files need to be listed explicitly
|
|
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
|