From d7a604c8b29574be21002ad5c90ff27d76301824 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 9 Sep 2016 10:44:16 -0700 Subject: [PATCH] GUACAMOLE-175: Move common core of guacd into libguacd utility library. --- Makefile.am | 8 +++-- configure.ac | 5 +++ src/guacd/Makefile.am | 20 ++++------- src/libguacd/Makefile.am | 50 ++++++++++++++++++++++++++++ src/{guacd => libguacd}/log.c | 0 src/{guacd => libguacd}/log.h | 0 src/{guacd => libguacd}/socket-ssl.c | 0 src/{guacd => libguacd}/socket-ssl.h | 0 src/{guacd => libguacd}/user.c | 0 src/{guacd => libguacd}/user.h | 0 10 files changed, 66 insertions(+), 17 deletions(-) create mode 100644 src/libguacd/Makefile.am rename src/{guacd => libguacd}/log.c (100%) rename src/{guacd => libguacd}/log.h (100%) rename src/{guacd => libguacd}/socket-ssl.c (100%) rename src/{guacd => libguacd}/socket-ssl.h (100%) rename src/{guacd => libguacd}/user.c (100%) rename src/{guacd => libguacd}/user.h (100%) diff --git a/Makefile.am b/Makefile.am index 54899e99..78f76e1d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,6 +22,7 @@ ACLOCAL_AMFLAGS = -I m4 # Subprojects DIST_SUBDIRS = \ src/libguac \ + src/libguacd \ src/common \ src/common-ssh \ src/terminal \ @@ -33,9 +34,10 @@ DIST_SUBDIRS = \ src/protocols/vnc \ tests -SUBDIRS = \ - src/libguac \ - src/common \ +SUBDIRS = \ + src/libguac \ + src/common \ + src/libguacd \ tests if ENABLE_COMMON_SSH diff --git a/configure.ac b/configure.ac index 4c433591..a763d6a2 100644 --- a/configure.ac +++ b/configure.ac @@ -119,6 +119,10 @@ AC_SUBST([LIBGUAC_INCLUDE], '-I$(top_srcdir)/src/libguac') AC_SUBST([COMMON_LTLIB], '$(top_builddir)/src/common/libguac_common.la') AC_SUBST([COMMON_INCLUDE], '-I$(top_srcdir)/src/common') +# Common utility library for guacd implementations +AC_SUBST([LIBGUACD_LTLIB], '$(top_builddir)/src/libguacd/libguacd.la') +AC_SUBST([LIBGUACD_INCLUDE], '-I$(top_srcdir)/src/libguacd') + # Common base SSH client AC_SUBST([COMMON_SSH_LTLIB], '$(top_builddir)/src/common-ssh/libguac_common_ssh.la') AC_SUBST([COMMON_SSH_INCLUDE], '-I$(top_srcdir)/src/common-ssh') @@ -1101,6 +1105,7 @@ AC_CONFIG_FILES([Makefile src/common-ssh/Makefile src/terminal/Makefile src/libguac/Makefile + src/libguacd/Makefile src/guacd/Makefile src/guacenc/Makefile src/protocols/rdp/Makefile diff --git a/src/guacd/Makefile.am b/src/guacd/Makefile.am index 51e5f879..e25a1011 100644 --- a/src/guacd/Makefile.am +++ b/src/guacd/Makefile.am @@ -30,11 +30,9 @@ noinst_HEADERS = \ conf-file.h \ conf-parse.h \ connection.h \ - log.h \ move-fd.h \ proc.h \ - proc-map.h \ - user.h + proc-map.h guacd_SOURCES = \ conf-args.c \ @@ -42,19 +40,19 @@ guacd_SOURCES = \ conf-parse.c \ connection.c \ daemon.c \ - log.c \ move-fd.c \ proc.c \ - proc-map.c \ - user.c + proc-map.c guacd_CFLAGS = \ -Werror -Wall -pedantic \ @COMMON_INCLUDE@ \ + @LIBGUACD_INCLUDE@ \ @LIBGUAC_INCLUDE@ -guacd_LDADD = \ - @COMMON_LTLIB@ \ +guacd_LDADD = \ + @COMMON_LTLIB@ \ + @LIBGUACD_LTLIB@ \ @LIBGUAC_LTLIB@ guacd_LDFLAGS = \ @@ -68,12 +66,6 @@ EXTRA_DIST = \ CLEANFILES = $(init_SCRIPTS) -# SSL support -if ENABLE_SSL -noinst_HEADERS += socket-ssl.h -guacd_SOURCES += socket-ssl.c -endif - # Init script if ENABLE_INIT initdir = @init_dir@ diff --git a/src/libguacd/Makefile.am b/src/libguacd/Makefile.am new file mode 100644 index 00000000..9e20ceca --- /dev/null +++ b/src/libguacd/Makefile.am @@ -0,0 +1,50 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +AUTOMAKE_OPTIONS = foreign + +noinst_LTLIBRARIES = libguacd.la + +noinst_HEADERS = \ + log.h \ + user.h + +libguacd_la_SOURCES = \ + log.c \ + user.c + +libguacd_la_CFLAGS = \ + -Werror -Wall -pedantic \ + @COMMON_INCLUDE@ \ + @LIBGUAC_INCLUDE@ + +libguacd_la_LIBADD = \ + @COMMON_LTLIB@ \ + @LIBGUAC_LTLIB@ + +libguacd_la_LDFLAGS = \ + @PTHREAD_LIBS@ \ + @SSL_LIBS@ + +# SSL support +if ENABLE_SSL +noinst_HEADERS += socket-ssl.h +libguacd_la_SOURCES += socket-ssl.c +endif + diff --git a/src/guacd/log.c b/src/libguacd/log.c similarity index 100% rename from src/guacd/log.c rename to src/libguacd/log.c diff --git a/src/guacd/log.h b/src/libguacd/log.h similarity index 100% rename from src/guacd/log.h rename to src/libguacd/log.h diff --git a/src/guacd/socket-ssl.c b/src/libguacd/socket-ssl.c similarity index 100% rename from src/guacd/socket-ssl.c rename to src/libguacd/socket-ssl.c diff --git a/src/guacd/socket-ssl.h b/src/libguacd/socket-ssl.h similarity index 100% rename from src/guacd/socket-ssl.h rename to src/libguacd/socket-ssl.h diff --git a/src/guacd/user.c b/src/libguacd/user.c similarity index 100% rename from src/guacd/user.c rename to src/libguacd/user.c diff --git a/src/guacd/user.h b/src/libguacd/user.h similarity index 100% rename from src/guacd/user.h rename to src/libguacd/user.h