[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 1/2] qga: add additional win32 cflags and lib
From: |
Kirk Allan |
Subject: |
Re: [Qemu-devel] [PATCH v4 1/2] qga: add additional win32 cflags and libraries |
Date: |
Mon, 01 Jun 2015 15:19:53 -0600 |
>>>
>
> On 01/06/2015 20:56, Kirk Allan wrote:
>> Test if *-extra-cflags is being used to include flags such as
>> _WIN32_WINVER and WINVER to gain additional functionality offered
>> by Windows Vista/2008 and newer. If not, default WINVER to 0x501.
>>
>> Add the iphlpapi library to use APIs such as GetAdaptersInfo and
>> GetAdaptersAddresses.
>>
>> Signed-off-by: Kirk Allan <address@hidden>
>
> Elsewhere on the list, we've discussed putting extra cflags _after_ the
> configure-detected QEMU_CFLAGS. This would fix the issue in the first
> part of this patch too.
By the time this portion of the configure script executes, any --extra-cflags
have already been rolled into the QEMU_CFLAGS. Here I'm just checking if
WINVER is already contained in QEMU_CFLAGS. If it is not, then add
WINVER=0x501 to the flags as it was done before. If it's already contained in
the QEMU_CFLAGS, just use what's there. The only ordering difference would be
WINVER now comes before WIN32_LEAN_AND_MEAN.
>
> Is iphlpapi available on Windows XP?
Yes
>
> Paolo
>
>> ---
>> configure | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 4e2f78a..67bd9af 100755
>> --- a/configure
>> +++ b/configure
>> @@ -708,7 +708,12 @@ fi
>> if test "$mingw32" = "yes" ; then
>> EXESUF=".exe"
>> DSOSUF=".dll"
>> - QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
>> + # --extra-cflags can be used to set flags such as -DWINVER and
>> + # -D_WIN32_WINNT. If -DWINVER has not be set, default to XP (0x501).
>> + if [ "$QEMU_CFLAGS" = "${QEMU_CFLAGS%-DWINVER=*}" ] ; then
>> + QEMU_CFLAGS="-DWINVER=0x501 $QEMU_CFLAGS"
>> + fi
>> + QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN $QEMU_CFLAGS"
>> # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
>> QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
>> LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS"
>> @@ -724,7 +729,7 @@ if test "$mingw32" = "yes" ; then
>> sysconfdir="\${prefix}"
>> local_statedir=
>> confsuffix=""
>> - libs_qga="-lws2_32 -lwinmm -lpowrprof $libs_qga"
>> + libs_qga="-lws2_32 -lwinmm -lpowrprof -liphlpapi $libs_qga"
>> fi
>>
>> werror=""
>>
[Qemu-devel] [PATCH v4 2/2] qga: win32 implementation of qmp_guest_network_get_interfaces, Kirk Allan, 2015/06/01