endef
ifeq ($(BOARD),brcm-2.4)
- BUILDFLAGS = -DBCMDRIVER -I$(LINUX_DIR)/arch/mips/bcm947xx/include -I$(STAGING_DIR)/usr/include
- BUILDFLAGS += -DDBG=0 -DBCM_PROC_FS=1 -DT3_JUMBO_RCV_RCB_ENTRY_COUNT=256 -DNICE_SUPPORT
- BUILDFLAGS += -DPCIX_TARGET_WORKAROUND=1 -DINCLUDE_TBI_SUPPORT=1 -DINCLUDE_5701_AX_FIX=1
+ BUILDFLAGS := \
+ -DBCMDRIVER -I$(LINUX_DIR)/arch/mips/bcm947xx/include $(TARGET_CPPFLAGS) \
+ -DDBG=0 -DBCM_PROC_FS=1 -DT3_JUMBO_RCV_RCB_ENTRY_COUNT=256 -DNICE_SUPPORT \
+ -DPCIX_TARGET_WORKAROUND=1 -DINCLUDE_TBI_SUPPORT=1 -DINCLUDE_5701_AX_FIX=1
endif
define Build/Compile
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS) -I. -I$(PKG_BUILD_DIR)/include -Dlinux=1" \
all
- $(TARGET_CC) -o $(PKG_BUILD_DIR)/nas $(PKG_BUILD_DIR)/nas_exe.o -L$(STAGING_DIR)/usr/lib -lnvram $(PKG_BUILD_DIR)/router/shared/libshared.a
+ $(TARGET_CC) -o $(PKG_BUILD_DIR)/nas $(PKG_BUILD_DIR)/nas_exe.o $(TARGET_LDFLAGS) -lnvram $(PKG_BUILD_DIR)/router/shared/libshared.a
$(TARGET_CC) -o $(PKG_BUILD_DIR)/wl $(PKG_BUILD_DIR)/wl_exe.o
endef
TARGET_CFLAGS += \
-I$(PKG_BUILD_DIR) \
-I$(PKG_BUILD_DIR)/tinysrp \
- -I$(STAGING_DIR)/usr/include
+ $(TARGET_CPPFLAGS)
MAKE_FLAGS += \
CONFIGURE_ARGS="$(CONFIGURE_ARGS)" \
endef
define Build/CompileTarget
- CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/madwifi -I$(STAGING_DIR)/usr/include/mac80211 -I$(STAGING_DIR)/usr/include/libnl -I$(STAGING_DIR)/usr/include" \
+ CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/madwifi -I$(STAGING_DIR)/usr/include/mac80211 -I$(STAGING_DIR)/usr/include/libnl $(TARGET_CPPFLAGS)" \
$(MAKE) -C $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd \
$(TARGET_CONFIGURE_OPTS) \
$(DRIVER_MAKEOPTS) \
- LIBS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib \
+ LIBS="$(TARGET_LDFLAGS) \
$(if $(CONFIG_PACKAGE_kmod-mac80211),-lm $(STAGING_DIR)/usr/lib/libnl.a) \
$(if $(findstring default,$(1)),-lssl -lcrypto)" \
hostapd hostapd_cli
endef
MAKE_FLAGS += \
- CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/mac80211 -I$(STAGING_DIR)/usr/include/libnl -I$(STAGING_DIR)/usr/include" \
- LDFLAGS="-L$(STAGING_DIR)/usr/lib -lnl"
+ CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/mac80211 -I$(STAGING_DIR)/usr/include/libnl $(TARGET_CPPFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS) -lnl"
ifneq ($(CONFIG_LINUX_2_6),)
define Package/iw/install
endef
TARGET_CFLAGS += $(FPIC) $(if $(CONFIG_GCC_VERSION_4_3),-Wno-array-bounds)
-EXTRA_CFLAGS+=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/lib
-EXTRA_LDFLAGS+=-L$(STAGING_DIR)/usr/lib -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
+EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
+EXTRA_LDFLAGS += $(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
CONFIGURE_ARGS += \
--disable-curl \
endef
TARGET_CPPFLAGS += \
- -I$(STAGING_DIR)/usr/include \
-I$(LINUX_DIR)/include \
-I$(PKG_BUILD_DIR)
COPTS="$(TARGET_CFLAGS)" \
DEBUG="$(DEBUG)" \
VERSION="$(UCI_VERSION)" \
- CPPFLAGS="-I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include" \
+ CPPFLAGS="-I$(PKG_BUILD_DIR) $(TARGET_CPPFLAGS)" \
OS="Linux"
# work around a nasty gcc bug