package/coreutils: split COREUTILS_CLEANUP and use better names
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 20 Jun 2019 18:35:58 +0000 (20:35 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 20 Jun 2019 19:03:54 +0000 (21:03 +0200)
The COREUTILS_CLEANUP macro naming is a bit weird. In addition, it
does two unrelated things, and the introduction of support for
building coreutils as individual binaries will require splitting it
up.

So let's do this split as a preparation commit, and use better names
for both resulting macros.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/coreutils/coreutils.mk

index 5e7e0c6ea0939ee6c157263da485c347f1852223..c48dc235ac68ffd053eaaa4318e65fb258810858 100644 (file)
@@ -110,14 +110,17 @@ ifeq ($(BR2_STATIC_LIBS),y)
 COREUTILS_CONF_OPTS += --enable-no-install-program=stdbuf
 endif
 
-define COREUTILS_CLEANUP
-       # link for archaic shells
+# link for archaic shells
+define COREUTILS_CREATE_TEST_SYMLINK
        ln -fs coreutils $(TARGET_DIR)/usr/bin/[
-       # gnu thinks chroot is in bin, debian thinks it's in sbin
+endef
+COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_CREATE_TEST_SYMLINK
+
+# gnu thinks chroot is in bin, debian thinks it's in sbin
+define COREUTILS_FIX_CHROOT_LOCATION
        rm -f $(TARGET_DIR)/usr/bin/chroot
        ln -sf ../bin/coreutils $(TARGET_DIR)/usr/sbin/chroot
 endef
-
-COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_CLEANUP
+COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_FIX_CHROOT_LOCATION
 
 $(eval $(autotools-package))