cd006423117f2d856f80a612a8c721fe37f86b7c
[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
19 include $(INCLUDE_DIR)/package.mk
20
21 ifeq ($(KERNEL),2.4)
22 DEPENDS_KMOD:=+kmod-alsa
23 else
24 DEPENDS_KMOD:=+kmod-soundcore
25 endif
26
27 define Package/alsa-lib
28 SECTION:=libs
29 CATEGORY:=Libraries
30 TITLE:=ALSA (Advanced Linux Sound Architecture) library
31 URL:=http://www.alsa-project.org/
32 DEPENDS:=@USB_SUPPORT $(DEPENDS_KMOD)
33 endef
34
35 define Package/alsa-lib/description
36 This is the library package for alsa, needed by some userspace programs.
37 You must have enabled the ALSA support in the kernel.
38 endef
39
40 CONFIGURE_ARGS += \
41 --enable-shared \
42 --enable-static \
43 --disable-debugging \
44 --disable-profiling \
45 --with-softfloat \
46 --with-versioned=no \
47
48 define Build/Configure
49 $(call Build/Configure/Default)
50 $(call libtool_disable_rpath)
51 endef
52
53 define Build/Compile
54 # override AM_CFLAGS holding inappropriate optimization flags
55 $(MAKE) -C $(PKG_BUILD_DIR) AM_CFLAGS="" all
56 $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
57 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
58 endef
59
60 define Build/InstallDev
61 mkdir -p $(STAGING_DIR)/usr/include
62 $(CP) $(PKG_INSTALL_DIR)/usr/include/alsa $(STAGING_DIR)/usr/include/
63 mkdir -p $(STAGING_DIR)/usr/lib
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libasound.{a,so*} $(STAGING_DIR)/usr/lib/
65 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
66 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/alsa.pc $(STAGING_DIR)/usr/lib/pkgconfig/
67 $(SED) 's,-I$$$${includedir}/alsa,-I$(STAGING_DIR)/usr/include/alsa,g' $(STAGING_DIR)/usr/lib/pkgconfig/alsa.pc
68 $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/alsa.pc
69 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/alsa.pc
70 endef
71
72 define Build/UninstallDev
73 rm -rf $(STAGING_DIR)/usr/include/alsa \
74 $(STAGING_DIR)/usr/lib/libasound.{a,so*} \
75 $(STAGING_DIR)/usr/lib/pkgconfig/alsa.pc
76 endef
77
78 define Package/alsa-lib/install
79 $(INSTALL_DIR) $(1)/usr/lib
80 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libasound.so.* $(1)/usr/lib/
81 $(INSTALL_DIR) $(1)/usr/share/alsa/
82 $(CP) $(PKG_INSTALL_DIR)/usr/share/alsa/alsa.conf $(1)/usr/share/alsa/
83 endef
84
85 $(eval $(call BuildPackage,alsa-lib))