]> git.proxmox.com Git - mirror_qemu.git/commit - configure
configure: propagate --extra-cflags and --extra-ldflags to meson compile tests
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 5 Nov 2021 09:09:26 +0000 (10:09 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 Nov 2021 11:20:08 +0000 (12:20 +0100)
commita2866660441f114188b7d1025a4a19cbb6188fef
tree2ca9e2d764eaca3314be5989d5ecd953f7c8130b
parent8009da037418d454d4833e7d3c3367f2f4d7244a
configure: propagate --extra-cflags and --extra-ldflags to meson compile tests

Meson (intentionally) does not add QEMU_CFLAGS to cc.compiles/cc.links
tests, as they are supposed to be independent of the specific sets of
compilation flags used to build the programs.  However, the user can
still use CFLAGS or the toolchain file's LANG_args/LANG_link_args option
to specify -I or -L options that apply to cc.compiles/cc.links as well.

This is also the intended use of configure's --extra-cflags,
--extra-cxxflags and --extra-ldflags options.  For example, if
one has netmap's header in a nonstandard directory, up to commit
837b84b1c078bf3e909 it used to work fine to do:

.../configure --enable-netmap \
     --extra-cflags=-I/path/to/netmap/sys

but since the test was converted to meson, this does not work anymore.

Pass these options to meson via the toolchain file instead of via
config-host.mak, since both have the same purpose.

Reported-by: Owen LaGarde
Reported-by: Thomas Huth <thuth@redhat.com>
Fixes: 47b30835e4 ("configure: consistently pass CFLAGS/CXXFLAGS/LDFLAGS to meson", 2020-10-06)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
configure