ASR_BASE

Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/package/libs/argp-standalone/Makefile b/package/libs/argp-standalone/Makefile
new file mode 100644
index 0000000..23e5169
--- /dev/null
+++ b/package/libs/argp-standalone/Makefile
@@ -0,0 +1,63 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=argp-standalone
+PKG_VERSION:=1.3
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.lysator.liu.se/~nisse/misc/
+PKG_HASH:=dec79694da1319acd2238ce95df57f3680fea2482096e483323fddf3d818d8be
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE:=Makefile.am
+
+PKG_BUILD_FLAGS:=no-lto
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+define Package/argp-standalone
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Hierarchial argument parsing broken out from glibc
+  URL:=http://www.lysator.liu.se/~nisse/misc/
+endef
+
+define Package/argp-standalone/description
+  GNU libc hierarchial argument parsing library broken out from glibc.
+endef
+
+MAKE_FLAGS += \
+	CFLAGS="$(TARGET_CFLAGS) $(FPIC) -std=gnu89"
+
+HOST_MAKE_FLAGS += \
+	CFLAGS="$(HOST_CFLAGS) $(FPIC) -std=gnu89"
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(1)/usr/include
+	$(CP)   $(PKG_BUILD_DIR)/argp.h \
+		$(1)/usr/include/
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP)   $(PKG_BUILD_DIR)/libargp.a \
+		$(1)/usr/lib/
+endef
+
+define Host/Install
+	$(INSTALL_DIR) $(1)/include
+	$(CP)   $(HOST_BUILD_DIR)/argp.h \
+		$(1)/include/
+	$(INSTALL_DIR) $(1)/lib
+	$(CP)   $(HOST_BUILD_DIR)/libargp.a \
+		$(1)/lib/
+endef
+
+$(eval $(call BuildPackage,argp-standalone))
+$(eval $(call HostBuild))
diff --git a/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch
new file mode 100644
index 0000000..2dcfe9c
--- /dev/null
+++ b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch
@@ -0,0 +1,79 @@
+# --- T2-COPYRIGHT-NOTE-BEGIN ---
+# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
+# 
+# T2 SDE: package/.../rng-tools/throw-in-funcdef.patch.argp-standalone
+# Copyright (C) 2006 The T2 SDE Project
+# 
+# More information can be found in the files COPYING and README.
+# 
+# This patch file is dual-licensed. It is available under the license the
+# patched project is licensed under, as long as it is an OpenSource license
+# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
+# of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+# --- T2-COPYRIGHT-NOTE-END ---
+
+
+No __THROW in function implementation.
+	--jsaw
+
+--- a/argp.h
++++ b/argp.h
+@@ -560,17 +560,17 @@ __argp_short_program_name(const struct a
+ # endif
+ 
+ # ifndef ARGP_EI
+-#  define ARGP_EI extern __inline__
++#  define ARGP_EI extern inline
+ # endif
+ 
+ ARGP_EI void
+-__argp_usage (__const struct argp_state *__state) __THROW
++__argp_usage (__const struct argp_state *__state)
+ {
+   __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+ }
+ 
+ ARGP_EI int
+-__option_is_short (__const struct argp_option *__opt) __THROW
++__option_is_short (__const struct argp_option *__opt)
+ {
+   if (__opt->flags & OPTION_DOC)
+     return 0;
+@@ -582,7 +582,7 @@ __option_is_short (__const struct argp_o
+ }
+ 
+ ARGP_EI int
+-__option_is_end (__const struct argp_option *__opt) __THROW
++__option_is_end (__const struct argp_option *__opt)
+ {
+   return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+ }
+--- a/argp-parse.c
++++ b/argp-parse.c
+@@ -1277,13 +1277,13 @@ weak_alias (__argp_input, _argp_input)
+ /* Defined here, in case a user is not inlining the definitions in
+  * argp.h */
+ void
+-__argp_usage (__const struct argp_state *__state) __THROW
++__argp_usage (__const struct argp_state *__state)
+ {
+   __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+ }
+ 
+ int
+-__option_is_short (__const struct argp_option *__opt) __THROW
++__option_is_short (__const struct argp_option *__opt) 
+ {
+   if (__opt->flags & OPTION_DOC)
+     return 0;
+@@ -1297,7 +1297,7 @@ __option_is_short (__const struct argp_o
+ }
+ 
+ int
+-__option_is_end (__const struct argp_option *__opt) __THROW
++__option_is_end (__const struct argp_option *__opt) 
+ {
+   return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+ }
diff --git a/package/libs/argp-standalone/patches/002-no_optimize.patch b/package/libs/argp-standalone/patches/002-no_optimize.patch
new file mode 100644
index 0000000..1da330a
--- /dev/null
+++ b/package/libs/argp-standalone/patches/002-no_optimize.patch
@@ -0,0 +1,11 @@
+--- a/argp-fmtstream.h
++++ b/argp-fmtstream.h
+@@ -192,7 +192,7 @@ extern void __argp_fmtstream_update (arg
+ extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
+ extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
+ 
+-#ifdef __OPTIMIZE__
++#if 0
+ /* Inline versions of above routines.  */
+ 
+ #if !_LIBC
diff --git a/package/libs/argp-standalone/patches/900-fix-segfault-in_canon_doc_option.patch b/package/libs/argp-standalone/patches/900-fix-segfault-in_canon_doc_option.patch
new file mode 100644
index 0000000..46bffbb
--- /dev/null
+++ b/package/libs/argp-standalone/patches/900-fix-segfault-in_canon_doc_option.patch
@@ -0,0 +1,14 @@
+--- a/argp-help.c
++++ b/argp-help.c
+@@ -777,9 +777,9 @@ hol_entry_cmp (const struct hol_entry *e
+       const char *long2 = hol_entry_first_long (entry2);
+ 
+       if (doc1)
+-	doc1 = canon_doc_option (&long1);
++        doc1 = long1 != NULL && canon_doc_option (&long1);
+       if (doc2)
+-	doc2 = canon_doc_option (&long2);
++	doc2 = long2 != NULL && canon_doc_option (&long2);
+ 
+       if (doc1 != doc2)
+ 	/* `documentation' options always follow normal options (or