ap51-flash: Define IPPORT_TFTP where it is used
authorFlorian Fainelli <f.fainelli@gmail.com>
Wed, 12 Apr 2017 20:46:55 +0000 (13:46 -0700)
committerFlorian Fainelli <f.fainelli@gmail.com>
Thu, 13 Apr 2017 01:03:54 +0000 (18:03 -0700)
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>
utils/ap51-flash/Makefile
utils/ap51-flash/patches/100-ipport_tftp_def.patch [new file with mode: 0644]

index a30fa5d5268343fa0fbb2ae149e8e640a8a5fb57..af5134ee5552cd2e4d62c2a642d281abe3c9c353 100644 (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
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 (file)
index 0000000..ec728c8
--- /dev/null
@@ -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