Browse Source

- helpers.mk: add rewrite libtool libraries automatically

master
vanhofen 5 years ago
parent
commit
ddf82da7ac
  1. 8
      make/environment-build.mk
  2. 26
      make/helpers.mk

8
make/environment-build.mk

@ -194,14 +194,6 @@ PKG_CONFIG_PATH = $(PKG_CONFIG_LIBDIR)/pkgconfig
# -----------------------------------------------------------------------------
# rewrite-"functions"
REWRITE_LIBTOOL_RULES = sed -i \
-e "s,^libdir=.*,libdir='$(TARGET_LIB_DIR)'," \
-e "s,\(^dependency_libs='\| \|-L\|^dependency_libs='\)/lib,\ $(TARGET_LIB_DIR),g"
REWRITE_LIBTOOL = $(REWRITE_LIBTOOL_RULES) $(TARGET_LIB_DIR)
REWRITE_LIBTOOL_STATIC = $(REWRITE_LIBTOOL_RULES) $(STATIC_LIB_DIR)
REWRITE_CONFIG_RULES = sed -i \
-e "s,^prefix=.*,prefix='$(TARGET_DIR)'," \
-e "s,^exec_prefix=.*,exec_prefix='$(TARGET_DIR)'," \

26
make/helpers.mk

@ -41,6 +41,32 @@ APPLY_PATCHES = $(call apply_patches, $(PKG_PATCHES_DIR))
# -----------------------------------------------------------------------------
# rewrite libtool libraries
REWRITE_LIBTOOL_RULES = sed -i \
-e "s,^libdir=.*,libdir='$(TARGET_LIB_DIR)'," \
-e "s,\(^dependency_libs='\| \|-L\|^dependency_libs='\)/lib,\ $(TARGET_LIB_DIR),g"
REWRITE_LIBTOOL = $(REWRITE_LIBTOOL_RULES) $(TARGET_LIB_DIR)
REWRITE_LIBTOOL_STATIC = $(REWRITE_LIBTOOL_RULES) $(STATIC_LIB_DIR)
REWRITE_TAG = rewritten=1
define rewrite_libtool
cd $(TARGET_LIB_DIR); \
for la in *.la; do \
if ! grep -q "$(REWRITE_TAG)" $${la}; then \
echo -e "$(TERM_YELLOW)Rewriting $${la}$(TERM_NORMAL)"; \
$(REWRITE_LIBTOOL)/$${la}; \
echo -e "\n# Adapted to buildsystem\n$(REWRITE_TAG)" >> $${la}; \
fi; \
done
endef
# rewrite libtool libraries automatically
REWRITE_LIBTOOL_LA = $(call rewrite_libtool)
# -----------------------------------------------------------------------------
#
# Manipulation of .config files based on the Kconfig infrastructure.
# Used by the BusyBox package, the Linux kernel package, and more.

Loading…
Cancel
Save