Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | From 483a4bb00e7dd2f14d86e167c8013c8638723c33 Mon Sep 17 00:00:00 2001 |
| 2 | From: Emmanuele Bassi <ebassi@gnome.org> |
| 3 | Date: Thu, 18 Feb 2016 17:19:09 +0000 |
| 4 | Subject: [PATCH] build: Use AC_COMPILE_IFELSE |
| 5 | |
| 6 | Instead of AC_TRY_COMPILE, which has been deprecated by newer autoconf. |
| 7 | --- |
| 8 | Upstream-Status: Backport |
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 10 | |
| 11 | configure.ac | 66 ++++++++++++++++++++++++++++++------------------------------ |
| 12 | 1 file changed, 33 insertions(+), 33 deletions(-) |
| 13 | |
| 14 | diff --git a/configure.ac b/configure.ac |
| 15 | index 4d72e0c..8ca3f94 100644 |
| 16 | --- a/configure.ac |
| 17 | +++ b/configure.ac |
| 18 | @@ -348,24 +348,25 @@ AS_IF([test "x$enable_wayland" != xno], |
| 19 | # We need to manually check for Wayland support in Cogl because |
| 20 | # the windowing systems are not exposed in the pkg-config file |
| 21 | saved_CFLAGS="${CFLAGS}" |
| 22 | - CFLAGS="`$PKG_CONFIG --cflags $CLUTTER_BASE_PC_FILES`" |
| 23 | + CFLAGS="`$PKG_CONFIG --cflags cogl-1.0`" |
| 24 | |
| 25 | AC_MSG_CHECKING([for Wayland Cogl backend]) |
| 26 | - AC_TRY_COMPILE([#include <cogl/cogl.h>], |
| 27 | - [ |
| 28 | - #ifndef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT |
| 29 | - #error "No Wayland support in Cogl" |
| 30 | - #endif |
| 31 | - int main (void) { return 0; } |
| 32 | - ], |
| 33 | - [ |
| 34 | - AC_MSG_RESULT(yes) |
| 35 | - have_cogl_wayland=yes |
| 36 | - ], |
| 37 | - [ |
| 38 | - AC_MSG_RESULT(no) |
| 39 | - have_cogl_wayland=no |
| 40 | - ]) |
| 41 | + |
| 42 | + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 43 | +#include <cogl/cogl.h> |
| 44 | +]], |
| 45 | +[[ |
| 46 | +#ifndef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT |
| 47 | +#error Cogl compiled without Wayland support |
| 48 | +#endif |
| 49 | +]])], [ |
| 50 | + AC_MSG_RESULT(yes) |
| 51 | + have_cogl_wayland=yes |
| 52 | + ], [ |
| 53 | + AC_MSG_RESULT(no) |
| 54 | + have_cogl_wayland=no |
| 55 | + ]) |
| 56 | + |
| 57 | CFLAGS="${saved_CFLAGS}" |
| 58 | AS_IF([test "x$have_cogl_wayland" = xyes], |
| 59 | [ |
| 60 | @@ -499,26 +500,25 @@ AS_IF([test "x$enable_mir" = "xyes"], |
| 61 | # We need to manually check for Mir support in Cogl because |
| 62 | # the windowing systems are not exposed in the pkg-config file |
| 63 | saved_CFLAGS="${CFLAGS}" |
| 64 | - CFLAGS="`$PKG_CONFIG --cflags $CLUTTER_BASE_PC_FILES`" |
| 65 | + CFLAGS="`$PKG_CONFIG --cflags cogl-1.0`" |
| 66 | |
| 67 | AC_MSG_CHECKING([for Mir Cogl backend]) |
| 68 | - AC_TRY_COMPILE([#include <cogl/cogl.h>], |
| 69 | - [ |
| 70 | - #ifndef COGL_HAS_EGL_PLATFORM_MIR_SUPPORT |
| 71 | - #error "No Mir support in Cogl" |
| 72 | - #endif |
| 73 | - int main (void) { return 0; } |
| 74 | - ], |
| 75 | - [ |
| 76 | - AC_MSG_RESULT(yes) |
| 77 | - have_cogl_mir=yes |
| 78 | - ], |
| 79 | - [ |
| 80 | - AC_MSG_RESULT(no) |
| 81 | - have_cogl_mir=no |
| 82 | - ]) |
| 83 | |
| 84 | - CFLAGS="${saved_CFLAGS}" |
| 85 | + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 86 | +#include <cogl/cogl.h> |
| 87 | +]], |
| 88 | +[[ |
| 89 | +#ifndef COGL_HAS_EGL_PLATFORM_MIR_SUPPORT |
| 90 | +#error Cogl compiled without Mir support |
| 91 | +#endif |
| 92 | +]])], [ |
| 93 | + AC_MSG_RESULT(yes) |
| 94 | + have_cogl_mir=yes |
| 95 | + ], [ |
| 96 | + AC_MSG_RESULT(no) |
| 97 | + have_cogl_mir=no |
| 98 | + ]) |
| 99 | + |
| 100 | AS_IF([test "x$have_cogl_mir" = xno], [AC_MSG_ERROR("*** Cogl is missing Mir support.")]) |
| 101 | |
| 102 | PKG_CHECK_EXISTS([mirclient], |
| 103 | -- |
| 104 | 1.9.1 |
| 105 | |