kumquat-buildroot/package/skeleton/skeleton.mk
Yann E. MORIN 576d709a69 Revert "package/skeleton: drop $(HOST_DIR)/usr compatibility symlink"
In 38b798da73 (package/skeleton: drop $(HOST_DIR)/usr compatibility
symlink), we considered that $(HOST_DIR)/usr is a legacy symlink, and so
we dropped it. During review, it was pointed out that:

 1. [if] something installs in HOST_DIR/usr it's probably going to
    break somewhere down the line,

 2. DESTDIR is empty for host builds. And PREFIX/usr would be completely
    crazy.

However, we do have a package where DESTDIR is not empty for host
packages. Indeed, for host-systemd, we do have a convoluted sequence
where we configure it for the traditional /usr prefix, rather than
$(HOST_DIR) for all other host packages, and we install it with
DESTDIR=$(HOST_DIR). This is because systemd has to interpret path on
the target, not on the host, and confusion ensues if host systemd is not
configured with the same prefix as the target systemd. See commit
35c11a027c (package/systemd: add host variant) for the full, in-depth
explanations.

This reverts commit 38b798da73.

This also changes the comment to note that, although legacy, the usr
symlink is still required for some weird host packages.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2023-04-13 20:33:43 +02:00

30 lines
1023 B
Makefile

################################################################################
#
# skeleton
#
################################################################################
# The skeleton can't depend on the toolchain, since all packages depends on the
# skeleton and the toolchain is a target package, as is skeleton.
# Hence, skeleton would depends on the toolchain and the toolchain would depend
# on skeleton.
SKELETON_ADD_TOOLCHAIN_DEPENDENCY = NO
SKELETON_ADD_SKELETON_DEPENDENCY = NO
# Although the $(HOST_DIR)/usr symlink is mostly for backward compatibility,
# there are weird packages that still require it (see host-systemd, and
# commit 35c11a027c88).
define HOST_SKELETON_INSTALL_CMDS
# check-package DoNotInstallToHostdirUsr
$(Q)ln -snf . $(HOST_DIR)/usr
$(Q)mkdir -p $(HOST_DIR)/lib
$(Q)mkdir -p $(HOST_DIR)/include
$(Q)case $(HOSTARCH) in \
(*64) ln -snf lib $(HOST_DIR)/lib64;; \
(*) ln -snf lib $(HOST_DIR)/lib32;; \
esac
endef
$(eval $(virtual-package))
$(eval $(host-generic-package))