Commit 612ac9e4 authored by Sébastien Wilmet's avatar Sébastien Wilmet

build: change a bit the previous commit

To better follow my tastes.

- Don't have automagic configuration. Either dconf must be installed, or
  --disable-dconf-migration must be provided. So no surprises.
- Always define HAVE_DCONF_MIGRATION in config.h and have #if instead of
  #ifdef, so if HAVE_DCONF_MIGRATION is not present the code won't
  compile. #ifdef is a bit fragile.

#56
parent 58de4f73
......@@ -105,19 +105,21 @@ PKG_CHECK_MODULES([DEP], [
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
# dconf migration option
AC_ARG_ENABLE([dconf_migration],
[AS_HELP_STRING([--disable-dconf-migration],
[do not add support for latexila to gnome-latex dconf migration])],
[enable_dconf_migration=$enableval],
[enable_dconf_migration=yes])
if test x$enable_dconf_migration = xyes; then
PKG_CHECK_MODULES([DCONF_DEP], [dconf])
AC_DEFINE_UNQUOTED([HAVE_DCONF_MIGRATION], [1], [Whether dconf migration is supported])
else
AC_DEFINE_UNQUOTED([HAVE_DCONF_MIGRATION], [0], [Whether dconf migration is supported])
fi
AM_CONDITIONAL([DCONF_MIGRATION_BUILD], [test x$FOUND_DCONF_MIGRATION = xyes])
AM_CONDITIONAL([DCONF_MIGRATION_BUILD], [test x$enable_dconf_migration = xyes])
# Native Language Support
AX_REQUIRE_DEFINED([IT_PROG_INTLTOOL])
......@@ -221,4 +223,5 @@ Configuration:
GObject introspection: ${found_introspection}
Generate latexila.vapi: ${enable_vala}
Code coverage: ${enable_code_coverage}
dconf migration: ${enable_dconf_migration}
"
......@@ -69,20 +69,13 @@ liblatexila_private_headers = \
latexila-templates-common.h \
$(NULL)
if DCONF_MIGRATION_BUILD
liblatexila_private_headers += \
dh-dconf-migration.h \
$(NULL)
endif
liblatexila_private_c_files = \
latexila-templates-common.c \
$(NULL)
if DCONF_MIGRATION_BUILD
liblatexila_private_c_files += \
dh-dconf-migration.c \
$(NULL)
liblatexila_private_headers += dh-dconf-migration.h
liblatexila_private_c_files += dh-dconf-migration.c
endif
liblatexila_public_built_sources = \
......
......@@ -33,10 +33,11 @@
#include "config.h"
#include "latexila-utils.h"
#include <string.h>
#ifdef HAVE_DCONF_MIGRATION
#include "latexila-synctex.h"
#if HAVE_DCONF_MIGRATION
#include "dh-dconf-migration.h"
#endif
#include "latexila-synctex.h"
static gint
get_extension_position (const gchar *filename)
......@@ -496,8 +497,7 @@ latexila_utils_join_widgets (GtkWidget *widget_top,
static void
migrate_latexila_to_gnome_latex_gsettings (void)
{
#ifdef HAVE_DCONF_MIGRATION
#if HAVE_DCONF_MIGRATION
DhDconfMigration *migration;
gint i;
......@@ -568,7 +568,7 @@ migrate_latexila_to_gnome_latex_gsettings (void)
_dh_dconf_migration_free (migration);
#else
g_warning("dconf migration not supported!");
g_warning ("LaTeXila -> GNOME LaTeX dconf migration not supported.");
#endif
}
......
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