commit 84e6f380442456b764896b36878516f21ab8e55e
parent 4183ed76795fb45c8ef29d24f2970d2aead22257
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Thu, 5 Jun 2014 16:20:07 +0200
add alsalib
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat:
11 files changed, 303 insertions(+), 0 deletions(-)
diff --git a/alsalib/alsa-lib-portable-mutex.patch b/alsalib/alsa-lib-portable-mutex.patch
@@ -0,0 +1,33 @@
+--- alsa-lib-1.0.27.2.orig/src/conf.c
++++ alsa-lib-1.0.27.2/src/conf.c
+@@ -427,8 +427,8 @@
+ #ifndef DOC_HIDDEN
+
+ #ifdef HAVE_LIBPTHREAD
+-static pthread_mutex_t snd_config_update_mutex =
+- PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
++static pthread_mutex_t snd_config_update_mutex;
++static pthread_once_t snd_config_update_mutex_once = PTHREAD_ONCE_INIT;
+ #endif
+
+ struct _snd_config {
+@@ -472,8 +472,19 @@
+
+ #ifdef HAVE_LIBPTHREAD
+
++static void snd_config_init_mutex(void)
++{
++ pthread_mutexattr_t attr;
++
++ pthread_mutexattr_init(&attr);
++ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
++ pthread_mutex_init(&snd_config_update_mutex, &attr);
++ pthread_mutexattr_destroy(&attr);
++}
++
+ static inline void snd_config_lock(void)
+ {
++ pthread_once(&snd_config_update_mutex_once, snd_config_init_mutex);
+ pthread_mutex_lock(&snd_config_update_mutex);
+ }
+
diff --git a/alsalib/alsa-lib_kernel_off_t.patch b/alsalib/alsa-lib_kernel_off_t.patch
@@ -0,0 +1,10 @@
+--- alsa-lib-1.0.27.2.org/include/local.h
++++ alsa-lib-1.0.27.2/include/local.h
+@@ -116,7 +116,6 @@
+ /* kill and replace kernel-specific types */
+ #define __user
+ #define __force
+-#define __kernel_off_t off_t
+
+ #include <sound/asound.h>
+
diff --git a/alsalib/alsa-lib_mask_inline.patch b/alsalib/alsa-lib_mask_inline.patch
@@ -0,0 +1,10 @@
+--- alsa-lib-1.0.25/src/pcm/mask_inline.h
++++ alsa-lib-1.0.25.patched/src/pcm/mask_inline.h
+@@ -20,6 +20,7 @@
+ */
+
+ #include <sys/types.h>
++#include <strings.h>
+
+ #define MASK_INLINE static inline
+
diff --git a/alsalib/alsa-lib_mips_atomic.patch b/alsalib/alsa-lib_mips_atomic.patch
@@ -0,0 +1,28 @@
+--- alsa-lib-1.0.25/include/iatomic.h 2012-01-25 07:56:56.000000000 +0000
++++ alsa-lib-1.0.25-patched/include/iatomic.h 2012-11-02 05:47:09.105284415 +0000
+@@ -683,7 +683,6 @@
+ #endif /* __powerpc__ */
+
+ #ifdef __mips__
+-
+ typedef struct { volatile int counter; } atomic_t;
+
+ #define ATOMIC_INIT(i) { (i) }
+@@ -720,7 +719,7 @@
+ * Atomically adds @i to @v. Note that the guaranteed useful range
+ * of an atomic_t is only 24 bits.
+ */
+-extern __inline__ void atomic_add(int i, atomic_t * v)
++static __inline__ void atomic_add(int i, atomic_t * v)
+ {
+ unsigned long temp;
+
+@@ -744,7 +743,7 @@
+ * Atomically subtracts @i from @v. Note that the guaranteed
+ * useful range of an atomic_t is only 24 bits.
+ */
+-extern __inline__ void atomic_sub(int i, atomic_t * v)
++static __inline__ void atomic_sub(int i, atomic_t * v)
+ {
+ unsigned long temp;
+
diff --git a/alsalib/alsa-lib_mixed_types.patch b/alsalib/alsa-lib_mixed_types.patch
@@ -0,0 +1,145 @@
+--- alsa-lib-1.0.25.orig/src/pcm/pcm_misc.c 2013-07-22 23:16:24.942000003 +0000
++++ alsa-lib-1.0.25/src/pcm/pcm_misc.c 2013-07-22 23:18:34.345000003 +0000
+@@ -363,7 +363,7 @@
+ * \param format Sample format
+ * \return silence 64 bit word
+ */
+-u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format)
++uint64_t snd_pcm_format_silence_64(snd_pcm_format_t format)
+ {
+ switch (format) {
+ case SNDRV_PCM_FORMAT_S8:
+@@ -437,7 +437,7 @@
+ {
+ union {
+ float f[2];
+- u_int64_t i;
++ uint64_t i;
+ } u;
+ u.f[0] = u.f[1] = 0.0;
+ #ifdef SNDRV_LITTLE_ENDIAN
+@@ -450,7 +450,7 @@
+ {
+ union {
+ double f;
+- u_int64_t i;
++ uint64_t i;
+ } u;
+ u.f = 0.0;
+ #ifdef SNDRV_LITTLE_ENDIAN
+@@ -463,7 +463,7 @@
+ {
+ union {
+ float f[2];
+- u_int64_t i;
++ uint64_t i;
+ } u;
+ u.f[0] = u.f[1] = 0.0;
+ #ifdef SNDRV_LITTLE_ENDIAN
+@@ -476,7 +476,7 @@
+ {
+ union {
+ double f;
+- u_int64_t i;
++ uint64_t i;
+ } u;
+ u.f = 0.0;
+ #ifdef SNDRV_LITTLE_ENDIAN
+@@ -509,10 +509,10 @@
+ * \param format Sample format
+ * \return silence 32 bit word
+ */
+-u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format)
++uint32_t snd_pcm_format_silence_32(snd_pcm_format_t format)
+ {
+ assert(snd_pcm_format_physical_width(format) <= 32);
+- return (u_int32_t)snd_pcm_format_silence_64(format);
++ return (uint32_t)snd_pcm_format_silence_64(format);
+ }
+
+ /**
+@@ -520,10 +520,10 @@
+ * \param format Sample format
+ * \return silence 16 bit word
+ */
+-u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format)
++uint16_t snd_pcm_format_silence_16(snd_pcm_format_t format)
+ {
+ assert(snd_pcm_format_physical_width(format) <= 16);
+- return (u_int16_t)snd_pcm_format_silence_64(format);
++ return (uint16_t)snd_pcm_format_silence_64(format);
+ }
+
+ /**
+@@ -531,10 +531,10 @@
+ * \param format Sample format
+ * \return silence 8 bit word
+ */
+-u_int8_t snd_pcm_format_silence(snd_pcm_format_t format)
++uint8_t snd_pcm_format_silence(snd_pcm_format_t format)
+ {
+ assert(snd_pcm_format_physical_width(format) <= 8);
+- return (u_int8_t)snd_pcm_format_silence_64(format);
++ return (uint8_t)snd_pcm_format_silence_64(format);
+ }
+
+ /**
+@@ -550,7 +550,7 @@
+ return 0;
+ switch (snd_pcm_format_physical_width(format)) {
+ case 4: {
+- u_int8_t silence = snd_pcm_format_silence_64(format);
++ uint8_t silence = snd_pcm_format_silence_64(format);
+ unsigned int samples1;
+ if (samples % 2 != 0)
+ return -EINVAL;
+@@ -559,13 +559,13 @@
+ break;
+ }
+ case 8: {
+- u_int8_t silence = snd_pcm_format_silence_64(format);
++ uint8_t silence = snd_pcm_format_silence_64(format);
+ memset(data, silence, samples);
+ break;
+ }
+ case 16: {
+- u_int16_t silence = snd_pcm_format_silence_64(format);
+- u_int16_t *pdata = (u_int16_t *)data;
++ uint16_t silence = snd_pcm_format_silence_64(format);
++ uint16_t *pdata = (uint16_t *)data;
+ if (! silence)
+ memset(data, 0, samples * 2);
+ else {
+@@ -575,8 +575,8 @@
+ break;
+ }
+ case 24: {
+- u_int32_t silence = snd_pcm_format_silence_64(format);
+- u_int8_t *pdata = (u_int8_t *)data;
++ uint32_t silence = snd_pcm_format_silence_64(format);
++ uint8_t *pdata = (uint8_t *)data;
+ if (! silence)
+ memset(data, 0, samples * 3);
+ else {
+@@ -595,8 +595,8 @@
+ break;
+ }
+ case 32: {
+- u_int32_t silence = snd_pcm_format_silence_64(format);
+- u_int32_t *pdata = (u_int32_t *)data;
++ uint32_t silence = snd_pcm_format_silence_64(format);
++ uint32_t *pdata = (uint32_t *)data;
+ if (! silence)
+ memset(data, 0, samples * 4);
+ else {
+@@ -606,8 +606,8 @@
+ break;
+ }
+ case 64: {
+- u_int64_t silence = snd_pcm_format_silence_64(format);
+- u_int64_t *pdata = (u_int64_t *)data;
++ uint64_t silence = snd_pcm_format_silence_64(format);
++ uint64_t *pdata = (uint64_t *)data;
+ if (! silence)
+ memset(data, 0, samples * 8);
+ else {
diff --git a/alsalib/alsa-lib_pcm_h.patch b/alsalib/alsa-lib_pcm_h.patch
@@ -0,0 +1,25 @@
+--- alsa-lib-1.0.25/include/pcm.h
++++ alsa-lib-1.0.25.patched/include/pcm.h
+@@ -33,6 +33,7 @@
+ extern "C" {
+ #endif
+
++#include <stdint.h>
+ /**
+ * \defgroup PCM PCM Interface
+ * See the \ref pcm page for more details.
+@@ -941,10 +942,10 @@
+ int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */
+ snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
+ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
+-u_int8_t snd_pcm_format_silence(snd_pcm_format_t format);
+-u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
+-u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
+-u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
++uint8_t snd_pcm_format_silence(snd_pcm_format_t format);
++uint16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
++uint32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
++uint64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
+ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
+
+ snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
diff --git a/alsalib/alsalib.mk b/alsalib/alsalib.mk
@@ -0,0 +1,31 @@
+TARG = alsalib
+
+<$mkbuild/mk.common-noinst
+
+alsalib:QV:
+ # disable tests.
+ printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > test/Makefile.in
+ #
+ rm -f src/compat/hsearch_r.c
+ touch src/compat/hsearch_r.c
+ sed -i 's,#if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_SOURCE),#if 0,' include/global.h
+ #
+ CC="$CC -static" ./configure \
+ --prefix="$prefix" \
+ --mandir="$ROOT/share/man" \
+ --disable-shared \
+ --disable-python \
+ --disable-old-symbols \
+ --without-versioned \
+ --disable-aload \
+ --disable-alisp \
+ --enable-static
+ # install lib for use as a dependency.
+ make -j$nprocs install \
+ V="1" LDFLAGS="-all-static $LDFLAGS" DESTDIR=`pwd`/lib
+ # remove .la files for now ?
+ find `pwd`/lib -iname "*.la" -exec rm {} \;
+
+install:QV:
+ make -j$nprocs install \
+ V="1" LDFLAGS="-all-static $LDFLAGS" DESTDIR="$ROOT"
diff --git a/alsalib/checksums b/alsalib/checksums
@@ -0,0 +1 @@
+3fa9160e001cf21ddc6332c3748f8aa27bd1b514616fd1a9993c34128fe99d07e2dfc5f1a9177e1c17456d1361496f90bf3552f940fd85c6ea5ac9bbc30fe8ce alsa-lib-1.0.27.2.tar.bz2
diff --git a/alsalib/depsinc.mk b/alsalib/depsinc.mk
@@ -0,0 +1,6 @@
+<$alsalib_DEPDIR/v.mk
+
+alsalib_libdir = $alsalib_DEPDIR/alsa-lib-$v/lib/lib
+alsalib_includedir = $alsalib_DEPDIR/alsa-lib-$v/lib/include
+DEPS_CFLAGS = $DEPS_CFLAGS -I${alsalib_includedir}
+DEPS_LDFLAGS = $DEPS_LDFLAGS -L${alsalib_libdir} -lasound
diff --git a/alsalib/mkfile b/alsalib/mkfile
@@ -0,0 +1,13 @@
+<$mkbuild/mk.3rdparty
+
+<v.mk
+src = alsa-lib-$v
+url = ftp://ftp.alsa-project.org/pub/lib/alsa-lib-$v.tar.bz2
+mkfile = ../alsalib.mk
+patches = \
+ ../alsa-lib_pcm_h.patch \
+ ../alsa-lib_mixed_types.patch \
+ ../alsa-lib_mips_atomic.patch \
+ ../alsa-lib_mask_inline.patch \
+ ../alsa-lib_kernel_off_t.patch \
+ ../alsa-lib-portable-mutex.patch
diff --git a/alsalib/v.mk b/alsalib/v.mk
@@ -0,0 +1 @@
+v = 1.0.27.2