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

Nahum Shalman nshalman at elys.com
Thu May 3 09:32:19 PDT 2012


Consolidate two separate chunks of library hunting that depend on the
same check.

Check if we're actually building the client before looking for
client only libraries.

Hide some of the final output if we're not building the client.
---
I think this should address the rest of the concerns about
the previous version of this patch.

 configure.ac |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4b24c7d..6853d05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -183,7 +183,7 @@ AC_DEFINE_UNQUOTED([POSIX_YIELD_FUNC],$posix_yield_func,[The POSIX RT yield func
 
 SPICE_REQUIRES=""
 
-if test "x$enable_gui" = "xyes"; then
+if test "x$enable_gui" = "xyes" && test "x$enable_client" = "xyes" ; then
     PKG_CHECK_MODULES(CEGUI06, CEGUI-0.6 >= 0.6.0 CEGUI-0.6 < 0.7.0,
     [
         AC_SUBST(CEGUI06_CFLAGS)
@@ -254,7 +254,7 @@ SPICE_REQUIRES+=" openssl"
 # AC_SUBST(GL_LIBS)
 # SPICE_REQUIRES+=" gl glu"
 
-if test "x$enable_opengl" = "xyes"; then
+if test "x$enable_opengl" = "xyes" && test "x$enable_client" = "xyes" ; then
    AC_CHECK_LIB(GL, glBlendFunc, GL_LIBS="$GL_LIBS -lGL", enable_opengl=no)
    AC_CHECK_LIB(GLU, gluSphere, GL_LIBS="$GL_LIBS -lGLU", enable_opengl=no)
    AC_DEFINE([USE_OPENGL], [1], [Define to build with OpenGL support])
@@ -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 "x$red_target" = "xx11" && test "x$enable_client" = "xyes" ; 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,18 +482,18 @@ echo "
         python:                   ${PYTHON}
 
         Build Spice client:       ${enable_client}
-
+" ; if test "x$enable_client" == "xyes"; then echo "
         Have XRANDR 1.2:          ${have_xrandr12}
 
         Have Xinerama:            ${have_xinerama}
 
-        Support tunneling:        ${enable_tunnel}
-
         Red target:               ${red_target}
 
         OpenGL:                   ${enable_opengl}
 
         GUI:                      ${enable_gui}
+" ; fi ; echo "
+        Support tunneling:        ${enable_tunnel}
 
         Smartcard:                ${enable_smartcard}
 
-- 
1.7.7.6



More information about the Spice-devel mailing list