lsof.mk 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ################################################################################
  2. #
  3. # lsof
  4. #
  5. ################################################################################
  6. LSOF_VERSION = 4.93.2
  7. LSOF_SITE = $(call github,lsof-org,lsof,$(LSOF_VERSION))
  8. LSOF_LICENSE = lsof license
  9. # License is repeated in each file, this is a relatively small one.
  10. # It is also defined in 00README, but that contains a lot of other cruft.
  11. LSOF_LICENSE_FILES = dialects/linux/dproto.h
  12. ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
  13. LSOF_DEPENDENCIES += libtirpc
  14. endif
  15. ifeq ($(BR2_USE_WCHAR),)
  16. define LSOF_CONFIGURE_WCHAR_FIXUPS
  17. $(SED) 's,^#define[[:space:]]*HASWIDECHAR.*,#undef HASWIDECHAR,' \
  18. $(@D)/machine.h
  19. endef
  20. endif
  21. ifeq ($(BR2_ENABLE_LOCALE),)
  22. define LSOF_CONFIGURE_LOCALE_FIXUPS
  23. $(SED) 's,^#define[[:space:]]*HASSETLOCALE.*,#undef HASSETLOCALE,' \
  24. $(@D)/machine.h
  25. endef
  26. endif
  27. define LSOF_CONFIGURE_CMDS
  28. (cd $(@D) ; \
  29. echo n | $(TARGET_CONFIGURE_OPTS) DEBUG="$(TARGET_CFLAGS)" \
  30. LSOF_INCLUDE="$(STAGING_DIR)/usr/include" LSOF_CFLAGS_OVERRIDE=1 \
  31. LINUX_CLIB=-DGLIBCV=2 LSOF_CFGL="$(TARGET_LDFLAGS)" \
  32. ./Configure linux)
  33. $(LSOF_CONFIGURE_WCHAR_FIXUPS)
  34. $(LSOF_CONFIGURE_LOCALE_FIXUPS)
  35. endef
  36. define LSOF_BUILD_CMDS
  37. $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) DEBUG="$(TARGET_CFLAGS)" -C $(@D)
  38. endef
  39. define LSOF_INSTALL_TARGET_CMDS
  40. $(INSTALL) -D -m 755 $(@D)/lsof $(TARGET_DIR)/usr/bin/lsof
  41. endef
  42. $(eval $(generic-package))