Commit based upon d6442850bde61f0c3e7e2ae3247b4a856073c5e0
[librecmc/package-feed.git] / libs / faad2 / Makefile
1 #
2 # Copyright (C) 2008-2014 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:=faad2
11 PKG_VERSION:=2.7
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@SF/faac
16 PKG_MD5SUM:=4c332fa23febc0e4648064685a3d4332
17 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
18
19 PKG_CONFIG_DEPENDS := \
20         CONFIG_SOFT_FLOAT \
21         CONFIG_FAAD2_ALWAYS_USE_FLOATING_POINT
22
23 PKG_FIXUP:=autoreconf
24 PKG_INSTALL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 TARGET_CFLAGS += $(FPIC)
29
30 # Use fixed point math, if we're using soft floats, and the user didn't
31 # specifically ask to use floats anyways.
32 ifeq ($(CONFIG_SOFT_FLOAT)-$(CONFIG_FAAD2_ALWAYS_USE_FLOATING_POINT),y-)
33 TARGET_CFLAGS+= -DFIXED_POINT
34 FAAD2_CONFIG_OPTS= --without-fp -nfp
35 endif
36
37 define Package/faad2/Default
38   URL:=http://www.audiocoding.com/faad2.html
39   TITLE:=Freeware Advanced Audio Decoder
40 endef
41
42 define Package/faad2/Default/description
43         FAAD2 is the fastest ISO AAC audio decoder available.
44         FAAD2 correctly decodes all MPEG-4 and MPEG-2 MAIN,
45         LOW, LTP, LD and ER object type AAC files.
46 endef
47
48 define Package/faad2
49 $(call Package/faad2/Default)
50   SECTION:=sound
51   CATEGORY:=Sound
52   TITLE+=player
53   DEPENDS:=+libfaad2
54 endef
55
56 define Package/faad2/description
57 $(call Package/faad2/Default/description)
58   This package contains a binary to play AAC or MP4 files.
59 endef
60
61 define Package/libfaad2
62 $(call Package/faad2/Default)
63   SECTION:=libs
64   CATEGORY:=Libraries
65   TITLE+=library
66   DEPENDS:=@BUILD_PATENTED
67   MENU:=1
68 endef
69
70 define Package/libfaad2/config
71         source "$(SOURCE)/Config.in"
72 endef
73
74 define Package/libfaad2/description
75 $(call Package/faad2/Default/description)
76   This package contains the library.
77 endef
78
79 define Build/Configure
80         # This replacement were do according to many comments on the web because of gcc 3.4.5 version (.6 included).-
81         # which doesn't recognices the -iquote parameter to AM_CFLAGS
82         ($(SED) 's,-iquote $$$$(top_srcdir),-I$$$$(top_srcdir),g' $(PKG_BUILD_DIR)/libfaad/Makefile.am; \
83         $(SED) 's,-iquote $$$$(top_srcdir),-I$$$$(top_srcdir),g' $(PKG_BUILD_DIR)/libfaad/Makefile.in);
84         (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
85                 autoreconf -vif \
86         );
87         $(call Build/Configure/Default, \
88                 --with-mp4v2 \
89                 $(FAAD2_CONFIG_OPTS) \
90                 --without-xmms \
91                 , \
92                 FAAD2_CPPFLAGS="-fno-builtin-cos -fno-builtin-sin -fno-builtin-log" \
93         )
94 endef
95
96 define Build/InstallDev
97         $(INSTALL_DIR) $(1)/usr/include
98         $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include
99         $(INSTALL_DIR) $(1)/usr/lib
100         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfaad.{a,so*} $(1)/usr/lib/
101 endef
102
103 define Package/faad2/install
104         $(INSTALL_DIR) $(1)/usr/bin
105         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/faad $(1)/usr/bin/
106 endef
107
108 define Package/libfaad2/install
109         $(INSTALL_DIR) $(1)/usr/lib
110         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfaad.so.* $(1)/usr/lib/
111 endef
112
113 $(eval $(call BuildPackage,faad2))
114 $(eval $(call BuildPackage,libfaad2))