Add alsa-lib, with wordexp fixes, closes #486
[openwrt/svn-archive/archive.git] / libs / alsa-lib / patches / 01-no_wordexp.patch
1 diff -urN alsa-lib-1.0.10/src/alisp/alisp.c alsa-lib-1.0.10.new/src/alisp/alisp.c
2 --- alsa-lib-1.0.10/src/alisp/alisp.c 2005-01-19 14:56:31.000000000 +0100
3 +++ alsa-lib-1.0.10.new/src/alisp/alisp.c 2006-10-09 16:20:51.000000000 +0200
4 @@ -30,7 +30,6 @@
5 #include <ctype.h>
6 #include <math.h>
7 #include <err.h>
8 -#include <wordexp.h>
9
10 #define alisp_seq_iterator alisp_object
11
12 diff -urN alsa-lib-1.0.10/src/conf.c alsa-lib-1.0.10.new/src/conf.c
13 --- alsa-lib-1.0.10/src/conf.c 2005-10-12 18:08:53.000000000 +0200
14 +++ alsa-lib-1.0.10.new/src/conf.c 2006-10-09 16:21:06.000000000 +0200
15 @@ -415,7 +415,6 @@
16
17
18 #include <stdarg.h>
19 -#include <wordexp.h>
20 #include <dlfcn.h>
21 #include <limits.h>
22 #include <sys/stat.h>
23 diff -urN alsa-lib-1.0.10/src/names.c alsa-lib-1.0.10.new/src/names.c
24 --- alsa-lib-1.0.10/src/names.c 2005-06-06 16:01:13.000000000 +0200
25 +++ alsa-lib-1.0.10.new/src/names.c 2006-10-09 16:21:16.000000000 +0200
26 @@ -31,7 +31,6 @@
27 */
28
29 #include <stdarg.h>
30 -#include <wordexp.h>
31 #include <dlfcn.h>
32 #include <limits.h>
33 #include <sys/stat.h>
34 diff -urN alsa-lib-1.0.10/src/pcm/Makefile.am alsa-lib-1.0.10.new/src/pcm/Makefile.am
35 --- alsa-lib-1.0.10/src/pcm/Makefile.am 2005-02-24 11:16:52.000000000 +0100
36 +++ alsa-lib-1.0.10.new/src/pcm/Makefile.am 2006-10-09 16:22:44.000000000 +0200
37 @@ -9,7 +9,7 @@
38 pcm_route.c pcm_mulaw.c pcm_alaw.c pcm_adpcm.c \
39 pcm_rate.c pcm_plug.c pcm_misc.c pcm_mmap.c pcm_multi.c \
40 pcm_shm.c pcm_file.c pcm_null.c pcm_share.c \
41 - pcm_meter.c pcm_hooks.c pcm_lfloat.c pcm_ladspa.c \
42 + pcm_meter.c pcm_hooks.c pcm_lfloat.c \
43 pcm_direct.c pcm_dmix.c pcm_dsnoop.c pcm_dshare.c \
44 pcm_asym.c pcm_iec958.c pcm_softvol.c pcm_symbols.c \
45 pcm_ioplug.c pcm_extplug.c
46 @@ -17,7 +17,7 @@
47 EXTRA_DIST = pcm_dmix_i386.c pcm_dmix_x86_64.c pcm_dmix_generic.c
48
49 noinst_HEADERS = pcm_local.h pcm_plugin.h mask.h mask_inline.h \
50 - interval.h interval_inline.h plugin_ops.h ladspa.h \
51 + interval.h interval_inline.h plugin_ops.h \
52 pcm_direct.h pcm_dmix_i386.h pcm_dmix_x86_64.h \
53 pcm_generic.h pcm_ext_parm.h
54
55 diff -urN alsa-lib-1.0.10/src/pcm/Makefile.in alsa-lib-1.0.10.new/src/pcm/Makefile.in
56 --- alsa-lib-1.0.10/src/pcm/Makefile.in 2005-11-16 15:44:41.000000000 +0100
57 +++ alsa-lib-1.0.10.new/src/pcm/Makefile.in 2006-10-09 16:19:45.000000000 +0200
58 @@ -158,7 +158,7 @@
59 pcm_route.c pcm_mulaw.c pcm_alaw.c pcm_adpcm.c \
60 pcm_rate.c pcm_plug.c pcm_misc.c pcm_mmap.c pcm_multi.c \
61 pcm_shm.c pcm_file.c pcm_null.c pcm_share.c \
62 - pcm_meter.c pcm_hooks.c pcm_lfloat.c pcm_ladspa.c \
63 + pcm_meter.c pcm_hooks.c pcm_lfloat.c \
64 pcm_direct.c pcm_dmix.c pcm_dsnoop.c pcm_dshare.c \
65 pcm_asym.c pcm_iec958.c pcm_softvol.c pcm_symbols.c \
66 pcm_ioplug.c pcm_extplug.c
67 @@ -167,7 +167,7 @@
68 EXTRA_DIST = pcm_dmix_i386.c pcm_dmix_x86_64.c pcm_dmix_generic.c
69
70 noinst_HEADERS = pcm_local.h pcm_plugin.h mask.h mask_inline.h \
71 - interval.h interval_inline.h plugin_ops.h ladspa.h \
72 + interval.h interval_inline.h plugin_ops.h \
73 pcm_direct.h pcm_dmix_i386.h pcm_dmix_x86_64.h \
74 pcm_generic.h pcm_ext_parm.h
75
76 @@ -188,7 +188,7 @@
77 pcm_mulaw.lo pcm_alaw.lo pcm_adpcm.lo pcm_rate.lo pcm_plug.lo \
78 pcm_misc.lo pcm_mmap.lo pcm_multi.lo pcm_shm.lo pcm_file.lo \
79 pcm_null.lo pcm_share.lo pcm_meter.lo pcm_hooks.lo \
80 - pcm_lfloat.lo pcm_ladspa.lo pcm_direct.lo pcm_dmix.lo \
81 + pcm_lfloat.lo pcm_direct.lo pcm_dmix.lo \
82 pcm_dsnoop.lo pcm_dshare.lo pcm_asym.lo pcm_iec958.lo \
83 pcm_softvol.lo pcm_symbols.lo pcm_ioplug.lo pcm_extplug.lo
84 libpcm_la_OBJECTS = $(am_libpcm_la_OBJECTS)
85 @@ -209,7 +209,6 @@
86 @AMDEP_TRUE@ ./$(DEPDIR)/pcm_hooks.Plo ./$(DEPDIR)/pcm_hw.Plo \
87 @AMDEP_TRUE@ ./$(DEPDIR)/pcm_iec958.Plo \
88 @AMDEP_TRUE@ ./$(DEPDIR)/pcm_ioplug.Plo \
89 -@AMDEP_TRUE@ ./$(DEPDIR)/pcm_ladspa.Plo \
90 @AMDEP_TRUE@ ./$(DEPDIR)/pcm_lfloat.Plo \
91 @AMDEP_TRUE@ ./$(DEPDIR)/pcm_linear.Plo \
92 @AMDEP_TRUE@ ./$(DEPDIR)/pcm_meter.Plo ./$(DEPDIR)/pcm_misc.Plo \
93 @@ -277,7 +276,6 @@
94 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_hw.Plo@am__quote@
95 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_iec958.Plo@am__quote@
96 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_ioplug.Plo@am__quote@
97 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_ladspa.Plo@am__quote@
98 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_lfloat.Plo@am__quote@
99 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_linear.Plo@am__quote@
100 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_meter.Plo@am__quote@
101 diff -urN alsa-lib-1.0.10/src/pcm/pcm.c alsa-lib-1.0.10.new/src/pcm/pcm.c
102 --- alsa-lib-1.0.10/src/pcm/pcm.c 2005-09-29 21:11:50.000000000 +0200
103 +++ alsa-lib-1.0.10.new/src/pcm/pcm.c 2006-10-09 16:20:34.000000000 +0200
104 @@ -1937,7 +1937,7 @@
105 }
106
107 static char *build_in_pcms[] = {
108 - "adpcm", "alaw", "copy", "dmix", "file", "hooks", "hw", "ladspa", "lfloat",
109 + "adpcm", "alaw", "copy", "dmix", "file", "hooks", "hw", "lfloat",
110 "linear", "meter", "mulaw", "multi", "null", "plug", "rate", "route", "share",
111 "shm", "dsnoop", "dshare", "asym", "iec958", "softvol", NULL
112 };
113 diff -urN alsa-lib-1.0.10/src/pcm/pcm_symbols.c alsa-lib-1.0.10.new/src/pcm/pcm_symbols.c
114 --- alsa-lib-1.0.10/src/pcm/pcm_symbols.c 2005-01-03 19:19:23.000000000 +0100
115 +++ alsa-lib-1.0.10.new/src/pcm/pcm_symbols.c 2006-10-09 16:20:15.000000000 +0200
116 @@ -39,7 +39,6 @@
117 extern const char *_snd_module_pcm_share;
118 extern const char *_snd_module_pcm_shm;
119 extern const char *_snd_module_pcm_lfloat;
120 -extern const char *_snd_module_pcm_ladspa;
121 extern const char *_snd_module_pcm_dmix;
122 extern const char *_snd_module_pcm_dsnoop;
123 extern const char *_snd_module_pcm_dshare;
124 @@ -65,7 +64,6 @@
125 &_snd_module_pcm_share,
126 &_snd_module_pcm_shm,
127 &_snd_module_pcm_lfloat,
128 - &_snd_module_pcm_ladspa,
129 &_snd_module_pcm_dmix,
130 &_snd_module_pcm_dsnoop,
131 &_snd_module_pcm_dshare,
132 diff -urN alsa-lib-1.0.10/src/userfile.c alsa-lib-1.0.10.new/src/userfile.c
133 --- alsa-lib-1.0.10/src/userfile.c 2005-05-24 16:14:29.000000000 +0200
134 +++ alsa-lib-1.0.10.new/src/userfile.c 2006-10-09 16:21:42.000000000 +0200
135 @@ -1,58 +1,31 @@
136 -/*
137 - * Get full filename
138 - * Copyright (c) 2003 by Jaroslav Kysela <perex@suse.cz>
139 - *
140 - * This library is free software; you can redistribute it and/or modify
141 - * it under the terms of the GNU Lesser General Public License as
142 - * published by the Free Software Foundation; either version 2.1 of
143 - * the License, or (at your option) any later version.
144 - *
145 - * This program is distributed in the hope that it will be useful,
146 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
147 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
148 - * GNU Lesser General Public License for more details.
149 - *
150 - * You should have received a copy of the GNU Lesser General Public
151 - * License along with this library; if not, write to the Free Software
152 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
153 +/* This is a mockup of alsalib's userfile.c without its functionality but
154 + * the same interface.
155 *
156 + * Maybe someone, someday wants to FIXME.
157 */
158
159 #include <string.h>
160 +#include <stdlib.h>
161 +#include <stdio.h>
162 #include <errno.h>
163 -#include <wordexp.h>
164 -#include <assert.h>
165
166 -/**
167 - * \brief Get the full file name
168 - * \param file The file name string to parse
169 - * \param result The pointer to store the resultant file name
170 - * \return 0 if successful, or a negative error code
171 - *
172 - * Parses the given file name with POSIX-Shell-like expansion and
173 - * stores the first matchine one. The returned string is strdup'ed.
174 - */
175 int snd_user_file(const char *file, char **result)
176 {
177 - wordexp_t we;
178 - int err;
179 -
180 - assert(file && result);
181 - err = wordexp(file, &we, WRDE_NOCMD);
182 - switch (err) {
183 - case WRDE_NOSPACE:
184 - return -ENOMEM;
185 - case 0:
186 - if (we.we_wordc == 1)
187 - break;
188 - /* fall thru */
189 - default:
190 - wordfree(&we);
191 - return -EINVAL;
192 + static int warned;
193 + if(getenv("BROKEN_USERFILE_SILENT") == NULL) {
194 + if(getenv("BROKEN_USERFILE_DEBUG") == NULL) {
195 + if(warned == 0)
196 + fprintf(stderr, "WARNING: this snd_user_file implementation won't behave as expected.\n"
197 + " set BROKEN_USERFILE_DEBUG to see all problems, or\n"
198 + " set BROKEN_USERFILE_SILENT to disable all warnings.\n");
199 + warned = 1;
200 + } else {
201 + fprintf(stderr, "WARNING(snd_user_file): '%s' has not been expanded\n", file);
202 + }
203 }
204 - *result = strdup(we.we_wordv[0]);
205 +
206 + *result = strdup(file);
207 if (*result == NULL)
208 return -ENOMEM;
209 - wordfree(&we);
210 return 0;
211 }