autotools.mk 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. autoconf_bool = $(patsubst %,$(if $($(1)),--enable,--disable)-%,$(2))
  9. # delete *.la-files from staging_dir - we can not yet remove respective lines within all package
  10. # Makefiles, since backfire still uses libtool v1.5.x which (may) require those files
  11. define libtool_remove_files
  12. find $(1) -name '*.la' | $(XARGS) rm -f;
  13. endef
  14. define autoreconf
  15. (cd $(PKG_BUILD_DIR); \
  16. if [ -x ./autogen.sh ]; then \
  17. ./autogen.sh || true; \
  18. elif [ -f ./configure.ac ] || [ -f ./configure.in ]; then \
  19. rm -f ./GNUmakefile; \
  20. $(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
  21. $(patsubst %,-I %,$(PKG_LIBTOOL_PATHS)) $(PKG_LIBTOOL_PATHS) || true; \
  22. fi \
  23. );
  24. endef
  25. Hooks/InstallDev/Post += libtool_remove_files
  26. ifneq ($(filter libtool,$(PKG_FIXUP)),)
  27. PKG_BUILD_DEPENDS += libtool
  28. ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
  29. Hooks/Configure/Pre += autoreconf
  30. endif
  31. endif
  32. ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
  33. PKG_BUILD_DEPENDS += libtool
  34. ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
  35. Hooks/Configure/Pre += autoreconf
  36. endif
  37. endif