automake: don't rely on STAGING_DIR_HOST
authorMatthias Schiffer <redacted>
Mon, 3 Oct 2016 12:52:59 +0000 (14:52 +0200)
committerMatthias Schiffer <redacted>
Sun, 16 Oct 2016 15:49:13 +0000 (17:49 +0200)
We're currently preparing a change in LEDE that will change the host
staging dirs in a way that might break the sed commands used by the
automake Makefile. Change the command in a way that doesn't depend on the
path of the staging dir.

While it would be nicer to modify the configure script to use the correct
path in the first place, this doesn't work for the perl path, as perl is
used in shebang lines and must thus be an absolute path. Some scripts are
used both during build and on the target system, so fixing up the scripts
in the install step seems like the best option.

Signed-off-by: Matthias Schiffer <redacted>
devel/automake/Makefile

index 88cdbd14d3a13a6d11939701b087baa7a3a4c330..8357011c7b8a76b58970590f13ff3af321cee2b6 100644 (file)
@@ -34,6 +34,8 @@ define Package/automake/description
   with the GNU Coding Standards.
 endef
 
+FIX_PATHS = $(SED) '1c \#!/usr/bin/perl' -e 's| /[^ ]*/bin/perl| /usr/bin/perl|g'
+
 define Package/automake/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/automake-$(PKG_VERSION) \
@@ -42,10 +44,8 @@ define Package/automake/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aclocal-$(PKG_VERSION) \
          $(1)/usr/bin/aclocal-$(PKG_VERSION)
        $(LN) aclocal-$(PKG_VERSION) $(1)/usr/bin/aclocal
-       $(SED) 's|$(STAGING_DIR_HOST)|/usr|g' \
-         $(1)/usr/bin/automake-$(PKG_VERSION)
-       $(SED) 's|$(STAGING_DIR_HOST)|/usr|g' \
-         $(1)/usr/bin/aclocal-$(PKG_VERSION)
+       $(FIX_PATHS) $(1)/usr/bin/automake-$(PKG_VERSION)
+       $(FIX_PATHS) $(1)/usr/bin/aclocal-$(PKG_VERSION)
        $(INSTALL_DIR) $(1)/usr/share/automake-$(PKG_VERSION)
 
        for dir in \
git clone https://git.99rst.org/PROJECT