Re: [PATCH 3/3] Use autoconf rule for epoxy/egl.h (not present on macOS)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Apparently, it is available on macos:
https://trac.macports.org/browser/trunk/dports/graphics/libepoxy/Portfile

but your patch looks correct nonetheless (with the commit summary updated)

----- Original Message -----
> Signed-off-by: Christophe de Dinechin <dinechin@xxxxxxxxxx>
> ---
>  configure.ac            | 13 ++++++++++---
>  src/Makefile.am         |  2 +-
>  src/spice-widget-priv.h |  6 +++---
>  src/spice-widget.c      | 27 ++++++++++++++-------------
>  4 files changed, 28 insertions(+), 20 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index a6ac2de..caa2dc9 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -74,9 +74,16 @@ esac
>  AC_MSG_RESULT([$os_mac])
>  AM_CONDITIONAL([OS_MAC],[test "$os_mac" = "yes"])
>  
> -AC_CHECK_HEADERS([sys/socket.h netinet/in.h arpa/inet.h])
> -AC_CHECK_HEADERS([termios.h])
> -
> +AC_CHECK_HEADERS([sys/socket.h netinet/in.h arpa/inet.h termios.h])
> +AC_CHECK_HEADERS([epoxy/egl.h],
> +                 [have_egl=yes],
> +                 [have_egl=no])
> +AC_MSG_CHECKING([if we can use EGL in libepoxy)])
> +AC_MSG_RESULT([$have_egl])
> +AM_CONDITIONAL([HAVE_EGL],[test "$have_egl" = "yes"])
> +AS_IF([test "$have_egl" = "yes"],
> +       AC_DEFINE([HAVE_EGL], [1], [Define if supporting EGL]))
> +
>  AC_CHECK_LIBM
>  AC_SUBST(LIBM)
>  
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 4fa7357..bb7ad6c 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -145,7 +145,7 @@ SPICE_GTK_SOURCES_COMMON +=		\
>  	spice-widget-cairo.c		\
>  	$(NULL)
>  
> -if !OS_WIN32
> +if HAVE_EGL
>  SPICE_GTK_SOURCES_COMMON +=		\
>  	spice-widget-egl.c		\
>  	$(NULL)
> diff --git a/src/spice-widget-priv.h b/src/spice-widget-priv.h
> index e29e1b7..5b3216f 100644
> --- a/src/spice-widget-priv.h
> +++ b/src/spice-widget-priv.h
> @@ -24,7 +24,7 @@
>  #include <windows.h>
>  #endif
>  
> -#ifndef G_OS_WIN32
> +#ifdef HAVE_EPOXY_EGL_H
>  #include <epoxy/egl.h>
>  #endif
>  
> @@ -133,7 +133,7 @@ struct _SpiceDisplayPrivate {
>      int                     x11_accel_denominator;
>      int                     x11_threshold;
>  #endif
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>      struct {
>          gboolean            context_ready;
>          gboolean            enabled;
> @@ -150,7 +150,7 @@ struct _SpiceDisplayPrivate {
>          gboolean            call_draw_done;
>          SpiceGlScanout      scanout;
>      } egl;
> -#endif
> +#endif // HAVE_EGL
>  };
>  
>  int      spice_cairo_image_create                 (SpiceDisplay *display);
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index 5bbba8f..91aed58 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -235,7 +235,7 @@ static gint get_display_id(SpiceDisplay *display)
>  
>  static bool egl_enabled(SpiceDisplayPrivate *d)
>  {
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>      return d->egl.enabled;
>  #else
>      return false;
> @@ -574,7 +574,7 @@ static void grab_notify(SpiceDisplay *display, gboolean
> was_grabbed)
>  }
>  
>  #if GTK_CHECK_VERSION(3,16,0)
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>  /* Ignore GLib's too-new warnings */
>  G_GNUC_BEGIN_IGNORE_DEPRECATIONS
>  static gboolean
> @@ -646,7 +646,7 @@ static void spice_display_init(SpiceDisplay *display)
>      gtk_stack_set_visible_child(d->stack, area);
>  
>  #if GTK_CHECK_VERSION(3,16,0)
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>  /* Ignore GLib's too-new warnings */
>  G_GNUC_BEGIN_IGNORE_DEPRECATIONS
>      area = gtk_gl_area_new();
> @@ -977,6 +977,7 @@ static void set_mouse_accel(SpiceDisplay *display,
> gboolean enabled)
>      }
>  #else
>      g_warning("Mouse acceleration code missing for your platform");
> +    (void) d;
>  #endif
>  }
>  
> @@ -1305,7 +1306,7 @@ static gboolean do_color_convert(SpiceDisplay *display,
> GdkRectangle *r)
>      return true;
>  }
>  
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>  static void set_egl_enabled(SpiceDisplay *display, bool enabled)
>  {
>      SpiceDisplayPrivate *d = display->priv;
> @@ -1341,7 +1342,7 @@ static gboolean draw_event(GtkWidget *widget, cairo_t
> *cr, gpointer data)
>      SpiceDisplayPrivate *d = display->priv;
>      g_return_val_if_fail(d != NULL, false);
>  
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>      if (egl_enabled(d) &&
>          g_str_equal(gtk_stack_get_visible_child_name(d->stack),
>          "draw-area")) {
>          spice_egl_update_display(display);
> @@ -2101,7 +2102,7 @@ static void size_allocate(GtkWidget *widget,
> GtkAllocation *conf, gpointer data)
>          d->ww = conf->width;
>          d->wh = conf->height;
>          recalc_geometry(widget);
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>          if (egl_enabled(d))
>              spice_egl_resize_display(display, conf->width, conf->height);
>  #endif
> @@ -2144,7 +2145,7 @@ static void realize(GtkWidget *widget)
>  static void unrealize(GtkWidget *widget)
>  {
>      spice_cairo_image_destroy(SPICE_DISPLAY(widget));
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>      spice_egl_unrealize_display(SPICE_DISPLAY(widget));
>  #endif
>  
> @@ -2500,7 +2501,7 @@ static void update_area(SpiceDisplay *display,
>          .height = height
>      };
>  
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>      if (egl_enabled(d)) {
>          const SpiceGlScanout *so =
>              spice_display_get_gl_scanout(SPICE_DISPLAY_CHANNEL(d->display));
> @@ -2597,7 +2598,7 @@ static void invalidate(SpiceChannel *channel,
>          .height = h
>      };
>  
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>      set_egl_enabled(display, false);
>  #endif
>  
> @@ -2661,7 +2662,7 @@ static void cursor_set(SpiceCursorChannel *channel,
>      } else
>          g_warn_if_reached();
>  
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>      if (egl_enabled(d))
>          spice_egl_cursor_set(display);
>  #endif
> @@ -2833,7 +2834,7 @@ static void inputs_channel_event(SpiceChannel *channel,
> SpiceChannelEvent event,
>      spice_display_set_keypress_delay(display, delay);
>  }
>  
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>  G_GNUC_INTERNAL
>  void spice_display_widget_gl_scanout(SpiceDisplay *display)
>  {
> @@ -2942,7 +2943,7 @@ static void channel_new(SpiceSession *s, SpiceChannel
> *channel, gpointer data)
>              mark(display, primary.marked);
>          }
>  
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>          spice_g_signal_connect_object(channel, "notify::gl-scanout",
>                                        G_CALLBACK(spice_display_widget_gl_scanout),
>                                        display, G_CONNECT_SWAPPED);
> @@ -3102,7 +3103,7 @@ GdkPixbuf *spice_display_get_pixbuf(SpiceDisplay
> *display)
>      g_return_val_if_fail(d != NULL, NULL);
>      g_return_val_if_fail(d->display != NULL, NULL);
>  
> -#ifndef G_OS_WIN32
> +#if HAVE_EGL
>      if (egl_enabled(d)) {
>          GdkPixbuf *tmp;
>  
> --
> 2.11.0 (Apple Git-81)
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
> 
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]