Skip to content

Commit

Permalink
iproute2: honor COPTS; add missing include
Browse files Browse the repository at this point in the history
CFLAGS has been passed 2 times, one from TARGET_CFLAGS in EXTRA_CCOPTS,
the other from Makefile in PKG_BUILD_DIR.

Fix this issue by adjusting flags' order and remove duplicated flags
  • Loading branch information
wongsyrone committed May 4, 2016
1 parent 59a481f commit 32d5166
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package/network/utils/iproute2/Makefile
Expand Up @@ -20,6 +20,7 @@ PKG_LICENSE:=GPL-2.0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk

define Package/iproute2/Default
TITLE:=Routing control utility ($(2))
Expand Down Expand Up @@ -83,7 +84,7 @@ TARGET_CFLAGS += -DHAVE_SETNS
TARGET_CFLAGS += -ffunction-sections -fdata-sections

MAKE_FLAGS += \
EXTRA_CCOPTS="$(TARGET_CFLAGS) -I../include -I$(STAGING_DIR)/usr/include/libnl-tiny" \
EXTRA_CCOPTS="-I$(STAGING_DIR)/usr/include/libnl-tiny" \
KERNEL_INCLUDE="$(LINUX_DIR)/include" \
SHARED_LIBS="" \
LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections" \
Expand Down
11 changes: 11 additions & 0 deletions package/network/utils/iproute2/patches/999-honor-copts.patch
@@ -0,0 +1,11 @@
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,7 @@ CCOPTS = -O2 $(EXTRA_CCOPTS)
WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes
WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2

-CFLAGS := $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) $(CFLAGS)
+CFLAGS := $(WFLAGS) -I../include $(EXTRA_CCOPTS) $(DEFINES) $(CFLAGS)
YACCFLAGS = -d -t -v

SUBDIRS=lib ip tc bridge misc genl tipc man

0 comments on commit 32d5166

Please sign in to comment.