From: Sven Eden Date: Mon, 26 Mar 2018 16:22:06 +0000 (+0200) Subject: Prep v236: Adapt elogind parts in the build system to upstream changes. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=f54f5cd0dde625f9f7d9e89abb24414f2592fa2e;p=elogind.git Prep v236: Adapt elogind parts in the build system to upstream changes. --- diff --git a/man/meson.build b/man/meson.build index b40a97dba..32bd1b814 100644 --- a/man/meson.build +++ b/man/meson.build @@ -91,7 +91,12 @@ foreach tuple : xsltproc.found() ? manpages : [] output : htmlalias, command : ['ln', '-fs', html, '@OUTPUT@']) if want_html - dst = join_paths(docdir, 'html', htmlalias) +#if 0 /// This must be configurable in elogind +# dst = join_paths(docdir, 'html', htmlalias) +#else + dst = get_option('htmldir') + dst = dst != '' ? dst: join_paths(docdir, 'html', htmlalias) +#endif // 0 cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst) meson.add_install_script('sh', '-c', cmd) p2 += [link] diff --git a/meson.build b/meson.build index 38ae4e087..f6c81c1a8 100644 --- a/meson.build +++ b/meson.build @@ -175,15 +175,16 @@ pkgincludedir = join_paths(includedir, 'elogind/systemd') systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown') systemsleepdir = join_paths(rootlibexecdir, 'system-sleep') -# in elogind, udev is external and hus configurable +# in elogind, udev is external and thus configurable udevlibexecdir = get_option('udevbindir') udevlibexecdir = udevlibexecdir != '' ? udevlibexecdir : join_paths(rootprefixdir, 'lib/udev') udevrulesdir = get_option('udevrulesdir') udevrulesdir = udevrulesdir != '' ? udevrulesdir : join_paths(udevlibexecdir, 'rules.d') udevhomedir = udevlibexecdir factorydir = join_paths(datadir, 'factory') -docdir = '-'.join([join_paths(datadir, 'doc/elogind'), - meson.project_version()]) +docdir = get_option('docdir') +docdir = docdir != '' ? docdir: '-'.join([join_paths(datadir, 'doc/elogind'), + meson.project_version()]) testsdir = join_paths(prefixdir, 'lib/elogind/tests') randomseeddir = join_paths(localstatedir, 'lib/elogind') #endif // 0 @@ -384,7 +385,7 @@ foreach arg : ['unused-parameter', endif endforeach -if cc.compiles(' +if cc.compiles(''' #include #include typedef uint64_t usec_t; @@ -393,7 +394,7 @@ if cc.compiles(' struct timespec now; return 0; } -', name : '-Werror=shadow with local shadowing') +''', name : '-Werror=shadow with local shadowing') add_project_arguments('-Werror=shadow', language : 'c') endif @@ -846,16 +847,19 @@ conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) debug = get_option('debug') enable_debug_hashmap = false enable_debug_mmap_cache = false +#if 1 /// additional elogind debug mode +enable_debug_elogind = false +#endif // 1 if debug != '' foreach name : debug.split(',') if name == 'hashmap' enable_debug_hashmap = true elif name == 'mmap-cache' + enable_debug_mmap_cache = true #if 1 /// additional elogind debug mode - elif name == 'elogind' - conf.set('ENABLE_DEBUG_ELOGIND', true) + elif name == 'elogind' + enable_debug_elogind = true #endif // 1 - enable_debug_mmap_cache = true else message('unknown debug option "@0@", ignoring'.format(name)) endif @@ -863,6 +867,9 @@ if debug != '' endif conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap) conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache) +#if 1 /// additional elogind debug mode +conf.set10('ENABLE_DEBUG_ELOGIND', enable_debug_elogind) +#endif // 1 ##################################################################### @@ -946,7 +953,7 @@ if want_polkit != 'false' install_polkit_pkla = true endif endif -conf.set10('ENABLE_POLKIT', install_polkit) +conf.set10('ENABLE_POLKIT', install_polkit ? '1' : '0') want_acl = get_option('acl') if want_acl != 'false' @@ -2832,12 +2839,14 @@ if git.found() command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files) endif -if git.found() - meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh') - run_target( - 'git-contrib', - command : [meson_git_contrib_sh]) -endif +#if 0 /// UNNEEDED by elogind +# if git.found() +# meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh') +# run_target( +# 'git-contrib', +# command : [meson_git_contrib_sh]) +# endif +#endif // 0 if git.found() git_head = run_command( @@ -3046,12 +3055,13 @@ foreach tuple : [ ['debug mmap cache'], ] - cond = tuple.get(1, '') - if cond == '' + cond = tuple.get(1, false) + if not cond ident1 = 'HAVE_' + tuple[0].underscorify().to_upper() ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper() cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1 endif + if cond found += [tuple[0]] else diff --git a/meson_options.txt b/meson_options.txt index ac18363f4..4e2f472d6 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -53,6 +53,10 @@ option('udevrulesdir', type : 'string', option('udevbindir', type : 'string', description : '''directory for udev binary files''') +# We are nice and make the documentation paths configurable +option('docdir', type : 'string', description : 'path where to install the documentation.') +option('htmldir', type : 'string', description : 'path where to install the HTML documentation.') + # We have no systemd-shutdown binary, so we need 'halt' and 'reboot' option('halt-path', type : 'string', description : 'path to halt') option('reboot-path', type : 'string', description : 'path to reboot') @@ -176,11 +180,11 @@ option('default-hierarchy', type : 'combo', # option('time-epoch', type : 'string', # description : 'time epoch for time clients') #else - description : 'Wanted cgroup hierarchy if elogind has to be a cgroup controller: + description : '''Wanted cgroup hierarchy if elogind has to be a cgroup controller: "legacy" assumes cgroups version 1 mounted on /sys/fs/cgroup "hybrid" assumes cgroups version 2 mounted on /sys/fs/cgroup/unified and cgroups version 1 mounted on /sys/fs/cgroup. - "unified" assumes cgroups version 2 on /sys/fs/cgroup') + "unified" assumes cgroups version 2 on /sys/fs/cgroup''') option('cgroup-controller', type : 'string', description : 'Name of the cgroup controller to use') #endif // 0 diff --git a/pwx/rebuild_all.sh b/pwx/rebuild_all.sh index b90b97ac8..a77ec9c40 100755 --- a/pwx/rebuild_all.sh +++ b/pwx/rebuild_all.sh @@ -40,7 +40,7 @@ if [[ $minVers -gt 234 ]]; then debug_opt="-Ddebug=\"\" --buildtype release" if [[ "x$xType" = "xdebug" ]]; then - debug_opt="-Ddebug=elogind -Dtest=unsafe --buildtype debug" + debug_opt="-Ddebug=elogind -Dtests=unsafe --buildtype debug" fi set -x @@ -80,7 +80,7 @@ if [[ $minVers -gt 234 ]]; then -Dcgroup-controller=openrc -Ddefault-hierarchy=$cgdefault \ -Dacl=true -Dpam=true -Dselinux=false \ -Dbashcompletiondir=$PREFIX/usr/share/bash-completion/completions \ - -Dzsh-completion=$PREFIX/usr/share/zsh/site-functions \ + -Dzshcompletiondir=$PREFIX/usr/share/zsh/site-functions \ $extra_opts $(pwd -P) $(pwd -P)/build set +x