mirror of
https://github.com/dgibson/dtc.git
synced 2026-10-10 08:03:00 -04:00
yaml: Depend on libyaml >= 0.2.3
libyaml before 0.2.3 expects non-const string parameters. Supporting both variants would require either cpp magic or ignoring "discarded-qualifiers" compiler warnings. For the sake of simplicity just support libyaml 0.2.3 and newer. Note that NO_YAML can be overwritten on the make command line. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
This commit is contained in:
parent
f1657b2fb5
commit
0ac8b30ba5
3 changed files with 7 additions and 3 deletions
6
Makefile
6
Makefile
|
|
@ -55,7 +55,11 @@ else
|
||||||
CFLAGS += $(shell $(PKG_CONFIG) --cflags valgrind)
|
CFLAGS += $(shell $(PKG_CONFIG) --cflags valgrind)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
NO_YAML := $(shell $(PKG_CONFIG) --exists yaml-0.1; echo $$?)
|
# libyaml before version 0.2.3 expects non-const string parameters. Supporting
|
||||||
|
# both variants would require either cpp magic or passing
|
||||||
|
# -Wno-error=discarded-qualifiers to the compiler. For the sake of simplicity
|
||||||
|
# just support libyaml >= 0.2.3.
|
||||||
|
NO_YAML := $(shell $(PKG_CONFIG) --atleast-version 0.2.3 yaml-0.1; echo $$?)
|
||||||
ifeq ($(NO_YAML),1)
|
ifeq ($(NO_YAML),1)
|
||||||
CFLAGS += -DNO_YAML
|
CFLAGS += -DNO_YAML
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
yamltree = 'yamltree.c'
|
yamltree = 'yamltree.c'
|
||||||
yaml = dependency('yaml-0.1', required: get_option('yaml'), static: static_build)
|
yaml = dependency('yaml-0.1', version: '>=0.2.3', required: get_option('yaml'), static: static_build)
|
||||||
if not yaml.found()
|
if not yaml.found()
|
||||||
add_project_arguments('-DNO_YAML', language: 'c')
|
add_project_arguments('-DNO_YAML', language: 'c')
|
||||||
yamltree = []
|
yamltree = []
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ if [ -n "$NO_YAML" ]; then
|
||||||
no_yaml=false
|
no_yaml=false
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if pkg-config --exists yaml-0.1; then
|
if pkg-config --atleast-version 0.2.3 yaml-0.1; then
|
||||||
no_yaml=false
|
no_yaml=false
|
||||||
else
|
else
|
||||||
no_yaml=true
|
no_yaml=true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue