summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2018-04-03 20:10:23 +0200
committerIñigo Martínez <inigomartinez@gmail.com>2018-04-03 20:13:39 +0200
commit44d45dca5d1ab2369fa7e5c2789b31c51e44f985 (patch)
treea06a3283378c1f2341dd4148b0faf1f85fe1e380
parent9d845f7b9aef9795984a7659d228d66b36b7be5a (diff)
downloadgvfs-44d45dca5d1ab2369fa7e5c2789b31c51e44f985.tar.gz
build: Make SFTP backend optional
One of the requirements for SFTP is the existence of a ssh client. A new option has been added to make SFTP backend optional, so a ssh client is not a hard requirement anymore. https://bugzilla.gnome.org/show_bug.cgi?id=786149
-rw-r--r--daemon/meson.build36
-rw-r--r--meson.build8
-rw-r--r--meson_options.txt1
3 files changed, 28 insertions, 17 deletions
diff --git a/daemon/meson.build b/daemon/meson.build
index 1ecb303c..1744f740 100644
--- a/daemon/meson.build
+++ b/daemon/meson.build
@@ -251,26 +251,28 @@ cflags = [
programs += [['gvfsd-burn', sources, [gio_unix_dep], cflags]]
mounts += ['burn']
-sources = files(
- 'gvfsbackendsftp.c',
- 'pty_open.c'
-)
+if enable_sftp
+ sources = files(
+ 'gvfsbackendsftp.c',
+ 'pty_open.c'
+ )
-deps = socket_deps + [
- gio_unix_dep,
- util_dep
-]
+ deps = socket_deps + [
+ gio_unix_dep,
+ util_dep
+ ]
-cflags = [
- '-DBACKEND_HEADER=gvfsbackendsftp.h',
- '-DDEFAULT_BACKEND_TYPE=sftp',
- '-DBACKEND_TYPES="sftp", G_VFS_TYPE_BACKEND_SFTP,',
- '-DMAX_JOB_THREADS=1',
- '-DSSH_PROGRAM="@0@"'.format(find_program('ssh').path())
-]
+ cflags = [
+ '-DBACKEND_HEADER=gvfsbackendsftp.h',
+ '-DDEFAULT_BACKEND_TYPE=sftp',
+ '-DBACKEND_TYPES="sftp", G_VFS_TYPE_BACKEND_SFTP,',
+ '-DMAX_JOB_THREADS=1',
+ '-DSSH_PROGRAM="@0@"'.format(ssh.path())
+ ]
-programs += [['gvfsd-sftp', sources, deps, cflags]]
-mounts += ['sftp']
+ programs += [['gvfsd-sftp', sources, deps, cflags]]
+ mounts += ['sftp']
+endif
if enable_samba
sources = files('gvfsbackendsmb.c')
diff --git a/meson.build b/meson.build
index 15a78e47..665d284d 100644
--- a/meson.build
+++ b/meson.build
@@ -453,6 +453,13 @@ if enable_nfs
libnfs_dep = dependency('libnfs', version: '>= 1.9.8')
endif
+# *** SFTP backend ***
+enable_sftp = get_option('sftp')
+if enable_sftp
+ ssh = find_program('ssh', required: false)
+ assert(ssh.found(), 'SFTP backend requested but a ssh client is required')
+endif
+
# *** Enable development utils ***
enable_devel_utils = get_option('devel_utils')
enable_installed_tests = get_option('installed_tests')
@@ -523,6 +530,7 @@ output += ' gphoto2: ' + enable_gphoto2.to_string() + '\n'
output += ' http: ' + enable_http.to_string() + '\n'
output += ' mtp: ' + enable_mtp.to_string() + '\n'
output += ' nfs: ' + enable_nfs.to_string() + '\n'
+output += ' sftp: ' + enable_sftp.to_string() + '\n'
output += ' smb: ' + enable_samba.to_string() + '\n'
output += ' udisks2: ' + enable_udisks2.to_string() + '\n'
output += '\n'
diff --git a/meson_options.txt b/meson_options.txt
index 2c116a5f..66e2ade8 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -14,6 +14,7 @@ option('gphoto2', type: 'boolean', value: true, description: 'build with gphoto2
option('http', type: 'boolean', value: true, description: 'build with http/dav backends')
option('mtp', type: 'boolean', value: true, description: 'build with mtp backend and volume monitor')
option('nfs', type: 'boolean', value: true, description: 'build with nfs backend')
+option('sftp', type: 'boolean', value: true, description: 'build with sftp backend')
option('smb', type: 'boolean', value: true, description: 'build with smb backends')
option('udisks2', type: 'boolean', value: true, description: 'build with udisks2 volume monitor')