--- /dev/null
+#
+# Copyright (C) 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:=spandsp
+PKG_VERSION:=0.0.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.soft-switch.org/downloads/spandsp/
+PKG_MD5SUM:=897d839516a6d4edb20397d4757a7ca3
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libspandsp
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=spandsp library
+ DEPENDS:=+libtiff
+ MAINTAINER:=Jiri Slachta <slachta@cesnet.cz>
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspandsp* $(1)/usr/lib/
+
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/spandsp.h $(1)/usr/include/
+
+ $(INSTALL_DIR) $(1)/usr/include/spandsp
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/spandsp/*.h $(1)/usr/include/spandsp/
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/spandsp.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libspandsp/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspandsp*so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libspandsp))
--- /dev/null
+--- a/src/spandsp/fast_convert.h
++++ b/src/spandsp/fast_convert.h
+@@ -195,7 +195,7 @@ extern "C"
+ {
+ return (long int) (x);
+ }
+-#elif defined(__ppc__) || defined(__powerpc__)
++#elif defined(THISISNOTDEFINEDYADDAYADDA)
+ static __inline__ long int lfastrint(register double x)
+ {
+ int res[2];
+--- a/configure.ac
++++ b/configure.ac
+@@ -152,9 +152,7 @@ AC_ARG_ENABLE(builtin_tiff,
+
+ AC_FUNC_ERROR_AT_LINE
+ AC_FUNC_VPRINTF
+-AC_FUNC_MALLOC
+ AC_FUNC_MEMCMP
+-AC_FUNC_REALLOC
+ AC_FUNC_SELECT_ARGTYPES
+
+ AX_C99_FUNC_LRINT