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