From 9b8a2f03621293f5080de8f6816fd0a55abf6a20 Mon Sep 17 00:00:00 2001 From: Ulf Samuelsson Date: Thu, 29 Nov 2007 09:43:36 +0000 Subject: [PATCH] Add speex vocoder package --- package/Config.in | 1 + package/speex/Config.in | 17 +++++++ package/speex/speex.mk | 104 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 122 insertions(+) create mode 100644 package/speex/Config.in create mode 100644 package/speex/speex.mk diff --git a/package/Config.in b/package/Config.in index 5a42b1025f..1542592372 100644 --- a/package/Config.in +++ b/package/Config.in @@ -281,6 +281,7 @@ source "package/libsndfile/Config.in" source "package/libvorbis/Config.in" source "package/madplay/Config.in" source "package/mpg123/Config.in" +source "package/speex/Config.in" endif menuconfig BR2_GRAPHIC_SUPPORT diff --git a/package/speex/Config.in b/package/speex/Config.in new file mode 100644 index 0000000000..992bcf846f --- /dev/null +++ b/package/speex/Config.in @@ -0,0 +1,17 @@ +config BR2_PACKAGE_SPEEX + bool "speex" + default n + help + Speex is an Open Source/Free Software patent-free + audio compression format designed for speech. + It can be used for Voice over IP + + http://www.speex.org/ + +config BR2_PACKAGE_SPEEX_ARM5E + bool "Support ARM5E instruction set" + default y + depends on BR2_PACKAGE_SPEEX && BR2_arm + help + Use the additional instructions available in the ARM5E + or later cores. diff --git a/package/speex/speex.mk b/package/speex/speex.mk new file mode 100644 index 0000000000..00e85b904a --- /dev/null +++ b/package/speex/speex.mk @@ -0,0 +1,104 @@ +############################################################# +# +# speex +# +############################################################# + +SPEEX_VERSION=1.2beta2 + +# Don't alter below this line unless you (think) you know +# what you are doing! Danger, Danger! + +SPEEX_SOURCE=speex-$(SPEEX_VERSION).tar.gz +SPEEX_CAT:=$(ZCAT) +SPEEX_SITE=http://downloads.us.xiph.org/releases/speex +SPEEX_DIR=$(BUILD_DIR)/speex-$(SPEEX_VERSION) + +ifeq ($(BR2_PACKAGE_SPEEX_ARM5E),y) +SPEEX_FOR_ARM5E:=--enable-arm5e-asm +endif + +$(DL_DIR)/$(SPEEX_SOURCE): + $(WGET) -P $(DL_DIR) $(SPEEX_SITE)/$(SPEEX_SOURCE) + +$(SPEEX_DIR)/.unpacked: $(DL_DIR)/$(SPEEX_SOURCE) + $(SPEEX_CAT) $(DL_DIR)/$(SPEEX_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + touch $(SPEEX_DIR)/.unpacked + +$(SPEEX_DIR)/Makefile: $(SPEEX_DIR)/.unpacked + rm -f $(SPEEX_DIR)/Makefile + mkdir -p $(SPEEX_DIR) + (cd $(SPEEX_DIR); rm -rf config.cache; \ + $(TARGET_CONFIGURE_OPTS) \ + $(TARGET_CONFIGURE_ARGS) \ + $(SPEEX_DIR)/configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + --includedir=/usr/include \ + --enable-shared \ + --enable-fixed-point \ + $(SPEEX_FOR_ARM5E) \ + $(DISABLE_NLS); \ + ) + $(SED) "s,^OGG_CFLAGS.*,OGG_CFLAGS= -I$(STAGING_DIR)/usr/include,g" $(SPEEX_DIR)/Makefile + $(SED) "s,^OGG_LIBS.*,OGG_LIBS= -L$(STAGING_DIR)/usr/lib -logg,g" $(SPEEX_DIR)/Makefile + $(SED) "s,^OGG_CFLAGS.*,OGG_CFLAGS= -I$(STAGING_DIR)/usr/include,g" $(SPEEX_DIR)/libspeex/Makefile + $(SED) "s,^OGG_LIBS.*,OGG_LIBS= -L$(STAGING_DIR)/usr/lib -logg,g" $(SPEEX_DIR)/libspeex/Makefile + $(SED) "s,-I/usr/include,,g" $(SPEEX_DIR)/libspeex/Makefile + $(SED) "s,^OGG_CFLAGS.*,OGG_CFLAGS= -I$(STAGING_DIR)/usr/include,g" $(SPEEX_DIR)/src/Makefile + $(SED) "s,^OGG_LIBS.*,OGG_LIBS= -L$(STAGING_DIR)/usr/lib -logg,g" $(SPEEX_DIR)/src/Makefile + $(SED) "s,-I/usr/include,,g" $(SPEEX_DIR)/src/Makefile + $(SED) "s,^OGG_CFLAGS.*,OGG_CFLAGS= -I$(STAGING_DIR)/usr/include,g" $(SPEEX_DIR)/include/Makefile + $(SED) "s,^OGG_LIBS.*,OGG_LIBS= -L$(STAGING_DIR)/usr/lib -logg,g" $(SPEEX_DIR)/include/Makefile + $(SED) "s,-I/usr/include,,g" $(SPEEX_DIR)/include/Makefile + $(SED) "s,^OGG_CFLAGS.*,OGG_CFLAGS= -I$(STAGING_DIR)/usr/include,g" $(SPEEX_DIR)/include/speex/Makefile + $(SED) "s,^OGG_LIBS.*,OGG_LIBS= -L$(STAGING_DIR)/usr/lib -logg,g" $(SPEEX_DIR)/include/speex/Makefile + $(SED) "s,-I/usr/include,,g" $(SPEEX_DIR)/include/speex/Makefile + $(SED) "s,^OGG_CFLAGS.*,OGG_CFLAGS= -I$(STAGING_DIR)/usr/include,g" $(SPEEX_DIR)/doc/Makefile + $(SED) "s,^OGG_LIBS.*,OGG_LIBS= -L$(STAGING_DIR)/usr/lib -logg,g" $(SPEEX_DIR)/doc/Makefile + $(SED) "s,-I/usr/include,,g" $(SPEEX_DIR)/doc/Makefile + + + +$(SPEEX_DIR)/speex: $(SPEEX_DIR)/Makefile + rm -f $@ + $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(SPEEX_DIR) + +$(SPEEX_DIR)/.installed: $(SPEEX_DIR)/speex + $(MAKE) DESTDIR=$(STAGING_DIR) -C $(SPEEX_DIR) install + $(SED) "s,^libdir=.*,libdir=\'$(STAGING_DIR)/usr/lib\',g" $(STAGING_DIR)/usr/lib/libspeex.la + touch $@ + +$(TARGET_DIR)/usr/bin/speexdec: $(SPEEX_DIR)/.installed + cp -dpf $(STAGING_DIR)/usr/bin/speexdec $(TARGET_DIR)/usr/bin/speexdec + +$(TARGET_DIR)/usr/bin/speexenc: $(TARGET_DIR)/usr/bin/speexdec + cp -dpf $(STAGING_DIR)/usr/bin/speexenc $(TARGET_DIR)/usr/bin/speexenc + +$(TARGET_DIR)/usr/lib/libspeex.so: $(TARGET_DIR)/usr/bin/speexenc + cp -dpf $(STAGING_DIR)/usr/lib/libspeex.so* $(TARGET_DIR)/usr/lib + +speex-bins: + +speex: uclibc libogg $(TARGET_DIR)/usr/lib/libspeex.so + +speex-source: $(DL_DIR)/$(SPEEX_SOURCE) + +speex-clean: + @if [ -d $(SPEEX_DIR)/Makefile ]; then \ + $(MAKE) -C $(SPEEX_DIR) clean; \ + fi + +speex-dirclean: + rm -rf $(SPEEX_DIR) + +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_PACKAGE_SPEEX)),y) +TARGETS+=speex +endif -- 2.30.2