[Spice-devel] [PATCH spice-server 03/33] build: Detect Windows build and change some definitions

Christophe Fergeau cfergeau at redhat.com
Wed Jan 2 12:55:28 UTC 2019


On Sat, Dec 22, 2018 at 09:56:38AM -0500, Frediano Ziglio wrote:
> 
> > Hi
> > 
> > On Fri, Dec 21, 2018 at 4:03 PM Frediano Ziglio <fziglio at redhat.com> wrote:
> > >
> > > Windows needs some specific setting to use network.
> > >
> > > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > 
> > with neat below
> > Reviewed-by: Marc-André Lureau <marcandre.lureau at redhat.com>
> > 
> > > ---
> > >  configure.ac       | 18 +++++++++++++++++-
> > >  server/Makefile.am |  1 +
> > >  2 files changed, 18 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/configure.ac b/configure.ac
> > > index 96e4e66c..a2a81cef 100644
> > > --- a/configure.ac
> > > +++ b/configure.ac
> > > @@ -68,6 +68,18 @@ case $host_cpu in
> > >          SPICE_WARNING([spice-server on non-x86_64 architectures has not
> > >          been extensively tested])
> > >  esac
> > >
> > > +AC_MSG_CHECKING([for native Win32])
> > > +case "$host_os" in
> > > +     *mingw*|*cygwin*)
> > > +        os_win32=yes
> > > +        ;;
> > > +     *)
> > > +        os_win32=no
> > > +        ;;
> > > +esac
> > > +AC_MSG_RESULT([$os_win32])
> > > +AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
> > > +
> > >  dnl
> > >  =========================================================================
> > >  dnl Check optional features
> > >  SPICE_CHECK_SMARTCARD
> > > @@ -153,6 +165,9 @@ AC_CHECK_LIB(rt, clock_gettime, LIBRT="-lrt")
> > >  AC_SUBST(LIBRT)
> > >
> > >  AS_VAR_APPEND([SPICE_NONPKGCONFIG_LIBS], [" -pthread $LIBM $LIBRT"])
> > > +AS_IF([test "x$os_win32" = "xyes"], [
> > > +    AS_VAR_APPEND([SPICE_NONPKGCONFIG_LIBS], [" -lws2_32"])
> > > +])
> > >
> > >  SPICE_REQUIRES=""
> > >
> > > @@ -175,7 +190,8 @@ PKG_CHECK_MODULES([GOBJECT2], [gobject-2.0 >=
> > > $GLIB2_REQUIRED])
> > >  AS_VAR_APPEND([SPICE_REQUIRES], [" gobject-2.0 >= $GLIB2_REQUIRED"])
> > >
> > >  #used only by tests
> > > -PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= $GLIB2_REQUIRED])
> > > +AS_IF([test "x$os_win32" != "xyes"],
> > > +      PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= $GLIB2_REQUIRED]))
> > >
> > >  PIXMAN_REQUIRED=0.17.7
> > >  PKG_CHECK_MODULES(PIXMAN, pixman-1 >= $PIXMAN_REQUIRED)
> > > diff --git a/server/Makefile.am b/server/Makefile.am
> > > index 34ec22ad..5009d197 100644
> > > --- a/server/Makefile.am
> > > +++ b/server/Makefile.am
> > > @@ -6,6 +6,7 @@ check-valgrind:
> > >
> > >  AM_CPPFLAGS =                                  \
> > >         -DSPICE_SERVER_INTERNAL                 \
> > > +       -D_WIN32_WINNT=0x600                    \
> > 
> > I would add a comment in commit message or here that this require Vista API.
> > 
> > I have a preference to put those defines in a common top headers and
> > use #ifndef (so they can be easily overriden with CFLAGS). I am not
> > sure if we have a one though.
> > 
> 
> Is a
> 
> ## some code requires at least Vista
> 
> enough? (the double "#" make automake strip the comment before producing
> Makefile.in).

Why not AC_DEFINE _WIN32_WINNT when appropriate in configure.ac?

Christophe

> 
> > 
> > >         $(COMMON_CFLAGS)                        \
> > >         $(GLIB2_CFLAGS)                         \
> > >         $(GOBJECT2_CFLAGS)                      \
> 
> Frediano
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190102/6ff3206f/attachment-0001.sig>


More information about the Spice-devel mailing list