aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-11-08 16:23:32 +0100
committerRichard Henderson <richard.henderson@linaro.org>2021-11-08 16:23:32 +0100
commit5e10ccc2706768bcba608f5d174d4079944c270a (patch)
tree072f2a0b8a017bcfa567d452726bc98706bd46cc /configure
parent260f9210d2ce892c5e162a45b0e5ec0036bedc79 (diff)
parent8b4ed0dabae559ebe1fd6f8eb54e1ec6000a0a7a (diff)
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
* Fix off-by-one in MODE SELECT commands * extend --extra-*flags behavior to meson-based tests * allow using snappy in static builds * i386 TCG fixes * fix build failure when libgbm is not available # gpg: Signature made Mon 08 Nov 2021 12:20:24 PM CET # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] * remotes/bonzini/tags/for-upstream: ui/gtk-egl: Fix build failure when libgbm is not available configure: ignore preexisting QEMU_*FLAGS envvars configure: propagate --extra-cflags and --extra-ldflags to meson compile tests configure: preserve CFLAGS, CXXFLAGS and LDFLAGS in config.status configure: simplify calls to meson_quote docs: adjust for demise of scripts/create_config meson: perform snappy test with the C++ compiler if used hw/scsi/scsi-disk: MODE_PAGE_ALLS not allowed in MODE SELECT commands target-i386: mmu: fix handling of noncanonical virtual addresses target-i386: mmu: use pg_mode instead of HF_LMA_MASK Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure46
1 files changed, 28 insertions, 18 deletions
diff --git a/configure b/configure
index 33682cb971..89c1872c3b 100755
--- a/configure
+++ b/configure
@@ -158,7 +158,7 @@ update_cxxflags() {
# Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those
# options which some versions of GCC's C++ compiler complain about
# because they only make sense for C programs.
- QEMU_CXXFLAGS="$QEMU_CXXFLAGS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS"
+ QEMU_CXXFLAGS="-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS"
CONFIGURE_CXXFLAGS=$(echo "$CONFIGURE_CFLAGS" | sed s/-std=gnu11/-std=gnu++11/)
for arg in $QEMU_CFLAGS; do
case $arg in
@@ -174,14 +174,14 @@ update_cxxflags() {
compile_object() {
local_cflags="$1"
- do_cc $CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC
+ do_cc $CFLAGS $EXTRA_CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC
}
compile_prog() {
local_cflags="$1"
local_ldflags="$2"
- do_cc $CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC \
- $LDFLAGS $CONFIGURE_LDFLAGS $QEMU_LDFLAGS $local_ldflags
+ do_cc $CFLAGS $EXTRA_CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC \
+ $LDFLAGS $EXTRA_LDFLAGS $CONFIGURE_LDFLAGS $QEMU_LDFLAGS $local_ldflags
}
# symbolically link $1 to $2. Portable version of "ln -sf".
@@ -286,6 +286,10 @@ for opt do
esac
done
+EXTRA_CFLAGS=""
+EXTRA_CXXFLAGS=""
+EXTRA_LDFLAGS=""
+
xen_ctrl_version="$default_feature"
xfs="$default_feature"
membarrier="$default_feature"
@@ -394,13 +398,13 @@ for opt do
;;
--cpu=*) cpu="$optarg"
;;
- --extra-cflags=*) QEMU_CFLAGS="$QEMU_CFLAGS $optarg"
- QEMU_LDFLAGS="$QEMU_LDFLAGS $optarg"
- ;;
- --extra-cxxflags=*) QEMU_CXXFLAGS="$QEMU_CXXFLAGS $optarg"
+ --extra-cflags=*)
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $optarg"
+ EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg"
+ ;;
+ --extra-cxxflags=*) EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg"
;;
- --extra-ldflags=*) QEMU_LDFLAGS="$QEMU_LDFLAGS $optarg"
- EXTRA_LDFLAGS="$optarg"
+ --extra-ldflags=*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS $optarg"
;;
--enable-debug-info) debug_info="yes"
;;
@@ -461,11 +465,13 @@ sdl2_config="${SDL2_CONFIG-${cross_prefix}sdl2-config}"
# left shift of signed integers is well defined and has the expected
# 2s-complement style results. (Both clang and gcc agree that it
# provides these semantics.)
-QEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv $QEMU_CFLAGS"
+QEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv"
QEMU_CFLAGS="-Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
+QEMU_LDFLAGS=
+
# Flags that are needed during configure but later taken care of by Meson
CONFIGURE_CFLAGS="-std=gnu11 -Wall"
CONFIGURE_LDFLAGS=
@@ -1346,8 +1352,8 @@ Advanced options (experts only):
build time
--cxx=CXX use C++ compiler CXX [$cxx]
--objcc=OBJCC use Objective-C compiler OBJCC [$objcc]
- --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS
- --extra-cxxflags=CXXFLAGS append extra C++ compiler flags QEMU_CXXFLAGS
+ --extra-cflags=CFLAGS append extra C compiler flags CFLAGS
+ --extra-cxxflags=CXXFLAGS append extra C++ compiler flags CXXFLAGS
--extra-ldflags=LDFLAGS append extra linker flags LDFLAGS
--cross-cc-ARCH=CC use compiler when building ARCH guest test cases
--cross-cc-flags-ARCH= use compiler flags when building ARCH guest tests
@@ -3402,7 +3408,7 @@ EOF
update_cxxflags
- if do_cxx $CXXFLAGS $CONFIGURE_CXXFLAGS $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then
+ if do_cxx $CXXFLAGS $EXTRA_CXXFLAGS $CONFIGURE_CXXFLAGS $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then
# C++ compiler $cxx works ok with C compiler $cc
:
else
@@ -3894,6 +3900,7 @@ echo "TOPSRC_DIR=$source_path" >> $config_mak
if test "$skip_meson" = no; then
cross="config-meson.cross.new"
meson_quote() {
+ test $# = 0 && return
echo "'$(echo $* | sed "s/ /','/g")'"
}
@@ -3908,10 +3915,10 @@ if test "$skip_meson" = no; then
test -z "$cxx" && echo "link_language = 'c'" >> $cross
echo "[built-in options]" >> $cross
- echo "c_args = [${CFLAGS:+$(meson_quote $CFLAGS)}]" >> $cross
- echo "cpp_args = [${CXXFLAGS:+$(meson_quote $CXXFLAGS)}]" >> $cross
- echo "c_link_args = [${LDFLAGS:+$(meson_quote $LDFLAGS)}]" >> $cross
- echo "cpp_link_args = [${LDFLAGS:+$(meson_quote $LDFLAGS)}]" >> $cross
+ echo "c_args = [$(meson_quote $CFLAGS $EXTRA_CFLAGS)]" >> $cross
+ echo "cpp_args = [$(meson_quote $CXXFLAGS $EXTRA_CXXFLAGS)]" >> $cross
+ echo "c_link_args = [$(meson_quote $CFLAGS $LDFLAGS $EXTRA_CFLAGS $EXTRA_LDFLAGS)]" >> $cross
+ echo "cpp_link_args = [$(meson_quote $CXXFLAGS $LDFLAGS $EXTRA_CXXFLAGS $EXTRA_LDFLAGS)]" >> $cross
echo "[binaries]" >> $cross
echo "c = [$(meson_quote $cc $CPU_CFLAGS)]" >> $cross
test -n "$cxx" && echo "cpp = [$(meson_quote $cxx $CPU_CFLAGS)]" >> $cross
@@ -4056,9 +4063,12 @@ preserve_env AR
preserve_env AS
preserve_env CC
preserve_env CPP
+preserve_env CFLAGS
preserve_env CXX
+preserve_env CXXFLAGS
preserve_env INSTALL
preserve_env LD
+preserve_env LDFLAGS
preserve_env LD_LIBRARY_PATH
preserve_env LIBTOOL
preserve_env MAKE