Add alsa-lib package
authorUlf Samuelsson <ulf.samuelsson@atmel.com>
Mon, 23 Jul 2007 07:54:13 +0000 (07:54 -0000)
committerUlf Samuelsson <ulf.samuelsson@atmel.com>
Mon, 23 Jul 2007 07:54:13 +0000 (07:54 -0000)
package/Config.in
package/alsa-lib/Config.in [new file with mode: 0644]
package/alsa-lib/alsa-lib.mk [new file with mode: 0644]

index e2d269119fd036053990894f620555a61f567d77..f1e255c114d2227afbe5d7d57b42aa1e41e3643d 100644 (file)
@@ -246,6 +246,7 @@ menuconfig BR2_AUDIO_SUPPORT
          Support for audio libraries and applications
 
 if BR2_AUDIO_SUPPORT
+source "package/alsa-lib/Config.in"
 source "package/asterisk/Config.in"
 source "package/aumix/Config.in"
 source "package/libid3tag/Config.in"
diff --git a/package/alsa-lib/Config.in b/package/alsa-lib/Config.in
new file mode 100644 (file)
index 0000000..80986b5
--- /dev/null
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_ALSA_LIB
+       bool "alsa-lib"
+       default n
+       help
+         The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI
+         functionality to the Linux operating system.
+
+         http://www.alsa-project.org/
diff --git a/package/alsa-lib/alsa-lib.mk b/package/alsa-lib/alsa-lib.mk
new file mode 100644 (file)
index 0000000..735a80b
--- /dev/null
@@ -0,0 +1,74 @@
+#############################################################
+#
+# alsa-lib
+#
+#############################################################
+ALSA_LIB_VER:=1.0.14a
+ALSA_LIB_SOURCE:=alsa-lib-$(ALSA_LIB_VER).tar.bz2
+ALSA_LIB_SITE:=ftp://ftp.alsa-project.org/pub/lib
+ALSA_LIB_DIR:=$(BUILD_DIR)/alsa-lib-$(ALSA_LIB_VER)
+ALSA_LIB_CAT:=$(BZCAT)
+ALSA_LIB_BINARY:=libasound.so.2.0.0
+ALSA_LIB_TARGET_BINARY:=usr/lib/$(ALSA_LIB_BINARY)
+
+$(DL_DIR)/$(ALSA_LIB_SOURCE):
+       $(WGET) -P $(DL_DIR) $(ALSA_LIB_SITE)/$(ALSA_LIB_SOURCE)
+
+$(ALSA_LIB_DIR)/.unpacked: $(DL_DIR)/$(ALSA_LIB_SOURCE)
+       $(ALSA_LIB_CAT) $(DL_DIR)/$(ALSA_LIB_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+       toolchain/patch-kernel.sh $(ALSA_LIB_DIR) package/alsa-lib/ alsa-lib-$(ALSA_LIB_VER)\*.patch*
+       $(CONFIG_UPDATE) $(ALSA_LIB_DIR)
+       @touch $@
+
+$(ALSA_LIB_DIR)/.configured: $(ALSA_LIB_DIR)/.unpacked
+       (cd $(ALSA_LIB_DIR); rm -rf config.cache; \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               LDFLAGS="$(TARGET_LDFLAGS)" \
+               ./configure \
+               --target=$(GNU_TARGET_NAME) \
+               --host=$(GNU_TARGET_NAME) \
+               --build=$(GNU_HOST_NAME) \
+               --prefix=/usr \
+               --sysconfdir=/etc \
+               --enable-shared \
+               --enable-static \
+               --disable-docs \
+               $(DISABLE_NLS) \
+       );
+       @touch $@
+
+$(ALSA_LIB_DIR)/src/.libs/$(ALSA_LIB_BINARY): $(ALSA_LIB_DIR)/.configured
+       $(MAKE) -C $(ALSA_LIB_DIR)
+       @touch -c $@
+
+$(STAGING_DIR)/$(ALSA_LIB_TARGET_BINARY): $(ALSA_LIB_DIR)/src/.libs/$(ALSA_LIB_BINARY)
+       $(MAKE) DESTDIR=$(STAGING_DIR) -C $(ALSA_LIB_DIR) install
+       @touch -c $@
+
+$(TARGET_DIR)/$(ALSA_LIB_TARGET_BINARY): $(STAGING_DIR)/$(ALSA_LIB_TARGET_BINARY)
+       @mkdir -p $(TARGET_DIR)/usr/share/alsa
+       @mkdir -p $(TARGET_DIR)/usr/lib/alsa-lib
+       cp -dpf  $(STAGING_DIR)/lib/libasound.so*  $(TARGET_DIR)/usr/lib/
+       cp -rdpf $(STAGING_DIR)/usr/share/alsa/*   $(TARGET_DIR)/usr/share/alsa/
+       cp -rdpf $(STAGING_DIR)/usr/lib/alsa-lib/* $(TARGET_DIR)/usr/lib/alsa-lib/
+       -$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libasound.so*
+       -$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/alsa-lib/*.so
+       @touch -c $@
+
+alsa-lib: linux26 uclibc $(TARGET_DIR)/$(ALSA_LIB_TARGET_BINARY)
+
+alsa-lib-clean:
+       rm -f $(TARGET_DIR)/$(ALSA_LIB_TARGET_BINARY)
+       -$(MAKE) -C $(ALSA_LIB_DIR) clean
+
+alsa-lib-dirclean:
+       rm -rf $(ALSA_LIB_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_ALSA_LIB)),y)
+TARGETS+=alsa-lib
+endif