qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PULL 017/150] configure: generate Meson cross file


From: Paolo Bonzini
Subject: [PULL 017/150] configure: generate Meson cross file
Date: Tue, 18 Aug 2020 10:08:12 -0400

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 | 70 ++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 61 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index e0a2d262ea..22b89a5e24 100755
--- a/configure
+++ b/configure
@@ -8580,24 +8580,76 @@ 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.new"
+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
+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
+
+if test -f config-meson.cross && ! cmp $cross config-meson.cross >/dev/null 
2>&1; then
+    rm -rf meson-private meson-info meson-logs
+fi
+mv $cross config-meson.cross
+
 if test -d meson-private && ! test -f meson-private/coredata.dat; then
   rm -rf meson-private meson-info meson-logs
 fi
 NINJA=$PWD/ninjatool $meson setup \
         $(if test -d meson-private/; then echo --reconfigure; fi) \
-        --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
-- 
2.26.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]