Skip to contentSkip to conversation

iproute2 depends on iptables and both packages need AR set to TARGET_AR

PATCH New heiko at zuerker.org 3 participants 4 messages Dec 9, 2010 – Dec 10, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iproute2 depends on iptables and both packages need AR set to TARGET_AR

From: root <[email protected]>

---
 package/iproute2/Config.in   |    5 ++++-
 package/iproute2/iproute2.mk |    3 ++-
 package/iptables/iptables.mk |    2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)
package/iproute2/Config.in +4 -1
index 2412d8e..6d86c7c 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_IPROUTE2
 	bool "iproute2"
-	depends on BR2_INET_IPV6
+	depends on BR2_INET_IPV6 && BR2_PACKAGE_IPTABLES
 	help
 	  Kernel routing and traffic control utilities.  Provides things
 	  like ip and tc.
@@ -9,3 +9,6 @@ config BR2_PACKAGE_IPROUTE2
 
 comment "iproute2 requires a toolchain with IPv6 support"
 	depends on !BR2_INET_IPV6
+
+comment "iproute2 requires iptables"
+	depends on !BR2_PACKAGE_IPTABLES
package/iproute2/iproute2.mk +2 -1
index 0f99894..b1e136f 100644
@@ -8,6 +8,7 @@ IPROUTE2_VERSION = 2.6.35
 IPROUTE2_SOURCE = iproute2-$(IPROUTE2_VERSION).tar.bz2
 IPROUTE2_SITE = http://devresources.linuxfoundation.org/dev/iproute2/download
 IPROUTE2_TARGET_SBINS = ctstat genl ifstat ip lnstat nstat routef routel rtacct rtmon rtpr rtstat ss tc
+IPROUTE2_DEPENDENCIES = iptables
 
 define IPROUTE2_CONFIGURE_CMDS
 	# Use kernel headers
@@ -20,7 +21,7 @@ define IPROUTE2_CONFIGURE_CMDS
 endef
 
 define IPROUTE2_BUILD_CMDS
-	$(MAKE) CC="$(TARGET_CC)" -C $(@D)
+	$(MAKE) CC="$(TARGET_CC)" AR="$(TARGET_AR)" -C $(@D)
 endef
 
 define IPROUTE2_INSTALL_TARGET_CMDS
package/iptables/iptables.mk +2 -0
index 1ec2c85..9c3c577 100644
@@ -7,6 +7,8 @@ IPTABLES_VERSION = 1.4.10
 IPTABLES_SOURCE = iptables-$(IPTABLES_VERSION).tar.bz2
 IPTABLES_SITE = http://ftp.netfilter.org/pub/iptables
 IPTABLES_DEPENDENCIES = host-pkg-config
+IPTABLES_INSTALL_STAGING = yes
+IPTABLES_MAKE_OPT = AR=$(TARGET_AR)
 
 IPTABLES_CONF_OPT = --libexecdir=/usr/lib --with-kernel=$(LINUX_HEADERS_DIR)
 ifneq ($(BR2_INET_IPV6),y)
Signature · 1 line
1.7.3.2
#1 lore raw

PATCH 1/1 iproute2 depends on iptables and both packages need AR set to TARGET_AR

2010/12/10 <[email protected]>

Quoted 67 lines

From: root <[email protected]>

---
 package/iproute2/Config.in   |    5 ++++-
 package/iproute2/iproute2.mk |    3 ++-
 package/iptables/iptables.mk |    2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)
package/iproute2/Config.in +4 -1
index 2412d8e..6d86c7c 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_IPROUTE2
       bool "iproute2"
-       depends on BR2_INET_IPV6
+       depends on BR2_INET_IPV6 && BR2_PACKAGE_IPTABLES
       help
         Kernel routing and traffic control utilities.  Provides things
         like ip and tc.
@@ -9,3 +9,6 @@ config BR2_PACKAGE_IPROUTE2
 
 comment "iproute2 requires a toolchain with IPv6 support"
       depends on !BR2_INET_IPV6
