diff options
author | Paolo Bonzini | 2020-09-01 14:41:17 +0200 |
---|---|---|
committer | Paolo Bonzini | 2020-09-08 11:43:16 +0200 |
commit | 215b0c2fa5c9864343373f5a3e6680611dabef20 (patch) | |
tree | bcb2a515da4ec3cac572d7adcda7b8cddfb1d137 /configure | |
parent | configure: do not look for install(1) (diff) | |
download | qemu-215b0c2fa5c9864343373f5a3e6680611dabef20.tar.gz qemu-215b0c2fa5c9864343373f5a3e6680611dabef20.tar.xz qemu-215b0c2fa5c9864343373f5a3e6680611dabef20.zip |
meson: get glib compilation flags from GLIB_CFLAGS
The glib compilation flags were added to QEMU_CFLAGS. While we still
want them to be added to all compilation commands (at least for now),
do that via GLIB_CFLAGS rather than via QEMU_CFLAGS. This shows that
glib is a special case and makes it clearer that QEMU_CFLAGS is only
about compiler commands and not dependencies.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -3761,24 +3761,23 @@ if test "$plugins" = yes; then glib_modules="$glib_modules gmodule-2.0" fi -# This workaround is required due to a bug in pkg-config file for glib as it -# doesn't define GLIB_STATIC_COMPILATION for pkg-config --static - -if test "$static" = yes && test "$mingw32" = yes; then - QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS" -fi - for i in $glib_modules; do if $pkg_config --atleast-version=$glib_req_ver $i; then glib_cflags=$($pkg_config --cflags $i) glib_libs=$($pkg_config --libs $i) - QEMU_CFLAGS="$glib_cflags $QEMU_CFLAGS" LIBS="$glib_libs $LIBS" else error_exit "glib-$glib_req_ver $i is required to compile QEMU" fi done +# This workaround is required due to a bug in pkg-config file for glib as it +# doesn't define GLIB_STATIC_COMPILATION for pkg-config --static + +if test "$static" = yes && test "$mingw32" = yes; then + glib_cflags="-DGLIB_STATIC_COMPILATION $glib_cflags" +fi + if $pkg_config --atleast-version=$glib_req_ver gio-2.0; then gio=yes gio_cflags=$($pkg_config --cflags gio-2.0) @@ -3813,7 +3812,7 @@ int main(void) { } EOF -if ! compile_prog "$CFLAGS" "$LIBS" ; then +if ! compile_prog "$glib_cflags" "$glib_libs" ; then error_exit "sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T."\ "You probably need to set PKG_CONFIG_LIBDIR"\ "to point to the right pkg-config files for your"\ @@ -3828,7 +3827,7 @@ EOF if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then if cc_has_warning_flag "-Wno-unknown-attributes"; then glib_cflags="-Wno-unknown-attributes $glib_cflags" - QEMU_CFLAGS="-Wno-unknown-attributes $CFLAGS" + CFLAGS="-Wno-unknown-attributes $CFLAGS" fi fi |