[Buildroot] [RFC 4/9] package/llvm: RFC: install llvm-config in staging

Romain Naour romain.naour at gmail.com
Mon Jul 3 10:18:41 UTC 2017


Signed-off-by: Romain Naour <romain.naour at gmail.com>
---
 package/llvm/llvm.mk | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk
index 3d0a052..45ce4b4 100644
--- a/package/llvm/llvm.mk
+++ b/package/llvm/llvm.mk
@@ -24,6 +24,22 @@ LLVM_DEPENDENCIES = host-llvm zlib
 # Use native llvm-tblgen from host-llvm.
 LLVM_CONF_OPTS += -DLLVM_TABLEGEN=$(HOST_DIR)/usr/bin/llvm-tblgen
 
+# Copy llvm-config (host variant) to STAGING_DIR since llvm-config
+# provided by llvm target variant can't run on the host.
+# Also llvm-config (host variant) return include and lib directories
+# for the host if it's installed in host/usr/bin:
+# output/host/usr/bin/llvm-config --includedir
+# output/host/usr/include
+# When istalled in STAGING_DIR llvm-config return include and lib
+# directories from STAGING_DIR.
+# output/staging/usr/bin/llvm-config --includedir
+# output/staging/usr/include
+define LLVM_COPY_LLVM_CONFIG_TO_STAGING_DIR
+	$(INSTALL) -D -m 0755 $(HOST_DIR)/usr/bin/llvm-config \
+		$(STAGING_DIR)/usr/bin/llvm-config
+endef
+LLVM_POST_INSTALL_STAGING_HOOKS = LLVM_COPY_LLVM_CONFIG_TO_STAGING_DIR
+
 # Use "Unix Makefiles" generator for generating make-compatible parallel makefiles.
 # Ninja is not supported yet by Buildroot
 HOST_LLVM_CONF_OPTS += -G "Unix Makefiles"
-- 
2.9.4




More information about the buildroot mailing list