From 576d709a693aab13affdbe3d6dca5253e51a4877 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Tue, 11 Apr 2023 21:19:30 +0200 Subject: [PATCH] Revert "package/skeleton: drop $(HOST_DIR)/usr compatibility symlink" In 38b798da73ba (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 35c11a027c88 (package/systemd: add host variant) for the full, in-depth explanations. This reverts commit 38b798da73ba69c9e1d8279805b621f80b98bc64. 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 Cc: Arnout Vandecappelle (Essensium/Mind) --- package/skeleton/skeleton.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk index 186cb60189..4eaaf32ead 100644 --- a/package/skeleton/skeleton.mk +++ b/package/skeleton/skeleton.mk @@ -11,7 +11,12 @@ 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 \