From db35a37def14b72181f3630efeea0e0433103c41 Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Fri, 27 Jan 2023 21:54:48 +0100 Subject: Install a the configure_file (config.h) and use in headers This addresses: https://github.com/libfuse/libfuse/issues/724 HAVE_LIBC_VERSIONED_SYMBOLS configures the library if to use versioned symbols and is set at meson configuration time. External filesystems (the main target, actually) include fuse headers and the preprocessor then acts on HAVE_LIBC_VERSIONED_SYMBOLS. Problem was now that 'config.h' was not distributed with libfuse and so HAVE_LIBC_VERSIONED_SYMBOLS was never defined with external tools and the preprocessor did the wrong decision. This commit also increases the the minimal meson version, as this depends on meson feature only available in 0.50 WARNING: Project specifies a minimum meson_ version '>= 0.42' but uses features which were added in newer versions: * 0.50.0: {'install arg in configure_file'} Additionally the config file has been renamed to "fuse_config.h" to avoid clashes - 'config.h' is not very specific. --- example/passthrough.c | 4 ---- example/passthrough_fh.c | 4 ---- example/passthrough_hp.cc | 4 ---- example/passthrough_ll.c | 2 -- example/poll.c | 2 -- example/poll_client.c | 2 +- example/printcap.c | 2 -- include/fuse_common.h | 1 + lib/buffer.c | 2 +- lib/compat.c | 2 +- lib/cuse_lowlevel.c | 2 +- lib/fuse.c | 2 +- lib/fuse_loop.c | 2 +- lib/fuse_loop_mt.c | 2 +- lib/fuse_lowlevel.c | 2 +- lib/fuse_opt.c | 2 +- lib/fuse_signals.c | 2 +- lib/helper.c | 2 +- lib/modules/iconv.c | 2 +- lib/modules/subdir.c | 2 +- lib/mount.c | 2 +- lib/mount_util.c | 2 +- meson.build | 7 ++++--- test/test_setattr.c | 2 +- test/test_syscalls.c | 2 +- test/test_write_cache.c | 2 +- test/travis-install.sh | 2 +- util/fusermount.c | 2 +- util/mount.fuse.c | 2 +- 29 files changed, 26 insertions(+), 42 deletions(-) diff --git a/example/passthrough.c b/example/passthrough.c index ae13225..5963d58 100644 --- a/example/passthrough.c +++ b/example/passthrough.c @@ -25,10 +25,6 @@ #define FUSE_USE_VERSION 31 -#ifdef HAVE_CONFIG_H -#include -#endif - #define _GNU_SOURCE #ifdef linux diff --git a/example/passthrough_fh.c b/example/passthrough_fh.c index bdc5ecd..bc02794 100644 --- a/example/passthrough_fh.c +++ b/example/passthrough_fh.c @@ -25,10 +25,6 @@ #define FUSE_USE_VERSION 31 -#ifdef HAVE_CONFIG_H -#include -#endif - #define _GNU_SOURCE #include diff --git a/example/passthrough_hp.cc b/example/passthrough_hp.cc index b367978..26fa42e 100644 --- a/example/passthrough_hp.cc +++ b/example/passthrough_hp.cc @@ -45,10 +45,6 @@ #define FUSE_USE_VERSION FUSE_MAKE_VERSION(3, 12) -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif diff --git a/example/passthrough_ll.c b/example/passthrough_ll.c index a1d237a..8b2eb4b 100644 --- a/example/passthrough_ll.c +++ b/example/passthrough_ll.c @@ -37,8 +37,6 @@ #define _GNU_SOURCE #define FUSE_USE_VERSION 34 -#include "config.h" - #include #include #include diff --git a/example/poll.c b/example/poll.c index 521e6aa..e231b96 100644 --- a/example/poll.c +++ b/example/poll.c @@ -23,8 +23,6 @@ #define FUSE_USE_VERSION 31 -#include - #include #include #include diff --git a/example/poll_client.c b/example/poll_client.c index 222452a..e51bd0e 100644 --- a/example/poll_client.c +++ b/example/poll_client.c @@ -19,7 +19,7 @@ * \include poll_client.c */ -#include +#include #include #include diff --git a/example/printcap.c b/example/printcap.c index 4867988..30e2057 100644 --- a/example/printcap.c +++ b/example/printcap.c @@ -21,8 +21,6 @@ #define FUSE_USE_VERSION 31 -#include - #include #include #include diff --git a/include/fuse_common.h b/include/fuse_common.h index cf9bc27..1d050bb 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -14,6 +14,7 @@ #ifndef FUSE_COMMON_H_ #define FUSE_COMMON_H_ +#include "fuse_config.h" #include "fuse_opt.h" #include "fuse_log.h" #include diff --git a/lib/buffer.c b/lib/buffer.c index 757807a..4f2f491 100644 --- a/lib/buffer.c +++ b/lib/buffer.c @@ -11,7 +11,7 @@ #define _GNU_SOURCE -#include "config.h" +#include "fuse_config.h" #include "fuse_i.h" #include "fuse_lowlevel.h" #include diff --git a/lib/compat.c b/lib/compat.c index 6d4dece..cab6cbf 100644 --- a/lib/compat.c +++ b/lib/compat.c @@ -15,7 +15,7 @@ support version symboling */ -#include "config.h" +#include "fuse_config.h" #include "fuse_i.h" #include "fuse_misc.h" #include "fuse_opt.h" diff --git a/lib/cuse_lowlevel.c b/lib/cuse_lowlevel.c index 01a62ab..cd68787 100644 --- a/lib/cuse_lowlevel.c +++ b/lib/cuse_lowlevel.c @@ -7,7 +7,7 @@ See the file COPYING.LIB. */ -#include "config.h" +#include "fuse_config.h" #include "cuse_lowlevel.h" #include "fuse_kernel.h" #include "fuse_i.h" diff --git a/lib/fuse.c b/lib/fuse.c index 9834f75..a247d3c 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -13,7 +13,7 @@ /* For pthread_rwlock_t */ #define _GNU_SOURCE -#include "config.h" +#include "fuse_config.h" #include "fuse_i.h" #include "fuse_lowlevel.h" #include "fuse_opt.h" diff --git a/lib/fuse_loop.c b/lib/fuse_loop.c index e6560aa..b9c498b 100644 --- a/lib/fuse_loop.c +++ b/lib/fuse_loop.c @@ -8,7 +8,7 @@ See the file COPYING.LIB */ -#include "config.h" +#include "fuse_config.h" #include "fuse_lowlevel.h" #include "fuse_i.h" diff --git a/lib/fuse_loop_mt.c b/lib/fuse_loop_mt.c index b8b2fdd..cf9ad86 100644 --- a/lib/fuse_loop_mt.c +++ b/lib/fuse_loop_mt.c @@ -8,7 +8,7 @@ See the file COPYING.LIB. */ -#include "config.h" +#include "fuse_config.h" #include "fuse_lowlevel.h" #include "fuse_misc.h" #include "fuse_kernel.h" diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 8fe47db..fcc2108 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -11,7 +11,7 @@ #define _GNU_SOURCE -#include "config.h" +#include "fuse_config.h" #include "fuse_i.h" #include "fuse_kernel.h" #include "fuse_opt.h" diff --git a/lib/fuse_opt.c b/lib/fuse_opt.c index 93066b9..1d3b6a1 100644 --- a/lib/fuse_opt.c +++ b/lib/fuse_opt.c @@ -9,7 +9,7 @@ See the file COPYING.LIB */ -#include "config.h" +#include "fuse_config.h" #include "fuse_i.h" #include "fuse_opt.h" #include "fuse_misc.h" diff --git a/lib/fuse_signals.c b/lib/fuse_signals.c index 4271947..048d047 100644 --- a/lib/fuse_signals.c +++ b/lib/fuse_signals.c @@ -8,7 +8,7 @@ See the file COPYING.LIB */ -#include "config.h" +#include "fuse_config.h" #include "fuse_lowlevel.h" #include "fuse_i.h" diff --git a/lib/helper.c b/lib/helper.c index c3796c1..b270b85 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -10,7 +10,7 @@ See the file COPYING.LIB. */ -#include "config.h" +#include "fuse_config.h" #include "fuse_i.h" #include "fuse_misc.h" #include "fuse_opt.h" diff --git a/lib/modules/iconv.c b/lib/modules/iconv.c index 0ec3c2b..3d18a36 100644 --- a/lib/modules/iconv.c +++ b/lib/modules/iconv.c @@ -6,7 +6,7 @@ See the file COPYING.LIB */ -#include +#include #include #include diff --git a/lib/modules/subdir.c b/lib/modules/subdir.c index 616c0ee..e92eb62 100644 --- a/lib/modules/subdir.c +++ b/lib/modules/subdir.c @@ -6,7 +6,7 @@ See the file COPYING.LIB */ -#include +#include #include #include diff --git a/lib/mount.c b/lib/mount.c index 484bf40..bda3c47 100644 --- a/lib/mount.c +++ b/lib/mount.c @@ -8,7 +8,7 @@ See the file COPYING.LIB. */ -#include "config.h" +#include "fuse_config.h" #include "fuse_i.h" #include "fuse_misc.h" #include "fuse_opt.h" diff --git a/lib/mount_util.c b/lib/mount_util.c index 35e9948..daf7b5e 100644 --- a/lib/mount_util.c +++ b/lib/mount_util.c @@ -8,7 +8,7 @@ See the file COPYING.LIB. */ -#include "config.h" +#include "fuse_config.h" #include "mount_util.h" #include #include diff --git a/meson.build b/meson.build index d1b2ae0..0057c11 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('libfuse3', ['c'], version: '3.13.0', - meson_version: '>= 0.42', + meson_version: '>= 0.50', default_options: [ 'buildtype=debugoptimized', 'cpp_std=c++11', @@ -141,8 +141,8 @@ else endif # Write the test results into config.h (stored in build directory) -configure_file(output: 'config.h', - configuration : cfg) +configure_file(output: 'fuse_config.h', + configuration : cfg, install: true, install_dir: 'include/fuse3') # '.' will refer to current build directory, which contains config.h include_dirs = include_directories('include', 'lib', '.') @@ -169,3 +169,4 @@ endif foreach n : subdirs subdir(n) endforeach + diff --git a/test/test_setattr.c b/test/test_setattr.c index fa7c8ba..8575203 100644 --- a/test/test_setattr.c +++ b/test/test_setattr.c @@ -9,7 +9,7 @@ #define FUSE_USE_VERSION 30 -#include +#include #include #include #include diff --git a/test/test_syscalls.c b/test/test_syscalls.c index c835661..2ba55de 100644 --- a/test/test_syscalls.c +++ b/test/test_syscalls.c @@ -1,5 +1,5 @@ #define _GNU_SOURCE -#include "config.h" +#include "fuse_config.h" #include #include diff --git a/test/test_write_cache.c b/test/test_write_cache.c index 03ccc98..bc62ac1 100644 --- a/test/test_write_cache.c +++ b/test/test_write_cache.c @@ -9,7 +9,7 @@ #define FUSE_USE_VERSION 30 -#include +#include #include #include #include diff --git a/test/travis-install.sh b/test/travis-install.sh index 65360b4..924623b 100755 --- a/test/travis-install.sh +++ b/test/travis-install.sh @@ -4,7 +4,7 @@ set -e sudo python3 -m pip install --upgrade pip # Meson 0.45 requires Python 3.5 or newer -sudo python3 -m pip install pytest meson==0.44 +sudo python3 -m pip install pytest meson==0.50 valgrind --version ninja --version meson --version diff --git a/util/fusermount.c b/util/fusermount.c index ed62ea9..50989eb 100644 --- a/util/fusermount.c +++ b/util/fusermount.c @@ -8,7 +8,7 @@ /* This program does the mounting and unmounting of FUSE filesystems */ #define _GNU_SOURCE /* for clone */ -#include "config.h" +#include "fuse_config.h" #include "mount_util.h" #include diff --git a/util/mount.fuse.c b/util/mount.fuse.c index a6e5629..04d63b2 100644 --- a/util/mount.fuse.c +++ b/util/mount.fuse.c @@ -6,7 +6,7 @@ See the file COPYING. */ -#include "config.h" +#include "fuse_config.h" #include #include -- cgit v1.2.1