autotools.mk 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #
  2. # Copyright (C) 2007-2010 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. PKG_LIBTOOL_PATHS?=$(CONFIGURE_PATH)
  8. PKG_REMOVE_FILES?=aclocal.m4
  9. autoconf_bool = $(patsubst %,$(if $($(1)),--enable,--disable)-%,$(2))
  10. # delete *.la-files from staging_dir - we can not yet remove respective lines within all package
  11. # Makefiles, since backfire still uses libtool v1.5.x which (may) require those files
  12. define libtool_remove_files
  13. find $(1) -name '*.la' | $(XARGS) rm -f;
  14. endef
  15. define autoreconf
  16. (cd $(PKG_BUILD_DIR); \
  17. $(patsubst %,rm -f %;,$(PKG_REMOVE_FILES)) \
  18. if [ -x ./autogen.sh ]; then \
  19. ./autogen.sh || true; \
  20. elif [ -f ./configure.ac ] || [ -f ./configure.in ]; then \
  21. [ -f ./aclocal.m4 ] && [ ! -f ./acinclude.m4 ] && mv aclocal.m4 acinclude.m4; \
  22. [ -d ./autom4te.cache ] && rm -rf autom4te.cache; \
  23. $(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
  24. -B $(STAGING_DIR_HOST)/share/aclocal \
  25. -B $(STAGING_DIR)/host/share/aclocal \
  26. $(patsubst %,-I %,$(PKG_LIBTOOL_PATHS)) $(PKG_LIBTOOL_PATHS) || true; \
  27. fi \
  28. );
  29. endef
  30. Hooks/InstallDev/Post += libtool_remove_files
  31. ifneq ($(filter libtool,$(PKG_FIXUP)),)
  32. PKG_BUILD_DEPENDS += libtool
  33. ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
  34. Hooks/Configure/Pre += autoreconf
  35. endif
  36. endif
  37. ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
  38. PKG_BUILD_DEPENDS += libtool
  39. ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
  40. Hooks/Configure/Pre += autoreconf
  41. endif
  42. endif
  43. ifneq ($(filter autoreconf,$(PKG_FIXUP)),)
  44. ifeq ($(filter autoreconf,$(Hooks/Configure/Pre)),)
  45. Hooks/Configure/Pre += autoreconf
  46. endif
  47. endif