98da47fb4fe0a8d9ce42d79db752d2dfb7275682
[openwrt/svn-archive/archive.git] / libs / libmad / Makefile
1 #
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libmad
11 PKG_VERSION:=0.15.1b
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/mad \
16 ftp://ftp.mars.org/pub/mpeg/
17 PKG_MD5SUM:=1be543bc30c56fb6bea1d7bf6a64e66c
18
19 PKG_LICENSE:=GPLv2
20 PKG_LICENSE_FILES:=COPYING
21
22 PKG_FIXUP:=autoreconf
23
24 PKG_INSTALL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 FPM:=default
29 ifeq ($(ARCH),armeb)
30 FPM:=arm
31 endif
32 ifeq ($(ARCH),i386)
33 FPM:=intel
34 endif
35 ifeq ($(ARCH),mipsel)
36 FPM:=mips
37 endif
38
39 define Package/libmad
40 SECTION:=libs
41 CATEGORY:=Libraries
42 TITLE:=An high-quality MPEG audio decoding library
43 URL:=http://www.underbit.com/products/mad/
44 DEPENDS:=@BUILD_PATENTED
45 endef
46
47 define Package/libmad/description
48 MAD is a high-quality MPEG audio decoder. It currently supports
49 MPEG-1 and the MPEG-2 extension to lower sampling frequencies,
50 as well as the de facto MPEG 2.5 format. All three audio layers -
51 Layer I, Layer II, and Layer III (i.e. MP3) - are fully implemented.
52 endef
53
54 TARGET_CFLAGS += $(FPIC)
55
56 CONFIGURE_ARGS+= \
57 --enable-shared \
58 --enable-static \
59 --enable-fpm="$(FPM)" \
60 --disable-debugging \
61 --enable-speed \
62
63 # XXX: configure is parsing and "optimizing" CFLAGS, adding unsupported
64 # XXX: compiler args to it (like -fforce-mem)
65 # XXX: so pass an empty one to configure
66 CONFIGURE_VARS+= \
67 CFLAGS="" \
68
69 # XXX: and pass our own to make
70 MAKE_FLAGS+= \
71 CFLAGS="$(TARGET_CFLAGS)" \
72
73 define Build/InstallDev
74 $(INSTALL_DIR) $(1)/usr/include
75 $(CP) $(PKG_INSTALL_DIR)/usr/include/mad.h $(1)/usr/include/
76 $(INSTALL_DIR) $(1)/usr/lib
77 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.{a,so*} $(1)/usr/lib/
78 endef
79
80 define Package/libmad/install
81 $(INSTALL_DIR) $(1)/usr/lib
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.so.* $(1)/usr/lib/
83 endef
84
85 $(eval $(call BuildPackage,libmad))