grep.mk 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ################################################################################
  2. #
  3. # grep
  4. #
  5. ################################################################################
  6. GREP_VERSION = 3.6
  7. GREP_SITE = $(BR2_GNU_MIRROR)/grep
  8. GREP_SOURCE = grep-$(GREP_VERSION).tar.xz
  9. GREP_LICENSE = GPL-3.0+
  10. GREP_LICENSE_FILES = COPYING
  11. GREP_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES)
  12. # install into /bin like busybox grep
  13. GREP_CONF_OPTS = --exec-prefix=/
  14. ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
  15. define GREP_REMOVE_ALIAS
  16. $(RM) $(TARGET_DIR)/bin/[fe]grep
  17. endef
  18. GREP_POST_INSTALL_TARGET_HOOKS += GREP_REMOVE_ALIAS
  19. else
  20. # ensure egrep/fgrep shell wrappers use #!/bin/sh
  21. define GREP_FIXUP_SHEBANG
  22. $(SED) 's/bash$$/sh/' $(TARGET_DIR)/bin/[fe]grep
  23. endef
  24. GREP_POST_INSTALL_TARGET_HOOKS += GREP_FIXUP_SHEBANG
  25. endif
  26. # link with iconv if enabled
  27. ifeq ($(BR2_PACKAGE_LIBICONV),y)
  28. GREP_CONF_ENV += LIBS=-liconv
  29. GREP_DEPENDENCIES += libiconv
  30. endif
  31. # link with pcre if enabled
  32. ifeq ($(BR2_PACKAGE_PCRE),y)
  33. GREP_CONF_OPTS += --enable-perl-regexp
  34. GREP_DEPENDENCIES += pcre
  35. else
  36. GREP_CONF_OPTS += --disable-perl-regexp
  37. endif
  38. $(eval $(autotools-package))