diff options
author | Ryan Lortie <desrt@desrt.ca> | 2010-05-18 18:28:39 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2010-05-19 08:55:57 -0400 |
commit | b59a5551ecd448187d752d93a06c2298db121ace (patch) | |
tree | a656b7e56230fc003d32a8c0d88635b514ccf26e /m4macros | |
parent | 3e3779b7d0edbdfbea38655e353d0723a1b918d5 (diff) | |
download | glib-b59a5551ecd448187d752d93a06c2298db121ace.tar.gz glib-b59a5551ecd448187d752d93a06c2298db121ace.tar.bz2 glib-b59a5551ecd448187d752d93a06c2298db121ace.zip |
Bug 619038 - increase gsettings.m4 power
handle schema checking, installation, uninstallation, cleaning
Diffstat (limited to 'm4macros')
-rw-r--r-- | m4macros/gsettings.m4 | 71 |
1 files changed, 51 insertions, 20 deletions
diff --git a/m4macros/gsettings.m4 b/m4macros/gsettings.m4 index aeb6470ad..35cade83f 100644 --- a/m4macros/gsettings.m4 +++ b/m4macros/gsettings.m4 @@ -5,36 +5,67 @@ dnl AC_DEFUN([GLIB_GSETTINGS], [ - AC_ARG_ENABLE(schemas-install, - AC_HELP_STRING([--disable-schemas-install], - [Disable installation of GSettings schemas]), - [case ${enableval} in - yes|no) ;; - *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-install]) ;; - esac]) - AM_CONDITIONAL([GSETTINGS_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no]) - + 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_CHECK_RULE=' -.PHONY : check-gsettings-schema + GSETTINGS_RULES=' +.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas -check-gsettings-schema: gsettings_schema_validate_stamp -MOSTLYCLEANFILES += gsettings_schema_validate_stamp -gsettings_schema_validate_stamp: *.gschema.xml - $(GLIB_COMPILE_SCHEMAS) --dry-run $(addprefix --schema-file=,$?) - touch [$]@ +mostlyclean-am: clean-gsettings-schemas -all: check-gsettings-schema -' +%.gschema.valid: %.gschema.xml + $(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --dry-run --schema-file=$^ && touch [$]@ + +all-am: $(gsettings_SCHEMAS:.xml=.valid) +uninstall-am: uninstall-gsettings-schemas +install-data-am: install-gsettings-schemas + +gsettings__base_list = \ + sed "$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g" | \ + sed "$$!N;$$!N;$$!N;$$!N;s/\n/ /g" - _GSETTINGS_SUBST(GSETTINGS_CHECK_RULE) +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) $(gsettingsschemadir) + +clean-gsettings-schemas: + rm -f $(gsettings_SCHEMAS:.xml=.valid) + +' + _GSETTINGS_SUBST(GSETTINGS_RULES) ]) dnl _GSETTINGS_SUBST(VARIABLE) |