Commit 1a646a51 authored by llyzs's avatar llyzs Committed by llyzs

Developed a plugin system. Network protocols RDP, VNC and XDMCP were moved to...

Developed a plugin system. Network protocols RDP, VNC and XDMCP were moved to a separate project remmina-plugins and compiled individually as plugin .so files

git-svn-id: https://remmina.svn.sourceforge.net/svnroot/remmina/trunk@45 b6cfa94a-2857-405c-b0d6-536ef9fc39e1
parent cf6459a5
Please check the application About dialog or the official web site for a full list of authors.
http://remmina.sourceforge.net/contact.shtml
This diff is collapsed.
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
6. Often, you can also type `make uninstall' to remove the installed
files again.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
## Process this file with automake to produce Makefile.in
SUBDIRS = @REMMINA_PLUGINS_SUBDIRS@
#! /bin/sh
aclocal
autoheader --force
libtoolize -c --automake --force
automake --add-missing --copy --include-deps
autoconf
rm -rf autom4te.cache
noinst_HEADERS = remminaplugincommon.h
/*
* Remmina - The GTK+ Remote Desktop Client
* Copyright (C) 2009 - Vic Lee
* Copyright (C) 2010 Vic Lee
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -19,52 +19,63 @@
*/
#ifndef __REMMINAPLUG_XDMCP_H__
#define __REMMINAPLUG_XDMCP_H__
#ifndef __REMMINAPLUGINCOMMON_H__
#define __REMMINAPLUGINCOMMON_H__
#include "config.h"
#include "remminaplug.h"
#include <gtk/gtk.h>
#include <glib/gstdio.h>
#include <remmina/plugin.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
G_BEGIN_DECLS
#define REMMINA_TYPE_PLUG_XDMCP (remmina_plug_xdmcp_get_type ())
#define REMMINA_PLUG_XDMCP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), REMMINA_TYPE_PLUG_XDMCP, RemminaPlugXdmcp))
#define REMMINA_PLUG_XDMCP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), REMMINA_TYPE_PLUG_XDMCP, RemminaPlugXdmcpClass))
#define REMMINA_IS_PLUG_XDMCP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), REMMINA_TYPE_PLUG_XDMCP))
#define REMMINA_IS_PLUG_XDMCP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), REMMINA_TYPE_PLUG_XDMCP))
#define REMMINA_PLUG_XDMCP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REMMINA_TYPE_PLUG_XDMCP, RemminaPlugXdmcpClass))
typedef struct _RemminaPlugXdmcp
{
RemminaPlug plug;
GtkWidget *socket;
gint socket_id;
GPid pid;
gint output_fd;
gint error_fd;
typedef void (*PThreadCleanupFunc)(void*);
/* Wrapper marcos to make the compiler happy on both signle/multi-threaded mode */
#ifdef HAVE_PTHREAD
pthread_t thread;
#define IDLE_ADD gdk_threads_add_idle
#define TIMEOUT_ADD gdk_threads_add_timeout
#define CANCEL_ASYNC pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS,NULL);pthread_testcancel();
#define CANCEL_DEFER pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED,NULL);
#define THREADS_ENTER gdk_threads_enter();pthread_cleanup_push((PThreadCleanupFunc)gdk_threads_leave,NULL);
#define THREADS_LEAVE pthread_cleanup_pop(TRUE);
#else
gint thread;
#define IDLE_ADD g_idle_add
#define TIMEOUT_ADD g_timeout_add
#define CANCEL_ASYNC
#define CANCEL_DEFER
#define THREADS_ENTER
#define THREADS_LEAVE
#endif
} RemminaPlugXdmcp;
typedef struct _RemminaPlugXdmcpClass
{
RemminaPlugClass parent_class;
} RemminaPlugXdmcpClass;
GType remmina_plug_xdmcp_get_type (void) G_GNUC_CONST;
GtkWidget* remmina_plug_xdmcp_new (void);
#define MAX_X_DISPLAY_NUMBER 99
#define X_UNIX_SOCKET "/tmp/.X11-unix/X%d"
G_END_DECLS
#define INCLUDE_GET_AVAILABLE_XDISPLAY static gint \
remmina_get_available_xdisplay (void) \
{ \
gint i; \
gint display = 0; \
gchar fn[200]; \
for (i = 1; i < MAX_X_DISPLAY_NUMBER; i++) \
{ \
g_snprintf (fn, sizeof (fn), X_UNIX_SOCKET, i); \
if (!g_file_test (fn, G_FILE_TEST_EXISTS)) \
{ \
display = i; \
break; \
} \
} \
return display; \
}
#endif /* __REMMINAPLUG_XDMCP_H__ */
#endif /* __REMMINAPLUGINCOMMON_H__ */
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(remmina-plugins, 0.7.99.1)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([common/remminaplugincommon.h])
AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_MAKE_SET
# Only use -Wall if we have gcc
if test "x$GCC" = "xyes"; then
if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
CFLAGS="$CFLAGS -Wall"
fi
fi
remmina_plugindir='${libdir}/remmina/plugins'
AC_SUBST(remmina_plugindir)
remmina_datadir='${datadir}/remmina'
AC_SUBST(remmina_datadir)
# Checks for libraries.
PKG_CHECK_MODULES(REMMINA_PLUGINS, [
glib-2.0 >= 2.20.0
gtk+-2.0 >= 2.16.0
])
AC_SUBST(REMMINA_PLUGINS_CFLAGS)
AC_SUBST(REMMINA_PLUGINS_LIBS)
# Checks for plugin development files
saved_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $REMMINA_PLUGINS_CFLAGS"
AC_CHECK_HEADER(remmina/plugin.h, [], [
echo "ERROR: Remmina plugin development headers are not found."
exit 1
], [
#include <gtk/gtk.h>
])
CFLAGS=$saved_CFLAGS
# Check libpthread
AC_CHECK_LIB(pthread, pthread_create, [
AC_CHECK_HEADER(pthread.h, [
pthread_support="yes"
AC_DEFINE([HAVE_PTHREAD], [1], [Define to 1 if you have the `pthread' library (-lpthread).])
], pthread_support="no. libpthread-dev required.")
],[
pthread_support="no. libpthread required."
])
# Check remmina executable
if test "x$prefix" = "xNONE"; then
remminabin=$ac_default_prefix/bin/remmina
else
remminabin=$prefix/bin/remmina
fi
AC_CHECK_FILE($remminabin,
[remminabin_found="yes"],
[remminabin_found="no. (If you are packaging the plugins, please make sure it uses the same prefix as remmina and ignore this)"])
REMMINA_PLUGINS_SUBDIRS="common"
# Check RDP dependencies
rdp_plugin="yes"
REMMINA_PLUGINS_SUBDIRS="$REMMINA_PLUGINS_SUBDIRS rdp"
# Check VNC dependencies
AC_ARG_ENABLE(vnc,
[AS_HELP_STRING([--disable-vnc], [Disable VNC])],
[vnc_plugin=$enableval],
[vnc_plugin="yes"]
)
if test "x$vnc_plugin" != "xno"; then
if test "x$vnc_plugin" = "xdl"; then
AC_CHECK_LIB(vncclient, rfbGetClient, [
AC_CHECK_HEADER(rfb/rfbclient.h, [
vnc_plugin="link to libvncclient externally"
VNC_CFLAGS=""
VNC_LIBS="-lvncclient"
AC_SUBST(VNC_CFLAGS)
AC_SUBST(VNC_LIBS)
AC_DEFINE([HAVE_LIBVNCCLIENT], [1], [Define to 1 if you have libvncclient.])
], vnc_plugin="no. libvncclient(libvncserver)-dev required.")
],[
vnc_plugin="no. libvncclient(libvncserver) required."
])
else
vnc_plugin=""
fi
else
vnc_plugin="disabled."
fi
if test "x$vnc_plugin" = "x"; then
AC_CHECK_LIB(z, deflate, , vnc_plugin="no. zlib required.")
fi
if test "x$vnc_plugin" = "x"; then
AC_CHECK_HEADER(zlib.h, , vnc_plugin="no. zlib-dev required.")
fi
if test "x$vnc_plugin" = "x"; then
AC_CHECK_LIB(jpeg, jpeg_CreateCompress, , vnc_plugin="no. libjpeg required.")
fi
if test "x$vnc_plugin" = "x"; then
AC_CHECK_HEADER(jpeglib.h, , vnc_plugin="no. libjpeg-dev required.")
fi
if test "x$vnc_plugin" = "x"; then
PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.4.0, , vnc_plugin="no. libgnutls-dev required.")
fi
if test "x$vnc_plugin" = "x"; then
AX_PREFIX_CONFIG_H([libvncserver/rfb/rfbconfig.h], [LIBVNCSERVER])
REMMINA_PLUGINS_SUBDIRS="$REMMINA_PLUGINS_SUBDIRS libvncserver vnc"
VNC_CFLAGS="-I../libvncserver $GNUTLS_CFLAGS"
VNC_LIBS="../libvncserver/libvncclient.la -ljpeg -lz $GNUTLS_LIBS"
AC_SUBST(VNC_CFLAGS)
AC_SUBST(VNC_LIBS)
AC_DEFINE([WITH_CLIENT_TLS], [1], [Enable support for gnutls in libvncclient])
AC_DEFINE([HAVE_LIBVNCCLIENT], [1], [Define to 1 if you have libvncclient.])
vnc_plugin="yes"
fi
# Check XDMCP dependencies
xdmcp_plugin="yes"
REMMINA_PLUGINS_SUBDIRS="$REMMINA_PLUGINS_SUBDIRS xdmcp"
# Checks for header files.
AC_CHECK_HEADERS_ONCE(
netdb.h
arpa/inet.h
netinet/in.h
sys/socket.h
sys/un.h
fcntl.h
errno.h
termios.h
)
AC_SUBST(REMMINA_PLUGINS_SUBDIRS)
AC_CONFIG_FILES([
Makefile
common/Makefile
rdp/Makefile
libvncserver/Makefile
vnc/Makefile
xdmcp/Makefile
])
AC_OUTPUT
echo
echo "Remmina-Plugins configure result:"
echo
echo "* Remmina main program: $remminabin_found"
echo "* Multi-threaded support: $pthread_support"
echo "* RDP plugin: $rdp_plugin"
echo "* VNC plugin: $vnc_plugin"
echo "* XDMCP plugin: $xdmcp_plugin"
echo
echo "Type \"make\" to compile remmina-plugins."
echo
## Process this file with automake to produce Makefile.in
plugindir = $(remmina_plugindir)
plugin_LTLIBRARIES = remmina-plugin-rdp.la
remmina_plugin_rdp_la_SOURCES = remminapluginrdp.c
remmina_plugin_rdp_la_CFLAGS = @REMMINA_PLUGINS_CFLAGS@
remmina_plugin_rdp_la_LDFLAGS = -avoid-version -module
remmina_plugin_rdp_la_LIBADD = @REMMINA_PLUGINS_LIBS@
appicon16emblemsdir = $(remmina_datadir)/icons/hicolor/16x16/emblems
appicon16emblems_DATA = \
16x16/emblems/remmina-rdp.png \
16x16/emblems/remmina-rdp-ssh.png
appicon22emblemsdir = $(remmina_datadir)/icons/hicolor/22x22/emblems
appicon22emblems_DATA = \
22x22/emblems/remmina-rdp.png \
22x22/emblems/remmina-rdp-ssh.png
EXTRA_DIST = \
$(appicon16emblems_DATA) \
$(appicon22emblems_DATA)
## Process this file with automake to produce Makefile.in
plugindir = $(remmina_plugindir)
plugin_LTLIBRARIES = remmina-plugin-vnc.la
remmina_plugin_vnc_la_SOURCES = remminapluginvnc.c
remmina_plugin_vnc_la_CFLAGS = @VNC_CFLAGS@ @REMMINA_PLUGINS_CFLAGS@
remmina_plugin_vnc_la_LDFLAGS = -avoid-version -module
remmina_plugin_vnc_la_LIBADD = @VNC_LIBS@ @REMMINA_PLUGINS_LIBS@
appicon16emblemsdir = $(remmina_datadir)/icons/hicolor/16x16/emblems
appicon16emblems_DATA = \
16x16/emblems/remmina-vnc.png \
16x16/emblems/remmina-vnc-ssh.png
appicon22emblemsdir = $(remmina_datadir)/icons/hicolor/22x22/emblems
appicon22emblems_DATA = \
22x22/emblems/remmina-vnc.png \
22x22/emblems/remmina-vnc-ssh.png
EXTRA_DIST = \
$(appicon16emblems_DATA) \
$(appicon22emblems_DATA)
## Process this file with automake to produce Makefile.in
plugindir = $(remmina_plugindir)
plugin_LTLIBRARIES = remmina-plugin-xdmcp.la
remmina_plugin_xdmcp_la_SOURCES = remminapluginxdmcp.c
remmina_plugin_xdmcp_la_CFLAGS = @REMMINA_PLUGINS_CFLAGS@
remmina_plugin_xdmcp_la_LDFLAGS = -avoid-version -module
remmina_plugin_xdmcp_la_LIBADD = @REMMINA_PLUGINS_LIBS@
appicon16emblemsdir = $(remmina_datadir)/icons/hicolor/16x16/emblems
appicon16emblems_DATA = \
16x16/emblems/remmina-xdmcp.png \
16x16/emblems/remmina-xdmcp-ssh.png
appicon22emblemsdir = $(remmina_datadir)/icons/hicolor/22x22/emblems
appicon22emblems_DATA = \
22x22/emblems/remmina-xdmcp.png \
22x22/emblems/remmina-xdmcp-ssh.png
EXTRA_DIST = \
$(appicon16emblems_DATA) \
$(appicon22emblems_DATA)
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#AC_PREREQ(2.59)
AC_INIT(remmina, 0.7.0)
AC_PREREQ(2.60)
AC_INIT(remmina, 0.7.99.1)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER([config.h])
AC_CONFIG_SRCDIR([src/remmina.c])
AC_CONFIG_MACRO_DIR([m4])