+
+comment "iproute2 requires iptables"
+       depends on !BR2_PACKAGE_IPTABLES
package/iproute2/iproute2.mk +0 -0
index 0f99894..b1e136f 100644
@@ -8,6 +8,7 @@ IPROUTE2_VERSION = 2.6.35
 IPROUTE2_SOURCE = iproute2-$(IPROUTE2_VERSION).tar.bz2
 IPROUTE2_SITE =

http://devresources.linuxfoundation.org/dev/iproute2/download
IPROUTE2_TARGET_SBINS = ctstat genl ifstat ip lnstat nstat routef routel
rtacct rtmon rtpr rtstat ss tc

package/iproute2/iproute2.mk +2 -1
+IPROUTE2_DEPENDENCIES = iptables
 
 define IPROUTE2_CONFIGURE_CMDS
       # Use kernel headers
@@ -20,7 +21,7 @@ define IPROUTE2_CONFIGURE_CMDS
 endef
 
 define IPROUTE2_BUILD_CMDS
-       $(MAKE) CC="$(TARGET_CC)" -C $(@D)
+       $(MAKE) CC="$(TARGET_CC)" AR="$(TARGET_AR)" -C $(@D)
 endef
 
 define IPROUTE2_INSTALL_TARGET_CMDS
package/iptables/iptables.mk +2 -2
index 1ec2c85..9c3c577 100644
@@ -7,6 +7,8 @@ IPTABLES_VERSION = 1.4.10
 IPTABLES_SOURCE = iptables-$(IPTABLES_VERSION).tar.bz2
 IPTABLES_SITE = http://ftp.netfilter.org/pub/iptables
 IPTABLES_DEPENDENCIES = host-pkg-config
+IPTABLES_INSTALL_STAGING = yes
+IPTABLES_MAKE_OPT = AR=$(TARGET_AR)
 
 IPTABLES_CONF_OPT = --libexecdir=/usr/lib
--with-kernel=$(LINUX_HEADERS_DIR)
 ifneq ($(BR2_INET_IPV6),y)
--
Quoted 3 lines

1.7.3.2

Do you have a real problems with AR in iptables? I don't find $(AR) in the unpacked iptables source. And don't see any ar while iptables building process.

I think it's not good to set hard dependence on iptables to the iproute2
package. Because iproute2 can be built without iptables. So the iptables is optional for iproute2.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20101210/1c06b67a/attachment.html>

#2 lore raw

PATCH 1/1 iproute2 depends on iptables and both packages need AR set to TARGET_AR

Quoted 67 lines · Pkun

2010/12/10 <[email protected]>

Quoted 64 lines

From: root <[email protected]>

---

?package/iproute2/Config.in ? | ? ?5 ++++-
?package/iproute2/iproute2.mk | ? ?3 ++-
?package/iptables/iptables.mk | ? ?2 ++

?3 files changed, 8 insertions(+), 2 deletions(-)

package/iproute2/Config.in +0 -0
index 2412d8e..6d86c7c 100644
@@ -1,6 +1,6 @@

?config BR2_PACKAGE_IPROUTE2
? ? ? ?bool "iproute2"
- ? ? ? depends on BR2_INET_IPV6
+ ? ? ? depends on BR2_INET_IPV6 && BR2_PACKAGE_IPTABLES
? ? ? ?help
? ? ? ? ?Kernel routing and traffic control utilities. ?Provides things ? ? ? ? ?like ip and tc.

package/iproute2/Config.in +0 -0
@@ -9,3 +9,6 @@ config BR2_PACKAGE_IPROUTE2
 

?comment "iproute2 requires a toolchain with IPv6 support" ? ? ? ?depends on !BR2_INET_IPV6

package/iproute2/Config.in +3 -0
+
+comment "iproute2 requires iptables"
+ ? ? ? depends on !BR2_PACKAGE_IPTABLES
package/iproute2/iproute2.mk +0 -0
index 0f99894..b1e136f 100644
@@ -8,6 +8,7 @@ IPROUTE2_VERSION = 2.6.35

