summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorMarc-André Lureau2019-07-12 23:47:54 +0200
committerPaolo Bonzini2020-08-21 12:30:05 +0200
commitfc9298928658485bf92fc8aaa782d26ca79aee6b (patch)
treec43b99a13d6552d10073fa1af23fb9928962dabb /configure
parentconfigure: integrate Meson in the build system (diff)
downloadqemu-fc9298928658485bf92fc8aaa782d26ca79aee6b.tar.gz
qemu-fc9298928658485bf92fc8aaa782d26ca79aee6b.tar.xz
qemu-fc9298928658485bf92fc8aaa782d26ca79aee6b.zip
configure: generate Meson cross file
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure72
1 files changed, 63 insertions, 9 deletions
diff --git a/configure b/configure
index 26d571afca..958a0a4201 100755
--- a/configure
+++ b/configure
@@ -8630,21 +8630,75 @@ echo >> "$iotests_common_env"
echo "export PYTHON='$python'" >> "$iotests_common_env"
if test "$skip_meson" = no; then
+cross="config-meson.cross.new"
+meson_quote() {
+ echo "['$(echo $* | sed "s/ /','/g")']"
+}
+
+echo "# Automatically generated by configure - do not modify" > $cross
+echo "[properties]" >> $cross
+test -z "$cxx" && echo "link_language = 'c'" >> $cross
+echo "[binaries]" >> $cross
+echo "c = $(meson_quote $cc)" >> $cross
+test -n "$cxx" && echo "cpp = $(meson_quote $cxx)" >> $cross
+echo "ar = $(meson_quote $ar)" >> $cross
+echo "nm = $(meson_quote $nm)" >> $cross
+echo "pkgconfig = $(meson_quote $pkg_config_exe)" >> $cross
+echo "ranlib = $(meson_quote $ranlib)" >> $cross
+echo "strip = $(meson_quote $strip)" >> $cross
+echo "windres = $(meson_quote $windres)" >> $cross
+if test -n "$cross_prefix"; then
+ cross_arg="--cross-file config-meson.cross"
+ # Hack: Meson expects an absolute path for the *build* machine
+ # for the prefix, so add a slash in front of a Windows path that
+ # includes a drive letter.
+ #
+ # See https://github.com/mesonbuild/meson/issues/7577.
+ echo "[host_machine]" >> $cross
+ if test "$mingw32" = "yes" ; then
+ echo "system = 'windows'" >> $cross
+ case $prefix in
+ ?:*) pre_prefix=/ ;;
+ esac
+ fi
+ case "$ARCH" in
+ i386|x86_64)
+ echo "cpu_family = 'x86'" >> $cross
+ ;;
+ ppc64le)
+ echo "cpu_family = 'ppc64'" >> $cross
+ ;;
+ *)
+ echo "cpu_family = '$ARCH'" >> $cross
+ ;;
+ esac
+ echo "cpu = '$cpu'" >> $cross
+ if test "$bigendian" = "yes" ; then
+ echo "endian = 'big'" >> $cross
+ else
+ echo "endian = 'little'" >> $cross
+ fi
+else
+ cross_arg="--native-file config-meson.cross"
+fi
+mv $cross config-meson.cross
+
rm -rf meson-private meson-info meson-logs
NINJA=$PWD/ninjatool $meson setup \
- --prefix "$prefix" \
- --libdir "$libdir" \
- --libexecdir "$libexecdir" \
- --bindir "$bindir" \
- --includedir "$includedir" \
- --datadir "$datadir" \
- --mandir "$mandir" \
- --sysconfdir "$sysconfdir" \
- --localstatedir "$local_statedir" \
+ --prefix "${pre_prefix}$prefix" \
+ --libdir "${pre_prefix}$libdir" \
+ --libexecdir "${pre_prefix}$libexecdir" \
+ --bindir "${pre_prefix}$bindir" \
+ --includedir "${pre_prefix}$includedir" \
+ --datadir "${pre_prefix}$datadir" \
+ --mandir "${pre_prefix}$mandir" \
+ --sysconfdir "${pre_prefix}$sysconfdir" \
+ --localstatedir "${pre_prefix}$local_statedir" \
-Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \
-Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \
-Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \
-Dstrip=$(if test "$strip_opt" = yes; then echo true; else echo false; fi) \
+ $cross_arg \
"$PWD" "$source_path"
if test "$?" -ne 0 ; then