summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2017-07-18 19:25:30 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-07-22 21:44:59 +0200
commit92d4b3e8ddaf54c7aa45c0b75293304fd740a20a (patch)
treeb7ea2935fe9c2a4a054ce7af0ddfc17e7718137b
parent3b6fa452f6ee20f54e47fdc3106620ff258f13b7 (diff)
downloadbuildroot-92d4b3e8ddaf54c7aa45c0b75293304fd740a20a.tar.gz
buildroot-92d4b3e8ddaf54c7aa45c0b75293304fd740a20a.zip
package/skeleton: make SKELETON_LIB_SYMLINK a macro
Rather than duplicate that code in all skeleton packages, make this a macro, so that it is easier to use. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--package/skeleton/skeleton.mk30
1 files changed, 18 insertions, 12 deletions
diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
index 017479a990..0a8add66dc 100644
--- a/package/skeleton/skeleton.mk
+++ b/package/skeleton/skeleton.mk
@@ -17,6 +17,7 @@ SKELETON_INSTALL_STAGING = YES
############
# Macros available for use by any skeleton package:
# - SKELETON_RSYNC
+# - SKELETON_LIB_SYMLINK
# This function rsyncs the skeleton directory in $(1) to the destination
# in $(2), which should be either $(TARTGET_DIR) or $(STAGING_DIR)
@@ -26,6 +27,21 @@ define SKELETON_RSYNC
$(1)/ $(2)/
endef
+# Make a symlink lib32->lib or lib64->lib as appropriate.
+# MIPS64/n32 requires lib32 even though it's a 64-bit arch.
+# $(1): base dir (either staging or target)
+ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y)
+define SKELETON_LIB_SYMLINK
+ ln -snf lib $(1)/lib64
+ ln -snf lib $(1)/usr/lib64
+endef
+else
+define SKELETON_LIB_SYMLINK
+ ln -snf lib $(1)/lib32
+ ln -snf lib $(1)/usr/lib32
+endef
+endif
+
ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y)
SKELETON_PATH = $(call qstrip,$(BR2_ROOTFS_SKELETON_CUSTOM_PATH))
@@ -92,19 +108,10 @@ define SKELETON_USR_SYMLINKS_OR_DIRS
endef
endif
-# We make a symlink lib32->lib or lib64->lib as appropriate
-# MIPS64/n32 requires lib32 even though it's a 64-bit arch.
-ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y)
-SKELETON_LIB_SYMLINK = lib64
-else
-SKELETON_LIB_SYMLINK = lib32
-endif
-
define SKELETON_INSTALL_TARGET_CMDS
$(call SKELETON_RSYNC,$(SKELETON_PATH),$(TARGET_DIR))
$(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
- ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
- ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
+ $(call SKELETON_LIB_SYMLINK,$(TARGET_DIR))
$(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
$(TARGET_DIR_WARNING_FILE)
endef
@@ -120,8 +127,7 @@ define SKELETON_INSTALL_STAGING_CMDS
$(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/sbin
$(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include
$(call SKELETON_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
- ln -snf lib $(STAGING_DIR)/$(SKELETON_LIB_SYMLINK)
- ln -snf lib $(STAGING_DIR)/usr/$(SKELETON_LIB_SYMLINK)
+ $(call SKELETON_LIB_SYMLINK,$(STAGING_DIR))
endef
# The TARGET_FINALIZE_HOOKS must be sourced only if the users choose to use the
OpenPOWER on IntegriCloud