]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove gsettings.m4 and write directly into Makefile.in
authorYuuki Harano <masm+github@masm11.me>
Tue, 4 Jan 2022 06:27:36 +0000 (15:27 +0900)
committerYuuki Harano <masm+github@masm11.me>
Tue, 4 Jan 2022 08:29:17 +0000 (17:29 +0900)
* 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

Makefile.in
configure.ac
m4/gsettings.m4 [deleted file]

index 5bafe0f140fe631cff0ad78b7a9546652f1dd3ca..b72127dde671278c69db0cc7ba1ca4ed95703af5 100644 (file)
@@ -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
index dabc2b425f8813a5839e578137d45d05bcc201dd..517a5b5ba5e115127c4ea6db2a066cc66084e4bb 100644 (file)
@@ -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 (file)
index 882e6a8..0000000
+++ /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 '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead "  <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod "    <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail "  </@type@>" --ftail "</schemalist>" [$]^ > [$]@.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])])
-]
-)