Commit 58de4f73 authored by Tom Schoonjans's avatar Tom Schoonjans Committed by Sébastien Wilmet

build: add option to disable dconf migration support

dconf is not available on Mac OS X or Windows.

It is also useful on Linux because dconf has an unstable API: if dconf
breaks its API in the future and gnome-latex is unmaintained, it will
still be possible to compile gnome-latex by disabling the dconf
migration support.

Fixes #56
parent 731d683e
......@@ -102,10 +102,23 @@ PKG_CHECK_MODULES([DEP], [
tepl-4 >= ${TEPL_REQUIRED_VERSION}
gspell-1 >= ${GSPELL_REQUIRED_VERSION}
gee-0.8 >= ${GEE_REQUIRED_VERSION}
dconf
gsettings-desktop-schemas
])
AC_ARG_ENABLE([dconf_migration],[AS_HELP_STRING([--disable-dconf-migration],[do not add support for dconf migration])],[enable_dconf_migration=$enableval],[enable_dconf_migration=check])
FOUND_DCONF_MIGRATION=
if test x$enable_dconf_migration != xno ; then
PKG_CHECK_MODULES([DCONF_DEP], [dconf], [
FOUND_DCONF_MIGRATION=yes
AC_DEFINE([HAVE_DCONF_MIGRATION], [], [Enable DConf migration support])
], [FOUND_DCONF_MIGRATION=no])
if test x$enable_dconf_migration = xyes && test x$FOUND_DCONF_MIGRATION = xno ; then
AC_MSG_ERROR([Enabling dconf migration support requires the presence of dconf])
fi
fi
AM_CONDITIONAL([DCONF_MIGRATION_BUILD], [test x$FOUND_DCONF_MIGRATION = xyes])
# Native Language Support
AX_REQUIRE_DEFINED([IT_PROG_INTLTOOL])
IT_PROG_INTLTOOL([0.50.1])
......
......@@ -7,6 +7,7 @@ liblatexila_la_CPPFLAGS = \
liblatexila_la_CFLAGS = \
$(DEP_CFLAGS) \
$(DCONF_DEP_CFLAGS) \
$(WARN_CFLAGS) \
$(CODE_COVERAGE_CFLAGS) \
-I$(top_builddir)/src/evince
......@@ -16,6 +17,7 @@ liblatexila_la_LDFLAGS = \
liblatexila_la_LIBADD = \
$(DEP_LIBS) \
$(DCONF_DEP_LIBS) \
$(CODE_COVERAGE_LIBS) \
../evince/libevince.la
......@@ -64,15 +66,25 @@ liblatexila_public_c_files = \
$(NULL)
liblatexila_private_headers = \
dh-dconf-migration.h \
latexila-templates-common.h \
$(NULL)
if DCONF_MIGRATION_BUILD
liblatexila_private_headers += \
dh-dconf-migration.h \
$(NULL)
endif
liblatexila_private_c_files = \
dh-dconf-migration.c \
latexila-templates-common.c \
$(NULL)
if DCONF_MIGRATION_BUILD
liblatexila_private_c_files += \
dh-dconf-migration.c \
$(NULL)
endif
liblatexila_public_built_sources = \
latexila-enum-types.c \
latexila-enum-types.h \
......
......@@ -30,9 +30,12 @@
* Various utility functions.
*/
#include "config.h"
#include "latexila-utils.h"
#include <string.h>
#ifdef HAVE_DCONF_MIGRATION
#include "dh-dconf-migration.h"
#endif
#include "latexila-synctex.h"
static gint
......@@ -493,6 +496,8 @@ latexila_utils_join_widgets (GtkWidget *widget_top,
static void
migrate_latexila_to_gnome_latex_gsettings (void)
{
#ifdef HAVE_DCONF_MIGRATION
DhDconfMigration *migration;
gint i;
......@@ -562,6 +567,9 @@ migrate_latexila_to_gnome_latex_gsettings (void)
}
_dh_dconf_migration_free (migration);
#else
g_warning("dconf migration not supported!");
#endif
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment