2013-06-06 07:53:30 +08:00
|
|
|
################################################################################
|
2006-06-23 14:53:28 +08:00
|
|
|
#
|
|
|
|
# lsof
|
|
|
|
#
|
2013-06-06 07:53:30 +08:00
|
|
|
################################################################################
|
2011-10-07 23:25:21 +08:00
|
|
|
|
|
|
|
LSOF_VERSION = 4.85
|
2010-12-13 05:53:53 +08:00
|
|
|
LSOF_SOURCE = lsof_$(LSOF_VERSION).tar.bz2
|
|
|
|
LSOF_SITE = ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/
|
2012-11-13 09:05:50 +08: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 14:53:28 +08:00
|
|
|
|
2012-04-26 08:15:24 +08:00
|
|
|
# Make certain full-blown lsof gets built after the busybox version (1.20+)
|
|
|
|
LSOF_DEPENDENCIES += $(if $(BR2_PACKAGE_BUSYBOX),busybox)
|
|
|
|
|
2010-12-13 05:53:53 +08:00
|
|
|
BR2_LSOF_CFLAGS =
|
2006-11-29 20:59:56 +08:00
|
|
|
ifeq ($(BR2_LARGEFILE),)
|
2010-12-13 05:53:53 +08:00
|
|
|
BR2_LSOF_CFLAGS += -U_FILE_OFFSET_BITS
|
2006-11-29 20:59:56 +08:00
|
|
|
endif
|
2007-06-27 01:45:08 +08:00
|
|
|
ifeq ($(BR2_INET_IPV6),)
|
2010-12-13 05:53:53 +08:00
|
|
|
BR2_LSOF_CFLAGS += -UHASIPv6
|
2006-11-29 20:59:56 +08:00
|
|
|
endif
|
|
|
|
|
2009-01-18 22:22:30 +08:00
|
|
|
ifeq ($(BR2_USE_WCHAR),)
|
2010-12-13 05:53:53 +08:00
|
|
|
define LSOF_CONFIGURE_WCHAR_FIXUPS
|
|
|
|
$(SED) 's,^#define[[:space:]]*HASWIDECHAR.*,#undef HASWIDECHAR,' \
|
2010-12-27 22:49:00 +08:00
|
|
|
$(@D)/machine.h
|
2010-12-13 05:53:53 +08:00
|
|
|
$(SED) 's,^#define[[:space:]]*WIDECHARINCL.*,,' \
|
2010-12-27 22:49:00 +08:00
|
|
|
$(@D)/machine.h
|
2010-12-13 05:53:53 +08:00
|
|
|
endef
|
2006-12-14 07:08:48 +08:00
|
|
|
endif
|
2010-12-13 05:53:53 +08:00
|
|
|
|
2009-01-18 22:22:30 +08:00
|
|
|
ifeq ($(BR2_ENABLE_LOCALE),)
|
2010-12-13 05:53:53 +08:00
|
|
|
define LSOF_CONFIGURE_LOCALE_FIXUPS
|
|
|
|
$(SED) 's,^#define[[:space:]]*HASSETLOCALE.*,#undef HASSETLOCALE,' \
|
2010-12-27 22:49:00 +08:00
|
|
|
$(@D)/machine.h
|
2010-12-13 05:53:53 +08:00
|
|
|
endef
|
2006-12-14 07:08:48 +08:00
|
|
|
endif
|
2006-06-23 14:53:28 +08:00
|
|
|
|
2010-12-13 05:53:53 +08:00
|
|
|
# The .tar.bz2 contains another .tar, which contains the source code.
|
2011-10-21 06:05:23 +08:00
|
|
|
define LSOF_EXTRACT_CMDS
|
2013-08-02 17:05:14 +08:00
|
|
|
$(call suitable-extractor,$(LSOF_SOURCE)) $(DL_DIR)/$(LSOF_SOURCE) | \
|
2011-10-21 06:05:23 +08:00
|
|
|
$(TAR) -O $(TAR_OPTIONS) - lsof_$(LSOF_VERSION)/lsof_$(LSOF_VERSION)_src.tar | \
|
|
|
|
$(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(LSOF_DIR) $(TAR_OPTIONS) -
|
2010-12-13 05:53:53 +08:00
|
|
|
endef
|
2006-06-23 14:53:28 +08:00
|
|
|
|
2010-12-13 05:53:53 +08: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 14:53:28 +08:00
|
|
|
|
2010-12-13 05:53:53 +08:00
|
|
|
define LSOF_BUILD_CMDS
|
|
|
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) DEBUG="$(TARGET_CFLAGS) $(BR2_LSOF_CFLAGS)" -C $(@D)
|
|
|
|
endef
|
2006-06-23 14:53:28 +08:00
|
|
|
|
2010-12-13 05:53:53 +08:00
|
|
|
define LSOF_INSTALL_TARGET_CMDS
|
|
|
|
install -D -m 755 $(@D)/lsof $(TARGET_DIR)/bin/lsof
|
|
|
|
endef
|
|
|
|
|
2012-07-03 06:07:32 +08:00
|
|
|
$(eval $(generic-package))
|