2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2006-06-23 08:53:28 +02:00
|
|
|
#
|
|
|
|
# lsof
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2011-10-07 17:25:21 +02:00
|
|
|
|
|
|
|
LSOF_VERSION = 4.85
|
2010-12-12 22:53:53 +01:00
|
|
|
LSOF_SOURCE = lsof_$(LSOF_VERSION).tar.bz2
|
|
|
|
LSOF_SITE = ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/
|
2012-11-13 02:05:50 +01:00
|
|
|
LSOF_LICENSE = lsof license
|
|
|
|
# License is repeated in each file, this is a relatively small one.
|
|
|
|
# It is also defined in 00README, but that contains a lot of other cruft.
|
|
|
|
LSOF_LICENSE_FILES = dialects/linux/dproto.h
|
2006-06-23 08:53:28 +02:00
|
|
|
|
2012-04-26 02:15:24 +02:00
|
|
|
# Make certain full-blown lsof gets built after the busybox version (1.20+)
|
|
|
|
LSOF_DEPENDENCIES += $(if $(BR2_PACKAGE_BUSYBOX),busybox)
|
|
|
|
|
2010-12-12 22:53:53 +01:00
|
|
|
BR2_LSOF_CFLAGS =
|
2006-11-29 13:59:56 +01:00
|
|
|
ifeq ($(BR2_LARGEFILE),)
|
2010-12-12 22:53:53 +01:00
|
|
|
BR2_LSOF_CFLAGS += -U_FILE_OFFSET_BITS
|
2006-11-29 13:59:56 +01:00
|
|
|
endif
|
2007-06-26 19:45:08 +02:00
|
|
|
ifeq ($(BR2_INET_IPV6),)
|
2010-12-12 22:53:53 +01:00
|
|
|
BR2_LSOF_CFLAGS += -UHASIPv6
|
2006-11-29 13:59:56 +01:00
|
|
|
endif
|
|
|
|
|
2009-01-18 15:22:30 +01:00
|
|
|
ifeq ($(BR2_USE_WCHAR),)
|
2010-12-12 22:53:53 +01:00
|
|
|
define LSOF_CONFIGURE_WCHAR_FIXUPS
|
|
|
|
$(SED) 's,^#define[[:space:]]*HASWIDECHAR.*,#undef HASWIDECHAR,' \
|
2010-12-27 15:49:00 +01:00
|
|
|
$(@D)/machine.h
|
2010-12-12 22:53:53 +01:00
|
|
|
$(SED) 's,^#define[[:space:]]*WIDECHARINCL.*,,' \
|
2010-12-27 15:49:00 +01:00
|
|
|
$(@D)/machine.h
|
2010-12-12 22:53:53 +01:00
|
|
|
endef
|
2006-12-14 00:08:48 +01:00
|
|
|
endif
|
2010-12-12 22:53:53 +01:00
|
|
|
|
2009-01-18 15:22:30 +01:00
|
|
|
ifeq ($(BR2_ENABLE_LOCALE),)
|
2010-12-12 22:53:53 +01:00
|
|
|
define LSOF_CONFIGURE_LOCALE_FIXUPS
|
|
|
|
$(SED) 's,^#define[[:space:]]*HASSETLOCALE.*,#undef HASSETLOCALE,' \
|
2010-12-27 15:49:00 +01:00
|
|
|
$(@D)/machine.h
|
2010-12-12 22:53:53 +01:00
|
|
|
endef
|
2006-12-14 00:08:48 +01:00
|
|
|
endif
|
2006-06-23 08:53:28 +02:00
|
|
|
|
2010-12-12 22:53:53 +01:00
|
|
|
# The .tar.bz2 contains another .tar, which contains the source code.
|
2011-10-21 00:05:23 +02:00
|
|
|
define LSOF_EXTRACT_CMDS
|
|
|
|
$(INFLATE.bz2) $(DL_DIR)/$(LSOF_SOURCE) | \
|
|
|
|
$(TAR) -O $(TAR_OPTIONS) - lsof_$(LSOF_VERSION)/lsof_$(LSOF_VERSION)_src.tar | \
|
|
|
|
$(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(LSOF_DIR) $(TAR_OPTIONS) -
|
2010-12-12 22:53:53 +01:00
|
|
|
endef
|
2006-06-23 08:53:28 +02:00
|
|
|
|
2010-12-12 22:53:53 +01:00
|
|
|
define LSOF_CONFIGURE_CMDS
|
|
|
|
(cd $(@D) ; \
|
|
|
|
echo n | $(TARGET_CONFIGURE_OPTS) DEBUG="$(TARGET_CFLAGS) $(BR2_LSOF_CFLAGS)" \
|
|
|
|
LSOF_INCLUDE="$(STAGING_DIR)/usr/include" LSOF_CFLAGS_OVERRIDE=1 ./Configure linux)
|
|
|
|
$(LSOF_CONFIGURE_WCHAR_FIXUPS)
|
|
|
|
$(LSOF_CONFIGURE_LOCALE_FIXUPS)
|
|
|
|
endef
|
2006-06-23 08:53:28 +02:00
|
|
|
|
2010-12-12 22:53:53 +01:00
|
|
|
define LSOF_BUILD_CMDS
|
|
|
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) DEBUG="$(TARGET_CFLAGS) $(BR2_LSOF_CFLAGS)" -C $(@D)
|
|
|
|
endef
|
2006-06-23 08:53:28 +02:00
|
|
|
|
2010-12-12 22:53:53 +01:00
|
|
|
define LSOF_INSTALL_TARGET_CMDS
|
|
|
|
install -D -m 755 $(@D)/lsof $(TARGET_DIR)/bin/lsof
|
|
|
|
endef
|
|
|
|
|
|
|
|
define LSOF_UNINSTALL_TARGET_CMDS
|
|
|
|
rm -f $(TARGET_DIR)/bin/lsof
|
|
|
|
endef
|
|
|
|
|
|
|
|
define LSOF_CLEAN_CMDS
|
2010-12-27 15:49:00 +01:00
|
|
|
-$(MAKE) -C $(@D) clean
|
2010-12-12 22:53:53 +01:00
|
|
|
endef
|
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(generic-package))
|