From 31f77baa3aa90b4e9d406a2ba90e8b9afd8f403b Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Wed, 12 Apr 2017 13:46:55 -0700 Subject: [PATCH] ap51-flash: Define IPPORT_TFTP where it is used Defining IPPORT_TFTP on the pre-processor command line leads to the following error for glibc-based toolchains: mipsel-linux-gnu-gcc -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -mips16 -minterlink-mips16 -I/local/users/fainelli/openwrt/trunk/staging_dir/target-mipsel-linux-gnu_glibc/usr/include -I/local/users/fainelli/openwrt/trunk/staging_dir/target-mipsel-linux-gnu_glibc/include -I/opt/toolchains/stbgcc-4.8-1.5/usr/include -I/opt/toolchains/stbgcc-4.8-1.5/include -Wall -Werror -W -g3 -std=gnu99 -Os -fno-strict-aliasing -DLINUX -DREVISION_VERSION=\"2016-10-16\" -DFLASH_FROM_FILE -DNO_LIBPCAP -D_GNU_SOURCE -UIPPORT_TFTP -DIPPORT_TFTP=69 -MD -c flash.c -o flash.o :0:13: error: expected identifier before numeric constant Instead, move this where this gets used, in proto.c Signed-off-by: Florian Fainelli --- utils/ap51-flash/Makefile | 2 +- .../ap51-flash/patches/100-ipport_tftp_def.patch | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 utils/ap51-flash/patches/100-ipport_tftp_def.patch diff --git a/utils/ap51-flash/Makefile b/utils/ap51-flash/Makefile index a30fa5d52..af5134ee5 100644 --- a/utils/ap51-flash/Makefile +++ b/utils/ap51-flash/Makefile @@ -30,7 +30,7 @@ define Package/ap51-flash URL:=http://dev.cloudtrax.com/wiki/ap51-flash-station endef -TARGET_EXTRA_CFLAGS:=-DFLASH_FROM_FILE -DNO_LIBPCAP -D_GNU_SOURCE -DIPPORT_TFTP=69 +TARGET_EXTRA_CFLAGS:=-DFLASH_FROM_FILE -DNO_LIBPCAP -D_GNU_SOURCE ifeq ($(CONFIG_BIG_ENDIAN),y) TARGET_EXTRA_CFLAGS:=$(TARGET_EXTRA_CFLAGS) -DUIP_CONF_BYTE_ORDER=1234 endif diff --git a/utils/ap51-flash/patches/100-ipport_tftp_def.patch b/utils/ap51-flash/patches/100-ipport_tftp_def.patch new file mode 100644 index 000000000..ec728c84f --- /dev/null +++ b/utils/ap51-flash/patches/100-ipport_tftp_def.patch @@ -0,0 +1,15 @@ +Index: ap51-flash-2016-10-16/proto.c +=================================================================== +--- ap51-flash-2016-10-16.orig/proto.c ++++ ap51-flash-2016-10-16/proto.c +@@ -29,6 +29,10 @@ + #include "router_redboot.h" + #include "router_tftp_client.h" + ++#ifndef IPPORT_TFTP ++#define IPPORT_TFTP 69 ++#endif ++ + #define TFTP_SRC_PORT 13337 + #define REDBOOT_TELNET_SPORT 13337 + #define REDBOOT_TELNET_DPORT 9000