summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2022-02-11 15:08:37 +0100
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2022-02-11 15:08:37 +0100
commit1e3cf2699512acfbdea347164200ebd81062d58e (patch)
tree1014b274fb3d0e4cb40b9e4e631c77c23f6fae48
parent3893c67ad33ce74b52b1bb448cd82df331774dcc (diff)
downloadmm-common-1e3cf2699512acfbdea347164200ebd81062d58e.tar.gz
Update README
-rw-r--r--README27
1 files changed, 15 insertions, 12 deletions
diff --git a/README b/README
index 326a314..6b1ce92 100644
--- a/README
+++ b/README
@@ -80,30 +80,33 @@ The mm-common-get shell script is installed in ${bindir} and must be
invoked with run_command() early in a meson.build file. The meson.build file
should contain code similar to
- python = import('python').find_installation('python3')
+ python3 = import('python').find_installation()
cmd_py = '''
import os
import sys
- sys.exit(0 if os.path.isdir("@0@") else 1)
+ sys.exit(os.path.isdir("@0@") or os.path.isfile("@0@"))
'''.format(project_source_root / '.git')
- is_git_build = run_command(python, '-c', cmd_py).returncode() == 0
+ is_git_build = run_command(python3, '-c', cmd_py, check: false).returncode() != 0
maintainer_mode_opt = get_option('maintainer-mode')
maintainer_mode = maintainer_mode_opt == 'true' or \
(maintainer_mode_opt == 'if-git-build' and is_git_build)
- mm_common_get = find_program('mm-common-get', required: maintainer_mode)
-
- if maintainer_mode and mm_common_get.found()
+ mm_common_get = find_program('mm-common-get', required: false)
+ if maintainer_mode and not mm_common_get.found()
+ message('Maintainer mode requires the \'mm-common-get\' command. If it is not found,\n' +
+ 'install the \'mm-common\' package, version 1.0.0 or higher.')
+ # If meson --wrap-mode != forcefallback, Meson falls back to the mm-common
+ # subproject only if mm-common-get is required.
+ mm_common_get = find_program('mm-common-get', required: true)
+ endif
+ if maintainer_mode
# Copy files to untracked/build_scripts and untracked/docs.
run_command(mm_common_get, '--force',
project_source_root / 'untracked' / 'build_scripts',
- project_source_root / 'untracked' / 'docs')
+ project_source_root / 'untracked' / 'docs',
+ check: true,
+ )
endif
-In a Unix-like system the first few lines can be replaced with
-
- is_git_build = run_command('test', '-d', project_source_root/'.git').returncode() == 0
-
-
Autoconf M4 macros (Autotools)
------------------------------