As a related note, is anyone seriously using/developing the mainline QEMU sources on/for Windows?
If so, what is the recommended environment to do so? I'm currently using cygwin to generate
mingw-linked binaries (which dont require cygwin.dll at runtime), but I can think of other ways
to generate these:
- using MSYS + mingw
- using mingw and the Windows command line
- using Linux and the linux-mingw32 toolchain
Finally, what is the best way to send patches to this list?. I notice that many patches are also sent
directly to various developers, and that they tend to get reviewed/accepted/rejected a tad more rapidly.
Is it ok to send patches as attachments ? or should they be sent with git-send-email instead?
By the way, I'd be happy to regularly check the Windows mainline build if that can help.
I'm also preparing a series of patches that fix several Windows-specific issues (most of them related
to this horrible thing they called Winsock...).
Thanks for your time.
- David
Feature detection didn't work properly under cygwin because the OS_CFLAGS=-mno-cygwinflags was not passed to the feature checks (which only used $ARCH_CFLAGS). The endresult being that features were detected against the mostly-Posix Cygwin headers,while compilation happened against the Mingw headers which lack many headers like<sys/uio.h>, <fnmatch.h> and others.Also, an OS_LDFLAGS=-mno-cygwin was missing, resulting in a link-time errorFinally, three helper functions are introduced to simplify feature detection withinthe configure script: check_compile, check_link and check_link_with_log. Featuredetection code was modified to use them instead of directly calling $cc with a reallylong list of arguments.Signed-off-by: digit <digit@google.com>---configure | 98 +++++++++++++++++++++++++++++++++++--------------------------1 files changed, 56 insertions(+), 42 deletions(-)diff --git a/configure b/configureindex 89e7f53..e0191f0 100755--- a/configure+++ b/configure@@ -73,7 +73,21 @@ cat > $TMPC <<EOF#endifint main(void) { return 0; }EOF- $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null+ $cc $ARCH_CFLAGS -c -o $TMPO $TMPC ${OS_CFLAGS} > /dev/null 2> /dev/null+}++check_compile() {+ $cc $ARCH_CFLAGS $OS_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null+}++check_link() {+ $cc $ARCH_CFLAGS $OS_CFLAGS -o $TMPE $TMPC $* > /dev/null 2> /dev/null+}++check_link_with_log() {+ TMPLOG=$1+ shift+ $cc $ARCH_CFLAGS $OS_CFLAGS -o $TMPE $TMPC $* > $TMPLOG 2>&1}if check_define __i386__ ; then@@ -216,6 +230,7 @@ case $targetos inCYGWIN*)mingw32="yes"OS_CFLAGS="-mno-cygwin"+OS_LDFLAGS="-mno-cygwin"if [ "$cpu" = "i386" ] ; thenkqemu="yes"fi@@ -763,7 +778,7 @@ int main(int argc, char ** argv){}EOF-if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then+if check_link; then$TMPE && bigendian="yes"elseecho big/little test failed@@ -809,7 +824,7 @@ void foo()}EOF-if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then+if check_compile; then:elsenptl="no"@@ -822,7 +837,7 @@ cat > $TMPC << EOF#include <zlib.h>int main(void) { zlibVersion(); return 0; }EOF-if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev/null 2> /dev/null ; then+if check_link -lz; then:elseecho@@ -841,7 +856,7 @@ cat > $TMPC <<EOF#include <xs.h>int main(void) { xs_daemon_open; xc_interface_open; }EOF- if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC -lxenstore -lxenctrl 2> /dev/null > /dev/null ; then+ if check_link -lxenstore -lxenctrl; then:elsexen="no"@@ -855,6 +870,8 @@ sdl_too_old=noif test "$sdl" = "yes" ; thensdl_config="sdl-config"+ sdl_cflags=`$sdl_config --cflags 2> /dev/null`+ sdl_ldflags=`$sdl_config --libs 2> /dev/null`sdl=nosdl_static=no@@ -863,7 +880,7 @@ cat > $TMPC << EOF#undef main /* We don't want SDL to override our main() */int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }EOF- if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > $TMPSDLLOG 2>&1 ; then+ if check_link_with_log $TMPSDLLOG $sdl_cflags $sdl_ldflags; then_sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`if test "$_sdlversion" -lt 121 ; thensdl_too_old=yes@@ -882,7 +899,7 @@ EOFsdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"fi- if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev/null 2> /dev/null; then+ if check_link `$sdl_config --cflags 2> /dev/null` $sdl_static_libs; thensdl_static=yesfifi # static link@@ -905,8 +922,8 @@ cat > $TMPC <<EOF#endifint main(void) { return 0; }EOF- if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > /dev/null 2>&1 ; then- sdl_x11="yes"+ if check_link $sdl_cflags $sdl_ldflags; then+ sdl_x11="yes"fifi@@ -919,11 +936,10 @@ int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }EOFvnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`- if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \- $vnc_tls_libs > /dev/null 2> /dev/null ; then- :+ if check_link $vnc_tls_cflags $vnc_tls_libs; then+ :else- vnc_tls="no"+ vnc_tls="no"fifi@@ -938,11 +954,10 @@ EOF# Assuming Cyrus-SASL installed in /usr prefixvnc_sasl_cflags=""vnc_sasl_libs="-lsasl2"- if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_sasl_cflags $TMPC \- $vnc_sasl_libs 2> /dev/null > /dev/null ; then- :+ if check_link $vnc_sasl_cflags $vnc_sasl_libs; then+ :else- vnc_sasl="no"+ vnc_sasl="no"fifi@@ -957,7 +972,7 @@ int main(void)return 0;}EOF-if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then+if check_link; thenfnmatch="yes"fi@@ -973,7 +988,7 @@ int main(void)return 0;}EOF- if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev/null 2> /dev/null ; then+ if check_link -lvdeplug; then:elsevde="no"@@ -994,7 +1009,7 @@ audio_drv_probe()#include <$hdr>int main(void) { $exp }EOF- if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev/null 2> /dev/null ; then+ if check_link $cfl $lib; then:elseecho@@ -1058,8 +1073,8 @@ cat > $TMPC << EOF#include <brlapi.h>int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }EOF- if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev/null 2> /dev/null ; then- brlapi=yes+ if check_link -lbrlapi; then+ brlapi=yesfi # brlapi compile testfi # -z $brlapi@@ -1075,7 +1090,7 @@ if test "$curses" = "yes" ; then#endifint main(void) { resize_term(0, 0); return curses_version(); }EOF- if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then+ if check_link -lcurses; thencurses=yesfifi # test "$curses"@@ -1089,8 +1104,9 @@ if test "$curl" = "yes" ; then#include <curl/curl.h>int main(void) { return curl_easy_init(); }EOF+ curl_cflags=`curl-cflags --cflags 2>/dev/null`curl_libs=`curl-config --libs 2>/dev/null`- if $cc $ARCH_CFLAGS $curl_libs -o $TMPE $TMPC > /dev/null 2> /dev/null ; then+ if check_link $curl_cflags $curl_libs; thencurl=yesfifi # test "$curl"@@ -1107,8 +1123,7 @@ int main(void) { return bt_error(0); }EOFbluez_cflags=`pkg-config --cflags bluez 2> /dev/null`bluez_libs=`pkg-config --libs bluez 2> /dev/null`- if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \- $bluez_libs > /dev/null 2> /dev/null ; then+ if check_link $bluez_cflags $bluez_libs; then:elsebluez="no"@@ -1139,24 +1154,23 @@ EOFif test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \-a -d "$kerneldir/arch/x86/include" ; thenkvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"- elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then- kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"+ elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then+ kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"elif test -d "$kerneldir/arch/$cpu/include" ; thenkvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"fielsekvm_cflags=""fi- if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \- > /dev/null 2>/dev/null ; then+ if check_link $kvm_cflags; then:elsekvm="no";if [ -x "`which awk 2>/dev/null`" ] && \[ -x "`which grep 2>/dev/null`" ]; thenkvmerr=`LANG=C $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \- | grep "error: " \- | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`+ | grep "error: " \+ | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`if test "$kvmerr" != "" ; thenkvm="no - (${kvmerr})\n\NOTE: To enable KVM support, update your kernel to 2.6.29+ or install \@@ -1178,7 +1192,7 @@ cat > $TMPC << EOFint main(void) { pthread_create(0,0,0,0); return 0; }EOFfor pthread_lib in $PTHREADLIBS_LIST; do- if $cc $ARCH_CFLAGS -o $TMPE $TMPC $pthread_lib 2> /dev/null > /dev/null ; then+ if check_link $pthread_lib; thenpthread=yesPTHREADLIBS="$pthread_lib"break@@ -1200,7 +1214,7 @@ cat > $TMPC <<EOFint main(void) { struct iovec iov; return 0; }EOFiovec=no-if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then+if check_link; theniovec=yesfi@@ -1213,7 +1227,7 @@ cat > $TMPC <<EOFint main(void) { preadv; }EOFpreadv=no-if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then+if check_link; thenpreadv=yesfi@@ -1224,7 +1238,7 @@ if test "$fdt" = "yes" ; thencat > $TMPC << EOFint main(void) { return 0; }EOF- if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev/null > /dev/null ; then+ if check_link -lfdt; thenfdt=yesfifi@@ -1249,7 +1263,7 @@ main(void)return (unlinkat(AT_FDCWD, "nonexistent_file", 0));}EOF- if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null > /dev/null ; then+ if check_link; thenatfile=yesfifi@@ -1271,7 +1285,7 @@ main(void)return inotify_init();}EOF- if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null > /dev/null ; then+ if check_link; theninotify=yesfifi@@ -1291,9 +1305,9 @@ int main(void) { clockid_t id; return clock_gettime(id, NULL); }EOFrt=no-if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then+if check_link; then:-elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev/null 2> /dev/null ; then+elif check_link -lrt; thenrt=yesfi@@ -1529,7 +1543,7 @@ else#include <byteswap.h>int main(void) { return bswap_32(0); }EOF- if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then+ if check_link; thenecho "#define HAVE_BYTESWAP_H 1" >> $config_hficat > $TMPC << EOF@@ -1538,7 +1552,7 @@ EOF#include <machine/bswap.h>int main(void) { return bswap32(0); }EOF- if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then+ if check_link; thenecho "#define HAVE_MACHINE_BSWAP_H 1" >> $config_hfifi--1.6.1.2