diff --git a/configure b/configure index 2735f9ae253c608b7e1c4a6db89ecb3301d386bc..423f4355508af7b3ce77e06c8500dd3418758aa8 100755 --- a/configure +++ b/configure @@ -1424,6 +1424,9 @@ if compile_prog "-Werror -fno-gcse" "" ; then fi if test "$static" = "yes" ; then + if test "$modules" = "yes" ; then + error_exit "static and modules are mutually incompatible" + fi if test "$pie" = "yes" ; then error_exit "static and pie are mutually incompatible" else @@ -2483,8 +2486,12 @@ if test "$mingw32" = yes; then else glib_req_ver=2.12 fi +glib_modules=gthread-2.0 +if test "$modules" = yes; then + glib_modules="$glib_modules gmodule-2.0" +fi -for i in gthread-2.0 gmodule-2.0; do +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` diff --git a/util/module.c b/util/module.c index 42bc3732c931457d1e70ad3c8398778d001e2864..dc08c16111443e5c351df70c9b7e0c2bd5cb87a5 100644 --- a/util/module.c +++ b/util/module.c @@ -14,7 +14,9 @@ */ #include +#ifdef CONFIG_MODULES #include +#endif #include "qemu-common.h" #include "qemu/queue.h" #include "qemu/module.h"