diff --git a/config.subr b/config.subr
index 50e3954..3757f9f 100644
--- a/config.subr
+++ b/config.subr
@@ -1,7 +1,10 @@
#!/bin/sh
+set -e
+
+SRCDIR="$(dirname $0)"
o_rule() {
- $CC $CPPFLAGS -M "$1"
+ $CC $CPPFLAGS -M "$1" || { echo "$1" | sed -e 's/^\(.*\)\.c$/\1.o: \1.c/'; }
}
lo_rule() {
@@ -9,7 +12,7 @@ lo_rule() {
}
prog_rule() {
- o_rule "$1" | sed -e 's/[.]o:/:/'
+ { o_rule "$1" || exit 1; } | sed -e 's/[.]o:/:/'
}
c2prog() {
@@ -52,8 +55,10 @@ fi
echo "CC = $CC" >> ${CONFIG_MK}
if test -z "$LIBTOOL"; then
- if test -x /usr/local/bin/libtool; then
- LIBTOOL=/usr/local/bin/libtool
+ if test -x "$(which glibtool)"; then
+ LIBTOOL="$(which glibtool)"
+ elif test -x "$(which libtool)"; then
+ LIBTOOL="$(which libtool)"
else
LIBTOOL=libtool
fi
@@ -111,12 +116,12 @@ rtbuf_library() {
LIBRARIES=
+ echo sources: "'$SOURCES'"
for SRC in $SOURCES; do
SRC_LO="$(c2lo "$SRC")"
echo >> ${CONFIG_MK}
lo_rule "$SRC" >> ${CONFIG_MK}
echo "\t${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS} -c $SRC -o $SRC_LO" >> ${CONFIG_MK}
-
SRC_LA="$(c2la "$SRC")"
echo >> ${CONFIG_MK}
echo "$SRC_LA: $SRC_LO" >> ${CONFIG_MK}
@@ -134,3 +139,12 @@ rtbuf_library() {
echo "\t\${LIBTOOL} --tag=CC --mode=install \${INSTALL} -o \${OWNER} -g \${GROUP} -m 0755 $LIB \${RTBUF_LIBRARY_LIBDIR}/$LIB" >> ${CONFIG_MK}
done
}
+
+check_sndio() {
+ if "$CC" $CPPFLAGS $CFLAGS -c "${SRCDIR}/lib/sndio/config.c" -o /dev/null; then
+ HAVE_SNDIO=Yes
+ else
+ HAVE_SNDIO=No
+ fi
+ echo "HAVE_SNDIO = $HAVE_SNDIO" >> ${CONFIG_MK}
+}
diff --git a/gtk3/rtbuf_gtk3.c b/gtk3/rtbuf_gtk3.c
index ae2185e..cb3f953 100644
--- a/gtk3/rtbuf_gtk3.c
+++ b/gtk3/rtbuf_gtk3.c
@@ -29,8 +29,6 @@
#include "rtbuf_gtk3_widget.h"
#include "stack.h"
-extern int snprintf (char *, size_t, const char *, ...);
-
unsigned int g_next_id = 0;
GtkBuilder *builder = NULL;
diff --git a/lib/configure b/lib/configure
index 94d7e2b..4ea44f3 100755
--- a/lib/configure
+++ b/lib/configure
@@ -9,9 +9,6 @@ SOURCES="$(ls *.c | grep -Ev '_type.c$' | tr '\n' ' ')"
DIRS="$(ls -d */)"
-if test -d /usr/local/include; then
- CPPFLAGS="-I/usr/local/include"
-fi
CPPFLAGS="$CPPFLAGS"
echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
@@ -21,14 +18,19 @@ 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}
-LDFLAGS=""
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=
for TYPE_SRC in $TYPE_SOURCES; do
diff --git a/lib/dynamic/configure b/lib/dynamic/configure
index aaaf64f..9a1d489 100755
--- a/lib/dynamic/configure
+++ b/lib/dynamic/configure
@@ -22,7 +22,7 @@ echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
LDFLAGS=""
echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
-LIBS=""
+LIBS="../librtbuf_signal.la ../../librtbuf/librtbuf.la"
echo "LIBS = $LIBS" >> ${CONFIG_MK}
rtbuf_library dynamic
diff --git a/lib/glfw3/configure b/lib/glfw3/configure
index 58df28e..50aa1c3 100755
--- a/lib/glfw3/configure
+++ b/lib/glfw3/configure
@@ -7,9 +7,6 @@ SOURCES="$(ls *.c | tr '\n' ' ')"
require_pkg_config
-if test -d /usr/local/include; then
- CPPFLAGS="-I/usr/local/include"
-fi
CPPFLAGS="$CPPFLAGS $(pkg-config --cflags-only-I glfw3)"
echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
@@ -22,10 +19,13 @@ CFLAGS="$CFLAGS -W -Wall -Werror -std=c89 -pedantic"
CFLAGS="$CFLAGS $(pkg-config --cflags-only-other glfw3)"
echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
-LDFLAGS=""
echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
LIBS="$(pkg-config --libs glfw3)"
+if test "$(uname -s)" = "Darwin"; then
+ LIBS="$LIBS -framework OpenGL"
+fi
+LIBS="$LIBS ../../librtbuf/librtbuf.la ../librtbuf_music.la ../librtbuf_signal.la"
echo "LIBS = $LIBS" >> ${CONFIG_MK}
rtbuf_library glfw3
diff --git a/lib/portaudio/configure b/lib/portaudio/configure
index 969d39d..c3a0a4f 100755
--- a/lib/portaudio/configure
+++ b/lib/portaudio/configure
@@ -7,9 +7,6 @@ SOURCES="$(ls *.c | tr '\n' ' ')"
require_pkg_config
-if test -d /usr/local/include; then
- CPPFLAGS="-I/usr/local/include"
-fi
CPPFLAGS="$CPPFLAGS $(pkg-config --cflags-only-I portaudio-2.0)"
echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
@@ -19,13 +16,12 @@ else
CFLAGS="-DNDEBUG -O3"
fi
CFLAGS="$CFLAGS -W -Wall -Werror -std=c89 -pedantic"
-CFLAGS="$CFLAGS $(pkg-config --cflags-only-other portaudio-2.0)"
+CFLAGS="$CFLAGS $(pkg-config --cflags portaudio-2.0)"
echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
-LDFLAGS=""
echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
-LIBS="../librtbuf_signal.la"
+LIBS="../../librtbuf/librtbuf.la ../librtbuf_signal.la"
LIBS="$LIBS $(pkg-config --libs portaudio-2.0)"
echo "LIBS = $LIBS" >> ${CONFIG_MK}
diff --git a/lib/reverb/configure b/lib/reverb/configure
index 1108d48..cd848e9 100755
--- a/lib/reverb/configure
+++ b/lib/reverb/configure
@@ -5,9 +5,6 @@ set -e
SOURCES="$(ls *.c | tr '\n' ' ')"
-if test -d /usr/local/include; then
- CPPFLAGS="-I/usr/local/include"
-fi
CPPFLAGS="$CPPFLAGS"
echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
@@ -19,10 +16,9 @@ fi
CFLAGS="$CFLAGS -W -Wall -Werror -std=c89 -pedantic"
echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
-LDFLAGS=""
echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
-LIBS=""
+LIBS="../../librtbuf/librtbuf.la ../librtbuf_signal.la"
echo "LIBS = $LIBS" >> ${CONFIG_MK}
rtbuf_library reverb
diff --git a/lib/signal/configure b/lib/signal/configure
index ae9f7f7..2df4b72 100755
--- a/lib/signal/configure
+++ b/lib/signal/configure
@@ -22,7 +22,7 @@ echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
LDFLAGS=""
echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
-LIBS="../librtbuf_signal.la -lm"
+LIBS="../../librtbuf/librtbuf.la ../librtbuf_signal.la -lm"
echo "LIBS = $LIBS" >> ${CONFIG_MK}
rtbuf_library signal
diff --git a/lib/sndio.c b/lib/sndio.c
deleted file mode 100644
index d6ed601..0000000
--- a/lib/sndio.c
+++ /dev/null
@@ -1,31 +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 <sndio.h>
-#include <stdio.h>
-#include <strings.h>
-#include "../librtbuf/rtbuf.h"
-#include "../librtbuf/lib.h"
-#include "signal.h"
-#include "signal_type.h"
-#include "sndio.h"
-#include "sndio_type.h"
-
-void print_sio_par (struct sio_par *par)
-{
- printf("#<sio_par bits=%i sig=%i rchan=%i pchan=%i rate=%i>",
- par->bits, par->sig, par->rchan, par->pchan, par->rate);
-}
diff --git a/lib/sndio.h b/lib/sndio.h
deleted file mode 100644
index 0f296fd..0000000
--- a/lib/sndio.h
+++ /dev/null
@@ -1,68 +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.
- */
-#ifndef RTBUF_SNDIO_H
-#define RTBUF_SNDIO_H
-
-#include <sndio.h>
-#include "signal.h"
-
-void print_sio_par (struct sio_par *par);
-
-enum {
- RTBUF_SNDIO_LEFT = 0,
- RTBUF_SNDIO_RIGHT,
- RTBUF_SNDIO_CHANNELS
-};
-
-#define RTBUF_SNDIO_SAMPLE_TYPE "short"
-#define RTBUF_SNDIO_SAMPLES \
- (RTBUF_SNDIO_CHANNELS * RTBUF_SIGNAL_SAMPLES)
-
-typedef short t_rtbuf_sndio_sample;
-typedef t_rtbuf_sndio_sample t_rtbuf_sndio_samples[RTBUF_SNDIO_SAMPLES];
-
-#pragma pack(push,1)
-typedef struct rtbuf_sndio_input_data {
- t_rtbuf_signal signal[RTBUF_SNDIO_CHANNELS];
- t_rtbuf_sndio_samples samples;
-} s_rtbuf_sndio_input_data;
-#pragma pack(pop)
-
-int rtbuf_sndio_input (s_rtbuf *rtb);
-int rtbuf_sndio_input_start (s_rtbuf *rtb);
-int rtbuf_sndio_input_stop (s_rtbuf *rtb);
-
-typedef struct rtbuf_sndio_output_reserved {
- struct sio_hdl *sio_hdl;
- struct sio_par want;
- struct sio_par have;
-} s_rtbuf_sndio_output_reserved;
-
-#pragma pack(push,1)
-typedef struct rtbuf_sndio_output_data {
- t_rtbuf_sndio_samples samples;
- s_rtbuf_sndio_output_reserved reserved;
-} s_rtbuf_sndio_output_data;
-#pragma pack(pop)
-
-#define RTBUF_SNDIO_OUTPUT_RESERVED_SIZE \
- sizeof(s_rtbuf_sndio_output_reserved)
-
-int rtbuf_sndio_output (s_rtbuf *rtb);
-int rtbuf_sndio_output_start (s_rtbuf *rtb);
-int rtbuf_sndio_output_stop (s_rtbuf *rtb);
-
-#endif
diff --git a/lib/sndio/config.c b/lib/sndio/config.c
new file mode 100644
index 0000000..53c5fdf
--- /dev/null
+++ b/lib/sndio/config.c
@@ -0,0 +1 @@
+#include <stdio.h>
diff --git a/lib/sndio/configure b/lib/sndio/configure
index fd0b467..7495f7d 100755
--- a/lib/sndio/configure
+++ b/lib/sndio/configure
@@ -5,9 +5,6 @@ set -e
SOURCES="$(ls *.c | tr '\n' ' ')"
-if test -d /usr/local/include; then
- CPPFLAGS="-I/usr/local/include"
-fi
CPPFLAGS="$CPPFLAGS"
echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
@@ -19,10 +16,15 @@ fi
CFLAGS="$CFLAGS -W -Wall -Werror -std=c89 -pedantic"
echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
-LDFLAGS=""
echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
LIBS="-lsndio ../librtbuf_signal.la"
echo "LIBS = $LIBS" >> ${CONFIG_MK}
-rtbuf_library sndio
+check_sndio()
+
+if test "x$HAVE_SNDIO" = "xYes"; then
+ rtbuf_library sndio
+else
+ echo "libraries:" >> ${CONFIG_MK}
+fi
diff --git a/lib/sndio/sndio.c b/lib/sndio/sndio.c
new file mode 100644
index 0000000..d6ed601
--- /dev/null
+++ b/lib/sndio/sndio.c
@@ -0,0 +1,31 @@
+/*
+ * 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 <sndio.h>
+#include <stdio.h>
+#include <strings.h>
+#include "../librtbuf/rtbuf.h"
+#include "../librtbuf/lib.h"
+#include "signal.h"
+#include "signal_type.h"
+#include "sndio.h"
+#include "sndio_type.h"
+
+void print_sio_par (struct sio_par *par)
+{
+ printf("#<sio_par bits=%i sig=%i rchan=%i pchan=%i rate=%i>",
+ par->bits, par->sig, par->rchan, par->pchan, par->rate);
+}
diff --git a/lib/sndio/sndio.h b/lib/sndio/sndio.h
new file mode 100644
index 0000000..0f296fd
--- /dev/null
+++ b/lib/sndio/sndio.h
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+#ifndef RTBUF_SNDIO_H
+#define RTBUF_SNDIO_H
+
+#include <sndio.h>
+#include "signal.h"
+
+void print_sio_par (struct sio_par *par);
+
+enum {
+ RTBUF_SNDIO_LEFT = 0,
+ RTBUF_SNDIO_RIGHT,
+ RTBUF_SNDIO_CHANNELS
+};
+
+#define RTBUF_SNDIO_SAMPLE_TYPE "short"
+#define RTBUF_SNDIO_SAMPLES \
+ (RTBUF_SNDIO_CHANNELS * RTBUF_SIGNAL_SAMPLES)
+
+typedef short t_rtbuf_sndio_sample;
+typedef t_rtbuf_sndio_sample t_rtbuf_sndio_samples[RTBUF_SNDIO_SAMPLES];
+
+#pragma pack(push,1)
+typedef struct rtbuf_sndio_input_data {
+ t_rtbuf_signal signal[RTBUF_SNDIO_CHANNELS];
+ t_rtbuf_sndio_samples samples;
+} s_rtbuf_sndio_input_data;
+#pragma pack(pop)
+
+int rtbuf_sndio_input (s_rtbuf *rtb);
+int rtbuf_sndio_input_start (s_rtbuf *rtb);
+int rtbuf_sndio_input_stop (s_rtbuf *rtb);
+
+typedef struct rtbuf_sndio_output_reserved {
+ struct sio_hdl *sio_hdl;
+ struct sio_par want;
+ struct sio_par have;
+} s_rtbuf_sndio_output_reserved;
+
+#pragma pack(push,1)
+typedef struct rtbuf_sndio_output_data {
+ t_rtbuf_sndio_samples samples;
+ s_rtbuf_sndio_output_reserved reserved;
+} s_rtbuf_sndio_output_data;
+#pragma pack(pop)
+
+#define RTBUF_SNDIO_OUTPUT_RESERVED_SIZE \
+ sizeof(s_rtbuf_sndio_output_reserved)
+
+int rtbuf_sndio_output (s_rtbuf *rtb);
+int rtbuf_sndio_output_start (s_rtbuf *rtb);
+int rtbuf_sndio_output_stop (s_rtbuf *rtb);
+
+#endif
diff --git a/lib/sndio/sndio_type.c b/lib/sndio/sndio_type.c
new file mode 100644
index 0000000..d6dcf44
--- /dev/null
+++ b/lib/sndio/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/sndio_type.c b/lib/sndio_type.c
deleted file mode 100644
index d6dcf44..0000000
--- a/lib/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/synth/configure b/lib/synth/configure
index 18015d1..2f1d9f5 100755
--- a/lib/synth/configure
+++ b/lib/synth/configure
@@ -22,7 +22,7 @@ echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
LDFLAGS=""
echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
-LIBS=""
+LIBS="../../librtbuf/librtbuf.la ../librtbuf_music.la ../librtbuf_signal.la"
echo "LIBS = $LIBS" >> ${CONFIG_MK}
rtbuf_library synth
diff --git a/librtbuf/configure b/librtbuf/configure
index 13d7784..15260e5 100755
--- a/librtbuf/configure
+++ b/librtbuf/configure
@@ -11,9 +11,6 @@ echo "SOURCES = $SOURCES" >> ${CONFIG_MK}
OBJECTS="$(c2lo "$SOURCES")"
echo "OBJECTS = $OBJECTS" >> ${CONFIG_MK}
-if test -d /usr/local/include; then
- CPPFLAGS="-I/usr/local/include"
-fi
CPPFLAGS="$CPPFLAGS -DRTBUF_LIBDIR=\\\"${RTBUF_LIBDIR}\\\" -DVER=\\\"${VER}\\\""
echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
@@ -25,7 +22,9 @@ fi
CFLAGS="$CFLAGS -W -Wall -Werror -std=c89 -pedantic"
echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
-LDFLAGS=""
+if [[ -d /opt/homebrew/lib ]]; then
+ LDFLAGS="$LDFLAGS -L/opt/homebrew/lib -lSystem"
+fi
echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
LIBS=""
diff --git a/librtbuf/rtbuf_type.c b/librtbuf/rtbuf_type.c
index 5e24911..e07f7e2 100644
--- a/librtbuf/rtbuf_type.c
+++ b/librtbuf/rtbuf_type.c
@@ -22,8 +22,6 @@
#include "type.h"
#include "symbol.h"
-extern int snprintf (char *, size_t, const char *, ...);
-
s_data_type g_rtbuf_data_type_type = {
sizeof(s_rtbuf_type) * 8,
DATA_TYPE_BITS