[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 018/147] build-sys: add meson submodule
From: |
Paolo Bonzini |
Subject: |
[PATCH 018/147] build-sys: add meson submodule |
Date: |
Mon, 10 Aug 2020 19:06:56 +0200 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
.gitmodules | 3 +++
configure | 53 ++++++++++++++++++++++++++++++++++++++++++-----
meson | 1 +
scripts/archive-source.sh | 3 ++-
4 files changed, 54 insertions(+), 6 deletions(-)
create mode 160000 meson
diff --git a/.gitmodules b/.gitmodules
index 9c0501a..ce97939 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -58,3 +58,6 @@
[submodule "roms/qboot"]
path = roms/qboot
url = https://github.com/bonzini/qboot
+[submodule "meson"]
+ path = meson
+ url = https://github.com/mesonbuild/meson/
diff --git a/configure b/configure
index f38c783..5806f92 100755
--- a/configure
+++ b/configure
@@ -174,6 +174,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
}
@@ -506,7 +525,7 @@ fuzzing="no"
rng_none="no"
secret_keyring=""
libdaxctl=""
-meson=meson
+meson=""
supported_cpu="no"
supported_os="no"
@@ -1978,11 +1997,35 @@ python_version=$($python -c 'import sys;
print("%d.%d.%d" % (sys.version_info[0]
# Suppress writing compiled files
python="$python -B"
-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.55.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
+
+if test "$meson" = git; then
+ git_submodules="${git_submodules} meson"
fi
-meson=$(command -v $meson)
+if test "$git_update" = yes; then
+ (cd "${source_path}" && GIT="$git" "./scripts/git-submodule.sh" update
"$git_submodules")
+fi
+
+case "$meson" in
+ git | internal)
+ meson=${source_path}/meson/meson.py
+ ;;
+ *)
+ meson=$(command -v meson)
+ if ! has "$meson" ; then
+ error_exit "Meson not found. Use
--meson=/path/to/meson|git|internal"
+ fi
+ ;;
+esac
+meson="$python $meson"
# Check that the C compiler works. Doing this here before testing
# the host CPU ensures that we had a valid CC to autodetect the
diff --git a/meson b/meson
new file mode 160000
index 0000000..d0c68dc
--- /dev/null
+++ b/meson
@@ -0,0 +1 @@
+Subproject commit d0c68dc11507a47b9b85de508e023d9590d60565
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
- [PATCH 005/147] meson: rename .inc.c files to .inc, (continued)
- [PATCH 005/147] meson: rename .inc.c files to .inc, Paolo Bonzini, 2020/08/10
- [PATCH 008/147] tests/vm: check for Python YAML parser in the Makefile, Paolo Bonzini, 2020/08/10
- [PATCH 011/147] configure: do not include $(...) variables in config-host.mak, Paolo Bonzini, 2020/08/10
- [PATCH 010/147] nsis: use "make DESTDIR=" instead of "make prefix=", Paolo Bonzini, 2020/08/10
- [PATCH 012/147] configure: expand path variables for meson configure, Paolo Bonzini, 2020/08/10
- [PATCH 014/147] tests/vm: include setuptools, Paolo Bonzini, 2020/08/10
- [PATCH 013/147] configure: prepare CFLAGS/CXXFLAGS/LDFLAGS for Meson, Paolo Bonzini, 2020/08/10
- [PATCH 015/147] configure: integrate Meson in the build system, Paolo Bonzini, 2020/08/10
- [PATCH 017/147] build-sys hack: link with whole .fa archives, Paolo Bonzini, 2020/08/10
- [PATCH 016/147] configure: generate Meson cross file, Paolo Bonzini, 2020/08/10
- [PATCH 018/147] build-sys: add meson submodule,
Paolo Bonzini <=
- [PATCH 019/147] meson: move summary to meson.build, Paolo Bonzini, 2020/08/10
- [PATCH 020/147] meson: enable pie, Paolo Bonzini, 2020/08/10
- [PATCH 021/147] meson: use coverage option, Paolo Bonzini, 2020/08/10
- [PATCH 022/147] meson: add sparse support, Paolo Bonzini, 2020/08/10
- [PATCH 023/147] meson: add testsuite Makefile generator, Paolo Bonzini, 2020/08/10
- [PATCH 025/147] meson: add remaining generated tcg trace helpers, Paolo Bonzini, 2020/08/10
- [PATCH 024/147] libqemuutil, qapi, trace: convert to meson, Paolo Bonzini, 2020/08/10
- [PATCH 026/147] meson: add version.o, Paolo Bonzini, 2020/08/10
- [PATCH 027/147] contrib/libvhost-user: convert to Meson, Paolo Bonzini, 2020/08/10
- [PATCH 030/147] contrib/vhost-user-scsi: convert to Meson, Paolo Bonzini, 2020/08/10