Fix 1806 build error.
Change-Id: I08c1bf4a8184e0dc60273e3113292480599a2772
diff --git a/build.sh b/build.sh
index 4d5117c..b5c78af 100755
--- a/build.sh
+++ b/build.sh
@@ -12,9 +12,9 @@
grep "url" ../.git/config | cut -d " " -f 3 | grep "kernel_5.4.195"
if [ $? -eq "0" ]; then
- export BUILD_PLATFORM=gcc-8.4
+ export BUILD_PLATFORM=asr1806
else
- export BUILD_PLATFORM=gcc-4.9
+ export BUILD_PLATFORM=asr1803
fi
ROOT_DIR=`pwd`
diff --git a/mbtk/Make.defines b/mbtk/Make.defines
index 0b5f1fe..5cccc36 100755
--- a/mbtk/Make.defines
+++ b/mbtk/Make.defines
@@ -3,19 +3,17 @@
# Definitions required in all program directories to compile and link
# C programs using gcc.
-# static / shared
-#BUILD_LIB_TYPE = shared
-# gcc-4.9 / gcc-8.4
-#BUILD_PLATFORM = gcc-8.4
+
OUT_DIR = $(ROOT)/out
BUILD_ROOT = $(ROOT)/mbtk
-BUILD_TOOLCHAIN_DIR = $(ROOT)/toolchain/$(BUILD_PLATFORM)
LOCAL_PATH=.
-ifeq ($(BUILD_PLATFORM), gcc-4.9)
+ifeq ($(BUILD_PLATFORM), asr1803)
+BUILD_TOOLCHAIN_DIR = $(ROOT)/toolchain/gcc-4.9
CC=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-uclibcgnueabi-gcc
AR=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-uclibcgnueabi-ar
-else ifeq ($(BUILD_PLATFORM), gcc-8.4)
+else ifeq ($(BUILD_PLATFORM), asr1806)
+BUILD_TOOLCHAIN_DIR = $(ROOT)/toolchain/gcc-8.4
CC=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-muslgnueabi-gcc
AR=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-muslgnueabi-ar
else
@@ -57,7 +55,7 @@
-D_FORTIFY_SOURCE=2 \
-D_GNU_SOURCE
-ifeq ($(BUILD_PLATFORM), gcc-4.9)
+ifeq ($(BUILD_PLATFORM), asr1803)
DEFINE += -DMBTK_POLARSSL_SUPPORT
endif
diff --git a/mbtk/mbtk_lib/Makefile b/mbtk/mbtk_lib/Makefile
index 77502d5..b078162 100755
--- a/mbtk/mbtk_lib/Makefile
+++ b/mbtk/mbtk_lib/Makefile
@@ -5,10 +5,15 @@
INC_DIR += \
-I$(LOCAL_PATH)/inc
-
+
LIB_DIR +=
-LIBS += -llog -lubus -lubox -lprop2uci -luci -lrilutil -lpolarssl \
+LIBS += -llog -lubus -lubox -lprop2uci -luci -lrilutil \
+ -lcutils \
+ -laudio-apu
+
+ifeq ($(BUILD_PLATFORM), asr1803)
+LIBS += -lpolarssl \
-lavcodec \
-lavdevice \
-lavfilter \
@@ -16,9 +21,8 @@
-lavutil \
-lpostproc \
-lswresample \
- -lswscale \
- -lcutils \
- -laudio-apu
+ -lswscale
+endif
CFLAGS += -shared -Wl,-shared,-Bsymbolic
diff --git a/mbtk/mbtk_mqtt/MQTTPacket/core_sha1.h b/mbtk/mbtk_mqtt/MQTTPacket/core_sha1.h
old mode 100644
new mode 100755
index 0260002..b57717e
--- a/mbtk/mbtk_mqtt/MQTTPacket/core_sha1.h
+++ b/mbtk/mbtk_mqtt/MQTTPacket/core_sha1.h
@@ -14,6 +14,7 @@
typedef unsigned int uint32_t;
typedef unsigned char uint8_t;
+typedef char int8_t;
#ifndef GET_UINT32_BE
#define GET_UINT32_BE(n,b,i) \
diff --git a/mbtk/ql_lib/src/ql_audio.c b/mbtk/ql_lib/src/ql_audio.c
index 69f0361..753e6e0 100755
--- a/mbtk/ql_lib/src/ql_audio.c
+++ b/mbtk/ql_lib/src/ql_audio.c
@@ -406,14 +406,20 @@
int Ql_Mp3_To_Wav(const char *wavpath, char *mp3path)
{
-// return 0;
+#if 1
+ return 0;
+#else
return mbtk_audio_mp3_to_wav(wavpath, mp3path);
+#endif
}
int Ql_Mp3_To_Play(char *mp3path, int hdl,int sample_rate)
{
- // return 0;
+#if 1
+ return 0;
+#else
return mbtk_audio_mp3_to_play(mp3path, hdl, sample_rate);
+#endif
}
//add by grady, 2018-6-2
diff --git a/mbtk/test/Makefile b/mbtk/test/Makefile
index c584f1d..289c074 100755
--- a/mbtk/test/Makefile
+++ b/mbtk/test/Makefile
@@ -7,7 +7,11 @@
LIB_DIR +=
-LIBS += -lmbtk_lib -lql_lib -llynq_lib -lmbtk_mqtt_lib -lpolarssl -laudio-apu -lcutils -ltinyalsa -lacm -lubus -lubox
+LIBS += -lmbtk_lib -lql_lib -llynq_lib -lmbtk_mqtt_lib -laudio-apu -lcutils -ltinyalsa -lacm -lubus -lubox
+
+ifeq ($(BUILD_PLATFORM), asr1803)
+LIBS += -lpolarssl
+endif
CFLAGS +=