summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.am20
-rw-r--r--src/module-simple-protocol.c19
2 files changed, 33 insertions, 6 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 59e61568..fc7b3933 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,7 +24,8 @@ pkglib_LTLIBRARIES=libprotocol-simple.la module-simple-protocol-tcp.la \
libsocket-server.la module-pipe-sink.la libpstream.la libiochannel.la \
libpacket.la module-oss.la module-oss-mmap.la liboss.la libioline.la \
libcli.la module-cli.la libtokenizer.la libdynarray.la \
- module-simple-protocol-unix.la
+ module-simple-protocol-unix.la module-cli-protocol-tcp.la \
+ libprotocol-cli.la
polypaudio_SOURCES = idxset.c idxset.h \
queue.c queue.h \
@@ -82,16 +83,25 @@ libtokenizer_la_SOURCES = tokenizer.c tokenizer.h
libtokenizer_la_LDFLAGS = -avoid-version
libtokenizer_la_LIBADD = libdynarray.la
-module_simple_protocol_tcp_la_SOURCES = module-simple-protocol.c
-module_simple_protocol_tcp_la_CFLAGS = -DUSE_TCP_SOCKETS $(AM_CFLAGS)
+libprotocol_cli_la_SOURCES = protocol-cli.c protocol-cli.h
+libprotocol_cli_la_LDFLAGS = -avoid-version
+libprotocol_cli_la_LIBADD = libsocket-server.la libiochannel.la libcli.la
+
+module_simple_protocol_tcp_la_SOURCES = module-protocol-stub.c
+module_simple_protocol_tcp_la_CFLAGS = -DUSE_TCP_SOCKETS -DUSE_PROTOCOL_SIMPLE $(AM_CFLAGS)
module_simple_protocol_tcp_la_LDFLAGS = -module -avoid-version
module_simple_protocol_tcp_la_LIBADD = libprotocol-simple.la libiochannel.la
-module_simple_protocol_unix_la_SOURCES = module-simple-protocol.c
-module_simple_protocol_unix_la_CFLAGS = -DUSE_UNIX_SOCKETS $(AM_CFLAGS)
+module_simple_protocol_unix_la_SOURCES = module-protocol-stub.c
+module_simple_protocol_unix_la_CFLAGS = -DUSE_UNIX_SOCKETS -DUSE_PROTOCOL_SIMPLE $(AM_CFLAGS)
module_simple_protocol_unix_la_LDFLAGS = -module -avoid-version
module_simple_protocol_unix_la_LIBADD = libprotocol-simple.la libiochannel.la
+module_cli_protocol_tcp_la_SOURCES = module-protocol-stub.c
+module_cli_protocol_tcp_la_CFLAGS = -DUSE_TCP_SOCKETS -DUSE_PROTOCOL_CLI $(AM_CFLAGS)
+module_cli_protocol_tcp_la_LDFLAGS = -module -avoid-version
+module_cli_protocol_tcp_la_LIBADD = libprotocol-cli.la libiochannel.la
+
module_pipe_sink_la_SOURCES = module-pipe-sink.c
module_pipe_sink_la_LDFLAGS = -module -avoid-version
module_pipe_sink_la_LIBADD = libiochannel.la
diff --git a/src/module-simple-protocol.c b/src/module-simple-protocol.c
index c25ff06a..905594c6 100644
--- a/src/module-simple-protocol.c
+++ b/src/module-simple-protocol.c
@@ -3,7 +3,19 @@
#include "module.h"
#include "socket-server.h"
-#include "protocol-simple.h"
+
+#ifdef USE_PROTOCOL_SIMPLE
+ #include "protocol-simple.h"
+ #define protocol_free protcol_simple_free
+#else
+ #ifdef USE_PROTOCOL_CLI
+ #include "protocol-cli.h"
+ #define protocol_new protocol_cli_new
+ #define protocol_free protocol_cli_free
+ #else
+ #error "Broken build system"
+ #endif
+#endif
int module_init(struct core *c, struct module*m) {
struct socket_server *s;
@@ -17,7 +29,12 @@ int module_init(struct core *c, struct module*m) {
return -1;
#endif
+#ifdef USE_PROTOCOL_SIMPLE
m->userdata = protocol_simple_new(c, s, PROTOCOL_SIMPLE_PLAYBACK);
+#else
+ m->userdata = protocol_new(c, s);
+#endif
+
assert(m->userdata);
return 0;
}