diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2010-06-10 16:47:38 +0800 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2010-06-18 09:35:12 +0800 |
commit | a9c56d98390d3c2c592c00ceef0d10151d6f9c49 (patch) | |
tree | ad1b938f224502eb7752841fc3e7644aa9732c66 /m4/gsettings.m4 | |
parent | 96569c764125b9c80909c7cece9e37b65eb632ca (diff) | |
download | gsoc2013-empathy-a9c56d98390d3c2c592c00ceef0d10151d6f9c49.tar gsoc2013-empathy-a9c56d98390d3c2c592c00ceef0d10151d6f9c49.tar.gz gsoc2013-empathy-a9c56d98390d3c2c592c00ceef0d10151d6f9c49.tar.bz2 gsoc2013-empathy-a9c56d98390d3c2c592c00ceef0d10151d6f9c49.tar.lz gsoc2013-empathy-a9c56d98390d3c2c592c00ceef0d10151d6f9c49.tar.xz gsoc2013-empathy-a9c56d98390d3c2c592c00ceef0d10151d6f9c49.tar.zst gsoc2013-empathy-a9c56d98390d3c2c592c00ceef0d10151d6f9c49.zip |
Convert to new-style schema
Diffstat (limited to 'm4/gsettings.m4')
-rw-r--r-- | m4/gsettings.m4 | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/m4/gsettings.m4 b/m4/gsettings.m4 new file mode 100644 index 000000000..b68698980 --- /dev/null +++ b/m4/gsettings.m4 @@ -0,0 +1,80 @@ +dnl GLIB_GSETTINGS +dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether +dnl the schema should be compiled +dnl + +AC_DEFUN([GLIB_GSETTINGS], +[ + m4_pattern_allow([AM_V_GEN]) + AC_ARG_ENABLE(schemas-compile, + AC_HELP_STRING([--disable-schemas-compile], + [Disable regeneration of gschemas.compiled on install]), + [case ${enableval} in + yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;; + no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;; + esac]) + AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE]) + PKG_PROG_PKG_CONFIG([0.16]) + AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas]) + AC_SUBST(GLIB_COMPILE_SCHEMAS, `$PKG_CONFIG --variable glib_compile_schemas gio-2.0`) + if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then + AC_MSG_ERROR([glib-compile-schemas not found.]) + fi + + GSETTINGS_RULES=' +.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas + +mostlyclean-am: clean-gsettings-schemas + +%.gschema.valid: %.gschema.xml + $(AM_V_GEN) if test -f "$^"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --dry-run --schema-file=$${d}$^ && touch [$]@ + +all-am: $(gsettings_SCHEMAS:.xml=.valid) +uninstall-am: uninstall-gsettings-schemas +install-data-am: install-gsettings-schemas + +.SECONDARY: $(gsettings_SCHEMAS) + +gsettings__base_list = \ + sed "$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g" | \ + sed "$$!N;$$!N;$$!N;$$!N;s/\n/ /g" + +install-gsettings-schemas: $(gsettings_SCHEMAS:.xml=.valid) + @$(NORMAL_INSTALL) + test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)" + @list='\''$(gsettings_SCHEMAS)'\''; test -n "$(gsettingsschemadir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(gsettings__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '\''$(DESTDIR)$(gsettingsschemadir)'\''"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(gsettingsschemadir)" || exit $$?; \ + done + test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir) + +uninstall-gsettings-schemas: + @$(NORMAL_UNINSTALL) + @list='\''$(gsettings_SCHEMAS)'\''; test -n "$(gsettingsschemadir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files + test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) --uninstall $(gsettingsschemadir) + +clean-gsettings-schemas: + rm -f $(gsettings_SCHEMAS:.xml=.valid) + +' + _GSETTINGS_SUBST(GSETTINGS_RULES) +]) + +dnl _GSETTINGS_SUBST(VARIABLE) +dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST +AC_DEFUN([_GSETTINGS_SUBST], +[ +AC_SUBST([$1]) +m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) +] +) |