xref: /OK3568_Linux_fs/buildroot/package/net-tools/net-tools.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# net-tools
4#
5################################################################################
6
7NET_TOOLS_VERSION = 2.10
8NET_TOOLS_SOURCE = net-tools-$(NET_TOOLS_VERSION).tar.xz
9NET_TOOLS_SITE = http://downloads.sourceforge.net/project/net-tools
10NET_TOOLS_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES)
11NET_TOOLS_LICENSE = GPL-2.0+
12NET_TOOLS_LICENSE_FILES = COPYING
13NET_TOOLS_CPE_ID_VENDOR = net-tools_project
14
15define NET_TOOLS_CONFIGURE_CMDS
16	(cd $(@D); yes "" | ./configure.sh config.in )
17endef
18
19# Enable I18N when appropiate
20ifeq ($(BR2_SYSTEM_ENABLE_NLS),y)
21define NET_TOOLS_ENABLE_I18N
22	$(SED) 's:I18N 0:I18N 1:' $(@D)/config.h
23endef
24endif
25
26# Enable IPv6
27define NET_TOOLS_ENABLE_IPV6
28	$(SED) 's:_AFINET6 0:_AFINET6 1:' $(@D)/config.h
29endef
30
31NET_TOOLS_POST_CONFIGURE_HOOKS += NET_TOOLS_ENABLE_I18N NET_TOOLS_ENABLE_IPV6
32
33define NET_TOOLS_BUILD_CMDS
34	$(TARGET_CONFIGURE_OPTS) \
35		LDFLAGS="$(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)" \
36		$(MAKE) -C $(@D)
37endef
38
39# ifconfig & route reside in /sbin for busybox, so ensure we don't end
40# up with two versions of those.
41define NET_TOOLS_INSTALL_TARGET_CMDS
42	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
43	mv -f $(TARGET_DIR)/bin/ifconfig $(TARGET_DIR)/sbin/ifconfig
44	mv -f $(TARGET_DIR)/bin/route $(TARGET_DIR)/sbin/route
45endef
46
47$(eval $(generic-package))
48