Commit fa2915fb38e69bace1a1481d192aaf966a841dbd

Thomas de Grivel 2022-03-07T09:36:26

fix compilation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
diff --git a/config.subr b/config.subr
index 3757f9f..08c082f 100644
--- a/config.subr
+++ b/config.subr
@@ -1,10 +1,8 @@
 #!/bin/sh
 set -e
 
-SRCDIR="$(dirname $0)"
-
 o_rule() {
-    $CC $CPPFLAGS -M "$1" || { echo "$1" | sed -e 's/^\(.*\)\.c$/\1.o: \1.c/'; }
+    "$CC" $CPPFLAGS $CFLAGS -M "$1" || { echo "$1" | sed -e 's/^\(.*\)\.c$/\1.o: \1.c/'; }
 }
 
 lo_rule() {
@@ -140,11 +138,67 @@ rtbuf_library() {
     done
 }
 
+check_glfw3() {
+    LOG=.lib.glfw3.config.log
+    OLD_CFLAGS=$CFLAGS
+    OLD_LIBS=$LIBS
+    CFLAGS="$CFLAGS $(pkg-config --cflags glfw3)"
+    LIBS="$LIBS $(pkg-config --libs glfw3)"
+    echo "$CC" $CPPFLAGS $CFLAGS "${LIB_SRCDIR}/glfw3/config.c" -o /dev/null ${LDFLAGS} ${LIBS} > $LOG
+    if   "$CC" $CPPFLAGS $CFLAGS "${LIB_SRCDIR}/glfw3/config.c" -o /dev/null ${LDFLAGS} ${LIBS} >> $LOG 2>&1; then
+        HAVE_GLFW3=Yes
+    else
+        HAVE_GLFW3=No
+        CFLAGS=$OLD_CFLAGS
+        LIBS=$OLD_LIBS
+    fi
+    echo "Checking library glfw3: $HAVE_GLFW3" >&2
+    echo "HAVE_GLFW3 = $HAVE_GLFW3" >> ${CONFIG_MK}
+}
+
+check_portaudio() {
+    LOG=.lib.portaudio.config.log
+    OLD_CFLAGS=$CFLAGS
+    OLD_LIBS=$LIBS
+    CFLAGS="$CFLAGS $(pkg-config --cflags portaudio-2.0)"
+    LIBS="$LIBS $(pkg-config --libs portaudio-2.0)"
+    echo "$CC" $CPPFLAGS $CFLAGS "${LIB_SRCDIR}/portaudio/config.c" -o /dev/null ${LDFLAGS} ${LIBS} > $LOG
+    if   "$CC" $CPPFLAGS $CFLAGS "${LIB_SRCDIR}/portaudio/config.c" -o /dev/null ${LDFLAGS} ${LIBS} >> $LOG 2>&1; then
+        HAVE_PORTAUDIO=Yes
+    else
+        HAVE_PORTAUDIO=No
+        CFLAGS=$OLD_CFLAGS
+        LIBS=$OLD_LIBS
+    fi
+    echo "Checking library portaudio: $HAVE_PORTAUDIO" >&2
+    echo "HAVE_PORTAUDIO = $HAVE_PORTAUDIO" >> ${CONFIG_MK}
+}
+
 check_sndio() {
-    if "$CC" $CPPFLAGS $CFLAGS -c "${SRCDIR}/lib/sndio/config.c" -o /dev/null; then
+    LOG=.lib.sndio.config.log
+    if "$CC" $CPPFLAGS $CFLAGS "${LIB_SRCDIR}/sndio/config.c" -o /dev/null ${LDFLAGS} -lsndio > $LOG 2>&1; then
         HAVE_SNDIO=Yes
     else
         HAVE_SNDIO=No
     fi
+    echo "Checking library sndio: $HAVE_SNDIO" >&2
     echo "HAVE_SNDIO = $HAVE_SNDIO" >> ${CONFIG_MK}
 }
+
+type_prog() {
+    TYPE_SRC="$1_type.c"
+    TYPE_PROG="$(c2prog "$TYPE_SRC")"
+    TYPE_H="${TYPE_PROG}.h"
+    echo >> ${CONFIG_MK}
+    prog_rule "$TYPE_SRC" >> ${CONFIG_MK}
+    echo "\t\${CC} \${CPPFLAGS} \${CFLAGS} $TYPE_SRC -o $TYPE_PROG" >> ${CONFIG_MK}
+    echo >> ${CONFIG_MK}
+    echo "${TYPE_H}: $TYPE_PROG" >> ${CONFIG_MK}
+    echo "\t./$TYPE_PROG > $TYPE_H" >> ${CONFIG_MK}
+    echo >> ${CONFIG_MK}
+    echo "CLEANFILES += $TYPE_PROG $TYPE_H" >> ${CONFIG_MK}
+    if ! test -f "${TYPE_H}"; then
+        touch "${TYPE_H}"
+    fi
+    TYPES="$TYPES $TYPE_H"
+}
diff --git a/lib/.lib.portaudio.config.log b/lib/.lib.portaudio.config.log
new file mode 100644
index 0000000..565966a
--- /dev/null
+++ b/lib/.lib.portaudio.config.log
@@ -0,0 +1 @@
+cc -DGL_SILENCE_DEPRECATION=1 -DNDEBUG -O3 -W -Wall -Werror -std=c89 -pedantic -I/opt/homebrew/Cellar/portaudio/19.7.0/include ./portaudio/config.c -o /dev/null -L/opt/homebrew/Cellar/portaudio/19.7.0/lib -lportaudio -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework CoreFoundation -framework CoreServices
diff --git a/lib/.lib.sndio.config.log b/lib/.lib.sndio.config.log
new file mode 100644
index 0000000..04b5090
--- /dev/null
+++ b/lib/.lib.sndio.config.log
@@ -0,0 +1,52 @@
+./sndio/config.c:1:10: error: 'sndio.h' file not found with <angled> include; use "quotes" instead
+#include <sndio.h>
+         ^~~~~~~~~
+         "sndio.h"
+In file included from ./sndio/config.c:1:
+./sndio/sndio.h:19:10: error: 'sndio.h' file not found with <angled> include; use "quotes" instead
+#include <sndio.h>
+         ^~~~~~~~~
+         "sndio.h"
+./sndio/sndio.h:22:28: error: declaration of 'struct sio_par' will not be visible outside of this function [-Werror,-Wvisibility]
+void print_sio_par (struct sio_par *par);
+                           ^
+./sndio/sndio.h:35:52: error: use of undeclared identifier 'RTBUF_SIGNAL_SAMPLES'
+typedef t_rtbuf_sndio_sample t_rtbuf_sndio_samples[RTBUF_SNDIO_SAMPLES];
+                                                   ^
+./sndio/sndio.h:32:27: note: expanded from macro 'RTBUF_SNDIO_SAMPLES'
+  (RTBUF_SNDIO_CHANNELS * RTBUF_SIGNAL_SAMPLES)
+                          ^
+./sndio/sndio.h:39:3: error: unknown type name 't_rtbuf_signal'
+  t_rtbuf_signal signal[RTBUF_SNDIO_CHANNELS];
+  ^
+./sndio/sndio.h:44:24: error: unknown type name 's_rtbuf'
+int rtbuf_sndio_input (s_rtbuf *rtb);
+                       ^
+./sndio/sndio.h:45:30: error: unknown type name 's_rtbuf'
+int rtbuf_sndio_input_start (s_rtbuf *rtb);
+                             ^
+./sndio/sndio.h:46:29: error: unknown type name 's_rtbuf'
+int rtbuf_sndio_input_stop (s_rtbuf *rtb);
+                            ^
+./sndio/sndio.h:50:18: error: field has incomplete type 'struct sio_par'
+  struct sio_par want;
+                 ^
+./sndio/sndio.h:50:10: note: forward declaration of 'struct sio_par'
+  struct sio_par want;
+         ^
+./sndio/sndio.h:51:18: error: field has incomplete type 'struct sio_par'
+  struct sio_par have;
+                 ^
+./sndio/sndio.h:50:10: note: forward declaration of 'struct sio_par'
+  struct sio_par want;
+         ^
+./sndio/sndio.h:64:25: error: unknown type name 's_rtbuf'
+int rtbuf_sndio_output (s_rtbuf *rtb);
+                        ^
+./sndio/sndio.h:65:31: error: unknown type name 's_rtbuf'
+int rtbuf_sndio_output_start (s_rtbuf *rtb);
+                              ^
+./sndio/sndio.h:66:30: error: unknown type name 's_rtbuf'
+int rtbuf_sndio_output_stop (s_rtbuf *rtb);
+                             ^
+13 errors generated.
diff --git a/lib/Makefile.am b/lib/Makefile.am
deleted file mode 100644
index 4fbcc6a..0000000
--- a/lib/Makefile.am
+++ /dev/null
@@ -1,86 +0,0 @@
-CLEANFILES =
-rtbuf_includedir = $(includedir)/rtbuf
-rtbuf_include_HEADERS =
-rtbuf_libdir = $(libdir)/rtbuf
-rtbuf_lib_LTLIBRARIES =
-lib_LTLIBRARIES =
-
-SUBDIRS = . signal dynamic glfw3 portaudio sndio synth # reverb
-
-# music
-
-music_type: music_type.c include/rtbuf/music.h
-	${CC} ${CFLAGS} ${CPPFLAGS} -o music_type music_type.c
-include/rtbuf/music_type.h: music_type
-	./music_type > include/rtbuf/music_type.h
-CLEANFILES += music_type include/rtbuf/music_type.h
-music.lo: include/rtbuf/music_type.h
-
-lib_LTLIBRARIES += librtbuf_music.la
-librtbuf_music_la_LIBADD = ${MUSIC_LIBS} ../librtbuf/librtbuf.la
-librtbuf_music_la_LDFLAGS = -no-undefined -module
-librtbuf_music_la_SOURCES = \
-	music.c
-
-rtbuf_include_HEADERS += \
-	include/rtbuf/music.h \
-	include/rtbuf/music_type.h
-
-# portaudio
-
-if ENABLE_PORTAUDIO
-portaudio_type: portaudio_type.c include/rtbuf/portaudio.h
-	${CC} ${CFLAGS} ${CPPFLAGS} -o portaudio_type portaudio_type.c
-include/rtbuf/portaudio_type.h: portaudio_type
-	./portaudio_type > include/rtbuf/portaudio_type.h
-CLEANFILES += portaudio_type include/rtbuf/portaudio_type.h
-all-local: include/rtbuf/portaudio_type.h
-endif # ENABLE_PORTAUDIO
-
-# reverb
-
-reverb_type: reverb_type.c include/rtbuf/reverb.h
-	${CC} ${CFLAGS} ${CPPFLAGS} -o reverb_type reverb_type.c
-include/rtbuf/reverb_type.h: reverb_type
-	./reverb_type > include/rtbuf/reverb_type.h
-CLEANFILES += reverb_type include/rtbuf/reverb_type.h
-reverb.lo: include/rtbuf/reverb_type.h
-
-# signal
-
-signal_type: signal_type.c include/rtbuf/signal.h
-	${CC} ${CFLAGS} ${CPPFLAGS} -o signal_type signal_type.c
-include/rtbuf/signal_type.h: signal_type
-	./signal_type > include/rtbuf/signal_type.h
-CLEANFILES += signal_type include/rtbuf/signal_type.h
-signal.lo: include/rtbuf/signal_type.h
-
-lib_LTLIBRARIES += librtbuf_signal.la
-librtbuf_signal_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf/librtbuf.la
-librtbuf_signal_la_LDFLAGS = -no-undefined -module
-librtbuf_signal_la_SOURCES = \
-	signal.c
-
-rtbuf_include_HEADERS += \
-	include/rtbuf/signal.h \
-	include/rtbuf/signal_type.h
-
-# sndio
-
-if ENABLE_SNDIO
-sndio_type: sndio_type.c include/rtbuf/sndio.h
-	${CC} ${CFLAGS} ${CPPFLAGS} -o sndio_type sndio_type.c
-include/rtbuf/sndio_type.h: sndio_type
-	./sndio_type > include/rtbuf/sndio_type.h
-CLEANFILES += sndio_type include/rtbuf/sndio_type.h
-all-local: include/rtbuf/sndio_type.h
-endif # ENABLE_SNDIO
-
-# synth
-
-synth_type: synth_type.c include/rtbuf/synth.h include/rtbuf/music_type.h include/rtbuf/signal_type.h
-	${CC} ${CFLAGS} ${CPPFLAGS} -o synth_type synth_type.c
-include/rtbuf/synth_type.h: synth_type
-	./synth_type > include/rtbuf/synth_type.h
-CLEANFILES += synth_type include/rtbuf/synth_type.h
-all-local: include/rtbuf/synth_type.h
diff --git a/lib/configure b/lib/configure
index 4ea44f3..4818503 100755
--- a/lib/configure
+++ b/lib/configure
@@ -3,7 +3,7 @@ set -e
 
 . ../config.subr
 
-TYPE_SOURCES="$(ls *_type.c | tr '\n' ' ')"
+LIB_SRCDIR="$(dirname $0)"
 
 SOURCES="$(ls *.c | grep -Ev '_type.c$' | tr '\n' ' ')"
 
@@ -18,43 +18,33 @@ else
     CFLAGS="-DNDEBUG -O3"
 fi
 CFLAGS="$CFLAGS -W -Wall -Werror -std=c89 -pedantic"
-CFLAGS="$CFLAGS $(pkg-config --cflags portaudio-2.0)"
-echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
-
-echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
 
 LIBS=""
-echo "LIBS = $LIBS" >> ${CONFIG_MK}
 
 check_sndio
 if ! test "x$HAVE_SNDIO" = "xYes"; then
     DIRS="$(echo "$DIRS" | grep -v sndio)"
 fi
 
-TYPES=
+check_portaudio
+if ! test "x$HAVE_PORTAUDIO" = "xYes"; then
+    DIRS="$(echo "$DIRS" | grep -v portaudio)"
+fi
 
-for TYPE_SRC in $TYPE_SOURCES; do
-    TYPE_PROG="$(c2prog "$TYPE_SRC")"
-    TYPE_H="${TYPE_PROG}.h"
-    TYPES="$TYPES $TYPE_H"
-    echo > "$TYPE_H"
-done
+echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
+echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
+echo "LIBS = $LIBS" >> ${CONFIG_MK}
 
-echo >> ${CONFIG_MK}
-echo "types:${TYPES}" >> ${CONFIG_MK}
+TYPES=
+type_prog music
+if test "x$HAVE_PORTAUDIO" = "xYes"; then
+    type_prog portaudio
+fi
+type_prog reverb
+type_prog signal
+type_prog synth
 
-for TYPE_SRC in $TYPE_SOURCES; do
-    TYPE_PROG="$(c2prog "$TYPE_SRC")"
-    TYPE_H="${TYPE_PROG}.h"
-    echo >> ${CONFIG_MK}
-    prog_rule "$TYPE_SRC" >> ${CONFIG_MK}
-    echo "\t\${CC} \${CPPFLAGS} \${CFLAGS} $TYPE_SRC -o $TYPE_PROG" >> ${CONFIG_MK}
-    echo >> ${CONFIG_MK}
-    echo "${TYPE_H}: $TYPE_PROG" >> ${CONFIG_MK}
-    echo "\t./$TYPE_PROG > $TYPE_H" >> ${CONFIG_MK}
-    echo >> ${CONFIG_MK}
-    echo "CLEANFILES += $TYPE_PROG $TYPE_H" >> ${CONFIG_MK}
-done
+echo "types:${TYPES}" >> ${CONFIG_MK}
 
 LIBRARIES=
 
@@ -101,9 +91,3 @@ done
 for DIR in $DIRS; do
     (cd $DIR && ./configure)
 done
-
-for TYPE_SRC in $TYPE_SOURCES; do
-    TYPE_PROG="$(c2prog "$TYPE_SRC")"
-    TYPE_H="${TYPE_PROG}.h"
-    rm "$TYPE_H"
-done
diff --git a/lib/glfw3/configure b/lib/glfw3/configure
index 50aa1c3..21edc40 100755
--- a/lib/glfw3/configure
+++ b/lib/glfw3/configure
@@ -8,6 +8,7 @@ SOURCES="$(ls *.c | tr '\n' ' ')"
 require_pkg_config
 
 CPPFLAGS="$CPPFLAGS $(pkg-config --cflags-only-I glfw3)"
+CPPFLAGS="$CPPFLAGS -DGL_SILENCE_DEPRECATION=1"
 echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
 
 if [ x"$DEBUG" = x"yes" ]; then
diff --git a/lib/glfw3/keyboard.c b/lib/glfw3/keyboard.c
index 00a966e..bcfdc38 100644
--- a/lib/glfw3/keyboard.c
+++ b/lib/glfw3/keyboard.c
@@ -231,7 +231,9 @@ void rtbuf_glfw3_keyboard_close (GLFWwindow *window)
 
 GLFWwindow * rtbuf_glfw3_keyboard_window (s_rtbuf *rtb)
 {
-  GLFWwindow *window = glfwCreateWindow(RTBUF_GLFW3_KEYBOARD_WIDTH,
+  GLFWwindow *window;
+  glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
+  window = glfwCreateWindow(RTBUF_GLFW3_KEYBOARD_WIDTH,
                                         RTBUF_GLFW3_KEYBOARD_HEIGHT,
                                         "rtbuf_glfw3_keyboard",
                                         NULL, NULL);
diff --git a/lib/portaudio/.lib.portaudio.config.log b/lib/portaudio/.lib.portaudio.config.log
new file mode 100644
index 0000000..ea82422
--- /dev/null
+++ b/lib/portaudio/.lib.portaudio.config.log
@@ -0,0 +1 @@
+cc -DGL_SILENCE_DEPRECATION=1 -DNDEBUG -O3 -W -Wall -Werror -std=c89 -pedantic -I/opt/homebrew/Cellar/portaudio/19.7.0/include ./../portaudio/config.c -o /dev/null -L/opt/homebrew/Cellar/portaudio/19.7.0/lib -lportaudio -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework CoreFoundation -framework CoreServices
diff --git a/lib/portaudio/Makefile.am b/lib/portaudio/Makefile.am
deleted file mode 100644
index 5bebc5d..0000000
--- a/lib/portaudio/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-if ENABLE_PORTAUDIO
-CLEANFILES =
-rtbuf_includedir = $(includedir)/rtbuf/portaudio
-rtbuf_include_HEADERS =
-rtbuf_libdir = $(libdir)/rtbuf/portaudio
-rtbuf_lib_LTLIBRARIES =
-
-rtbuf_lib_LTLIBRARIES += input.la
-input_la_LDFLAGS = -no-undefined -module -shared
-input_la_LIBADD = ${PORTAUDIO_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += output.la
-output_la_LDFLAGS = -no-undefined -module -shared
-output_la_LIBADD = ${PORTAUDIO_LIBS} ../librtbuf_signal.la
-endif
diff --git a/lib/portaudio/config.c b/lib/portaudio/config.c
new file mode 100644
index 0000000..23db5b2
--- /dev/null
+++ b/lib/portaudio/config.c
@@ -0,0 +1,6 @@
+#include <portaudio.h>
+
+int main ()
+{
+  return 0;
+}
diff --git a/lib/portaudio/configure b/lib/portaudio/configure
index c3a0a4f..447e4d5 100755
--- a/lib/portaudio/configure
+++ b/lib/portaudio/configure
@@ -3,12 +3,13 @@ set -e
 
 . ../../config.subr
 
-SOURCES="$(ls *.c | tr '\n' ' ')"
+SOURCES="input.c output.c"
+
+LIB_SRCDIR="$(dirname "$0")/.."
 
 require_pkg_config
 
-CPPFLAGS="$CPPFLAGS $(pkg-config --cflags-only-I portaudio-2.0)"
-echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
+CPPFLAGS="$CPPFLAGS"
 
 if [ x"$DEBUG" = x"yes" ]; then
     CFLAGS="-DDEBUG -O0 -ggdb"
@@ -16,13 +17,14 @@ else
     CFLAGS="-DNDEBUG -O3"
 fi
 CFLAGS="$CFLAGS -W -Wall -Werror -std=c89 -pedantic"
-CFLAGS="$CFLAGS $(pkg-config --cflags portaudio-2.0)"
-echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
 
-echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
+check_portaudio 
 
 LIBS="../../librtbuf/librtbuf.la ../librtbuf_signal.la"
-LIBS="$LIBS $(pkg-config --libs portaudio-2.0)"
+
+echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
+echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
+echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
 echo "LIBS = $LIBS" >> ${CONFIG_MK}
 
 rtbuf_library portaudio
diff --git a/lib/signal/Makefile.am b/lib/signal/Makefile.am
deleted file mode 100644
index e796580..0000000
--- a/lib/signal/Makefile.am
+++ /dev/null
@@ -1,61 +0,0 @@
-bandpass2_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-delay_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-equalizer10_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += flanger.la
-flanger_la_LDFLAGS = -no-undefined -module
-flanger_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += hipass.la
-hipass_la_LDFLAGS = -no-undefined -module
-hipass_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += hipass2.la
-hipass2_la_LDFLAGS = -no-undefined -module
-hipass2_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += hipass3.la
-hipass3_la_LDFLAGS = -no-undefined -module
-hipass3_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += hipass4.la
-hipass4_la_LDFLAGS = -no-undefined -module
-hipass4_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += hipass5.la
-hipass5_la_LDFLAGS = -no-undefined -module
-hipass5_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += lowpass.la
-lowpass_la_LDFLAGS = -no-undefined -module
-lowpass_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += lowpass2.la
-lowpass2_la_LDFLAGS = -no-undefined -module
-lowpass2_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += lowpass3.la
-lowpass3_la_LDFLAGS = -no-undefined -module
-lowpass3_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += lowpass4.la
-lowpass4_la_LDFLAGS = -no-undefined -module
-lowpass4_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += lowpass5.la
-lowpass5_la_LDFLAGS = -no-undefined -module
-lowpass5_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += sawtooth.la
-sawtooth_la_LDFLAGS = -no-undefined -module
-sawtooth_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += sinus.la
-sinus_la_LDFLAGS = -no-undefined -module
-sinus_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += square.la
-square_la_LDFLAGS = -no-undefined -module
-square_la_LIBADD = ${SIGNAL_LIBS} ../librtbuf_signal.la
-
-endif
diff --git a/lib/sndio/Makefile.am b/lib/sndio/Makefile.am
deleted file mode 100644
index 36f3f73..0000000
--- a/lib/sndio/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-if ENABLE_SNDIO
-
-CLEANFILES =
-rtbuf_includedir = $(includedir)/rtbuf/sndio
-rtbuf_include_HEADERS =
-rtbuf_libdir = $(libdir)/rtbuf/sndio
-rtbuf_lib_LTLIBRARIES =
-
-rtbuf_lib_LTLIBRARIES += input.la
-input_la_LDFLAGS = -no-undefined -module -shared
-input_la_LIBADD = ${SNDIO_LIBS} ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += output.la
-output_la_LDFLAGS = -no-undefined -module -shared
-output_la_LIBADD = ${SNDIO_LIBS} ../librtbuf_signal.la
-
-endif
diff --git a/lib/sndio/config.c b/lib/sndio/config.c
index 53c5fdf..ac503b3 100644
--- a/lib/sndio/config.c
+++ b/lib/sndio/config.c
@@ -1 +1 @@
-#include <stdio.h>
+#include <sndio.h>
diff --git a/lib/sndio/configure b/lib/sndio/configure
index 7495f7d..568b147 100755
--- a/lib/sndio/configure
+++ b/lib/sndio/configure
@@ -21,7 +21,7 @@ echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
 LIBS="-lsndio ../librtbuf_signal.la"
 echo "LIBS = $LIBS" >> ${CONFIG_MK}
 
-check_sndio()
+check_sndio
 
 if test "x$HAVE_SNDIO" = "xYes"; then
     rtbuf_library sndio
diff --git a/lib/sndio/sndio_type.c b/lib/sndio/sndio_type.c
deleted file mode 100644
index d6dcf44..0000000
--- a/lib/sndio/sndio_type.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <stdio.h>
-#include "../librtbuf/rtbuf.h"
-#include "sndio.h"
-
-int main ()
-{
-  printf("/* file generated by rtbuf_sndio_type */\n");
-  printf("#ifndef RTBUF_SNDIO_TYPE_H\n"
-         "#define RTBUF_SNDIO_TYPE_H\n"
-         "\n");
-  printf("#define RTBUF_SNDIO_SAMPLES_TYPE RTBUF_SNDIO_SAMPLE_TYPE"
-         " \"[%u]\"\n",
-         RTBUF_SNDIO_SAMPLES);
-  printf("#define RTBUF_SNDIO_OUTPUT_RESERVED_TYPE"
-         " \"char[%u]\"\n",
-         (unsigned int) RTBUF_SNDIO_OUTPUT_RESERVED_SIZE);
-  printf("\n"
-         "#endif\n");
-  return 0;
-}
diff --git a/lib/sndio_type.c b/lib/sndio_type.c
new file mode 100644
index 0000000..d6dcf44
--- /dev/null
+++ b/lib/sndio_type.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include "../librtbuf/rtbuf.h"
+#include "sndio.h"
+
+int main ()
+{
+  printf("/* file generated by rtbuf_sndio_type */\n");
+  printf("#ifndef RTBUF_SNDIO_TYPE_H\n"
+         "#define RTBUF_SNDIO_TYPE_H\n"
+         "\n");
+  printf("#define RTBUF_SNDIO_SAMPLES_TYPE RTBUF_SNDIO_SAMPLE_TYPE"
+         " \"[%u]\"\n",
+         RTBUF_SNDIO_SAMPLES);
+  printf("#define RTBUF_SNDIO_OUTPUT_RESERVED_TYPE"
+         " \"char[%u]\"\n",
+         (unsigned int) RTBUF_SNDIO_OUTPUT_RESERVED_SIZE);
+  printf("\n"
+         "#endif\n");
+  return 0;
+}
diff --git a/lib/synth/Makefile.am b/lib/synth/Makefile.am
deleted file mode 100644
index 73e81a7..0000000
--- a/lib/synth/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-CLEANFILES =
-rtbuf_includedir = $(includedir)/rtbuf/synth
-rtbuf_include_HEADERS =
-rtbuf_libdir = $(libdir)/rtbuf/synth
-rtbuf_lib_LTLIBRARIES =
-
-rtbuf_lib_LTLIBRARIES += adsr.la
-adsr_la_LDFLAGS = -no-undefined -module -shared
-adsr_la_LIBADD = ../librtbuf_signal.la
-
-rtbuf_lib_LTLIBRARIES += synth.la
-synth_la_LDFLAGS = -no-undefined -module -shared
-synth_la_LIBADD = ../librtbuf_music.la ../librtbuf_signal.la