2010-04-23 15:39:44 +02:00
|
|
|
dnl GLIB_GSETTINGS
|
2010-04-21 13:25:23 +02:00
|
|
|
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
|
|
|
|
dnl the schema should be compiled
|
|
|
|
dnl
|
|
|
|
|
2010-04-23 15:39:44 +02:00
|
|
|
AC_DEFUN([GLIB_GSETTINGS],
|
2010-04-21 13:25:23 +02:00
|
|
|
[
|
|
|
|
AC_ARG_ENABLE(schemas-install,
|
|
|
|
AC_HELP_STRING([--disable-schemas-install],
|
2010-04-23 23:27:26 +02:00
|
|
|
[Disable installation of GSettings schemas]),
|
2010-04-21 13:25:23 +02:00
|
|
|
[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])
|
|
|
|
|
2010-04-23 23:27:26 +02:00
|
|
|
PKG_PROG_PKG_CONFIG([0.16])
|
|
|
|
|
2010-04-21 13:25:23 +02:00
|
|
|
AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
|
2010-04-23 23:27:26 +02:00
|
|
|
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
|
2010-04-21 13:25:23 +02:00
|
|
|
|
|
|
|
GSETTINGS_CHECK_RULE='
|
|
|
|
.PHONY : check-gsettings-schema
|
|
|
|
|
|
|
|
check-gsettings-schema: gsettings_schema_validate_stamp
|
2010-04-23 23:27:26 +02:00
|
|
|
MOSTLYCLEANFILES += gsettings_schema_validate_stamp
|
2010-05-15 03:58:08 +02:00
|
|
|
gsettings_schema_validate_stamp: *.gschema.xml
|
2010-05-15 11:56:21 +02:00
|
|
|
$(GLIB_COMPILE_SCHEMAS) --dry-run $(addprefix --schema-file=,$?)
|
2010-04-21 13:25:23 +02:00
|
|
|
touch [$]@
|
|
|
|
|
|
|
|
all: check-gsettings-schema
|
|
|
|
'
|
|
|
|
|
|
|
|
_GSETTINGS_SUBST(GSETTINGS_CHECK_RULE)
|
|
|
|
])
|
|
|
|
|
|
|
|
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])])
|
|
|
|
]
|
|
|
|
)
|