[PATCH v2 25/37] build-sys: set glib dependency version

marcandre.lureau@redhat.com posted 37 patches 4 years, 4 months ago
[PATCH v2 25/37] build-sys: set glib dependency version
Posted by marcandre.lureau@redhat.com 4 years, 4 months ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Further meson configuration tests are to be added based on the glib
version. Also correct the version reporting in the config log.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure   | 1 +
 meson.build | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 375cde2b44..57e363fd73 100755
--- a/configure
+++ b/configure
@@ -4889,6 +4889,7 @@ echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
 echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
 echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
 echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
+echo "GLIB_VERSION=$(pkg-config --modversion glib-2.0)" >> $config_host_mak
 echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
 echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
 echo "EXESUF=$EXESUF" >> $config_host_mak
diff --git a/meson.build b/meson.build
index e1cddf5139..9494590aa2 100644
--- a/meson.build
+++ b/meson.build
@@ -311,14 +311,16 @@ endif
 add_project_arguments(config_host['GLIB_CFLAGS'].split(),
                       native: false, language: ['c', 'cpp', 'objc'])
 glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(),
-                          link_args: config_host['GLIB_LIBS'].split())
+                          link_args: config_host['GLIB_LIBS'].split(),
+                          version: config_host['GLIB_VERSION'])
 # override glib dep with the configure results (for subprojects)
 meson.override_dependency('glib-2.0', glib)
 
 gio = not_found
 if 'CONFIG_GIO' in config_host
   gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
-                           link_args: config_host['GIO_LIBS'].split())
+                           link_args: config_host['GIO_LIBS'].split(),
+                           version: config_host['GLIB_VERSION'])
 endif
 lttng = not_found
 if 'CONFIG_TRACE_UST' in config_host
-- 
2.33.0.721.g106298f7f9


Re: [PATCH v2 25/37] build-sys: set glib dependency version
Posted by Philippe Mathieu-Daudé 4 years, 1 month ago
On 10/9/21 23:08, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Further meson configuration tests are to be added based on the glib
> version. Also correct the version reporting in the config log.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  configure   | 1 +
>  meson.build | 6 ++++--
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 375cde2b44..57e363fd73 100755
> --- a/configure
> +++ b/configure
> @@ -4889,6 +4889,7 @@ echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
>  echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
>  echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
>  echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
> +echo "GLIB_VERSION=$(pkg-config --modversion glib-2.0)" >> $config_host_mak
>  echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
>  echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
>  echo "EXESUF=$EXESUF" >> $config_host_mak
> diff --git a/meson.build b/meson.build
> index e1cddf5139..9494590aa2 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -311,14 +311,16 @@ endif
>  add_project_arguments(config_host['GLIB_CFLAGS'].split(),
>                        native: false, language: ['c', 'cpp', 'objc'])
>  glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(),
> -                          link_args: config_host['GLIB_LIBS'].split())
> +                          link_args: config_host['GLIB_LIBS'].split(),
> +                          version: config_host['GLIB_VERSION'])
>  # override glib dep with the configure results (for subprojects)
>  meson.override_dependency('glib-2.0', glib)
>  
>  gio = not_found
>  if 'CONFIG_GIO' in config_host
>    gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
> -                           link_args: config_host['GIO_LIBS'].split())
> +                           link_args: config_host['GIO_LIBS'].split(),
> +                           version: config_host['GLIB_VERSION'])
>  endif
>  lttng = not_found
>  if 'CONFIG_TRACE_UST' in config_host
> 

Can you display it in summary_info too?

Otherwise:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


Re: [PATCH v2 25/37] build-sys: set glib dependency version
Posted by Marc-André Lureau 4 years, 1 month ago
Hi

On Fri, Dec 17, 2021 at 5:31 PM Philippe Mathieu-Daudé <philmd@redhat.com>
wrote:

