[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
- [PULL 005/150] meson: rename included C source files to .c.inc, (continued)
- [PULL 005/150] meson: rename included C source files to .c.inc, Paolo Bonzini, 2020/08/18
- [PULL 011/150] nsis: use "make DESTDIR=" instead of "make prefix=", Paolo Bonzini, 2020/08/18
- [PULL 014/150] configure: prepare CFLAGS/CXXFLAGS/LDFLAGS for Meson, Paolo Bonzini, 2020/08/18
- [PULL 004/150] trace: switch position of headers to what Meson requires, Paolo Bonzini, 2020/08/18
- [PULL 008/150] tests/vm: do not pollute configure with --efi-aarch64, Paolo Bonzini, 2020/08/18
- [PULL 013/150] configure: expand path variables for meson configure, Paolo Bonzini, 2020/08/18
- [PULL 012/150] configure: do not include $(...) variables in config-host.mak, Paolo Bonzini, 2020/08/18
- [PULL 010/150] tests/docker: add test script for static linux-user builds, Paolo Bonzini, 2020/08/18
- [PULL 015/150] tests/vm: include setuptools, Paolo Bonzini, 2020/08/18
- [PULL 009/150] tests/vm: check for Python YAML parser in the Makefile, Paolo Bonzini, 2020/08/18
- [PULL 017/150] configure: generate Meson cross file,
Paolo Bonzini <=
- [PULL 018/150] build-sys hack: link with whole .fa archives, Paolo Bonzini, 2020/08/18
- [PULL 016/150] configure: integrate Meson in the build system, Paolo Bonzini, 2020/08/18
- [PULL 020/150] meson: move summary to meson.build, Paolo Bonzini, 2020/08/18
- [PULL 021/150] meson: enable pie, Paolo Bonzini, 2020/08/18
- [PULL 022/150] meson: use coverage option, Paolo Bonzini, 2020/08/18
- [PULL 019/150] build-sys: add meson submodule, Paolo Bonzini, 2020/08/18
- [PULL 028/150] contrib/libvhost-user: convert to Meson, Paolo Bonzini, 2020/08/18
- [PULL 029/150] tools/virtiofsd: convert to Meson, Paolo Bonzini, 2020/08/18
- [PULL 027/150] meson: add version.o, Paolo Bonzini, 2020/08/18
- [PULL 030/150] contrib/vhost-user-blk: convert to Meson, Paolo Bonzini, 2020/08/18