autotools.mk 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. $(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
  20. $(patsubst %,-I %,$(PKG_LIBTOOL_PATHS)) $(PKG_LIBTOOL_PATHS) || true; \
  21. fi \
  22. );
  23. endef
  24. Hooks/InstallDev/Post += libtool_remove_files
  25. ifneq ($(filter libtool,$(PKG_FIXUP)),)
  26. PKG_BUILD_DEPENDS += libtool
  27. ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
  28. Hooks/Configure/Pre += autoreconf
  29. endif
  30. endif
  31. ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
  32. PKG_BUILD_DEPENDS += libtool
  33. ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
  34. Hooks/Configure/Pre += autoreconf
  35. endif
  36. endif