ASR_BASE

Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/external/subpack/libs/libshout/Makefile b/external/subpack/libs/libshout/Makefile
new file mode 100644
index 0000000..9cd11e4
--- /dev/null
+++ b/external/subpack/libs/libshout/Makefile
@@ -0,0 +1,119 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libshout
+PKG_VERSION:=2.4.6
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://downloads.us.xiph.org/releases/libshout/
+PKG_HASH:=39cbd4f0efdfddc9755d88217e47f8f2d7108fa767f9d58a2ba26a16d8f7c910
+
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+PKG_LICENSE:=LGPL-2.1-or-later
+PKG_LICENSE_FILES:=COPYING
+PKG_CPE_ID:=cpe:/a:libshout:libshout
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libshout/default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Shoutcast client library
+  URL:=http://www.icecast.org
+  DEPENDS:= +libvorbisidec +libpthread
+endef
+
+define Package/libshout
+  $(call Package/libshout/default)
+  TITLE+= (no theora)
+  DEPENDS+= +libopenssl
+  VARIANT:=notheora
+endef
+
+define Package/libshout-nossl
+  $(call Package/libshout/default)
+  TITLE+= (no ssl/theora)
+  VARIANT:=nossl
+endef
+
+define Package/libshout-full
+  $(call Package/libshout/default)
+  TITLE+=(full)
+  DEPENDS+= +libtheora +libopenssl
+  VARIANT:=full
+endef
+
+define Package/libshout/description/default
+ libshout allows applications to easily communicate and broadcast
+ to an Icecast streaming media server. It handles the socket connections,
+ metadata communication, and data streaming for the calling application,
+ and lets developers focus on feature sets instead of implementation
+ details.
+endef
+
+define Package/libshout/description
+  $(call Package/libshout/description/default)
+  .
+  This package does not have Theora support.
+endef
+
+define Package/libshout-nossl/description
+  $(call Package/libshout/description/default)
+  .
+  This package does not have OpenSSL or Theora support.
+endef
+
+Package/libshout-full/description=$(Package/libshout/description/default)
+
+CONFIGURE_ARGS += \
+	--enable-shared \
+	--enable-static \
+	--disable-speex \
+	--without-pic
+
+ifeq ($(BUILD_VARIANT),notheora)
+  CONFIGURE_ARGS += --disable-theora
+endif
+
+ifeq ($(BUILD_VARIANT),nossl)
+  CONFIGURE_ARGS += --disable-theora --without-openssl
+endif
+
+CONFIGURE_VARS += \
+	VORBIS_CFLAGS="-I$(STAGING_DIR)/usr/include/tremor/" \
+	VORBIS_LIBS="$(TARGET_LDFLAGS) -lvorbisidec" \
+
+TARGET_CFLAGS += $(FPIC)
+
+PACKAGE_CONFIG_FILE=shout$(if $(findstring $(BUILD_VARIANT),full),-full).pc
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(1)/usr/include
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/shout $(1)/usr/include/
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libshout.{a,so*} $(1)/usr/lib/
+	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/shout.pc $(1)/usr/lib/pkgconfig/$(PACKAGE_CONFIG_FILE)
+	$(SED) 's| -I/usr/include||' $(1)/usr/lib/pkgconfig/$(PACKAGE_CONFIG_FILE)
+endef
+
+define Package/libshout/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libshout.so.* $(1)/usr/lib/
+endef
+
+Package/libshout-full/install=$(Package/libshout/install)
+Package/libshout-nossl/install=$(Package/libshout/install)
+
+$(eval $(call BuildPackage,libshout))
+$(eval $(call BuildPackage,libshout-nossl))
+$(eval $(call BuildPackage,libshout-full))
diff --git a/external/subpack/libs/libshout/patches/010-gcc14.patch b/external/subpack/libs/libshout/patches/010-gcc14.patch
new file mode 100644
index 0000000..0ff6839
--- /dev/null
+++ b/external/subpack/libs/libshout/patches/010-gcc14.patch
@@ -0,0 +1,11 @@
+--- a/src/shout_private.h
++++ b/src/shout_private.h
+@@ -33,6 +33,8 @@
+ #include <common/timing/timing.h>
+ #include "util.h"
+ 
++#include <stdio.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ 
+ #ifdef HAVE_STDINT_H
diff --git a/external/subpack/libs/libshout/patches/100-add_with-openssl_option.patch b/external/subpack/libs/libshout/patches/100-add_with-openssl_option.patch
new file mode 100644
index 0000000..7319e29
--- /dev/null
+++ b/external/subpack/libs/libshout/patches/100-add_with-openssl_option.patch
@@ -0,0 +1,27 @@
+--- a/m4/xiph_openssl.m4
++++ b/m4/xiph_openssl.m4
+@@ -29,14 +29,16 @@ else
+     fi
+ fi
+ 
+-# Now try linking to openssl
+-xt_save_CFLAGS="$CFLAGS"
+-xt_save_LIBS="$LIBS"
+-CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
+-LIBS="$OPENSSL_LIBS $LIBS"
+-AC_TRY_LINK([#include <openssl/ssl.h>], [void *a = SSL_new], [openssl_ok='yes'])
+-CFLAGS="$xt_save_CFLAGS"
+-LIBS="$xt_save_LIBS"
++if test "x$openssl_prefix" != "xno"; then
++    # Now try linking to openssl
++    xt_save_CFLAGS="$CFLAGS"
++    xt_save_LIBS="$LIBS"
++    CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
++    LIBS="$OPENSSL_LIBS $LIBS"
++    AC_TRY_LINK([#include <openssl/ssl.h>], [void *a = SSL_new], [openssl_ok='yes'])
++    CFLAGS="$xt_save_CFLAGS"
++    LIBS="$xt_save_LIBS"
++fi
+ 
+ if test "$openssl_ok" = "yes"; then
+     AC_DEFINE(HAVE_OPENSSL, 1, [Define if you have libopenssl.])
diff --git a/external/subpack/libs/libshout/patches/120-vorbis-c.patch b/external/subpack/libs/libshout/patches/120-vorbis-c.patch
new file mode 100644
index 0000000..d7886b7
--- /dev/null
+++ b/external/subpack/libs/libshout/patches/120-vorbis-c.patch
@@ -0,0 +1,11 @@
+--- a/src/codec_vorbis.c
++++ b/src/codec_vorbis.c
+@@ -29,7 +29,7 @@
+ #endif
+ #include <stdlib.h>
+ 
+-#include <vorbis/codec.h>
++#include <tremor/ivorbiscodec.h>
+ 
+ #include "shout_private.h"
+ #include "format_ogg.h"