[packages] alsa: add audio group in postinstall (#8755)
[openwrt/svn-archive/archive.git] / sound / alsa / 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
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=alsa-driver
12 PKG_VERSION:=1.0.14rc1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/driver/
17 PKG_MD5SUM:=4cff99be4b225e96663fbd61cabe3182
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define KernelPackage/alsa
22 SUBMENU:=Other modules
23 DEPENDS:=@USB_SUPPORT @LINUX_2_4
24 TITLE:=Advanced Linux Sound Architecture
25 FILES:=$(PKG_BUILD_DIR)/modules/*.$(LINUX_KMOD_SUFFIX)
26 AUTOLOAD=$(call AutoLoad,70,$(shell cat ./files/alsa.modules))
27 endef
28
29 define KernelPackage/alsa/postinst
30 grep -qs "^audio:" "$$IPKG_INSTROOT/etc/group" || echo "audio:x:29:" >> "$$IPKG_INSTROOT/etc/group"
31 exit 0
32 endef
33
34 ifeq ($(KERNEL),2.4)
35 ifeq ($(LINUX_KARCH),i386)
36 KERNEL_C_OPTS:= -Os -mpreferred-stack-boundary=2 -march=i486 -fno-unit-at-a-time
37 endif
38 ifeq ($(LINUX_KARCH),mips)
39 KERNEL_C_OPTS:= -Os -G 0 -mlong-calls -mno-abicalls -fno-pic -finline-limit=100000 -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap
40 endif
41 endif
42 ifeq ($(LINUX_KARCH),i386)
43 KERNEL_C_INCS:= -I$(LINUX_DIR)/include/asm-i386/mach-generic -I$(LINUX_DIR)/include/asm-i386/mach-default
44 endif
45 ifeq ($(LINUX_KARCH),mips)
46 KERNEL_C_INCS:= -I$(LINUX_DIR)/include/asm-mips/mach-generic
47 endif
48
49 CONFIGURE_VARS:= \
50 CFLAGS="$(KERNEL_C_INCS)"
51
52 CONFIGURE_ARGS:= \
53 --with-build="$(LINUX_DIR)" \
54 --with-kernel="$(LINUX_DIR)" \
55 --with-cross="$(KERNEL_CROSS)" \
56 --with-redhat=no \
57 --with-suse=no \
58 --with-oss=yes \
59 --with-isapnp=no \
60 --with-sequencer=no \
61 --with-cards=usb-audio
62
63 define Build/Compile
64 $(MAKE) -C $(PKG_BUILD_DIR) \
65 ARCH="$(LINUX_KARCH)" \
66 CROSS_COMPILE="$(TARGET_CROSS)" \
67 c_opts="$(KERNEL_C_OPTS)" \
68 CP="$(CP)" \
69 all
70 endef
71
72 $(eval $(call KernelPackage,alsa))