iproute2: fix build with toolchains providing setns(2)
authorPeter Korsgaard <jacmet@sunsite.dk>
Sat, 3 Nov 2012 08:21:25 +0000 (09:21 +0100)
committerPeter Korsgaard <jacmet@sunsite.dk>
Sat, 3 Nov 2012 08:21:25 +0000 (09:21 +0100)
Fixes http://autobuild.buildroot.net/results/b2f28621bc9d6048057c406048b3f7d665cef165

ipnetns.c contains a replacement setns implementation, which is used
if the toolchain doesn't provide any (HAVE_SETNS not set).

We don't have any knowledge of toolchain setns support on buildroot
level, but the (handwritten) configure script contains a test for it,
so run the configure script before building.

The configure script isn't written for cross compilation, so it needs
to be massaged slightly to use the cross compiler / flags.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/iproute2/iproute2.mk

index 62328abd759307b15b3022cdfa6b740e366afa0a..03767ccda81e386ffcee2e82a3a5d2ce5896cd22 100644 (file)
@@ -27,6 +27,8 @@ endef
 endif
 
 define IPROUTE2_CONFIGURE_CMDS
+       $(SED) 's/gcc/$$CC $$CFLAGS/g' $(@D)/configure
+       cd $(@D) && $(TARGET_CONFIGURE_OPTS) ./configure
        # arpd needs berkeleydb
        $(SED) "/^TARGETS=/s: arpd : :" $(IPROUTE2_DIR)/misc/Makefile
        echo "IPT_LIB_DIR:=/usr/lib/xtables" >>$(IPROUTE2_DIR)/Config