[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 016/150] configure: generate Meson cross file
From: |
Paolo Bonzini |
Subject: |
[PATCH 016/150] configure: generate Meson cross file |
Date: |
Mon, 17 Aug 2020 16:35:09 +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>
---
configure | 68 +++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 59 insertions(+), 9 deletions(-)
diff --git a/configure b/configure
index f99baba99e..994e9844aa 100755
--- a/configure
+++ b/configure
@@ -8580,21 +8580,71 @@ 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 "[host_machine]" >> $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.
+ 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
+
+ cross_arg="--cross-file=$cross"
+fi
+
rm -rf meson-private/ meson-logs/ meson-info/
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
--
2.26.2
- [PATCH 006/150] build-sys hack: ensure target directory is there, (continued)
- [PATCH 006/150] build-sys hack: ensure target directory is there, Paolo Bonzini, 2020/08/17
- [PATCH 008/150] tests/vm: check for Python YAML parser in the Makefile, Paolo Bonzini, 2020/08/17
- [PATCH 007/150] tests/vm: do not pollute configure with --efi-aarch64, Paolo Bonzini, 2020/08/17
- [PATCH 005/150] meson: rename .inc.c files to .inc, Paolo Bonzini, 2020/08/17
- [PATCH 009/150] tests/docker: add test script for static linux-user builds, Paolo Bonzini, 2020/08/17
- [PATCH 011/150] configure: do not include $(...) variables in config-host.mak, Paolo Bonzini, 2020/08/17
- [PATCH 010/150] nsis: use "make DESTDIR=" instead of "make prefix=", Paolo Bonzini, 2020/08/17
- [PATCH 012/150] configure: expand path variables for meson configure, Paolo Bonzini, 2020/08/17
- [PATCH 013/150] configure: prepare CFLAGS/CXXFLAGS/LDFLAGS for Meson, Paolo Bonzini, 2020/08/17
- [PATCH 014/150] tests/vm: include setuptools, Paolo Bonzini, 2020/08/17
- [PATCH 016/150] configure: generate Meson cross file,
Paolo Bonzini <=
- [PATCH 017/150] build-sys hack: link with whole .fa archives, Paolo Bonzini, 2020/08/17
- [PATCH 015/150] configure: integrate Meson in the build system, Paolo Bonzini, 2020/08/17
- [PATCH 020/150] meson: enable pie, Paolo Bonzini, 2020/08/17
- [PATCH 018/150] build-sys: add meson submodule, Paolo Bonzini, 2020/08/17
- [PATCH 022/150] meson: add sparse support, Paolo Bonzini, 2020/08/17
- [PATCH 019/150] meson: move summary to meson.build, Paolo Bonzini, 2020/08/17
- [PATCH 021/150] meson: use coverage option, Paolo Bonzini, 2020/08/17
- [PATCH 023/150] meson: add testsuite Makefile generator, Paolo Bonzini, 2020/08/17
- [PATCH 025/150] meson: add remaining generated tcg trace helpers, Paolo Bonzini, 2020/08/17
- [PATCH 027/150] contrib/libvhost-user: convert to Meson, Paolo Bonzini, 2020/08/17