[Spice-devel] cleanup x11 library detection for building client

Submitted by Nahum Shalman on May 3, 2012, 3 p.m.

Details

Message ID 1336057208-20719-1-git-send-email-nshalman@elys.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Nahum Shalman May 3, 2012, 3 p.m.
consolidate two separate chunks of library hunting that depend on the
same check, and check if we're actually building the client.

hide some of the final output if we're not building the client
---
 configure.ac |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

Patch hide | download patch | download mbox

diff --git a/configure.ac b/configure.ac
index 4b24c7d..aaa388c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -269,11 +269,14 @@  AC_SUBST(GL_CFLAGS)
 AC_SUBST(GL_LIBS)
 SPICE_NONPKGCONFIG_LIBS+=" $GL_LIBS"
 
-if test "$red_target" = "x11"; then
+if test "$red_target" = "x11" && test "$enable_client" = "yes" ; then
 	PKG_CHECK_MODULES(XRANDR, xrandr)
 	PKG_CHECK_MODULES(XFIXES, xfixes)
+	PKG_CHECK_MODULES(MISC_X, x11 xext xrender)
 	AC_SUBST(XRANDR_CFLAGS)
 	AC_SUBST(XRANDR_LIBS)
+	AC_SUBST(MISC_X_CFLAGS)
+	AC_SUBST(MISC_X_LIBS)
 
 	PKG_CHECK_MODULES(XRANDR12,
 	        xrandr >= 1.2,
@@ -288,12 +291,6 @@  if test "x$have_xrandr12" = "xyes" ; then
   AC_DEFINE([HAVE_XRANDR12], [], [Define if we have XRANDR 12])
 fi
 
-if test "$red_target" = "x11"; then
-	PKG_CHECK_MODULES(MISC_X, x11 xext xrender)
-	AC_SUBST(MISC_X_CFLAGS)
-	AC_SUBST(MISC_X_LIBS)
-fi
-
 PKG_CHECK_MODULES(XINERAMA,
         xinerama >= 1.0,
         have_xinerama=yes,
@@ -485,11 +482,11 @@  echo "
         python:                   ${PYTHON}
 
         Build Spice client:       ${enable_client}
-
+" ; if test $enable_client == "yes"; then echo "
         Have XRANDR 1.2:          ${have_xrandr12}
 
         Have Xinerama:            ${have_xinerama}
-
+" ; fi ; echo "
         Support tunneling:        ${enable_tunnel}
 
         Red target:               ${red_target}

Comments

On Thu, May 03, 2012 at 11:00:08AM -0400, Nahum Shalman wrote:
> consolidate two separate chunks of library hunting that depend on the
> same check, and check if we're actually building the client.
> 
> hide some of the final output if we're not building the client
> ---
>  configure.ac |   15 ++++++---------
>  1 files changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 4b24c7d..aaa388c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -269,11 +269,14 @@ AC_SUBST(GL_CFLAGS)
>  AC_SUBST(GL_LIBS)
>  SPICE_NONPKGCONFIG_LIBS+=" $GL_LIBS"
>  
> -if test "$red_target" = "x11"; then
> +if test "$red_target" = "x11" && test "$enable_client" = "yes" ; then
>  	PKG_CHECK_MODULES(XRANDR, xrandr)
>  	PKG_CHECK_MODULES(XFIXES, xfixes)
> +	PKG_CHECK_MODULES(MISC_X, x11 xext xrender)
>  	AC_SUBST(XRANDR_CFLAGS)
>  	AC_SUBST(XRANDR_LIBS)
> +	AC_SUBST(MISC_X_CFLAGS)
> +	AC_SUBST(MISC_X_LIBS)
>  
>  	PKG_CHECK_MODULES(XRANDR12,
>  	        xrandr >= 1.2,
> @@ -288,12 +291,6 @@ if test "x$have_xrandr12" = "xyes" ; then
>    AC_DEFINE([HAVE_XRANDR12], [], [Define if we have XRANDR 12])
>  fi
>  
> -if test "$red_target" = "x11"; then
> -	PKG_CHECK_MODULES(MISC_X, x11 xext xrender)
> -	AC_SUBST(MISC_X_CFLAGS)
> -	AC_SUBST(MISC_X_LIBS)
> -fi
> -
>  PKG_CHECK_MODULES(XINERAMA,
>          xinerama >= 1.0,
>          have_xinerama=yes,
> @@ -485,11 +482,11 @@ echo "
>          python:                   ${PYTHON}
>  
>          Build Spice client:       ${enable_client}
> -
> +" ; if test $enable_client == "yes"; then echo "
>          Have XRANDR 1.2:          ${have_xrandr12}
>  
>          Have Xinerama:            ${have_xinerama}
> -
> +" ; fi ; echo "
>          Support tunneling:        ${enable_tunnel}
>  
>          Red target:               ${red_target}

"Red target:" could be moved to the if test $enable_client block as well
since it's only relevant for the client. The patch looks good otherwise.

Christophe
On Thu, May 03, 2012 at 05:25:08PM +0200, Christophe Fergeau wrote:
> On Thu, May 03, 2012 at 11:00:08AM -0400, Nahum Shalman wrote:
> > consolidate two separate chunks of library hunting that depend on the
> > same check, and check if we're actually building the client.
> > 
> > hide some of the final output if we're not building the client
> > ---
> >  configure.ac |   15 ++++++---------
> >  1 files changed, 6 insertions(+), 9 deletions(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index 4b24c7d..aaa388c 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -269,11 +269,14 @@ AC_SUBST(GL_CFLAGS)
> >  AC_SUBST(GL_LIBS)
> >  SPICE_NONPKGCONFIG_LIBS+=" $GL_LIBS"
> >  
> > -if test "$red_target" = "x11"; then
> > +if test "$red_target" = "x11" && test "$enable_client" = "yes" ; then
> >  	PKG_CHECK_MODULES(XRANDR, xrandr)
> >  	PKG_CHECK_MODULES(XFIXES, xfixes)
> > +	PKG_CHECK_MODULES(MISC_X, x11 xext xrender)
> >  	AC_SUBST(XRANDR_CFLAGS)
> >  	AC_SUBST(XRANDR_LIBS)
> > +	AC_SUBST(MISC_X_CFLAGS)
> > +	AC_SUBST(MISC_X_LIBS)
> >  
> >  	PKG_CHECK_MODULES(XRANDR12,
> >  	        xrandr >= 1.2,
> > @@ -288,12 +291,6 @@ if test "x$have_xrandr12" = "xyes" ; then
> >    AC_DEFINE([HAVE_XRANDR12], [], [Define if we have XRANDR 12])
> >  fi
> >  
> > -if test "$red_target" = "x11"; then
> > -	PKG_CHECK_MODULES(MISC_X, x11 xext xrender)
> > -	AC_SUBST(MISC_X_CFLAGS)
> > -	AC_SUBST(MISC_X_LIBS)
> > -fi
> > -
> >  PKG_CHECK_MODULES(XINERAMA,
> >          xinerama >= 1.0,
> >          have_xinerama=yes,
> > @@ -485,11 +482,11 @@ echo "
> >          python:                   ${PYTHON}
> >  
> >          Build Spice client:       ${enable_client}
> > -
> > +" ; if test $enable_client == "yes"; then echo "
> >          Have XRANDR 1.2:          ${have_xrandr12}
> >  
> >          Have Xinerama:            ${have_xinerama}
> > -
> > +" ; fi ; echo "
> >          Support tunneling:        ${enable_tunnel}
> >  
> >          Red target:               ${red_target}
> 
> "Red target:" could be moved to the if test $enable_client block as well
> since it's only relevant for the client. The patch looks good otherwise.
> 

Oh, the GUI and opengl stuff below that is also client-specific if I'm not
mistaken, the tests for that could also be disabled when the client is
disabled.

Christophe