[Spice-devel,spice-gtk] build-sys: Add webdav_support variable to spice-client-glib-2.0.pc

Submitted by Eduardo Lima (Etrunko) on March 3, 2017, 6:34 p.m.

Details

Message ID 20170303183454.8515-1-etrunko@redhat.com
State New
Headers show
Series "build-sys: Add webdav_support variable to spice-client-glib-2.0.pc" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Eduardo Lima (Etrunko) March 3, 2017, 6:34 p.m.
This allows us to inform the clients of this library if it was built
with support for folder sharing or not.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
 configure.ac                | 1 +
 spice-client-glib-2.0.pc.in | 2 ++
 2 files changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/configure.ac b/configure.ac
index 4fd0bd7..47ac832 100644
--- a/configure.ac
+++ b/configure.ac
@@ -207,6 +207,7 @@  AS_IF([test "x$have_phodav" = "xyes"],
        AC_DEFINE([USE_PHODAV], [1], [Define if supporting phodav]))
 
 AM_CONDITIONAL([WITH_PHODAV], [test "x$have_phodav" = "xyes"])
+AC_SUBST(have_phodav)
 
 AC_ARG_WITH([audio],
   AS_HELP_STRING([--with-audio=@<:@gstreamer/pulse/auto/no@:>@], [For legacy compatibility only]),
diff --git a/spice-client-glib-2.0.pc.in b/spice-client-glib-2.0.pc.in
index 27d6886..9695099 100644
--- a/spice-client-glib-2.0.pc.in
+++ b/spice-client-glib-2.0.pc.in
@@ -3,6 +3,8 @@  exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
 
+webdav_support=@have_phodav@
+
 Name: spice-client-glib-2.0
 Description: SPICE Client GLib 2.0 library
 Version: @VERSION@

Comments

Hi

----- Original Message -----
> This allows us to inform the clients of this library if it was built
> with support for folder sharing or not.
> 
> Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>

Interesting approach, but you should rather do that at run time. This would allow to dynamically replace the shared library without recompiling.

You can do spice_session_get_webdav_server() to know if it's enabled, for example

NACK

> ---
>  configure.ac                | 1 +
>  spice-client-glib-2.0.pc.in | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/configure.ac b/configure.ac
> index 4fd0bd7..47ac832 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -207,6 +207,7 @@ AS_IF([test "x$have_phodav" = "xyes"],
>         AC_DEFINE([USE_PHODAV], [1], [Define if supporting phodav]))
>  
>  AM_CONDITIONAL([WITH_PHODAV], [test "x$have_phodav" = "xyes"])
> +AC_SUBST(have_phodav)
>  
>  AC_ARG_WITH([audio],
>    AS_HELP_STRING([--with-audio=@<:@gstreamer/pulse/auto/no@:>@], [For legacy
>    compatibility only]),
> diff --git a/spice-client-glib-2.0.pc.in b/spice-client-glib-2.0.pc.in
> index 27d6886..9695099 100644
> --- a/spice-client-glib-2.0.pc.in
> +++ b/spice-client-glib-2.0.pc.in
> @@ -3,6 +3,8 @@ exec_prefix=@exec_prefix@
>  libdir=@libdir@
>  includedir=@includedir@
>  
> +webdav_support=@have_phodav@
> +
>  Name: spice-client-glib-2.0
>  Description: SPICE Client GLib 2.0 library
>  Version: @VERSION@
> --
> 2.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
>
On 03/03/17 18:42, Marc-André Lureau wrote:
> Hi
> 
> ----- Original Message -----
>> This allows us to inform the clients of this library if it was built
>> with support for folder sharing or not.
>>
>> Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
> 
> Interesting approach, but you should rather do that at run time. This would allow to dynamically replace the shared library without recompiling.
> 
> You can do spice_session_get_webdav_server() to know if it's enabled, for example

Well, my idea was to check for this at configure time and completely
avoid the build of related source code that would make use of this feature.
Hi

----- Original Message -----
> On 03/03/17 18:42, Marc-André Lureau wrote:
> > Hi
> > 
> > ----- Original Message -----
> >> This allows us to inform the clients of this library if it was built
> >> with support for folder sharing or not.
> >>
> >> Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
> > 
> > Interesting approach, but you should rather do that at run time. This would
> > allow to dynamically replace the shared library without recompiling.
> > 
> > You can do spice_session_get_webdav_server() to know if it's enabled, for
> > example
> 
> Well, my idea was to check for this at configure time and completely
> avoid the build of related source code that would make use of this feature.

What's the point if you can check it a runtime? You may save a few function to compile, but you lose the flexibility of changing the library without recompiling the project: runtime wins.