Fix alsa-lib on 2.6 kernels, add an hotplug rule to populate /dev with the sound...
[openwrt/svn-archive/archive.git] / libs / alsa-lib / 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:=alsa-lib
12 PKG_VERSION:=1.0.13
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/lib/
17 PKG_MD5SUM:=d55a9d7d2a79d738a1b7a511cffda4b6
18 PKG_CAT:=bzcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24 ifeq ($(KERNEL),2.4)
25 define Package/alsa-lib
26 SECTION:=libs
27 CATEGORY:=Libraries
28 DEPENDS:=+kmod-alsa @USB_SUPPORT
29 TITLE:=ALSA (Advanced Linux Sound Architecture) library
30 DESCRIPTION:=\
31 This is the library package for alsa, needed by some userspace programs. You must \\\
32 have enabled the ALSA support in the kernel.
33 URL:=http://www.alsa-project.org/
34 endef
35 else
36 define Package/alsa-lib
37 SECTION:=libs
38 CATEGORY:=Libraries
39 DEPENDS:=+kmod-soundcore @USB_SUPPORT
40 TITLE:=ALSA (Advanced Linux Sound Architecture) library
41 DESCRIPTION:=\
42 This is the library package for alsa, needed by some userspace programs. You must \\\
43 have enabled the ALSA support in the kernel.
44 URL:=http://www.alsa-project.org/
45 endef
46 endif
47
48 define Build/Configure
49 $(call Build/Configure/Default,\
50 --enable-shared \
51 --enable-static \
52 --disable-debugging \
53 --disable-profiling \
54 --with-softfloat \
55 --with-versioned=no \
56 )
57 endef
58
59 define Build/Compile
60 # override AM_CFLAGS holding inappropriate optimization flags
61 $(MAKE) -C $(PKG_BUILD_DIR) \
62 AM_CFLAGS="" \
63 DESTDIR="$(PKG_INSTALL_DIR)" \
64 all install
65 endef
66
67 define Build/InstallDev
68 mkdir -p $(STAGING_DIR)/usr/include
69 $(CP) $(PKG_INSTALL_DIR)/usr/include/alsa $(STAGING_DIR)/usr/include/
70 mkdir -p $(STAGING_DIR)/usr/lib
71 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libasound.{a,so}* $(STAGING_DIR)/usr/lib/
72 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
73 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/alsa.pc $(STAGING_DIR)/usr/lib/pkgconfig/
74 $(SED) 's,-I$$$${includedir}/alsa,,g' $(STAGING_DIR)/usr/lib/pkgconfig/alsa.pc
75 $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/alsa.pc
76 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/alsa.pc
77 endef
78
79 define Build/UninstallDev
80 rm -rf \
81 $(STAGING_DIR)/usr/include/alsa \
82 $(STAGING_DIR)/usr/lib/libasound.{a,so}* \
83 $(STAGING_DIR)/usr/lib/pkgconfig/alsa.pc
84 endef
85
86 define Package/alsa-lib/install
87 $(INSTALL_DIR) $(1)/usr/lib
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libasound.so.* $(1)/usr/lib/
89 $(INSTALL_DIR) $(1)/usr/share/alsa/
90 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/share/alsa/alsa.conf $(1)/usr/share/alsa/
91 endef
92
93 $(eval $(call BuildPackage,alsa-lib))