summaryrefslogtreecommitdiff
path: root/makefiles
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-12-04 16:50:41 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-12-04 16:50:41 +0000
commite974fe9e3c3db8ce0d39aad1bfe92d6a9c793dce (patch)
tree4a054b989f11719416b1e19dc8cf521304a399cd /makefiles
parent5f7f3dc1a377dc54eeab95ad1cd2d52026c4a0f0 (diff)
downloadbuildsystem-e974fe9e3c3db8ce0d39aad1bfe92d6a9c793dce.tar.gz
buildsystem-e974fe9e3c3db8ce0d39aad1bfe92d6a9c793dce.tar.bz2
New macro to extend compiler/linker flags from pkg-config metadata
svn path=/trunk/tools/buildsystem/; revision=10969
Diffstat (limited to 'makefiles')
-rw-r--r--makefiles/Makefile.pkgconfig19
1 files changed, 19 insertions, 0 deletions
diff --git a/makefiles/Makefile.pkgconfig b/makefiles/Makefile.pkgconfig
index 9e0e75d..c9bb8a1 100644
--- a/makefiles/Makefile.pkgconfig
+++ b/makefiles/Makefile.pkgconfig
@@ -67,3 +67,22 @@ define pkg_config_package_compare_version
endef
+# Add package to compiler/linker flags
+# 1: Name of package to add details of
+# 2: CFLAGS variable to extend, or none
+# 3: LDFLAGS variable to extend, or none
+define pkg_config_package_add_flags
+ ifeq ($$(PKGCONFIG),)
+ $$(error pkg-config is required to auto-detect package version)
+ endif
+
+ ifneq ($(2),)
+ $$($(2)) := $$($(2)) $$(shell $$(PKGCONFIG) --cflags $(1))
+ endif
+
+ ifneq ($(3),)
+ $$($(3)) := $$($(3)) $$(shell $$(PKGCONFIG) --libs $(1))
+ endif
+
+endef
+