From cdb039080f47ee31e97dcb88591e8194e03f3878 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Fri, 2 Nov 2012 23:10:36 -0700 Subject: [PATCH] chansrv: added --enable-fuse option --- configure.ac | 12 ++++++++++++ sesman/chansrv/Makefile.am | 7 ++++++- sesman/chansrv/chansrv_fuse.c | 11 ++++------- sesman/chansrv/clipboard_file.c | 7 +++---- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index c7b437e2..b29ce965 100644 --- a/configure.ac +++ b/configure.ac @@ -43,6 +43,10 @@ AC_ARG_ENABLE(simplesound, AS_HELP_STRING([--enable-simplesound], [Build simple pulse audio interface (default: no)]), [simplesound=true], [simplesound=false]) AM_CONDITIONAL(XRDP_SIMPLESOUND, [test x$simplesound = xtrue]) +AC_ARG_ENABLE(fuse, AS_HELP_STRING([--enable-fuse], + [Build fuse(clipboard file / drive redir) (default: no)]), + [fuse=true], [fuse=false]) +AM_CONDITIONAL(XRDP_FUSE, [test x$fuse = xtrue]) AM_CONDITIONAL(GOT_PREFIX, test "x${prefix}" != "xNONE"]) @@ -70,6 +74,14 @@ then [AC_MSG_ERROR([please install libjpeg-dev or libjpeg-devel])]) fi +# checking for fuse +if ! test -z "$enable_fuse" +then + AC_CHECK_HEADER([fuse.h], [], + [AC_MSG_ERROR([please install libfuse-dev or fuse-devel])], + [#define _FILE_OFFSET_BITS 64]) +fi + # checking for libpulse libpulse-simple if ! test -z "$enable_simplesound" then diff --git a/sesman/chansrv/Makefile.am b/sesman/chansrv/Makefile.am index b6b6de2b..4272eb0e 100644 --- a/sesman/chansrv/Makefile.am +++ b/sesman/chansrv/Makefile.am @@ -10,6 +10,11 @@ EXTRA_DEFINES += -DXRDP_SIMPLESOUND EXTRA_LIBS += -lpthread -lpulse -lpulse-simple endif +if XRDP_FUSE +EXTRA_DEFINES += -DXRDP_FUSE +EXTRA_LIBS += -lfuse +endif + AM_CFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ @@ -36,7 +41,7 @@ xrdp_chansrv_SOURCES = \ chansrv_fuse.c xrdp_chansrv_LDFLAGS = \ - $(EXTRA_FLAGS) -lfuse + $(EXTRA_FLAGS) xrdp_chansrv_LDADD = \ -L/usr/X11R6/lib \ diff --git a/sesman/chansrv/chansrv_fuse.c b/sesman/chansrv/chansrv_fuse.c index 1c63f66c..d6a0daa5 100644 --- a/sesman/chansrv/chansrv_fuse.c +++ b/sesman/chansrv/chansrv_fuse.c @@ -16,9 +16,7 @@ * limitations under the License. */ -#define XRDP_USE_FUSE 1 - -#ifdef XRDP_USE_FUSE +#ifdef XRDP_FUSE #define FUSE_USE_VERSION 26 #define _FILE_OFFSET_BITS 64 @@ -54,14 +52,13 @@ static char *g_mountpoint = 0; static tintptr g_bufsize = 0; static char *g_buffer = 0; static int g_fd = 0; - -struct file_item *g_file_items = 0; -int g_file_items_count = 0; - static time_t g_time = 0; static int g_uid = 0; static int g_gid = 0; +extern struct file_item *g_file_items; /* in chansrv_file.c */ +extern int g_file_items_count; /* in chansrv_file.c */ + struct dirbuf { char *p; diff --git a/sesman/chansrv/clipboard_file.c b/sesman/chansrv/clipboard_file.c index 394ab6f6..9175bfaf 100644 --- a/sesman/chansrv/clipboard_file.c +++ b/sesman/chansrv/clipboard_file.c @@ -47,15 +47,14 @@ } \ while (0) +struct file_item *g_file_items = 0; +int g_file_items_count = 0; + extern int g_cliprdr_chan_id; /* in chansrv.c */ extern struct clip_s2c g_clip_s2c; /* in clipboard.c */ extern struct clip_c2s g_clip_c2s; /* in clipboard.c */ -extern struct file_item *g_file_items; /* in chansrv_fuse.c */ -extern int g_file_items_count; /* in chansrv_fuse.c */ - - struct cb_file_info { char pathname[256];