gsettings m4: check for .xml in src/builddir
authorRyan Lortie <desrt@desrt.ca>
Thu, 27 May 2010 15:58:54 +0000 (11:58 -0400)
committerRyan Lortie <desrt@desrt.ca>
Thu, 27 May 2010 15:58:54 +0000 (11:58 -0400)
This checks for the .gschema.xml file in the srcdir and builddir and
runs the schema validation on which one it finds.  This handles
non-srcdir builds in both cases: .gschema.xml is in the tarball and
.gschema.xml is generated.

m4macros/gsettings.m4

index 329700d..b686989 100644 (file)
@@ -28,7 +28,7 @@ AC_DEFUN([GLIB_GSETTINGS],
 mostlyclean-am: clean-gsettings-schemas
 
 %.gschema.valid: %.gschema.xml
-       $(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --dry-run --schema-file=$^ && touch [$]@
+       $(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