Allow building without iconv.
authorNikolaus Rath <Nikolaus@rath.org>
Tue, 22 Aug 2017 10:10:50 +0000 (12:10 +0200)
committerNikolaus Rath <Nikolaus@rath.org>
Tue, 22 Aug 2017 10:10:50 +0000 (12:10 +0200)
cfg.has('HAVE_ICONV') was always true.

ChangeLog.rst
lib/fuse.c
lib/meson.build

index ee1941eface4b00d0d96df7feb6041e6099172fd..844f6620246086d4ea6e16bf796043d093efb070 100644 (file)
@@ -1,6 +1,8 @@
 Unreleased Changes
 ==================
 
+* libfuse can now be build without libiconv.
+
 * Fixed support for `FUSE_CAP_POSIX_ACL`: setting this capability
   flag had no effect in the previous versions of libfuse 3.x;
   now ACLs should actually work.
index b0130725022c56113c7203eb533bf67c28391a9b..a5df0b8ba850d9083ec6fc12bd58f1c770ad3d20 100644 (file)
@@ -198,7 +198,9 @@ struct fuse_context_i {
 
 /* Defined by FUSE_REGISTER_MODULE() in lib/modules/subdir.c and iconv.c.  */
 extern fuse_module_factory_t fuse_module_subdir_factory;
+#ifdef HAVE_ICONV
 extern fuse_module_factory_t fuse_module_iconv_factory;
+#endif
 
 static pthread_key_t fuse_context_key;
 static pthread_mutex_t fuse_context_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -4476,7 +4478,9 @@ void fuse_lib_help(struct fuse_args *args)
 
        /* Print help for builtin modules */
        print_module_help("subdir", &fuse_module_subdir_factory);
+#ifdef HAVE_ICONV
        print_module_help("iconv", &fuse_module_iconv_factory);
+#endif
 
        /* Parse command line options in case we need to
           activate more modules */
@@ -4661,7 +4665,9 @@ struct fuse *fuse_new_31(struct fuse_args *args,
        if (builtin_modules_registered == 0) {
                /* If not, register them. */
                fuse_register_module("subdir", fuse_module_subdir_factory, NULL);
+#ifdef HAVE_ICONV
                fuse_register_module("iconv", fuse_module_iconv_factory, NULL);
+#endif
                builtin_modules_registered= 1;
        }
        pthread_mutex_unlock(&fuse_context_lock);
index 1cfface68eea775202a99d2afe6dae137d1c44a3..b07c06cad0b0fdfe9a302301ea77c3a1aa982b9a 100644 (file)
@@ -9,7 +9,7 @@ else
    libfuse_sources += [ 'mount_bsd.c' ]
 endif
 
-if cfg.has('HAVE_ICONV')
+if cfg.get('HAVE_ICONV')
    libfuse_sources += [ 'modules/iconv.c' ]
 endif