?IPROUTE2_SOURCE = iproute2-$(IPROUTE2_VERSION).tar.bz2 ?IPROUTE2_SITE =
http://devresources.linuxfoundation.org/dev/iproute2/download
?IPROUTE2_TARGET_SBINS = ctstat genl ifstat ip lnstat nstat routef routel rtacct rtmon rtpr rtstat ss tc
+IPROUTE2_DEPENDENCIES = iptables

?define IPROUTE2_CONFIGURE_CMDS
? ? ? ?# Use kernel headers

package/iproute2/iproute2.mk +0 -0
@@ -20,7 +21,7 @@ define IPROUTE2_CONFIGURE_CMDS

?endef

?define IPROUTE2_BUILD_CMDS
- ? ? ? $(MAKE) CC="$(TARGET_CC)" -C $(@D)
+ ? ? ? $(MAKE) CC="$(TARGET_CC)" AR="$(TARGET_AR)" -C $(@D) ?endef

?define IPROUTE2_INSTALL_TARGET_CMDS

package/iptables/iptables.mk +0 -0
index 1ec2c85..9c3c577 100644
@@ -7,6 +7,8 @@ IPTABLES_VERSION = 1.4.10

?IPTABLES_SOURCE = iptables-$(IPTABLES_VERSION).tar.bz2 ?IPTABLES_SITE = http://ftp.netfilter.org/pub/iptables
?IPTABLES_DEPENDENCIES = host-pkg-config

package/iptables/iptables.mk +2 -0
+IPTABLES_INSTALL_STAGING = yes
+IPTABLES_MAKE_OPT = AR=$(TARGET_AR)
Quoted 11 lines
Quoted 6 lines

?IPTABLES_CONF_OPT = --libexecdir=/usr/lib
--with-kernel=$(LINUX_HEADERS_DIR)
?ifneq ($(BR2_INET_IPV6),y)
--
1.7.3.2

Do you have a real problems with AR in iptables? I don't find $(AR) in the unpacked iptables source. And don't see any ar while iptables building process.

Indeed for autotools packages, AR is set to TARGET_AR at configure step. So there is no need to set it again at build step.

Quoted 5 lines

I think it's not good to set hard dependence on iptables to the iproute2 package. Because iproute2 can be built without iptables. So the iptables is optional for iproute2.

It's not good indeed, because if you run the configure script, it's going to detect it.
All you have to do is to patch the configure script, so it doesn't use 'gcc' but '$(CC)' which is set by buildroot.
Otherwise you could probably fill the Config file produced by the configure script yourself, so you know exactly what you enable or not.

Regards,

--
Lionel Landwerlin

#3 lore raw

PATCH 1/1 iproute2 depends on iptables and both packages need AR set to TARGET_AR

[................]

Quoted 5 lines
Quoted 3 lines

Do you have a real problems with AR in iptables? I don't find $(AR) in the unpacked iptables source. And don't see any ar while iptables building process.

Indeed for autotools packages, AR is set to TARGET_AR at configure step.

So

Quoted 1 line

there is no need to set it again at build step.

It definitely did not build without it. I tried multiple times. For some reason it kept using the host's ar, which didn't work so well.

Quoted 6 lines
Quoted 4 lines

I think it's not good to set hard dependence on iptables to the iproute2 package. Because iproute2 can be built without iptables. So the iptables is optional for iproute2.

It's not good indeed, because if you run the configure script, it's going

to

Quoted 2 lines

detect it.
All you have to do is to patch the configure script, so it doesn't use

'gcc' but

Quoted 2 lines

'$(CC)' which is set by buildroot.
Otherwise you could probably fill the Config file produced by the

configure

Quoted 1 line

script yourself, so you know exactly what you enable or not.

Right now iproute2 chokes if it doesn't find the xtables stuff from iptables.
I took a quick look at the makefile and we'd need to make sure TC_CONFIG_XT is not defined.
I'll take a look at this today and send in a revised patch.

Signature · 3 lines
Regards
   Heiko Zuerker
   http://www.devil-linux.org