package/dtc: add optional libyaml dependency
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Mon, 29 Jul 2019 12:16:37 +0000 (14:16 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Thu, 1 Aug 2019 08:51:38 +0000 (10:51 +0200)
Since bump to version 1.5.0 with commit
b2f4dc7bc15bcf2cc0282e6a226d97f050975c35, dtc binary optionally depends
on libyaml which is enabled if it is found by pkgconfig so:
 - add host-pkgconf and libyaml dependencies only if
   BR2_PACKAGE_DTC_PROGRAMS and BR2_PACKAGE_LIBYAML are set
 - disable yaml for host build (and so remove host-pkgconf from
   HOST_DTC_DEPENDENCIES)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/dtc/dtc.mk

index fd736532f304dafe5f366cf3765e6deb60062674..b99a96df83ec344424d39bda9706231e090b2330 100644 (file)
@@ -10,8 +10,8 @@ DTC_SITE = https://www.kernel.org/pub/software/utils/dtc
 DTC_LICENSE = GPL-2.0+ or BSD-2-Clause (library)
 DTC_LICENSE_FILES = README.license GPL
 DTC_INSTALL_STAGING = YES
-DTC_DEPENDENCIES = host-bison host-flex host-pkgconf
-HOST_DTC_DEPENDENCIES = host-bison host-flex host-pkgconf
+DTC_DEPENDENCIES = host-bison host-flex
+HOST_DTC_DEPENDENCIES = host-bison host-flex
 
 DTC_MAKE_OPTS = \
        PREFIX=/usr \
@@ -19,7 +19,8 @@ DTC_MAKE_OPTS = \
 
 HOST_DTC_MAKE_OPTS = \
        PREFIX=$(HOST_DIR) \
-       NO_PYTHON=1
+       NO_PYTHON=1 \
+       NO_YAML=1
 
 define DTC_POST_INSTALL_TARGET_RM_DTDIFF
        rm -f $(TARGET_DIR)/usr/bin/dtdiff
@@ -33,6 +34,10 @@ ifeq ($(BR2_PACKAGE_BASH),)
 DTC_POST_INSTALL_TARGET_HOOKS += DTC_POST_INSTALL_TARGET_RM_DTDIFF
 endif
 
+ifeq ($(BR2_PACKAGE_LIBYAML),y)
+DTC_DEPENDENCIES += host-pkgconf libyaml
+endif
+
 else # $(BR2_PACKAGE_DTC_PROGRAMS) != y
 
 DTC_INSTALL_GOAL = install-lib