build: Use the same pattern for the manual Mir check

Ensure that the checks are similar and create similar results.
This commit is contained in:
Emmanuele Bassi 2015-06-10 14:00:05 +01:00
parent 2fd47ce08e
commit 0eb300e2ee

View File

@ -486,12 +486,11 @@ AS_IF([test "x$enable_mir" = "xyes"],
SUPPORT_MIR=1 SUPPORT_MIR=1
SUPPORT_COGL=1 SUPPORT_COGL=1
have_cogl_mir=no # We need to manually check for Mir support in Cogl because
SAVED_CFLAGS="${CFLAGS}" # the windowing systems are not exposed in the pkg-config file
saved_CFLAGS="${CFLAGS}"
CFLAGS="`$PKG_CONFIG --cflags $CLUTTER_BASE_PC_FILES`" CFLAGS="`$PKG_CONFIG --cflags $CLUTTER_BASE_PC_FILES`"
# Manually check whether cogl has Mir support, as we can't rely on
# versioning yet.
AC_MSG_CHECKING([for Mir Cogl backend]) AC_MSG_CHECKING([for Mir Cogl backend])
AC_TRY_COMPILE([#include <cogl/cogl.h>], AC_TRY_COMPILE([#include <cogl/cogl.h>],
[ [
@ -500,15 +499,17 @@ AS_IF([test "x$enable_mir" = "xyes"],
#endif #endif
int main (void) { return 0; } int main (void) { return 0; }
], ],
AC_MSG_RESULT(yes) [
have_cogl_mir=yes, AC_MSG_RESULT(yes)
AC_MSG_RESULT(no) have_cogl_mir=yes
have_cogl_mir=no) ],
[
AC_MSG_RESULT(no)
have_cogl_mir=no
])
CFLAGS="${SAVED_CFLAGS}" CFLAGS="${saved_CFLAGS}"
AS_IF([test "x$have_cogl_mir" = xno], [AC_MSG_ERROR("*** Cogl is missing Mir support.")])
AS_IF([test "x$have_cogl_mir" = "xno"],
[AC_MSG_ERROR([COGL_HAS_EGL_PLATFORM_MIR_SUPPORT not defined but the Mir backend has been explicitly enabled])])
PKG_CHECK_EXISTS([mirclient], PKG_CHECK_EXISTS([mirclient],
[BACKEND_PC_FILES="$BACKEND_PC_FILES mirclient"], [BACKEND_PC_FILES="$BACKEND_PC_FILES mirclient"],