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
|
|
|
|
2015-10-02 16:39:13 +02:00
|
|
|
LSOF_VERSION = 4.89
|
2010-12-12 22:53:53 +01:00
|
|
|
LSOF_SOURCE = lsof_$(LSOF_VERSION).tar.bz2
|
2015-01-02 14:24:41 +01:00
|
|
|
# Use http mirror since master ftp site access is very draconian
|
|
|
|
LSOF_SITE = http://www.mirrorservice.org/sites/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)
|
|
|
|
|
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
|
|
|
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
|
2014-10-25 20:29:31 +02:00
|
|
|
$(call suitable-extractor,$(LSOF_SOURCE)) $(DL_DIR)/$(LSOF_SOURCE) | \
|
|
|
|
$(TAR) -O $(TAR_OPTIONS) - lsof_$(LSOF_VERSION)/lsof_$(LSOF_VERSION)_src.tar | \
|
2015-07-12 13:51:59 +02:00
|
|
|
$(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) ; \
|
2015-04-19 14:40:00 +02:00
|
|
|
echo n | $(TARGET_CONFIGURE_OPTS) DEBUG="$(TARGET_CFLAGS)" \
|
2014-05-14 14:45:08 +02:00
|
|
|
LSOF_INCLUDE="$(STAGING_DIR)/usr/include" LSOF_CFLAGS_OVERRIDE=1 \
|
|
|
|
LINUX_CLIB=-DGLIBCV=2 ./Configure linux)
|
2010-12-12 22:53:53 +01:00
|
|
|
$(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
|
2016-10-14 00:13:08 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) DEBUG="$(TARGET_CFLAGS)" -C $(@D)
|
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_INSTALL_TARGET_CMDS
|
2014-06-29 17:05:03 +02:00
|
|
|
$(INSTALL) -D -m 755 $(@D)/lsof $(TARGET_DIR)/usr/bin/lsof
|
2010-12-12 22:53:53 +01:00
|
|
|
endef
|
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(generic-package))
|