From 5b66e05f8df4fe82042fda41e261a6f84fdbeeeb Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 13 Sep 2010 01:14:08 -0700 Subject: [PATCH] Moved guac -> libguac, moving towards pluggable protocols. --- guacamole/Makefile | 14 ++++++++-- guacamole/libguac/Makefile | 26 +++++++++++++++++ guacamole/{proxy => libguac}/client.c | 0 guacamole/{proxy => libguac}/guacio.c | 0 guacamole/{proxy => libguac/include}/client.h | 0 guacamole/{proxy => libguac/include}/guacio.h | 0 .../{proxy => libguac/include}/protocol.h | 0 guacamole/{proxy => libguac}/protocol.c | 0 guacamole/proxy/Makefile | 22 ++++----------- guacamole/proxy/daemon.c | 3 +- guacamole/proxy/vnc_client.h | 28 ------------------- guacamole/vnc/Makefile | 20 +++++++++++++ guacamole/{proxy => vnc}/vnc_client.c | 0 13 files changed, 63 insertions(+), 50 deletions(-) create mode 100644 guacamole/libguac/Makefile rename guacamole/{proxy => libguac}/client.c (100%) rename guacamole/{proxy => libguac}/guacio.c (100%) rename guacamole/{proxy => libguac/include}/client.h (100%) rename guacamole/{proxy => libguac/include}/guacio.h (100%) rename guacamole/{proxy => libguac/include}/protocol.h (100%) rename guacamole/{proxy => libguac}/protocol.c (100%) delete mode 100644 guacamole/proxy/vnc_client.h create mode 100644 guacamole/vnc/Makefile rename guacamole/{proxy => vnc}/vnc_client.c (100%) diff --git a/guacamole/Makefile b/guacamole/Makefile index 62b2883fd..c0f61bb08 100644 --- a/guacamole/Makefile +++ b/guacamole/Makefile @@ -1,15 +1,23 @@ -.PHONY: client proxy clean +.PHONY: client proxy clean libguac vnc -all: client proxy +all: client proxy vnc client: $(MAKE) -C client all -proxy: +proxy: libguac $(MAKE) -C proxy all +libguac: + $(MAKE) -C libguac all + +vnc: libguac + $(MAKE) -C vnc all + clean: $(MAKE) -C client clean $(MAKE) -C proxy clean + $(MAKE) -C libguac clean + $(MAKE) -C vnc clean diff --git a/guacamole/libguac/Makefile b/guacamole/libguac/Makefile new file mode 100644 index 000000000..8d348efeb --- /dev/null +++ b/guacamole/libguac/Makefile @@ -0,0 +1,26 @@ + +CFLAGS=-O2 -fPIC -pedantic -Wall -Werror -Iinclude +LDFLAGS=-lpng + +.PHONY: clean + +all: libguac.so + +libguac.so: client.o guacio.o protocol.o + $(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname,libguac.so.0 -o libguac.so client.o protocol.o guacio.o + +client.o: client.c include/client.h include/guacio.h + $(CC) $(CFLAGS) -c client.c + +protocol.o: protocol.c include/protocol.h include/guacio.h + $(CC) $(CFLAGS) -c protocol.c + +guacio.o: guacio.c include/guacio.h + $(CC) $(CFLAGS) -c guacio.c + +clean: + $(RM) *.o *.so + +distclean: clean + $(RM) *~ + diff --git a/guacamole/proxy/client.c b/guacamole/libguac/client.c similarity index 100% rename from guacamole/proxy/client.c rename to guacamole/libguac/client.c diff --git a/guacamole/proxy/guacio.c b/guacamole/libguac/guacio.c similarity index 100% rename from guacamole/proxy/guacio.c rename to guacamole/libguac/guacio.c diff --git a/guacamole/proxy/client.h b/guacamole/libguac/include/client.h similarity index 100% rename from guacamole/proxy/client.h rename to guacamole/libguac/include/client.h diff --git a/guacamole/proxy/guacio.h b/guacamole/libguac/include/guacio.h similarity index 100% rename from guacamole/proxy/guacio.h rename to guacamole/libguac/include/guacio.h diff --git a/guacamole/proxy/protocol.h b/guacamole/libguac/include/protocol.h similarity index 100% rename from guacamole/proxy/protocol.h rename to guacamole/libguac/include/protocol.h diff --git a/guacamole/proxy/protocol.c b/guacamole/libguac/protocol.c similarity index 100% rename from guacamole/proxy/protocol.c rename to guacamole/libguac/protocol.c diff --git a/guacamole/proxy/Makefile b/guacamole/proxy/Makefile index 5c62706db..83940835a 100644 --- a/guacamole/proxy/Makefile +++ b/guacamole/proxy/Makefile @@ -1,27 +1,15 @@ -CFLAGS=-O2 -pedantic -Wall -Werror -LDFLAGS=-lpng -lvncclient +CFLAGS=-O2 -pedantic -Wall -Werror -I../libguac/include +LDFLAGS=-L../libguac -lpng -lguac .PHONY: clean all: guacd -guacd: daemon.o client.o guacio.o protocol.o vnc_client.o - $(CC) $(CFLAGS) $(LDFLAGS) daemon.o client.o protocol.o guacio.o vnc_client.o -o guacd +guacd: daemon.o + $(CC) $(CFLAGS) $(LDFLAGS) daemon.o -o guacd -client.o: client.c client.h guacio.h - $(CC) $(CFLAGS) -c client.c - -vnc_client.o: vnc_client.c vnc_client.h guacio.h - $(CC) $(CFLAGS) -c vnc_client.c - -protocol.o: protocol.c protocol.h guacio.h - $(CC) $(CFLAGS) -c protocol.c - -guacio.o: guacio.c guacio.h - $(CC) $(CFLAGS) -c guacio.c - -daemon.o: daemon.c client.h vnc_client.h +daemon.o: daemon.c $(CC) $(CFLAGS) -c daemon.c clean: diff --git a/guacamole/proxy/daemon.c b/guacamole/proxy/daemon.c index f6a656c35..30106d58e 100644 --- a/guacamole/proxy/daemon.c +++ b/guacamole/proxy/daemon.c @@ -26,7 +26,6 @@ #include #include "client.h" -#include "vnc_client.h" int main(int argc, char* argv[]) { @@ -107,7 +106,7 @@ int main(int argc, char* argv[]) { fprintf(stderr, "[guacamole] spawning client\n"); - client = guac_get_client(connected_socket_fd, vnc_guac_client_init, connect_host, connect_port); + client = NULL; /*guac_get_client(connected_socket_fd, vnc_guac_client_init, connect_host, connect_port); */ /* STUB! */ guac_start_client(client); guac_free_client(client); diff --git a/guacamole/proxy/vnc_client.h b/guacamole/proxy/vnc_client.h deleted file mode 100644 index e50908a68..000000000 --- a/guacamole/proxy/vnc_client.h +++ /dev/null @@ -1,28 +0,0 @@ - -/* - * Guacamole - Clientless Remote Desktop - * Copyright (C) 2010 Michael Jumper - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef _VNC_CLIENT_H -#define _VNC_CLIENT_H - -#include "client.h" - -void vnc_guac_client_init(guac_client* client, const char* hostname, int port); - -#endif - diff --git a/guacamole/vnc/Makefile b/guacamole/vnc/Makefile new file mode 100644 index 000000000..c7e011277 --- /dev/null +++ b/guacamole/vnc/Makefile @@ -0,0 +1,20 @@ + +CFLAGS=-O2 -fPIC -pedantic -Wall -Werror -I../libguac/include +LDFLAGS=-L../libguac -lpng -lguac + +.PHONY: clean + +all: libguac_client_vnc.so + +libguac_client_vnc.so: vnc_client.o + $(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname,libguac_client_vnc.so.0 -o libguac_client_vnc.so vnc_client.o + +vnc_client.o: vnc_client.c + $(CC) $(CFLAGS) -c vnc_client.c + +clean: + $(RM) *.o *.so + +distclean: clean + $(RM) *~ + diff --git a/guacamole/proxy/vnc_client.c b/guacamole/vnc/vnc_client.c similarity index 100% rename from guacamole/proxy/vnc_client.c rename to guacamole/vnc/vnc_client.c