autotools.mk 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #
  2. # Copyright (C) 2007-2008 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # $Id$
  8. define replace
  9. if [ -f "$(PKG_BUILD_DIR)/$(3)$(1)" -a -e "$(2)/$(1)" ]; then \
  10. rm -f $(PKG_BUILD_DIR)/$(3)$(1); \
  11. ln -s $(2)/$(1) $(PKG_BUILD_DIR)/$(3); \
  12. fi
  13. endef
  14. # replace copies of ltmain.sh with the build system's version
  15. update_libtool=$(call replace,libtool,$(STAGING_DIR)/host/bin,$(CONFIGURE_PATH)/)$(call replace,ltmain.sh,$(STAGING_DIR)/host/share/libtool,$(CONFIGURE_PATH)/)$(call replace,libtool.m4,$(STAGING_DIR)/host/share/aclocal,$(CONFIGURE_PATH)/)
  16. # prevent libtool from linking against host development libraries
  17. define libtool_fixup_libdir
  18. find $(1) -name '*.la' | $(XARGS) \
  19. $(SED) "s,\(^libdir='\| \|-L\|^dependency_libs='\)/usr/lib,\1$(STAGING_DIR)/usr/lib,g"
  20. find $(2) -name '*.la' | $(XARGS) \
  21. $(SED) "s,\(^libdir='\| \|-L\|^dependency_libs='\)/usr/lib,\1$(STAGING_DIR)/usr/lib,g"
  22. endef
  23. define remove_version_check
  24. if [ -f "$(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/configure" ]; then \
  25. $(SED) \
  26. 's,pardus_ltmain_version=.*,pardus_ltmain_version="$$$$pardus_lt_version",' \
  27. $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/configure; \
  28. fi
  29. endef
  30. ifneq ($(filter libtool,$(PKG_FIXUP)),)
  31. PKG_BUILD_DEPENDS += libtool
  32. Hooks/Configure/Pre += update_libtool remove_version_check
  33. Hooks/Configure/Post += update_libtool
  34. Hooks/InstallDev/Post += libtool_fixup_libdir
  35. endif