GUAC-653: Move terminal code to common location.

This commit is contained in:
Michael Jumper 2014-05-05 15:35:37 -07:00
parent f1b75335ae
commit b4e7f95603
23 changed files with 91 additions and 32 deletions

View File

@ -26,6 +26,7 @@ ACLOCAL_AMFLAGS = -I m4
DIST_SUBDIRS = \
src/libguac \
src/common \
src/terminal \
src/guacd \
src/protocols/rdp \
src/protocols/ssh \
@ -38,6 +39,10 @@ SUBDIRS = \
src/guacd \
tests
if ENABLE_TERMINAL
SUBDIRS += src/terminal
endif
if ENABLE_RDP
SUBDIRS += src/protocols/rdp
endif

View File

@ -87,8 +87,14 @@ AC_TYPE_SSIZE_T
# Bundled libguac
AC_SUBST([LIBGUAC_LTLIB], '$(top_builddir)/src/libguac/libguac.la')
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 non-libguac utility library
AC_SUBST([COMMON_LTLIB], '$(top_builddir)/src/common/libguac_common.la')
AC_SUBST([COMMON_INCLUDE], '-I$(top_srcdir)/src/common')
# Terminal emulator
AC_SUBST([TERMINAL_LTLIB], '$(top_builddir)/src/terminal/libguac_terminal.la')
AC_SUBST([TERMINAL_INCLUDE], '-I$(top_srcdir)/src/terminal $(PANGO_CFLAGS) $(PANGOCAIRO_CFLAGS)')
# Options
AC_ARG_WITH(init_dir,
@ -186,6 +192,18 @@ have_pango=yes
PKG_CHECK_MODULES([PANGO], [pango],, [have_pango=no]);
PKG_CHECK_MODULES([PANGOCAIRO], [pangocairo],, [have_pango=no]);
#
# Terminal emulator
#
have_terminal=yes
if test "x${have_pango}" = "xno"
then
have_terminal=no
fi
AM_CONDITIONAL([ENABLE_TERMINAL], [test "x${have_terminal}" = "xyes"])
#
# libVNCServer
#
@ -555,9 +573,9 @@ SSH_LIBS=
AC_CHECK_LIB([ssh2], [libssh2_session_init_ex],
[SSH_LIBS="$SSH_LIBS -lssh2"],
[have_libssh2=no])
AM_CONDITIONAL([ENABLE_SSH], [test "x${have_libssh2}" = "xyes" \
-a "x${have_pango}" = "xyes" \
-a "x${have_ssl}" = "xyes"])
AM_CONDITIONAL([ENABLE_SSH], [test "x${have_libssh2}" = "xyes" \
-a "x${have_terminal}" = "xyes" \
-a "x${have_ssl}" = "xyes"])
AC_SUBST(SSH_LIBS)
@ -594,6 +612,7 @@ AM_CONDITIONAL([ENABLE_SSH_AGENT],
AC_CONFIG_FILES([Makefile
tests/Makefile
src/common/Makefile
src/terminal/Makefile
src/libguac/Makefile
src/guacd/Makefile
src/protocols/rdp/Makefile

View File

@ -27,41 +27,22 @@ ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libguac-client-ssh.la
libguac_client_ssh_la_SOURCES = \
blank.c \
buffer.c \
char_mappings.c \
client.c \
clipboard.c \
common.c \
cursor.c \
display.c \
guac_handlers.c \
ibar.c \
sftp.c \
ssh_buffer.c \
ssh_client.c \
ssh_key.c \
terminal.c \
terminal_handlers.c
ssh_key.c
noinst_HEADERS = \
blank.h \
buffer.h \
char_mappings.h \
client.h \
clipboard.h \
common.h \
cursor.h \
display.h \
guac_handlers.h \
ibar.h \
sftp.h \
ssh_buffer.h \
ssh_client.h \
ssh_key.h \
terminal.h \
terminal_handlers.h \
types.h
ssh_key.h
# Add agent sources if enabled
if ENABLE_SSH_AGENT
@ -69,7 +50,7 @@ libguac_client_ssh_la_SOURCES += ssh_agent.c
noinst_HEADERS += ssh_agent.h
endif
libguac_client_ssh_la_CFLAGS = -Werror -Wall -Iinclude @PANGO_CFLAGS@ @PANGOCAIRO_CFLAGS@ @LIBGUAC_INCLUDE@ @COMMON_INCLUDE@
libguac_client_ssh_la_LIBADD = @LIBGUAC_LTLIB@ @COMMON_LTLIB@
libguac_client_ssh_la_LDFLAGS = -version-info 0:0:0 @SSH_LIBS@ @SSL_LIBS@ @PTHREAD_LIBS@ @PANGO_LIBS@ @PANGOCAIRO_LIBS@ @CAIRO_LIBS@
libguac_client_ssh_la_CFLAGS = -Werror -Wall -Iinclude @LIBGUAC_INCLUDE@ @COMMON_INCLUDE@ @TERMINAL_INCLUDE@
libguac_client_ssh_la_LIBADD = @LIBGUAC_LTLIB@ @COMMON_LTLIB@ @TERMINAL_LTLIB@
libguac_client_ssh_la_LDFLAGS = -version-info 0:0:0 @SSH_LIBS@ @SSL_LIBS@ @PTHREAD_LIBS@

54
src/terminal/Makefile.am Normal file
View File

@ -0,0 +1,54 @@
#
# Copyright (C) 2013 Glyptodon LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = -Werror -Wall -pedantic @PANGO_CFLAGS@ @PANGOCAIRO_CFLAGS@ @LIBGUAC_INCLUDE@
noinst_LTLIBRARIES = libguac_terminal.la
noinst_HEADERS = \
blank.h \
buffer.h \
char_mappings.h \
common.h \
cursor.h \
display.h \
ibar.h \
terminal.h \
terminal_handlers.h \
types.h
libguac_terminal_la_SOURCES = \
blank.c \
buffer.c \
char_mappings.c \
common.c \
cursor.c \
display.c \
ibar.c \
terminal.c \
terminal_handlers.c
libguac_terminal_la_LIBADD = @LIBGUAC_LTLIB@
libguac_terminal_la_LDFLAGS = @PTHREAD_LIBS@ @PANGO_LIBS@ @PANGOCAIRO_LIBS@ @CAIRO_LIBS@

View File

@ -32,6 +32,7 @@
#include <guacamole/client.h>
#include <guacamole/protocol.h>
#include <guacamole/socket.h>
#include <pango/pangocairo.h>
const guac_terminal_color guac_terminal_palette[16] = {

View File

@ -24,7 +24,6 @@
#include "char_mappings.h"
#include "common.h"
#include "sftp.h"
#include "terminal.h"
#include "terminal_handlers.h"
@ -885,7 +884,7 @@ int guac_terminal_guac_set_directory(guac_terminal* term, unsigned char c) {
if (c == 0x9C || c == 0x5C || c == 0x07) {
filename[length++] = '\0';
term->char_handler = guac_terminal_echo;
guac_sftp_set_upload_path(term->client, filename);
/*guac_sftp_set_upload_path(term->client, filename);*/
length = 0;
}
@ -906,7 +905,7 @@ int guac_terminal_guac_download(guac_terminal* term, unsigned char c) {
if (c == 0x9C || c == 0x5C || c == 0x07) {
filename[length++] = '\0';
term->char_handler = guac_terminal_echo;
guac_sftp_download_file(term->client, filename);
/*guac_sftp_download_file(term->client, filename);*/
length = 0;
}