alsa-lib - dep-waits on libasound2-dev
Petr Salinger
Petr.Salinger at t-systems.cz
Sat Nov 5 20:31:39 UTC 2005
Hi.
It looks like libasound2-dev have one of the biggest dep-waits listed on
http://unstable.buildd.net/buildd/kfreebsd_Dep-Wait.html
Will be usefull to have something like dummy package, which will provide it ?
I played litle bit with alsa-lib and with attached patch and
libtoolize --force
aclocal-1.7
autoconf
automake-1.7
it can be compiled on GNU/kFreeBSD.
It will not probably work at all with real hardware due to hacked ioctls.
But it may help for some other packages like kaffe.
What do you think about it ?
Petr
-------------- next part --------------
diff -urN alsa-lib-1.0.9.OLD/include/linux-asm-i386-ioctl.h alsa-lib-1.0.9/include/linux-asm-i386-ioctl.h
--- alsa-lib-1.0.9.OLD/include/linux-asm-i386-ioctl.h 1970-01-01 01:00:00.000000000 +0100
+++ alsa-lib-1.0.9/include/linux-asm-i386-ioctl.h 2005-11-05 16:20:07.000000000 +0100
@@ -0,0 +1,75 @@
+/* $Id: ioctl.h,v 1.5 1993/07/19 21:53:50 root Exp root $
+ *
+ * linux/ioctl.h for Linux by H.H. Bergman.
+ */
+
+#ifndef _ASMI386_IOCTL_H
+#define _ASMI386_IOCTL_H
+
+/* ioctl command encoding: 32 bits total, command in lower 16 bits,
+ * size of the parameter structure in the lower 14 bits of the
+ * upper 16 bits.
+ * Encoding the size of the parameter structure in the ioctl request
+ * is useful for catching programs compiled with old versions
+ * and to avoid overwriting user space outside the user buffer area.
+ * The highest 2 bits are reserved for indicating the ``access mode''.
+ * NOTE: This limits the max parameter size to 16kB -1 !
+ */
+
+/*
+ * The following is for compatibility across the various Linux
+ * platforms. The i386 ioctl numbering scheme doesn't really enforce
+ * a type field. De facto, however, the top 8 bits of the lower 16
+ * bits are indeed used as a type field, so we might just as well make
+ * this explicit here. Please be sure to use the decoding macros
+ * below from now on.
+ */
+#define _IOC_NRBITS 8
+#define _IOC_TYPEBITS 8
+#define _IOC_SIZEBITS 14
+#define _IOC_DIRBITS 2
+
+#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
+#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
+#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
+#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
+
+#define _IOC_NRSHIFT 0
+#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
+#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
+#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
+
+/*
+ * Direction bits.
+ */
+#define _IOC_NONE 0U
+#define _IOC_WRITE 1U
+#define _IOC_READ 2U
+
+#define _IOC(dir,type,nr,size) \
+ (((dir) << _IOC_DIRSHIFT) | \
+ ((type) << _IOC_TYPESHIFT) | \
+ ((nr) << _IOC_NRSHIFT) | \
+ ((size) << _IOC_SIZESHIFT))
+
+/* used to create numbers */
+#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
+#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
+#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
+#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
+
+/* used to decode ioctl numbers.. */
+#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
+#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
+#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
+#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
+
+/* ...and for the drivers/sound files... */
+
+#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
+#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
+#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
+#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
+#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
+
+#endif /* _ASMI386_IOCTL_H */
diff -urN alsa-lib-1.0.9.OLD/include/linux-asm-i386-types.h alsa-lib-1.0.9/include/linux-asm-i386-types.h
--- alsa-lib-1.0.9.OLD/include/linux-asm-i386-types.h 1970-01-01 01:00:00.000000000 +0100
+++ alsa-lib-1.0.9/include/linux-asm-i386-types.h 2005-11-05 16:20:28.000000000 +0100
@@ -0,0 +1,25 @@
+#ifndef _I386_TYPES_H
+#define _I386_TYPES_H
+
+#include <byteswap.h>
+
+#define __cpu_to_be32(x) bswap_32(x)
+#define __cpu_to_be16(x) bswap_16(x
+#define __cpu_to_le32(x) (x)
+#define __cpu_to_le16(x) (x)
+
+#define __be32_to_cpu(x) bswap_32(x)
+#define __be16_to_cpu(x) bswap_16(x
+#define __le32_to_cpu(x) (x)
+#define __le16_to_cpu(x) (x)
+
+typedef signed char __s8;
+typedef unsigned char __u8;
+
+typedef signed short __s16;
+typedef unsigned short __u16;
+
+typedef signed int __s32;
+typedef unsigned int __u32;
+
+#endif
diff -urN alsa-lib-1.0.9.OLD/include/sound/ainstr_fm.h alsa-lib-1.0.9/include/sound/ainstr_fm.h
--- alsa-lib-1.0.9.OLD/include/sound/ainstr_fm.h 2004-03-09 13:46:59.000000000 +0100
+++ alsa-lib-1.0.9/include/sound/ainstr_fm.h 2005-11-05 16:23:50.000000000 +0100
@@ -24,12 +24,8 @@
#ifndef __SOUND_AINSTR_FM_H
#define __SOUND_AINSTR_FM_H
-#ifndef __KERNEL__
-#define __KERNEL__
-#include <asm/types.h>
-#include <asm/byteorder.h>
-#undef __KERNEL__
-#endif
+#include <endian.h>
+#include "linux-asm-i386-types.h"
/*
* share types (share ID 1)
diff -urN alsa-lib-1.0.9.OLD/include/sound/ainstr_iw.h alsa-lib-1.0.9/include/sound/ainstr_iw.h
--- alsa-lib-1.0.9.OLD/include/sound/ainstr_iw.h 2004-03-09 13:47:00.000000000 +0100
+++ alsa-lib-1.0.9/include/sound/ainstr_iw.h 2005-11-05 16:20:07.000000000 +0100
@@ -24,12 +24,8 @@
#ifndef __SOUND_AINSTR_IW_H
#define __SOUND_AINSTR_IW_H
-#ifndef __KERNEL__
-#define __KERNEL__
-#include <asm/types.h>
-#include <asm/byteorder.h>
-#undef __KERNEL__
-#endif
+#include "linux-asm-i386-types.h"
+#include <endian.h>
/*
* share types (share ID 1)
diff -urN alsa-lib-1.0.9.OLD/include/sound/ainstr_simple.h alsa-lib-1.0.9/include/sound/ainstr_simple.h
--- alsa-lib-1.0.9.OLD/include/sound/ainstr_simple.h 2004-03-09 13:47:00.000000000 +0100
+++ alsa-lib-1.0.9/include/sound/ainstr_simple.h 2005-11-05 16:20:07.000000000 +0100
@@ -24,12 +24,8 @@
#ifndef __SOUND_AINSTR_SIMPLE_H
#define __SOUND_AINSTR_SIMPLE_H
-#ifndef __KERNEL__
-#define __KERNEL__
-#include <asm/types.h>
-#include <asm/byteorder.h>
-#undef __KERNEL__
-#endif
+#include "linux-asm-i386-types.h"
+#include <endian.h>
/*
* share types (share ID 1)
diff -urN alsa-lib-1.0.9.OLD/include/sound/asequencer.h alsa-lib-1.0.9/include/sound/asequencer.h
--- alsa-lib-1.0.9.OLD/include/sound/asequencer.h 2004-08-23 09:24:54.000000000 +0200
+++ alsa-lib-1.0.9/include/sound/asequencer.h 2005-11-05 16:20:07.000000000 +0100
@@ -22,10 +22,6 @@
#ifndef __SOUND_ASEQUENCER_H
#define __SOUND_ASEQUENCER_H
-#ifndef __KERNEL__
-#include <linux/ioctl.h>
-#endif
-
#include <sound/asound.h>
/** version of the sequencer */
diff -urN alsa-lib-1.0.9.OLD/include/sound/asound.h alsa-lib-1.0.9/include/sound/asound.h
--- alsa-lib-1.0.9.OLD/include/sound/asound.h 2005-05-19 18:59:05.000000000 +0200
+++ alsa-lib-1.0.9/include/sound/asound.h 2005-11-05 16:20:07.000000000 +0100
@@ -23,25 +23,14 @@
#ifndef __SOUND_ASOUND_H
#define __SOUND_ASOUND_H
-#if defined(LINUX) || defined(__LINUX__) || defined(__linux__)
-
-#include <linux/ioctl.h>
-
-#ifdef __KERNEL__
+#include <sys/time.h>
+#include <sys/types.h>
-#include <linux/types.h>
-#include <linux/time.h>
-#include <asm/byteorder.h>
+#include "linux-asm-i386-ioctl.h"
-#if __LITTLE_ENDIAN == 1234
-#define SNDRV_LITTLE_ENDIAN
-#elif __BIG_ENDIAN == 4321
-#define SNDRV_BIG_ENDIAN
-#else
-#error "Unsupported endian..."
-#endif
+#define EBADFD EBADF
+#define ESTRPIPE EPIPE
-#else /* !__KERNEL__ */
#include <endian.h>
#if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -52,14 +41,6 @@
#error "Unsupported endian..."
#endif
-#endif /* __KERNEL **/
-
-#endif /* LINUX */
-
-#ifndef __KERNEL__
-#include <sys/time.h>
-#include <sys/types.h>
-#endif
/*
* protocol version
diff -urN alsa-lib-1.0.9.OLD/src/async.c alsa-lib-1.0.9/src/async.c
--- alsa-lib-1.0.9.OLD/src/async.c 2004-05-06 20:56:53.000000000 +0200
+++ alsa-lib-1.0.9/src/async.c 2005-11-05 16:20:07.000000000 +0100
@@ -54,7 +54,9 @@
int fd;
struct list_head *i;
//assert(siginfo->si_code == SI_SIGIO);
+#if 0
fd = siginfo->si_fd;
+#endif
list_for_each(i, &snd_async_handlers) {
snd_async_handler_t *h = list_entry(i, snd_async_handler_t, glist);
if (h->fd == fd && h->callback)
diff -urN alsa-lib-1.0.9.OLD/src/instr/fm.c alsa-lib-1.0.9/src/instr/fm.c
--- alsa-lib-1.0.9.OLD/src/instr/fm.c 2005-05-24 16:14:31.000000000 +0200
+++ alsa-lib-1.0.9/src/instr/fm.c 2005-11-05 16:20:07.000000000 +0100
@@ -30,6 +30,7 @@
#include <sys/stat.h>
#include <stdio.h>
#include "local.h"
+#if 0
/* linux 2.6.9 workaround */
#include <linux/version.h>
#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,9)
@@ -43,7 +44,8 @@
#define __be16 __u16
#endif
#endif /* linux 2.6.9 workaround */
-#include <asm/byteorder.h>
+#endif
+#include <sys/types.h>
#include <sound/ainstr_fm.h>
/**
diff -urN alsa-lib-1.0.9.OLD/src/instr/iwffff.c alsa-lib-1.0.9/src/instr/iwffff.c
--- alsa-lib-1.0.9.OLD/src/instr/iwffff.c 2005-05-24 16:14:31.000000000 +0200
+++ alsa-lib-1.0.9/src/instr/iwffff.c 2005-11-05 16:20:07.000000000 +0100
@@ -31,6 +31,7 @@
#include <sys/stat.h>
#include <stdio.h>
#include "local.h"
+#if 0
/* linux 2.6.9 workaround */
#include <linux/version.h>
#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,9)
@@ -44,6 +45,7 @@
#define __be16 __u16
#endif
#endif /* linux 2.6.9 workaround */
+#endif
#include <sound/ainstr_iw.h>
/*
diff -urN alsa-lib-1.0.9.OLD/src/instr/simple.c alsa-lib-1.0.9/src/instr/simple.c
--- alsa-lib-1.0.9.OLD/src/instr/simple.c 2005-05-24 16:14:31.000000000 +0200
+++ alsa-lib-1.0.9/src/instr/simple.c 2005-11-05 16:20:07.000000000 +0100
@@ -31,6 +31,7 @@
#include <sys/stat.h>
#include <stdio.h>
#include "local.h"
+#if 0
/* linux 2.6.9 workaround */
#include <linux/version.h>
#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,9)
@@ -45,6 +46,8 @@
#endif
#endif /* linux 2.6.9 workaround */
#include <asm/byteorder.h>
+#endif
+
#include <sound/ainstr_simple.h>
/**
diff -urN alsa-lib-1.0.9.OLD/src/timer/timer_hw.c alsa-lib-1.0.9/src/timer/timer_hw.c
--- alsa-lib-1.0.9.OLD/src/timer/timer_hw.c 2005-05-15 16:47:03.000000000 +0200
+++ alsa-lib-1.0.9/src/timer/timer_hw.c 2005-11-05 16:20:08.000000000 +0100
@@ -92,7 +92,10 @@
}
if (sig < 0)
return 0;
- if (fcntl(fd, F_SETSIG, (long)sig) < 0) {
+#if 0
+ if (fcntl(fd, F_SETSIG, (long)sig) < 0)
+#endif
+ {
SYSERR("F_SETSIG failed");
return -errno;
}
More information about the Glibc-bsd-devel
mailing list