add arm optimizations (closes: #1305)
[openwrt/svn-archive/archive.git] / libs / libmad / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libmad
12 PKG_VERSION:=0.15.1b
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/mad \
17 ftp://ftp.mars.org/pub/mpeg/
18 PKG_MD5SUM:=1be543bc30c56fb6bea1d7bf6a64e66c
19 PKG_CAT:=zcat
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 FPM:=default
27 ifeq ($(ARCH),armeb)
28 FPM:=arm
29 endif
30 ifeq ($(ARCH),i386)
31 FPM:=intel
32 endif
33 ifeq ($(ARCH),mipsel)
34 FPM:=mips
35 endif
36
37 define Package/libmad
38 SECTION:=libs
39 CATEGORY:=Libraries
40 TITLE:=An high-quality MPEG audio decoding library
41 DESCRIPTION:=\
42 MAD is a high-quality MPEG audio decoder. It currently supports \\\
43 MPEG-1 and the MPEG-2 extension to lower sampling frequencies, \\\
44 as well as the de facto MPEG 2.5 format. All three audio layers - \\\
45 Layer I, Layer II, and Layer III (i.e. MP3) - are fully implemented.
46 URL:=http://www.underbit.com/products/mad/
47 endef
48
49 define Build/Configure
50 $(call Build/Configure/Default, \
51 --enable-shared \
52 --enable-static \
53 --enable-fpm="$(FPM)" \
54 --disable-debugging \
55 --enable-speed \
56 )
57 endef
58
59 define Build/Compile
60 $(MAKE) -C $(PKG_BUILD_DIR) \
61 DESTDIR="$(PKG_INSTALL_DIR)" \
62 all install
63 endef
64
65 define Build/InstallDev
66 mkdir -p $(STAGING_DIR)/usr/include
67 $(CP) $(PKG_INSTALL_DIR)/usr/include/mad.h $(STAGING_DIR)/usr/include/
68 mkdir -p $(STAGING_DIR)/usr/lib
69 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.{a,so*} $(STAGING_DIR)/usr/lib/
70 endef
71
72 define Build/UninstallDev
73 rm -rf \
74 $(STAGING_DIR)/usr/include/mad.h \
75 $(STAGING_DIR)/usr/lib/libmad.{a,so*}
76 endef
77
78 define Package/libmad/install
79 $(INSTALL_DIR) $(1)/usr/lib
80 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.so.* $(1)/usr/lib/
81 endef
82
83 $(eval $(call BuildPackage,libmad))