diff mbox series

[005/132] configure: generate Meson cross file

Message ID 1576155176-2464-6-git-send-email-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show
Series Proof of concept for Meson integration | expand

Commit Message

Paolo Bonzini Dec. 12, 2019, 12:50 p.m. UTC
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>
---
 configure | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
diff mbox series

Patch

diff --git a/configure b/configure
index 3e3eb3d..2f3e231 100755
--- a/configure
+++ b/configure
@@ -7852,6 +7852,46 @@  echo "# Automatically generated by configure - do not modify" > "$iotests_common
 echo >> "$iotests_common_env"
 echo "export PYTHON='$python'" >> "$iotests_common_env"
 
+cross="config-meson.cross"
+cross_arg=
+
+if test -n "$cross_prefix"; then
+    echo "# Automatically generated by configure - do not modify" > $cross
+    echo "[binaries]" >> $cross
+    echo "c = '$cc'" >> $cross
+    echo "cpp = '$cxx'" >> $cross
+    echo "ar = '$ar'" >> $cross
+    echo "nm = '$nm'" >> $cross
+    echo "pkgconfig = '$pkg_config_exe'" >> $cross
+    echo "ranlib = '$ranlib'" >> $cross
+    echo "strip = '$strip'" >> $cross
+    echo "windres = '$windres'" >> $cross
+
+    echo "[properties]" >> $cross
+    echo "root = '$prefix'" >> $cross
+
+    echo "[host_machine]" >> $cross
+if test "$mingw32" = "yes" ; then
+    echo "system = 'windows'" >> $cross
+fi
+case "$ARCH" in
+    i386|x86_64)
+        echo "cpu_family = 'x86'" >> $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
+
+    cross_arg="--cross-file=$cross"
+fi
+
 rm -rf meson-private meson-info meson-logs
 NINJA=$PWD/ninjatool $python $meson setup \
 	--prefix "$prefix" \
@@ -7865,6 +7905,7 @@  NINJA=$PWD/ninjatool $python $meson setup \
 	--localstatedir "$local_statedir" \
 	$(test "$strip_opt" = yes && echo --strip) \
 	--buildtype $(if test "$debug" = yes; then echo debug; else echo debugoptimized; fi) \
+        $cross_arg \
 	"$PWD" "$source_path"
 
 if test "$?" -ne 0 ; then