> On 10/9/21 23:08, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Further meson configuration tests are to be added based on the glib
> > version. Also correct the version reporting in the config log.
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  configure   | 1 +
> >  meson.build | 6 ++++--
> >  2 files changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 375cde2b44..57e363fd73 100755
> > --- a/configure
> > +++ b/configure
> > @@ -4889,6 +4889,7 @@ echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
> >  echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
> >  echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
> >  echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
> > +echo "GLIB_VERSION=$(pkg-config --modversion glib-2.0)" >>
> $config_host_mak
> >  echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
> >  echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
> >  echo "EXESUF=$EXESUF" >> $config_host_mak
> > diff --git a/meson.build b/meson.build
> > index e1cddf5139..9494590aa2 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -311,14 +311,16 @@ endif
> >  add_project_arguments(config_host['GLIB_CFLAGS'].split(),
> >                        native: false, language: ['c', 'cpp', 'objc'])
> >  glib = declare_dependency(compile_args:
> config_host['GLIB_CFLAGS'].split(),
> > -                          link_args: config_host['GLIB_LIBS'].split())
> > +                          link_args: config_host['GLIB_LIBS'].split(),
> > +                          version: config_host['GLIB_VERSION'])
> >  # override glib dep with the configure results (for subprojects)
> >  meson.override_dependency('glib-2.0', glib)
> >
> >  gio = not_found
> >  if 'CONFIG_GIO' in config_host
> >    gio = declare_dependency(compile_args:
> config_host['GIO_CFLAGS'].split(),
> > -                           link_args: config_host['GIO_LIBS'].split())
> > +                           link_args: config_host['GIO_LIBS'].split(),
> > +                           version: config_host['GLIB_VERSION'])
> >  endif
> >  lttng = not_found
> >  if 'CONFIG_TRACE_UST' in config_host
> >
>
> Can you display it in summary_info too?
>

Yeah, although it would need a special treatment.

Since GLib is a mandatory dependency, I am not sure we want to show
    GLib                         : YES

And because it's not a pkg-config dep, it doesn't show the version (could
probably be fixed in meson).

If you don't mind,  I leave that for another day :)




> Otherwise:
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
>
>
thanks

-- 
Marc-André Lureau
Re: [PATCH v2 25/37] build-sys: set glib dependency version
Posted by Philippe Mathieu-Daudé 4 years, 1 month ago
On 12/17/21 14:40, Marc-André Lureau wrote:

>     > diff --git a/meson.build b/meson.build
>     > index e1cddf5139..9494590aa2 100644
>     > --- a/meson.build
>     > +++ b/meson.build
>     > @@ -311,14 +311,16 @@ endif
>     >  add_project_arguments(config_host['GLIB_CFLAGS'].split(),
>     >                        native: false, language: ['c', 'cpp', 'objc'])
>     >  glib = declare_dependency(compile_args:
>     config_host['GLIB_CFLAGS'].split(),
>     > -                          link_args:
>     config_host['GLIB_LIBS'].split())
>     > +                          link_args:
>     config_host['GLIB_LIBS'].split(),
>     > +                          version: config_host['GLIB_VERSION'])
>     >  # override glib dep with the configure results (for subprojects)
>     >  meson.override_dependency('glib-2.0', glib)
>     > 
>     >  gio = not_found
>     >  if 'CONFIG_GIO' in config_host
>     >    gio = declare_dependency(compile_args:
>     config_host['GIO_CFLAGS'].split(),
>     > -                           link_args:
>     config_host['GIO_LIBS'].split())
>     > +                           link_args:
>     config_host['GIO_LIBS'].split(),
>     > +                           version: config_host['GLIB_VERSION'])
>     >  endif
>     >  lttng = not_found
>     >  if 'CONFIG_TRACE_UST' in config_host
>     >
> 
>     Can you display it in summary_info too?
> 
> 
> Yeah, although it would need a special treatment.
> 
> Since GLib is a mandatory dependency, I am not sure we want to show
>     GLib                         : YES
> 
> And because it's not a pkg-config dep, it doesn't show the version
> (could probably be fixed in meson).

Ah OK. Yes, I was thinking about displaying the GLib version.

> If you don't mind,  I leave that for another day :)

Sounds good, thanks.