diff options
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 176 |
1 files changed, 107 insertions, 69 deletions
diff --git a/meson.build b/meson.build index dea50842a..fad164e71 100644 --- a/meson.build +++ b/meson.build @@ -209,7 +209,6 @@ varrunissymllink = run_command('test', '-L', '/var/run').returncode() == 0 message('Setting VARRUN_IS_SYMLINK to: @0@'.format(varrunissymllink)) conf.set10('VARRUN_IS_SYMLINK', varrunissymllink) #endif // 1 - pamlibdir = get_option('pamlibdir') if pamlibdir == '' pamlibdir = join_paths(rootlibdir, 'security') @@ -446,6 +445,10 @@ foreach arg : ['unused-parameter', 'unused-result', 'format-signedness', 'error=nonnull', # work-around for gcc 7.1 turning this on on its own + + # Disable -Wmaybe-uninitialized, since it's noisy on gcc 8 with + # optimizations enabled, producing essentially false positives. + 'maybe-uninitialized', ] if cc.has_argument('-W' + arg) add_project_arguments('-Wno-' + arg, language : 'c') @@ -494,10 +497,14 @@ conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>')) conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>')) decl_headers = ''' +#if 1 /// elogind supports system where _GNU_SOURCE is not set in ENV +# ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +# endif // _GNU_SOURCE +#endif // 1 #include <uchar.h> #include <linux/ethtool.h> #include <linux/fib_rules.h> -#include <linux/stat.h> #include <sys/stat.h> ''' # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail @@ -511,10 +518,24 @@ foreach decl : ['char16_t', ] # We get -1 if the size cannot be determined - have = cc.sizeof(decl, prefix : decl_headers) > 0 + have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0 + + if decl == 'struct statx' + if have + want_linux_stat_h = false + else + have = cc.sizeof(decl, + prefix : decl_headers + '#include <linux/stat.h>', + args : '-D_GNU_SOURCE') > 0 + want_linux_stat_h = have + endif + endif + conf.set10('HAVE_' + decl.underscorify().to_upper(), have) endforeach +conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h) + foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'], ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'], ['IFLA_VRF_TABLE', 'linux/if_link.h'], @@ -556,12 +577,15 @@ foreach ident : [ #include <unistd.h>'''], ['pivot_root', '''#include <stdlib.h> #include <unistd.h>'''], # no known header declares pivot_root +#if 1 /// elogind supports musl, but upstream refuses to add qsort_r + ['qsort_r', '''#include <stdlib.h>'''], +#endif // 1 ['name_to_handle_at', '''#include <sys/types.h> #include <sys/stat.h> #include <fcntl.h>'''], ['setns', '''#include <sched.h>'''], ['renameat2', '''#include <stdio.h> -// #include <fcntl.h>'''], + #include <fcntl.h>'''], ['kcmp', '''#include <linux/kcmp.h>'''], ['keyctl', '''#include <sys/types.h> #include <keyutils.h>'''], @@ -571,7 +595,7 @@ foreach ident : [ #include <unistd.h>'''], ['statx', '''#include <sys/types.h> #include <sys/stat.h> -// #include <unistd.h>'''], + #include <unistd.h>'''], ['explicit_bzero' , '''#include <string.h>'''], ['reallocarray', '''#include <malloc.h>'''], ] @@ -815,41 +839,43 @@ message('maximum system GID is @0@'.format(system_gid_max)) nobody_user = get_option('nobody-user') nobody_group = get_option('nobody-group') -getent_result = run_command('getent', 'passwd', '65534') -if getent_result.returncode() == 0 - name = getent_result.stdout().split(':')[0] - if name != nobody_user - warning('\n' + - 'The local user with the UID 65534 does not match the configured user name "@0@" of the nobody user (its name is @1@).\n'.format(nobody_user, name) + - 'Your build will result in an user table setup that is incompatible with the local system.') +if not meson.is_cross_build() + getent_result = run_command('getent', 'passwd', '65534') + if getent_result.returncode() == 0 + name = getent_result.stdout().split(':')[0] + if name != nobody_user + warning('\n' + + 'The local user with the UID 65534 does not match the configured user name "@0@" of the nobody user (its name is @1@).\n'.format(nobody_user, name) + + 'Your build will result in an user table setup that is incompatible with the local system.') + endif endif -endif -id_result = run_command('id', '-u', nobody_user) -if id_result.returncode() == 0 - id = id_result.stdout().to_int() - if id != 65534 - warning('\n' + - 'The local user with the configured user name "@0@" of the nobody user does not have UID 65534 (it has @1@).\n'.format(nobody_user, id) + - 'Your build will result in an user table setup that is incompatible with the local system.') + id_result = run_command('id', '-u', nobody_user) + if id_result.returncode() == 0 + id = id_result.stdout().to_int() + if id != 65534 + warning('\n' + + 'The local user with the configured user name "@0@" of the nobody user does not have UID 65534 (it has @1@).\n'.format(nobody_user, id) + + 'Your build will result in an user table setup that is incompatible with the local system.') + endif endif -endif -getent_result = run_command('getent', 'group', '65534') -if getent_result.returncode() == 0 - name = getent_result.stdout().split(':')[0] - if name != nobody_group - warning('\n' + - 'The local group with the GID 65534 does not match the configured group name "@0@" of the nobody group (its name is @1@).\n'.format(nobody_group, name) + - 'Your build will result in an group table setup that is incompatible with the local system.') + getent_result = run_command('getent', 'group', '65534') + if getent_result.returncode() == 0 + name = getent_result.stdout().split(':')[0] + if name != nobody_group + warning('\n' + + 'The local group with the GID 65534 does not match the configured group name "@0@" of the nobody group (its name is @1@).\n'.format(nobody_group, name) + + 'Your build will result in an group table setup that is incompatible with the local system.') + endif endif -endif -id_result = run_command('id', '-g', nobody_group) -if id_result.returncode() == 0 - id = id_result.stdout().to_int() - if id != 65534 - warning('\n' + - 'The local group with the configured group name "@0@" of the nobody group does not have UID 65534 (it has @1@).\n'.format(nobody_group, id) + - 'Your build will result in an group table setup that is incompatible with the local system.') + id_result = run_command('id', '-g', nobody_group) + if id_result.returncode() == 0 + id = id_result.stdout().to_int() + if id != 65534 + warning('\n' + + 'The local group with the configured group name "@0@" of the nobody group does not have UID 65534 (it has @1@).\n'.format(nobody_group, id) + + 'Your build will result in an group table setup that is incompatible with the local system.') + endif endif endif if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup') @@ -879,7 +905,9 @@ substs.set('TTY_GID', tty_gid) # conf.set10('ENABLE_ADM_GROUP', get_option('adm-group')) # conf.set10('ENABLE_WHEEL_GROUP', get_option('wheel-group')) # -# substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode')) +# dev_kvm_mode = get_option('dev-kvm-mode') +# substs.set('DEV_KVM_MODE', dev_kvm_mode) +# conf.set10('DEV_KVM_UACCESS', dev_kvm_mode != '0666') # substs.set('GROUP_RENDER_MODE', get_option('group-render-mode')) #endif // 0 @@ -1322,7 +1350,7 @@ conf.set10('HAVE_DBUS', have) # # dns_over_tls = get_option('dns-over-tls') # if dns_over_tls != 'false' -# have = conf.get('HAVE_GNUTLS') == 1 +# have = libgnutls != [] and libgnutls.version().version_compare('>=3.5.3') # if dns_over_tls == 'true' and not have # error('DNS-over-TLS support was requested, but dependencies are not available') # endif @@ -1347,7 +1375,6 @@ conf.set10('HAVE_DBUS', have) # if want_importd != 'false' # have = (conf.get('HAVE_LIBCURL') == 1 and # conf.get('HAVE_ZLIB') == 1 and -# conf.get('HAVE_BZIP2') == 1 and # conf.get('HAVE_XZ') == 1 and # conf.get('HAVE_GCRYPT') == 1) # if want_importd == 'true' and not have @@ -1476,7 +1503,6 @@ conf.set_quoted('USER_GENERATOR_PATH', '/dev/null') ##################################################################### #endif // 1 - config_h = configure_file( output : 'config.h', configuration : conf) @@ -1548,7 +1574,7 @@ subdir('src/login') libelogind_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libelogind_sym) libelogind = shared_library( 'elogind', - 'src/systemd/sd-id128.h', # pick a header file at random to work around old meson bug + disable_mempool_c, version : libelogind_version, include_directories : includes, link_args : ['-shared', @@ -1585,6 +1611,7 @@ install_libelogind_static = static_library( #if 0 /// No gcrypt with elogind # basic_gcrypt_sources, #endif // 0 + disable_mempool_c, include_directories : includes, build_by_default : static_libelogind != 'false', install : static_libelogind != 'false', @@ -1656,6 +1683,7 @@ subdir('src/test') test_dlopen = executable( 'test-dlopen', test_dlopen_c, + disable_mempool_c, include_directories : includes, link_with : [libbasic], dependencies : [libdl]) @@ -1676,6 +1704,7 @@ test_dlopen = executable( # nss = shared_library( # 'nss_' + module, # 'src/nss-@0@/nss-@0@.c'.format(module), +# disable_mempool_c, # version : '2', # include_directories : includes, # # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned @@ -1946,16 +1975,14 @@ test_dlopen = executable( # test_dlopen, # args : [pam_systemd.full_path()]) # path to dlopen must include a slash # endif -# endif -# -# executable('systemd-user-runtime-dir', -# user_runtime_dir_sources, -# include_directories : includes, -# link_with : [libshared, liblogind_core], -# install_rpath : rootlibexecdir, -# install : true, -# install_dir : rootlibexecdir) -# +# +# executable('systemd-user-runtime-dir', +# user_runtime_dir_sources, +# include_directories : includes, +# link_with : [libshared], +# install_rpath : rootlibexecdir, +# install : true, +# install_dir : rootlibexecdir) #else executable('elogind', @@ -2666,17 +2693,19 @@ executable('elogind-cgroups-agent', # install_rpath : rootlibexecdir, # install : true) # public_programs += [exe] -# -# exe = executable('busctl', -# 'src/busctl/busctl.c', -# 'src/busctl/busctl-introspect.c', -# 'src/busctl/busctl-introspect.h', -# include_directories : includes, -# link_with : [libshared], -# install_rpath : rootlibexecdir, -# install : true) -# public_programs += [exe] -# +#endif // 0 + +exe = executable('busctl', + 'src/busctl/busctl.c', + 'src/busctl/busctl-introspect.c', + 'src/busctl/busctl-introspect.h', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true) +public_programs += [exe] + +#if 0 /// UNNEEDED by elogind # if conf.get('ENABLE_SYSUSERS') == 1 # exe = executable('systemd-sysusers', # 'src/sysusers/sysusers.c', @@ -3040,8 +3069,6 @@ subdir('shell-completion/zsh') # subdir('doc/var-log') #endif // 0 -# FIXME: figure out if the warning is true: -# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir install_subdir('factory/etc', install_dir : factorydir) @@ -3215,13 +3242,13 @@ status = [ 'rootexeclib dir: @0@'.format(rootlibexecdir), #endif // 1 #if 0 /// UNNEEDED by elogind -# 'SysV init scripts: @0@'.format(sysvinit_path), -# 'SysV rc?.d directories: @0@'.format(sysvrcnd_path), +# 'SysV init scripts: @0@'.format(sysvinit_path), +# 'SysV rc?.d directories: @0@'.format(sysvrcnd_path), #endif // 0 'PAM modules directory: @0@'.format(pamlibdir), 'PAM configuration directory: @0@'.format(pamconfdir), #if 0 /// UNNEEDED by elogind -# 'RPM macros directory: @0@'.format(rpmmacrosdir), +# 'RPM macros directory: @0@'.format(rpmmacrosdir), #endif // 0 'modprobe.d directory: @0@'.format(modprobedir), 'D-Bus policy directory: @0@'.format(dbuspolicydir), @@ -3276,6 +3303,13 @@ status = [ # 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)] #endif // 0 +status += [ + 'static libelogind: @0@'.format(get_option('static-libelogind')), +#if 0 /// elogind does not ship libudeb. Obviously. +# 'static libudev: @0@'.format(get_option('static-libudev'))] +#else + ] +#endif // 0 # TODO: # CFLAGS: ${OUR_CFLAGS} ${CFLAGS} # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS} @@ -3388,13 +3422,17 @@ foreach tuple : [ # ['wheel group', get_option('wheel-group')], # ['gshadow'], #endif // 0 - ['valgrind', conf.get('VALGRIND') == 1], #if 1 /// Extra debugging for elogind ['debug elogind'], #endif // 1 ['debug hashmap'], ['debug mmap cache'], -] + ['valgrind', conf.get('VALGRIND') == 1], +#if 0 /// elogind neither ships libudev nor systemctl. +# ['link-udev-shared', get_option('link-udev-shared')], +# ['link-systemctl-shared', get_option('link-systemctl-shared')], +#endif // 0 + ] if tuple.length() >= 2 cond = tuple[1] |