From: Yuuki Harano Date: Tue, 4 Jan 2022 06:27:36 +0000 (+0900) Subject: Remove gsettings.m4 and write directly into Makefile.in X-Git-Tag: emacs-29.0.90~3266 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=183936ee8e5bdf10e969b0d2cb661f81cf7950f9;p=emacs.git Remove gsettings.m4 and write directly into Makefile.in * configure.ac (HAVE_PGTK): Declare substitution (HAVE_GSETTINGS): Declare substitution * Makefile.in (HAVE_PGTK): New variable (HAVE_GSETTINGS): New variable (gsettingsschemadir): Don't use value from gsettings.m4 (distclean): Add clean-gsettings-schemas (install-gsettings-schemas): Implement instead of gsettings.m4 (uninstall-gsettings-schemas): Implement instead of gsettings.m4 (clean-gsettings-schemas): Implement instead of gsettings.m4 ($(gsettings_SCHEMAS:.xml=.valid)): Implement instead of gsettings.m4 * m4/gsettings.m4: Remove --- diff --git a/Makefile.in b/Makefile.in index 5bafe0f140f..b72127dde67 100644 --- a/Makefile.in +++ b/Makefile.in @@ -104,6 +104,9 @@ USE_STARTUP_NOTIFICATION = @USE_STARTUP_NOTIFICATION@ HAVE_BE_APP = @HAVE_BE_APP@ +HAVE_PGTK = @HAVE_PGTK@ +HAVE_GSETTINGS = @HAVE_GSETTINGS@ + # ==================== Where To Install Things ==================== # Location to install Emacs.app under GNUstep / macOS. @@ -213,7 +216,7 @@ icondir=$(datarootdir)/icons iconsrcdir=$(srcdir)/etc/images/icons # Where to install the gsettings schema file. -gsettingsschemadir = @gsettingsschemadir@ +gsettingsschemadir = $(datadir)/glib-2.0/schemas # ==================== Emacs-specific directories ==================== @@ -949,7 +952,7 @@ distclean_dirs = $(clean_dirs) leim lisp admin/grammars $(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),distclean))) -distclean: $(distclean_dirs:=_distclean) +distclean: $(distclean_dirs:=_distclean) clean-gsettings-schemas ${top_distclean} ### 'bootstrap-clean' @@ -1245,9 +1248,30 @@ gitmerge: -l ${srcdir}/admin/gitmerge.el \ --eval '(setq gitmerge-minimum-missing ${GITMERGE_NMIN})' -f gitmerge -@GSETTINGS_RULES@ - install-gsettings-schemas: +ifeq ($(HAVE_PGTK)$(HAVE_GSETTINGS),yesyes) + $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)" + $(INSTALL_DATA) $(srcdir)/$(gsettings_SCHEMAS) "$(DESTDIR)$(gsettingsschemadir)" + if [ -z "$(DESTDIR)" ]; then $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); fi +endif + uninstall-gsettings-schemas: +ifeq ($(HAVE_PGTK)$(HAVE_GSETTINGS),yesyes) + for x in $(gsettings_SCHEMAS); do \ + xx=`echo $$x | sed -e 's|.*/||'`; \ + rm -f "$(DESTDIR)$(gsettingsschemadir)/$${xx}"; \ + done + if [ -z "$(DESTDIR)" ]; then $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); fi +endif + clean-gsettings-schemas: -$(gsettings_SCHEMAS:.xml=.valid): +ifeq ($(HAVE_PGTK)$(HAVE_GSETTINGS),yesyes) + rm -f $(gsettings_SCHEMAS:.xml=.valid) +endif + +$(gsettings_SCHEMAS:.xml=.valid): $(srcdir)/$(gsettings_SCHEMAS) +ifeq ($(HAVE_PGTK)$(HAVE_GSETTINGS),yesyes) + $(GLIB_COMPILE_SCHEMAS) --strict --dry-run --schema-file=$(srcdir)/$(gsettings_SCHEMAS) + $(MKDIR_P) $(@D) + touch $@ +endif diff --git a/configure.ac b/configure.ac index dabc2b425f8..517a5b5ba5e 100644 --- a/configure.ac +++ b/configure.ac @@ -2318,6 +2318,7 @@ dnl use the toolkit if we have gtk, or X11R5 or newer. USE_X_TOOLKIT=none HAVE_PGTK=yes AC_DEFINE([HAVE_PGTK], 1, [Define to 1 if you have pure Gtk+-3.]) + AC_SUBST(HAVE_PGTK) ;; haiku ) term_header=haikuterm.h @@ -3008,6 +3009,7 @@ if test "${HAVE_X11}" = "yes" -o "${window_system}" = "pgtk" && test "${with_gse if test "$emacs_cv_gsettings_in_gio" = "yes"; then AC_DEFINE(HAVE_GSETTINGS, 1, [Define to 1 if using GSettings.]) + AC_SUBST(HAVE_GSETTINGS) SETTINGS_CFLAGS="$GSETTINGS_CFLAGS" SETTINGS_LIBS="$GSETTINGS_LIBS" test "$with_gconf" = "yes" || with_gconf=no diff --git a/m4/gsettings.m4 b/m4/gsettings.m4 deleted file mode 100644 index 882e6a83e76..00000000000 --- a/m4/gsettings.m4 +++ /dev/null @@ -1,88 +0,0 @@ -# Increment this whenever this file is changed. -#serial 2 - -dnl GLIB_GSETTINGS -dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether -dnl the schema should be compiled -dnl - -AC_DEFUN([GLIB_GSETTINGS], -[ - dnl We can't use PKG_PREREQ because that needs 0.29. - m4_ifndef([PKG_PROG_PKG_CONFIG], - [pkg.m4 version 0.28 or later is required]) - - m4_pattern_allow([AM_V_GEN]) - AC_ARG_ENABLE(schemas-compile, - AS_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]) - AS_IF([test x$cross_compiling != xyes], - [PKG_CHECK_VAR([GLIB_COMPILE_SCHEMAS], [gio-2.0], [glib_compile_schemas])], - [AC_PATH_PROG([GLIB_COMPILE_SCHEMAS], [glib-compile-schemas])]) - AC_SUBST(GLIB_COMPILE_SCHEMAS) - if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then - ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2]) - else - ifelse([$1],,[:],[$1]) - fi - - GSETTINGS_RULES=' -.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas - -mostlyclean-am: clean-gsettings-schemas - -gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE)) - -%.gschema.valid: %.gschema.xml $(gsettings__enum_file) - $(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$< && mkdir -p [$](@D) && touch [$]@ - -all-am: $(gsettings_SCHEMAS:.xml=.valid) -uninstall-am: uninstall-gsettings-schemas -install-data-am: install-gsettings-schemas - -.SECONDARY: $(gsettings_SCHEMAS) - -install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file) - @$(NORMAL_INSTALL) - if test -n "$^"; then \ - test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \ - $(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \ - test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \ - fi - -uninstall-gsettings-schemas: - @$(NORMAL_UNINSTALL) - @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; 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__enum_file) - -ifdef gsettings_ENUM_NAMESPACE -$(gsettings__enum_file): $(gsettings_ENUM_FILES) - $(AM_V_GEN) glib-mkenums --comments '\'''\'' --fhead "" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " " --vtail " " --ftail "" [$]^ > [$]@.tmp && mv [$]@.tmp [$]@ -endif -' - _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])]) -] -)