diff mbox series

[1/9] buildsys: Move gtk/vte cflags/libs to per object

Message ID 20170907082918.7299-2-famz@redhat.com
State New
Headers show
Series buildsys: Move ui/usb library cflags/libs to per object | expand

Commit Message

Fam Zheng Sept. 7, 2017, 8:29 a.m. UTC
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 configure        | 3 +--
 ui/Makefile.objs | 4 ++++
 2 files changed, 5 insertions(+), 2 deletions(-)

Comments

Philippe Mathieu-Daudé Sept. 7, 2017, 5:45 p.m. UTC | #1
On 09/07/2017 05:29 AM, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>   configure        | 3 +--
>   ui/Makefile.objs | 4 ++++
>   2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index b37cd54bda..e27a4bd683 100755
> --- a/configure
> +++ b/configure
> @@ -2437,7 +2437,6 @@ if test "$gtk" != "no"; then
>               gtk_cflags="$gtk_cflags $x11_cflags"
>               gtk_libs="$gtk_libs $x11_libs"
>           fi
> -        libs_softmmu="$gtk_libs $libs_softmmu"
>           gtk="yes"
>       elif test "$gtk" = "yes"; then
>           feature_not_found "gtk" "Install gtk3-devel"
> @@ -2678,7 +2677,6 @@ if test "$vte" != "no"; then
>           vte_cflags=$($pkg_config --cflags $vtepackage)
>           vte_libs=$($pkg_config --libs $vtepackage)
>           vteversion=$($pkg_config --modversion $vtepackage)
> -        libs_softmmu="$vte_libs $libs_softmmu"
>           vte="yes"
>       elif test "$vte" = "yes"; then
>           if test "$gtkabi" = "3.0"; then
> @@ -5750,6 +5748,7 @@ fi
>   if test "$vte" = "yes" ; then
>     echo "CONFIG_VTE=y" >> $config_host_mak
>     echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak
> +  echo "VTE_LIBS=$vte_libs" >> $config_host_mak
>   fi
>   if test "$virglrenderer" = "yes" ; then
>     echo "CONFIG_VIRGL=y" >> $config_host_mak
> diff --git a/ui/Makefile.objs b/ui/Makefile.objs
> index 3369451285..146a8ce062 100644
> --- a/ui/Makefile.objs
> +++ b/ui/Makefile.objs
> @@ -45,6 +45,10 @@ gtk.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
>   gtk-egl.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
>   gtk-gl-area.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
>   
> +gtk.o-libs := $(GTK_LIBS) $(VTE_LIBS)
> +gtk-egl.o-libs := $(GTK_LIBS) $(VTE_LIBS)
> +gtk-gl-area.o-libs := $(GTK_LIBS) $(VTE_LIBS)

$(foreach x, gtk gtk-egl gtk-gl-area, \
     $(eval $x.o-libs += $(GTK_LIBS) $(VTE_LIBS)) \
     $(eval $x.o-cflags += $(GTK_CFLAGS) $(VTE_CFLAGS)) \
)

> +
>   gtk-egl.o-libs += $(OPENGL_LIBS)
>   shader.o-libs += $(OPENGL_LIBS)
>   console-gl.o-libs += $(OPENGL_LIBS)
>
Peter Maydell Sept. 7, 2017, 5:50 p.m. UTC | #2
On 7 September 2017 at 18:45, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> On 09/07/2017 05:29 AM, Fam Zheng wrote:
>> diff --git a/ui/Makefile.objs b/ui/Makefile.objs
>> index 3369451285..146a8ce062 100644
>> --- a/ui/Makefile.objs
>> +++ b/ui/Makefile.objs
>> @@ -45,6 +45,10 @@ gtk.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
>>   gtk-egl.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
>>   gtk-gl-area.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
>>   +gtk.o-libs := $(GTK_LIBS) $(VTE_LIBS)
>> +gtk-egl.o-libs := $(GTK_LIBS) $(VTE_LIBS)
>> +gtk-gl-area.o-libs := $(GTK_LIBS) $(VTE_LIBS)
>
>
> $(foreach x, gtk gtk-egl gtk-gl-area, \
>     $(eval $x.o-libs += $(GTK_LIBS) $(VTE_LIBS)) \
>     $(eval $x.o-cflags += $(GTK_CFLAGS) $(VTE_CFLAGS)) \
>
> )

I think that's worse, personally. Most developers don't
touch the makefiles very often and so doing the simple
straightforward thing is better. Then it's clearer to
people who come along later how they need to add a new
file to the makefiles (a surprisingly common question).

thanks
-- PMM
diff mbox series

Patch

diff --git a/configure b/configure
index b37cd54bda..e27a4bd683 100755
--- a/configure
+++ b/configure
@@ -2437,7 +2437,6 @@  if test "$gtk" != "no"; then
             gtk_cflags="$gtk_cflags $x11_cflags"
             gtk_libs="$gtk_libs $x11_libs"
         fi
-        libs_softmmu="$gtk_libs $libs_softmmu"
         gtk="yes"
     elif test "$gtk" = "yes"; then
         feature_not_found "gtk" "Install gtk3-devel"
@@ -2678,7 +2677,6 @@  if test "$vte" != "no"; then
         vte_cflags=$($pkg_config --cflags $vtepackage)
         vte_libs=$($pkg_config --libs $vtepackage)
         vteversion=$($pkg_config --modversion $vtepackage)
-        libs_softmmu="$vte_libs $libs_softmmu"
         vte="yes"
     elif test "$vte" = "yes"; then
         if test "$gtkabi" = "3.0"; then
@@ -5750,6 +5748,7 @@  fi
 if test "$vte" = "yes" ; then
   echo "CONFIG_VTE=y" >> $config_host_mak
   echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak
+  echo "VTE_LIBS=$vte_libs" >> $config_host_mak
 fi
 if test "$virglrenderer" = "yes" ; then
   echo "CONFIG_VIRGL=y" >> $config_host_mak
diff --git a/ui/Makefile.objs b/ui/Makefile.objs
index 3369451285..146a8ce062 100644
--- a/ui/Makefile.objs
+++ b/ui/Makefile.objs
@@ -45,6 +45,10 @@  gtk.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
 gtk-egl.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
 gtk-gl-area.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
 
+gtk.o-libs := $(GTK_LIBS) $(VTE_LIBS)
+gtk-egl.o-libs := $(GTK_LIBS) $(VTE_LIBS)
+gtk-gl-area.o-libs := $(GTK_LIBS) $(VTE_LIBS)
+
 gtk-egl.o-libs += $(OPENGL_LIBS)
 shader.o-libs += $(OPENGL_LIBS)
 console-gl.o-libs += $(OPENGL_LIBS)