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
<command-line>:0:13: error: expected identifier before numeric constant

Instead, move this where this gets used, in proto.c

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
This commit is contained in:
Florian Fainelli 2017-04-12 13:46:55 -07:00
parent 37f6cae850
commit 31f77baa3a
2 changed files with 16 additions and 1 deletions

View File

@ -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

View File

@ -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