From 27636d80def676ae8599caadfec5c8657840d232 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Wed, 17 Jun 2015 18:51:14 +0200 Subject: build-sys: Use spice-common m4 macro for opengl This factorizes a bit of configure.ac m4 code. --- configure.ac | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 76226838..8da30668 100644 --- a/configure.ac +++ b/configure.ac @@ -70,12 +70,10 @@ esac dnl ========================================================================= dnl Check optional features -AC_ARG_ENABLE([opengl], - AS_HELP_STRING([--enable-opengl], - [Enable opengl requirement / support (not recommended)]),, - [enable_opengl="no"]) -AS_IF([test x"$enable_opengl" != "xno"], [enable_opengl="yes"]) -AM_CONDITIONAL(SUPPORT_GL, test "x$enable_opengl" = "xyes") +SPICE_CHECK_OPENGL([GL]) +AS_IF([test x"$enable_opengl" != "xno"], [ + AS_VAR_APPEND([SPICE_NONPKGCONFIG_LIBS], [" $GL_LIBS"]) +]) AC_ARG_ENABLE([lz4], AS_HELP_STRING([--enable-lz4],[Enable lz4 compression algorithm]),, @@ -148,35 +146,12 @@ AC_SUBST(SSL_CFLAGS) AC_SUBST(SSL_LIBS) AS_VAR_APPEND([SPICE_REQUIRES], [" openssl"]) -# These are commented out because the gl libraries on RHEL 5 do not have pkgconfig files -# -# PKG_CHECK_MODULES(GL, gl glu) -# AC_SUBST(GL_CFLAGS) -# AC_SUBST(GL_LIBS) -# AS_VAR_APPEND([SPICE_REQUIRES], [" gl glu"]) - -if test "x$enable_opengl" = "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]) - AC_DEFINE([GL_GLEXT_PROTOTYPES], [], [Enable GLExt prototypes]) - - if test "x$enable_opengl" = "xno"; then - AC_MSG_ERROR([GL libraries not available]) - fi -fi - -AC_SUBST(GL_CFLAGS) -AC_SUBST(GL_LIBS) -AS_VAR_APPEND([SPICE_NONPKGCONFIG_LIBS], [" $GL_LIBS"]) - if test "x$enable_lz4" = "xyes"; then PKG_CHECK_MODULES(LZ4, liblz4) AC_DEFINE([USE_LZ4], [1], [Define to build with Lz4 support]) fi AC_SUBST(LZ4_CFLAGS) AC_SUBST(LZ4_LIBS) - AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, AC_MSG_CHECKING([for jpeglib.h]) AC_TRY_CPP( -- cgit