[Feature]add MT2731_MP2_MR2_SVN388 baseline version

Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/meta/meta-gplv2/recipes-devtools/m4/m4-1.4.9.inc b/meta/meta-gplv2/recipes-devtools/m4/m4-1.4.9.inc
new file mode 100644
index 0000000..8c75dab
--- /dev/null
+++ b/meta/meta-gplv2/recipes-devtools/m4/m4-1.4.9.inc
@@ -0,0 +1,18 @@
+require m4.inc
+
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe\
+	file://examples/COPYING;md5=1d49bd61dc590f014cae7173b43e3e5c"
+
+PR = "r2"
+SRC_URI += "file://fix_for_circular_dependency.patch"
+
+SRC_URI_append_class-target = "\
+    file://0001-freeze-fix-compilation-error-with-security-flags-ena.patch \
+    file://0002-build-don-t-need-charset.alias-when-building-for-mus.patch \
+"
+
+SRC_URI[md5sum] = "1ba8e147aff5e79bd2bfb983d86b53d5"
+SRC_URI[sha256sum] = "815ce53853fbf6493617f467389b799208b1ec98296b95be44a683f8bcfd7c47"
+
diff --git a/meta/meta-gplv2/recipes-devtools/m4/m4.inc b/meta/meta-gplv2/recipes-devtools/m4/m4.inc
new file mode 100644
index 0000000..4a83929
--- /dev/null
+++ b/meta/meta-gplv2/recipes-devtools/m4/m4.inc
@@ -0,0 +1,10 @@
+SUMMARY = "Traditional Unix macro processor"
+DESCRIPTION = "GNU m4 is an implementation of the traditional Unix macro processor.  It is mostly SVR4 \
+compatible although it has some extensions (for example, handling more than 9 positional parameters to macros). \
+GNU M4 also has built-in functions for including files, running shell commands, doing arithmetic, etc."
+
+inherit autotools texinfo
+
+EXTRA_OEMAKE += "'infodir=${infodir}'"
+LDFLAGS_prepend_libc-uclibc = " -lrt "
+SRC_URI = "${GNU_MIRROR}/m4/m4-${PV}.tar.gz"
diff --git a/meta/meta-gplv2/recipes-devtools/m4/m4/0001-freeze-fix-compilation-error-with-security-flags-ena.patch b/meta/meta-gplv2/recipes-devtools/m4/m4/0001-freeze-fix-compilation-error-with-security-flags-ena.patch
new file mode 100644
index 0000000..b5a6413
--- /dev/null
+++ b/meta/meta-gplv2/recipes-devtools/m4/m4/0001-freeze-fix-compilation-error-with-security-flags-ena.patch
@@ -0,0 +1,35 @@
+From 5f07971ef7f087500f19beb778ff1c8fb176d76d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
+Date: Thu, 23 Mar 2017 12:23:24 +0000
+Subject: [PATCH 1/2] freeze: fix compilation error with security flags enabled
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| ../../m4-1.4.9/src/freeze.c: In function 'produce_frozen_state':
+| ../../m4-1.4.9/src/freeze.c:61:7: error: format not a string literal and no format arguments [-Werror=format-security]
+|        M4ERROR ((warning_status, errno, name));
+|        ^~~~~~~
+
+Upstream-Status: Inappropriate [required for m4 1.4.9 (GPLv2) recipe only]
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+---
+ src/freeze.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/freeze.c b/src/freeze.c
+index 7b8a7bc..eebcc59 100644
+--- a/src/freeze.c
++++ b/src/freeze.c
+@@ -58,7 +58,7 @@ produce_frozen_state (const char *name)
+ 
+   if (file = fopen (name, O_BINARY ? "wb" : "w"), !file)
+     {
+-      M4ERROR ((warning_status, errno, name));
++      M4ERROR ((warning_status, errno, "fopen failed: %s", name));
+       return;
+     }
+ 
+-- 
+2.11.0
+
diff --git a/meta/meta-gplv2/recipes-devtools/m4/m4/0002-build-don-t-need-charset.alias-when-building-for-mus.patch b/meta/meta-gplv2/recipes-devtools/m4/m4/0002-build-don-t-need-charset.alias-when-building-for-mus.patch
new file mode 100644
index 0000000..4cd4889
--- /dev/null
+++ b/meta/meta-gplv2/recipes-devtools/m4/m4/0002-build-don-t-need-charset.alias-when-building-for-mus.patch
@@ -0,0 +1,44 @@
+From c7fa0a47956570682e289937bf6f2d0516f491c6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
+Date: Thu, 23 Mar 2017 12:24:02 +0000
+Subject: [PATCH 2/2] build: don't need charset.alias when building for musl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Inappropriate [required for m4 1.4.9 (GPLv2) recipe only]
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+---
+ lib/Makefile.am | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index 2575743..4dc17fe 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -290,7 +290,11 @@ all-local: charset.alias ref-add.sed ref-del.sed
+ charset_alias = $(DESTDIR)$(libdir)/charset.alias
+ charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
+ install-exec-local: all-local
+-	test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir)
++	case '$(host_os)' in \
++	    linux-musl*) \
++	      : ;;\
++	    *) \
++	test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir) ;\
+ 	if test -f $(charset_alias); then \
+ 	  sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
+ 	  $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
+@@ -301,7 +305,8 @@ install-exec-local: all-local
+ 	    $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
+ 	    rm -f $(charset_tmp) ; \
+ 	  fi ; \
+-	fi
++	fi ;\
++	esac
+ 
+ uninstall-local: all-local
+ 	if test -f $(charset_alias); then \
+-- 
+2.11.0
+
diff --git a/meta/meta-gplv2/recipes-devtools/m4/m4/fix_for_circular_dependency.patch b/meta/meta-gplv2/recipes-devtools/m4/m4/fix_for_circular_dependency.patch
new file mode 100644
index 0000000..9877453
--- /dev/null
+++ b/meta/meta-gplv2/recipes-devtools/m4/m4/fix_for_circular_dependency.patch
@@ -0,0 +1,77 @@
+Upstream-Status: Inappropriate [licensing]
+
+The older GPLv2 m4 does not work well with newer autoconf. It causes the 
+circular dependency as seen bellow.
+  Removing this m4 file which was needed only forl older autoconf
+
+| configure.ac:34: error: AC_REQUIRE: circular dependency of AC_GNU_SOURCE
+| /build_disk/poky_build/build1/tmp/work/i586-poky-linux/m4-1.4.9-r0/m4-1.4.9/m4/extensions.m4:19: AC_USE_SYSTEM_EXTENSIONS is expanded from...
+| ../../lib/autoconf/specific.m4:310: AC_GNU_SOURCE is expanded from...
+| /build_disk/poky_build/build1/tmp/work/i586-poky-linux/m4-1.4.9-r0/m4-1.4.9/m4/gnulib-comp.m4:21: M4_EARLY is expanded from...
+| configure.ac:34: the top level
+| autom4te: /build_disk/poky_build/build1/tmp/sysroots/x86_64-linux/usr/bin/m4 failed with exit status: 1
+| aclocal: /build_disk/poky_build/build1/tmp/sysroots/x86_64-linux/usr/bin/autom4te failed with exit status: 1
+| autoreconf: aclocal failed with exit status: 1
+
+Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/03/16
+
+Index: m4-1.4.9/m4/extensions.m4
+===================================================================
+--- m4-1.4.9.orig/m4/extensions.m4
++++ m4-1.4.9/m4/extensions.m4
+@@ -6,53 +6,10 @@
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+ 
+-# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+-# Autoconf.  Perhaps we can remove this once we can assume Autoconf
+-# 2.61 or later everywhere, but since CVS Autoconf mutates rapidly
+-# enough in this area it's likely we'll need to redefine
+-# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+-
+-# AC_USE_SYSTEM_EXTENSIONS
+-# ------------------------
+-# Enable extensions on systems that normally disable them,
+-# typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+-  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+-  AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+-  AC_REQUIRE([AC_GNU_SOURCE])
+-  AC_REQUIRE([AC_AIX])
+-  AC_REQUIRE([AC_MINIX])
+-
+-  AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris.  */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+-  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+-    [ac_cv_safe_to_define___extensions__],
+-    [AC_COMPILE_IFELSE(
+-       [AC_LANG_PROGRAM([
+-#	  define __EXTENSIONS__ 1
+-	  AC_INCLUDES_DEFAULT])],
+-       [ac_cv_safe_to_define___extensions__=yes],
+-       [ac_cv_safe_to_define___extensions__=no])])
+-  test $ac_cv_safe_to_define___extensions__ = yes &&
+-    AC_DEFINE([__EXTENSIONS__])
+-  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+-  AC_DEFINE([_TANDEM_SOURCE])
+-])
+ 
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+ AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
+-  [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
++  [])
diff --git a/meta/meta-gplv2/recipes-devtools/m4/m4_1.4.9.bb b/meta/meta-gplv2/recipes-devtools/m4/m4_1.4.9.bb
new file mode 100644
index 0000000..b12c0ad
--- /dev/null
+++ b/meta/meta-gplv2/recipes-devtools/m4/m4_1.4.9.bb
@@ -0,0 +1,3 @@
+require m4-${PV}.inc
+
+BBCLASSEXTEND = "nativesdk"