[devhelp] build: better compile GResources



commit e8df90a18b099c17eed2e4377c68f7260a62162b
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed May 10 14:22:14 2017 +0200

    build: better compile GResources
    
    List the resource files explicitly, to better follow the Autotools
    philosophy. And I think $(shell ...) was not portable.

 configure.ac         |    3 ++-
 src/Makefile.am      |   13 ++++++++++---
 src/dh.gresource.xml |    2 +-
 3 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5796486..d948cdb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,7 +33,8 @@ AM_SILENT_RULES([yes])
 
 # Check for programs
 AC_PROG_CC
-AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
+AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
+AC_PATH_PROG([GLIB_COMPILE_RESOURCES], [glib-compile-resources])
 
 # Initialize libtool
 LT_PREREQ([2.2])
diff --git a/src/Makefile.am b/src/Makefile.am
index 84941db..f438292 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -157,11 +157,18 @@ devhelp_LDADD =           \
 devhelp_LDFLAGS =      \
        $(AM_LDFLAGS)
 
-resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/dh.gresource.xml)
+resource_files =               \
+       devhelp-menu.ui         \
+       dh-assistant.ui         \
+       dh-preferences.ui       \
+       dh-window.ui            \
+       help-overlay.ui         \
+       $(NULL)
+
 dh-resources.c: dh.gresource.xml $(resource_files)
-       glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name dh 
$(srcdir)/dh.gresource.xml
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name dh 
$(srcdir)/dh.gresource.xml
 dh-resources.h: dh.gresource.xml $(resource_files)
-       glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name dh 
$(srcdir)/dh.gresource.xml
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header --c-name dh 
$(srcdir)/dh.gresource.xml
 
 dh-enum-types.h: dh-enum-types.h.template $(libdevhelp_public_headers) $(GLIB_MKENUMS)
        $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template dh-enum-types.h.template 
$(libdevhelp_public_headers)) > $@
diff --git a/src/dh.gresource.xml b/src/dh.gresource.xml
index 269ffd7..5dda3b0 100644
--- a/src/dh.gresource.xml
+++ b/src/dh.gresource.xml
@@ -3,8 +3,8 @@
   <gresource prefix="/org/gnome/devhelp">
     <file preprocess="xml-stripblanks">devhelp-menu.ui</file>
     <file preprocess="xml-stripblanks">dh-assistant.ui</file>
-    <file preprocess="xml-stripblanks">dh-window.ui</file>
     <file preprocess="xml-stripblanks">dh-preferences.ui</file>
+    <file preprocess="xml-stripblanks">dh-window.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">help-overlay.ui</file>
   </gresource>
 </gresources>


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