[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 006/132] build-sys: add meson submodule
From: |
Paolo Bonzini |
Subject: |
[PATCH 006/132] build-sys: add meson submodule |
Date: |
Thu, 12 Dec 2019 13:50:50 +0100 |
From: Marc-André Lureau <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
---
.gitmodules | 3 +++
configure | 45 +++++++++++++++++++++++++++++++++++++++++----
meson | 1 +
scripts/archive-source.sh | 3 ++-
4 files changed, 47 insertions(+), 5 deletions(-)
create mode 160000 meson
diff --git a/.gitmodules b/.gitmodules
index c5c4741..67f4ed8 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -58,3 +58,6 @@
[submodule "roms/opensbi"]
path = roms/opensbi
url = https://git.qemu.org/git/opensbi.git
+[submodule "meson"]
+ path = meson
+ url = https://github.com/mesonbuild/meson/
diff --git a/configure b/configure
index 2f3e231..0eb3d70 100755
--- a/configure
+++ b/configure
@@ -171,6 +171,25 @@ path_of() {
return 1
}
+version_ge () {
+ local_ver1=`echo $1 | tr . ' '`
+ local_ver2=`echo $2 | tr . ' '`
+ while true; do
+ set x $local_ver1
+ local_first=${2-0}
+ # shift 2 does nothing if there are less than 2 arguments
+ shift; shift
+ local_ver1=$*
+ set x $local_ver2
+ # the second argument finished, the first must be greater or equal
+ test $# = 1 && return 0
+ test $local_first -lt $2 && return 1
+ test $local_first -gt $2 && return 0
+ shift; shift
+ local_ver2=$*
+ done
+}
+
have_backend () {
echo "$trace_backends" | grep "$1" >/dev/null
}
@@ -489,7 +508,6 @@ libxml2=""
debug_mutex="no"
libpmem=""
default_devices="yes"
-meson=meson
supported_cpu="no"
supported_os="no"
@@ -1827,9 +1845,28 @@ then
error_exit "Python not found. Use --python=/path/to/python"
fi
-if ! has "$meson"
-then
- error_exit "Meson not found. Use --meson=/path/to/meson"
+if test -z "$meson" ; then
+ if has meson && version_ge "$(meson --version)" 0.53.0; then
+ meson=meson
+ elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then
+ meson=git
+ elif test -e "${source_path}/meson/meson.py" ; then
+ meson=internal
+ fi
+fi
+
+case "$meson" in
+ git | internal)
+ if test "$meson" = git; then
+ git_submodules="${git_submodules} meson"
+ (cd "${source_path}" && GIT="$git" "./scripts/git-submodule.sh"
update meson)
+ fi
+ meson="${source_path}/meson/meson.py"
+ ;;
+esac
+
+if ! has "$meson" ; then
+ error_exit "Meson not found. Use --meson=/path/to/meson|git|internal"
fi
meson=$(command -v $meson)
diff --git a/meson b/meson
new file mode 160000
index 0000000..5031f49
--- /dev/null
+++ b/meson
@@ -0,0 +1 @@
+Subproject commit 5031f4981d4fcf6eb0bc950669a0a77a7df22939
diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh
index fb5d6b3..c6169db 100755
--- a/scripts/archive-source.sh
+++ b/scripts/archive-source.sh
@@ -26,7 +26,8 @@ sub_file="${sub_tdir}/submodule.tar"
# independent of what the developer currently has initialized
# in their checkout, because the build environment is completely
# different to the host OS.
-submodules="dtc slirp ui/keycodemapdb tests/fp/berkeley-softfloat-3
tests/fp/berkeley-testfloat-3"
+submodules="dtc slirp meson ui/keycodemapdb"
+submodules="$submodules tests/fp/berkeley-softfloat-3
tests/fp/berkeley-testfloat-3"
sub_deinit=""
function cleanup() {
--
1.8.3.1
- [RFC PATCH v3 000/132] Proof of concept for Meson integration, Paolo Bonzini, 2019/12/12
- [PATCH 001/132] build-sys hack: ensure target directory is there, Paolo Bonzini, 2019/12/12
- [PATCH 002/132] configure: do not include $(...) variables in config-host.mak, Paolo Bonzini, 2019/12/12
- [PATCH 003/132] configure: expand path variables for meson configure, Paolo Bonzini, 2019/12/12
- [PATCH 005/132] configure: generate Meson cross file, Paolo Bonzini, 2019/12/12
- [PATCH 006/132] build-sys: add meson submodule,
Paolo Bonzini <=
- [PATCH 007/132] meson: enable pie, Paolo Bonzini, 2019/12/12
- [PATCH 008/132] meson: use coverage option, Paolo Bonzini, 2019/12/12
- [PATCH 010/132] meson: add remaining generated tcg trace helpers, Paolo Bonzini, 2019/12/12
- [PATCH 004/132] configure: integrate Meson in the build system, Paolo Bonzini, 2019/12/12
- [PATCH 011/132] meson: add version.o, Paolo Bonzini, 2019/12/12
- [PATCH 013/132] contrib/vhost-user-blk: convert to Meson, Paolo Bonzini, 2019/12/12
- [PATCH 012/132] contrib/libvhost-user: convert to Meson, Paolo Bonzini, 2019/12/12
- [PATCH 014/132] contrib/vhost-user-scsi: convert to Meson, Paolo Bonzini, 2019/12/12
- [PATCH 015/132] contrib/rdmacm-mux: convert to Meson, Paolo Bonzini, 2019/12/12
- [PATCH 016/132] contrib/vhost-user-input: convert to meson, Paolo Bonzini, 2019/12/12