faad2: add configurable fixed point build
authorFlorian Fainelli <florian@openwrt.org>
Wed, 5 Dec 2012 17:31:33 +0000 (17:31 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Wed, 5 Dec 2012 17:31:33 +0000 (17:31 +0000)
Change the faad build to use fixed point math if emulated floating point
is in use (based on CONFIG_SOFT_FLOAT). Adds a config option to force
the use of floating point math.

Signed-off-by: Andy Leiserson <andy@leiserson.org>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
SVN-Revision: 34527

libs/faad2/Config.in [new file with mode: 0644]
libs/faad2/Makefile

diff --git a/libs/faad2/Config.in b/libs/faad2/Config.in
new file mode 100644 (file)
index 0000000..0033676
--- /dev/null
@@ -0,0 +1,12 @@
+config FAAD2_ALWAYS_USE_FLOATING_POINT
+       depends on PACKAGE_libfaad2
+       bool "Build FAAD2 to use floating-point math even if using soft floats."
+       default n
+       help
+               By default, libfaad2 will be built to use fixed point rather
+               than floating point math if emulated floating point operations
+               are being used. (See the CONFIG_SOFT_FLOAT option.) Set this
+               option if you would like to use floating point math regardless
+               of whether floating point emulation is in use.
+               
+               For the best real-time decoding ability, leave this option off.
index 3505e668defe81e3e267c1fe16f65602c5e899d3..025234ed61b20a982424b1f760c5f5861bc75974 100644 (file)
@@ -9,12 +9,16 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=faad2
 PKG_VERSION:=2.7
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/faac
 PKG_MD5SUM:=4c332fa23febc0e4648064685a3d4332
 
+PKG_CONFIG_DEPENDS := \
+       CONFIG_SOFT_FLOAT \
+       CONFIG_FAAD2_ALWAYS_USE_FLOATING_POINT
+
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
@@ -22,6 +26,12 @@ include $(INCLUDE_DIR)/package.mk
 
 TARGET_CFLAGS += $(FPIC)
 
+# Use fixed point math, if we're using soft floats, and the user didn't
+# specifically ask to use floats anyways.
+ifeq ($(CONFIG_SOFT_FLOAT)-$(CONFIG_FAAD2_ALWAYS_USE_FLOATING_POINT),y-)
+TARGET_CFLAGS+= -DFIXED_POINT
+endif
+
 define Package/faad2/Default
   URL:=http://www.audiocoding.com/faad2.html
   TITLE:=Freeware Advanced Audio Decoder
@@ -52,6 +62,11 @@ $(call Package/faad2/Default)
   CATEGORY:=Libraries
   TITLE+=library
   DEPENDS:=@BUILD_PATENTED
+  MENU:=1
+endef
+
+define Package/libfaad2/config
+       source "$(SOURCE)/Config.in"
 endef
 
 define Package/libfaad2/description