[libvirt PATCH 340/351] meson: generate run helper

Pavel Hrdina phrdina at redhat.com
Thu Jul 16 09:59:36 UTC 2020


Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 configure.ac                  |  2 --
 meson.build                   | 11 +++++++++++
 run.in                        |  2 +-
 scripts/meson-change-perms.sh |  6 ++++++
 4 files changed, 18 insertions(+), 3 deletions(-)
 create mode 100644 scripts/meson-change-perms.sh

diff --git a/configure.ac b/configure.ac
index b70aa17cb23..64d4f56b509 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,8 +103,6 @@ m4_if(m4_version_compare([2.61a.100],
       [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
         [GNUmakefile=$GNUmakefile])])
 
-AC_CONFIG_FILES([run],
-                [chmod +x,-w run])
 AC_CONFIG_FILES([\
         Makefile \
         .color_coded \
diff --git a/meson.build b/meson.build
index 9d0a0c1665b..2519b48b63f 100644
--- a/meson.build
+++ b/meson.build
@@ -2292,6 +2292,17 @@ endif
 configure_file(output: 'meson-config.h', configuration: conf)
 
 
+# generate run helper
+run_conf = configuration_data()
+run_conf.set('abs_builddir', meson.build_root())
+configure_file(
+  input: 'run.in',
+  output: 'run',
+  configuration: run_conf,
+)
+run_command('scripts/meson-change-perms.sh', 'a+x', 'run')
+
+
 # print configuration summary
 
 driver_summary = {
diff --git a/run.in b/run.in
index 1a0dee4d9ee..73bebbf805f 100644
--- a/run.in
+++ b/run.in
@@ -71,4 +71,4 @@ random_val="$(awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)"
 export MALLOC_PERTURB_=$random_val
 
 # Run the program.
-exec $b/libtool --mode=execute "$@"
+exec "$@"
diff --git a/scripts/meson-change-perms.sh b/scripts/meson-change-perms.sh
new file mode 100644
index 00000000000..b366d80077e
--- /dev/null
+++ b/scripts/meson-change-perms.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+perms=$1
+file=$2
+
+chmod $perms $MESON_BUILD_ROOT/$file
-- 
2.26.2




More information about the libvir-list mailing list