summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2008-08-29 14:34:17 (GMT)
committer Jaromil <jaromil@dyne.org>2008-08-29 14:34:17 (GMT)
commitd87463893e7926e9d4b10b4d0e83747504a575bc (patch)
treee55f03ce50b3864729018af01acbe74cb1e2cf65
parent119f192fc883478c9dce792753faf90964213552 (diff)
refactoring of the build system to produce multiple binaries:
this way single components can drop library dependencies, which makes it better for embedded installations, for instance having the synced player without installing X
-rw-r--r--Makefile52
-rw-r--r--Makefile.player35
-rw-r--r--Makefile.playlist39
-rw-r--r--Makefile.xmlrpc43
-rw-r--r--cmdline.cpp52
-rwxr-xr-xcompile.sh46
-rw-r--r--gui.cpp8
-rw-r--r--xmlrpc.cpp4
-rw-r--r--xmlrpc.h3
9 files changed, 210 insertions, 72 deletions
diff --git a/Makefile b/Makefile
index 8c981ba..422ec59 100644
--- a/Makefile
+++ b/Makefile
@@ -1,51 +1,7 @@
-# We don't need kludgy automatizations here,
-# let's use a simple Makefile.
-# Just tweak the values below to fix your paths
-#
-# $Id: Makefile 60 2004-11-12 15:40:18Z jaromil $
+all:
+ # to build run the compile.sh script
-CPP = g++
-LINKER = ld
-
-GTKFLAGS = `pkg-config --cflags gtk+-2.0`
-GTKLIBS = `pkg-config --libs gtk+-2.0`
-
-# debugging flags:
-#CPPFLAGS = -I. -Ixmlrpc++ -Wall -g -ggdb $(GTKFLAGS)
-# optimized flags:
-CPPFLAGS = -I. -Ixmlrpc++ -Wall -O2 -fomit-frame-pointer -ffast-math
-
-
-
-
-LIBS = xmlrpc++/libxmlrpc++.a -lpthread -lssl
-
-IVYSYNC_OBJ = decoder.o thread.o linklist.o utils.o cmdline.o xmlrpc.o
-
-all: xmlrpc ivysync ivysync-nox
-
-xmlrpc:
- cd xmlrpc++ && $(MAKE)
-
-ivysync: $(IVYSYNC_OBJ) gui.o
- $(CPP) $(CPPFLAGS) -o ivysync $(IVYSYNC_OBJ) $(LIBS) $(GTKLIBS)
-
-ivysync-nox: $(IVYSYNC_OBJ)
- $(CPP) $(CPPFLAGS) -o ivysync-nox $(IVYSYNC_OBJ) $(LIBS)
-
-
-#make clean
clean:
- rm -rf *.o *~ ivysync
-
-install: ivysync
- install ivysync /usr/local/bin
-
-# generic make rules
-#%: %.c
-# $(CC) $(CFLAGS) -o $@ $< $(LIBS)
-#%.o: %.c
-# $(CC) $(CFLAGS) -c -o $@ $<
-
-
+ rm -f *.a *.o *~
+ rm -f ivysync-nox ivysync-rpc ivysync-gtk xmlrpc++/*.o xmlrpc++/*.a
diff --git a/Makefile.player b/Makefile.player
new file mode 100644
index 0000000..bfe5fb0
--- /dev/null
+++ b/Makefile.player
@@ -0,0 +1,35 @@
+# We don't need kludgy automatizations here,
+# let's use a simple Makefile.
+# Just tweak the values below to fix your paths
+#
+# $Id: Makefile 60 2004-11-12 15:40:18Z jaromil $
+
+
+CPP = g++
+LINKER = ld
+
+CPPFLAGS = -I. -Wall -O2 -fomit-frame-pointer -ffast-math
+
+
+IVYSYNC_OBJ = decoder.o thread.o linklist.o utils.o cmdline.o
+
+all: ivysync-nox
+
+ivysync-nox: $(IVYSYNC_OBJ)
+ $(CPP) $(CPPFLAGS) -o ivysync-nox $(IVYSYNC_OBJ) -lpthread
+ rm -f *.o
+
+#make clean
+clean:
+ rm -rf *.o *~ ivysync-nox
+
+install: ivysync-nox
+ install ivysync-nox /usr/local/bin
+
+# generic make rules
+#%: %.c
+# $(CC) $(CFLAGS) -o $@ $< $(LIBS)
+#%.o: %.c
+# $(CC) $(CFLAGS) -c -o $@ $<
+
+
diff --git a/Makefile.playlist b/Makefile.playlist
new file mode 100644
index 0000000..8aea835
--- /dev/null
+++ b/Makefile.playlist
@@ -0,0 +1,39 @@
+# We don't need kludgy automatizations here,
+# let's use a simple Makefile.
+# Just tweak the values below to fix your paths
+#
+# $Id: Makefile 60 2004-11-12 15:40:18Z jaromil $
+
+
+CPP = g++
+LINKER = ld
+
+GTKFLAGS = -DWITH_GUI `pkg-config --cflags gtk+-2.0`
+GTKLIBS = `pkg-config --libs gtk+-2.0`
+
+# debugging flags:
+#CPPFLAGS = -I. -Ixmlrpc++ -Wall -g -ggdb $(GTKFLAGS)
+# optimized flags:
+CPPFLAGS = -I. -Wall -O2 -fomit-frame-pointer -ffast-math $(GTKFLAGS)
+
+
+
+
+IVYSYNC_OBJ = decoder.o thread.o linklist.o utils.o cmdline.o gui.o
+
+all: ivysync-gtk
+
+ivysync-gtk: $(IVYSYNC_OBJ)
+ $(CPP) $(CPPFLAGS) -o ivysync-gtk $(IVYSYNC_OBJ) $(GTKLIBS) -lpthread
+ rm -f *.o
+
+install: ivysync-gtk
+ install ivysync-gtk /usr/local/bin
+
+# generic make rules
+#%: %.c
+# $(CC) $(CFLAGS) -o $@ $< $(LIBS)
+#%.o: %.c
+# $(CC) $(CFLAGS) -c -o $@ $<
+
+
diff --git a/Makefile.xmlrpc b/Makefile.xmlrpc
new file mode 100644
index 0000000..52ac2ef
--- /dev/null
+++ b/Makefile.xmlrpc
@@ -0,0 +1,43 @@
+# We don't need kludgy automatizations here,
+# let's use a simple Makefile.
+# Just tweak the values below to fix your paths
+#
+# $Id: Makefile 60 2004-11-12 15:40:18Z jaromil $
+
+
+CPP = g++
+LINKER = ld
+
+
+# debugging flags:
+#CPPFLAGS = -I. -Ixmlrpc++ -Wall -g -ggdb $(GTKFLAGS)
+# optimized flags:
+
+CPPFLAGS = -I. -Ixmlrpc++ -Wall -O2 -fomit-frame-pointer -ffast-math -DWITH_XMLRPC
+
+
+
+
+LIBS = xmlrpc++/libxmlrpc++.a -lpthread -lssl
+
+IVYSYNC_OBJ = decoder.o thread.o linklist.o utils.o cmdline.o xmlrpc.o
+
+all: xmlrpc ivysync-rpc
+
+xmlrpc:
+ cd xmlrpc++ && $(MAKE)
+
+ivysync-rpc: $(IVYSYNC_OBJ)
+ $(CPP) $(CPPFLAGS) -o ivysync-rpc $(IVYSYNC_OBJ) $(LIBS)
+ rm -f *.o
+
+install: ivysync-rpc
+ install ivysync-rpc /usr/local/bin
+
+# generic make rules
+#%: %.c
+# $(CC) $(CFLAGS) -o $@ $< $(LIBS)
+#%.o: %.c
+# $(CC) $(CFLAGS) -c -o $@ $<
+
+
diff --git a/cmdline.cpp b/cmdline.cpp
index 61519f8..ff2fad8 100644
--- a/cmdline.cpp
+++ b/cmdline.cpp
@@ -31,10 +31,13 @@
#include <getopt.h>
#include <errno.h>
#include <signal.h>
+#include <string.h>
#include <decoder.h>
+#ifdef WITH_XMLRPC
#include <xmlrpc.h>
+#endif
#ifdef WITH_GUI
#include <gui.h>
@@ -59,11 +62,12 @@ Linklist decoders;
Gui *gui;
#endif
+#ifdef WITH_XMLRPC
// xmlrpc interface
XmlRpcServer *xmlrpc;
-
// Threaded daemon
IvySyncDaemon *ivydaemon;
+#endif
const char *help =
"Usage: ivysync [-hsDgt] [ -d /dev/video16 [ -p playmode files ] ]\n"
@@ -86,7 +90,9 @@ const struct option long_options[] = {
{ "device", required_argument, NULL, 'd'},
{ "scan", no_argument, NULL, 's'},
{ "buffer", required_argument, NULL, 'b'},
+#ifdef WITH_XMLRPC
{ "xmlrpc", required_argument, NULL, 'x'},
+#endif
{ "playmode", required_argument, NULL, 'p'},
#ifdef WITH_GUI
{ "gui", no_argument, NULL, 'g'},
@@ -322,6 +328,7 @@ int main(int argc, char **argv) {
#endif
+#ifdef WITH_XMLRPC
////////////////////////////////
/// setup the XMLRPC interface
if(rpcdaemon) {
@@ -351,9 +358,8 @@ int main(int argc, char **argv) {
A("XMLRPC daemon listening for commands on port %u",
rpcdaemonport);
}
-
////////////////////////////////
-
+#endif
////////////////////////////////
@@ -389,6 +395,7 @@ int main(int argc, char **argv) {
+#ifdef WITH_XMLRPC
if(rpcdaemon) {
// run as a daemon: quit only when requested
@@ -397,24 +404,27 @@ int main(int argc, char **argv) {
jsleep(0,10);
}
- } else {
-
- // run until all the channels are at the end
- int still_running = decoders.len();
-
- while(still_running) {
-
- still_running = 0;
- dec = (Decoder*)decoders.begin();
-
- while(dec) {
-
- if(dec->playing) still_running++;
-
- jsleep(1,0); // 1 second delay check
-
- dec = (Decoder*)dec->next;
- }
+ N("quit!");
+ exit(1);
+ }
+#endif
+
+
+ // run until all the channels are at the end
+ int still_running = decoders.len();
+
+ while(still_running) {
+
+ still_running = 0;
+ dec = (Decoder*)decoders.begin();
+
+ while(dec) {
+
+ if(dec->playing) still_running++;
+
+ jsleep(1,0); // 1 second delay check
+
+ dec = (Decoder*)dec->next;
}
}
diff --git a/compile.sh b/compile.sh
new file mode 100755
index 0000000..9b82ae7
--- /dev/null
+++ b/compile.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+echo
+echo
+
+echo "IvySync consists of different applications to manipulate and play"
+echo "syncstarted videos on multiple channels. First make sure all your"
+echo "dependencies are in place (-devel packages on your distribution)"
+echo "then choose below what to compile:"
+
+echo
+
+echo "1 - Standalone player - playback configured playlists"
+echo "2 - Playlist editor - graphical interface for playlists"
+echo "3 - XMLRPC daemon - remote controlled player daemon"
+echo "4 - ALL of the above"
+
+echo
+
+echo "press a number and then [enter]"
+read -s sel
+
+
+case $sel in
+ 1)
+ make -f Makefile.player
+ ;;
+ 2)
+ make -f Makefile.playlist
+ ;;
+ 3)
+ make -f Makefile.xmlrpc
+ ;;
+ 4)
+ make -f Makefile.player
+ make -f Makefile.playlist
+ make -f Makefile.xmlrpc
+ ;;
+ *)
+ echo "invalid selection."
+ ;;
+esac
+
+
+
+
diff --git a/gui.cpp b/gui.cpp
index 6464e60..324c65b 100644
--- a/gui.cpp
+++ b/gui.cpp
@@ -2,6 +2,8 @@
#include <iostream>
#include <cstdio>
+#include <stdlib.h>
+
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -420,15 +422,15 @@ Playlist::Playlist(int num) {
{ // then the drag and drop stuff
- target_entry[0].target = DRAG_TAR_NAME_0;
+ target_entry[0].target = (gchar*)DRAG_TAR_NAME_0;
target_entry[0].flags = 0;
target_entry[0].info = DRAG_TAR_INFO_0;
- target_entry[1].target = DRAG_TAR_NAME_1;
+ target_entry[1].target = (gchar*)DRAG_TAR_NAME_1;
target_entry[1].flags = 0;
target_entry[1].info = DRAG_TAR_INFO_1;
- target_entry[2].target = DRAG_TAR_NAME_2;
+ target_entry[2].target = (gchar*)DRAG_TAR_NAME_2;
target_entry[2].flags = 0;
target_entry[2].info = DRAG_TAR_INFO_2;
diff --git a/xmlrpc.cpp b/xmlrpc.cpp
index 7a529ed..39bcf96 100644
--- a/xmlrpc.cpp
+++ b/xmlrpc.cpp
@@ -19,6 +19,8 @@
*/
+#ifdef WITH_XMLRPC
+
#include <decoder.h>
#include <xmlrpc.h>
#include <utils.h>
@@ -307,3 +309,5 @@ void SetOffset::execute(XmlRpcValue &params, XmlRpcValue &result) {
D("XMLRPC: SetOffset decoder %u to position %d", decnum, pos);
dec->setoffset( (off64_t) pos );
}
+
+#endif
diff --git a/xmlrpc.h b/xmlrpc.h
index 0dfab27..cdc1eb5 100644
--- a/xmlrpc.h
+++ b/xmlrpc.h
@@ -21,6 +21,7 @@
#ifndef __XMLRPC_H__
#define __XMLRPC_H__
+#ifdef WITH_XMLRPC
#include <XmlRpc.h>
@@ -207,3 +208,5 @@ class Quit : public XmlRpcServerMethod, IvySyncPublicMethod {
};
#endif
+
+#endif