project('bindfs', 'c', version: '1.18.2', default_options: [ 'c_std=gnu11', # wie configure.ac für FUSE3 'warning_level=2' ] ) # --- config.h erzeugen (Ersatz für AC_CONFIG_HEADERS + Checks) --- cc = meson.get_compiler('c') conf = configuration_data() # Entspricht PACKAGE_STRING aus configure.ac conf.set('PACKAGE_STRING', '"@0@ @1@"'.format(meson.project_name(), meson.project_version())) # Header-/Funktions-Checks wie in configure.ac if cc.has_header('sys/file.h') conf.set('HAVE_SYS_FILE_H', 1) endif # utimensat / lutimes / futimesat if cc.has_function('utimensat', prefix: ''' #include #include #include #include ''') conf.set('HAVE_UTIMENSAT', 1) endif if cc.has_function('lutimes', prefix: '#include ') conf.set('HAVE_LUTIMES', 1) endif if cc.has_function('futimesat', prefix: ''' #include #include ''') conf.set('HAVE_FUTIMESAT', 1) endif # xattr-Funktionen foreach f : ['setxattr','getxattr','listxattr','removexattr', 'lsetxattr','lgetxattr','llistxattr','lremovexattr'] if cc.has_function(f, prefix: '#include ') conf.set('HAVE_@0@'.format(f.to_upper()), 1) endif endforeach # struct stat ... tv_nsec vorhanden? have_stat_nsec = cc.compiles(''' #include #include #include int main(void){ struct stat st; st.st_mtim.tv_nsec = 123; return 0; } ''') if have_stat_nsec conf.set('HAVE_STAT_NANOSEC', 1) endif # config.h in der Build-Root erzeugen configure_file(output: 'config.h', configuration: conf) # Dependencies fuse3_dep = dependency('fuse3', version: '>=3.4.0', required: true) #threads = dependency('threads') dl_dep = cc.find_library('dl', required: true) iconv_dep = dependency('iconv', required: false) # Android: yes; Linux: ja nach System # Entspricht my_CPPFLAGS in configure.ac add_project_arguments( [ '-D_REENTRANT', '-D_FILE_OFFSET_BITS=64', '-D_XOPEN_SOURCE=700', '-D__BSD_VISIBLE=1', '-D_BSD_SOURCE', '-D_DEFAULT_SOURCE', # Autotools bei FUSE3: '-DHAVE_FUSE_3=1', '-DFUSE_USE_VERSION=34', # genau wie CHECK_FUSE3 in configure.ac ], language: 'c' ) add_project_arguments(['-include', 'sys/stat.h'], language: 'c') # required for S_ISDIR # Entspricht my_CFLAGS / my_LDFLAGS add_project_arguments(['-Wall','-Wextra','-Wpedantic','-fno-common'], language: 'c') add_project_arguments(['-pthread'], language: 'c') add_project_link_arguments(['-pthread'], language: 'c') subdir('src')