[gnome-builder] build: add --enable-editorconfig



commit 7212eb0948338ef6a2c2d26ecfc1613144b313b4
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jan 24 17:07:48 2016 -0800

    build: add --enable-editorconfig
    
    Editorconfig requires pcre.h. If it cannot be found, just disable
    editorconfig.

 configure.ac                        |   15 ++++++++++++++-
 contrib/libeditorconfig/Makefile.am |    4 ++++
 libide/Makefile.am                  |   22 +++++++++++++++-------
 libide/ide.c                        |    7 ++++++-
 4 files changed, 39 insertions(+), 9 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 66b8bb3..b165650 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,7 +80,19 @@ APPSTREAM_XML
 dnl ***********************************************************************
 dnl Check for Required Headers
 dnl ***********************************************************************
-AC_CHECK_HEADER([pcre.h])
+AC_ARG_ENABLE([editorconfig],
+              AS_HELP_STRING([--enable-editorconfig],
+                             [Enable editorconfig file settings.]),
+              [enable_editorconfig=$enableval],
+              [enable_editorconfig=auto])
+AC_CHECK_HEADER([pcre.h],[have_pcre=yes],[have_pcre=no])
+AS_IF([test "$enable_editorconfig" = yes && test "$have_pcre" != "yes"],[
+       AC_MSG_ERROR([editorconfig requires pcre.h])
+])
+AS_IF([test "$enable_editorconfig" = "auto" && test "$have_pcre" = "yes"],[
+       enable_editorconfig=yes
+])
+AM_CONDITIONAL([ENABLE_EDITORCONFIG],[test "$enable_editorconfig" = "yes"])
 
 
 dnl ***********************************************************************
@@ -490,6 +502,7 @@ echo "  Command Bar .......................... : ${enable_command_bar_plugin}"
 echo "  Contribute ........................... : ${enable_contributing_plugin}"
 echo "  Ctags ................................ : ${enable_ctags_plugin}"
 echo "  Devhelp .............................. : ${enable_devhelp_plugin}"
+echo "  Editorconfig ......................... : ${enable_editorconfig}"
 echo "  Fpaste.org ........................... : ${enable_fpaste_plugin}"
 echo "  GCC .................................. : ${enable_gcc_plugin}"
 echo "  Git Version Control .................. : ${enable_git_plugin}"
diff --git a/contrib/libeditorconfig/Makefile.am b/contrib/libeditorconfig/Makefile.am
index 9923f32..3387308 100644
--- a/contrib/libeditorconfig/Makefile.am
+++ b/contrib/libeditorconfig/Makefile.am
@@ -1,3 +1,5 @@
+if ENABLE_EDITORCONFIG
+
 noinst_LTLIBRARIES = libeditorconfig.la
 
 libeditorconfig_la_SOURCES = \
@@ -34,4 +36,6 @@ libeditorconfig_la_CFLAGS = \
        -Deditorconfig_VERSION_SUFFIX=0 \
        $(NULL)
 
+endif
+
 -include $(top_srcdir)/git.mk
diff --git a/libide/Makefile.am b/libide/Makefile.am
index 8b465d5..a479de1 100644
--- a/libide/Makefile.am
+++ b/libide/Makefile.am
@@ -243,10 +243,6 @@ libide_1_0_la_public_sources = \
 
 libide_1_0_la_SOURCES = \
        $(libide_1_0_la_public_sources) \
-       editorconfig/editorconfig-glib.c \
-       editorconfig/editorconfig-glib.h \
-       editorconfig/ide-editorconfig-file-settings.c \
-       editorconfig/ide-editorconfig-file-settings.h \
        editor/ide-editor-frame-actions.c \
        editor/ide-editor-frame-actions.h \
        editor/ide-editor-frame.c \
@@ -410,14 +406,12 @@ libide_1_0_la_includes = \
        -I$(top_srcdir)/contrib/egg \
        -I$(top_srcdir)/contrib/gd \
        -I$(top_srcdir)/contrib/nautilus \
-       -I$(top_srcdir)/contrib/libeditorconfig \
        -I$(top_srcdir)/contrib/search \
        -I$(top_srcdir)/contrib/xml \
        -I$(top_builddir)/data/icons/hicolor \
        -I$(srcdir) \
        -I$(srcdir)/doap \
        -I$(srcdir)/editor \
-       -I$(srcdir)/editorconfig \
        -I$(srcdir)/greeter \
        -I$(srcdir)/genesis \
        -I$(srcdir)/gsettings \
@@ -463,7 +457,6 @@ libide_1_0_la_LIBADD = \
        $(top_builddir)/data/icons/hicolor/libicons.la \
        $(top_builddir)/contrib/egg/libegg-private.la \
        $(top_builddir)/contrib/gd/libgd.la \
-       $(top_builddir)/contrib/libeditorconfig/libeditorconfig.la \
        $(top_builddir)/contrib/nautilus/libnautilus.la \
        $(top_builddir)/contrib/search/libsearch.la \
        $(top_builddir)/contrib/xml/libxml.la \
@@ -475,6 +468,21 @@ libide_1_0_la_built_sources = \
        $(NULL)
 
 
+if ENABLE_EDITORCONFIG
+libide_1_0_la_SOURCES += \
+       editorconfig/editorconfig-glib.c \
+       editorconfig/editorconfig-glib.h \
+       editorconfig/ide-editorconfig-file-settings.c \
+       editorconfig/ide-editorconfig-file-settings.h
+
+libide_1_0_la_includes += \
+       -I$(top_srcdir)/contrib/libeditorconfig \
+       -I$(srcdir)/editorconfig
+
+libide_1_0_la_LIBADD += $(top_builddir)/contrib/libeditorconfig/libeditorconfig.la
+endif
+
+
 if ENABLE_PYTHON_SCRIPTING
 libide_1_0_la_includes += -I$(srcdir)/pygobject
 libide_1_0_la_SOURCES += \
diff --git a/libide/ide.c b/libide/ide.c
index 5e2534d..8d792e3 100644
--- a/libide/ide.c
+++ b/libide/ide.c
@@ -23,11 +23,14 @@
 #include "gconstructor.h"
 #include "ide.h"
 
-#include "ide-editorconfig-file-settings.h"
 #include "ide-file-settings.h"
 #include "ide-gsettings-file-settings.h"
 #include "ide-modelines-file-settings.h"
 
+#ifdef ENABLE_EDITORCONFIG
+# include "ide-editorconfig-file-settings.h"
+#endif
+
 #ifdef ENABLE_PYTHON_SCRIPTING
 # include "ide-pygobject-script.h"
 #endif
@@ -73,10 +76,12 @@ ide_init_ctor (void)
                                   IDE_TYPE_MODELINES_FILE_SETTINGS,
                                   IDE_FILE_SETTINGS_EXTENSION_POINT".modelines",
                                   -100);
+#ifdef ENABLE_EDITORCONFIG
   g_io_extension_point_implement (IDE_FILE_SETTINGS_EXTENSION_POINT,
                                   IDE_TYPE_EDITORCONFIG_FILE_SETTINGS,
                                   IDE_FILE_SETTINGS_EXTENSION_POINT".editorconfig",
                                   -200);
+#endif
   g_io_extension_point_implement (IDE_FILE_SETTINGS_EXTENSION_POINT,
                                   IDE_TYPE_GSETTINGS_FILE_SETTINGS,
                                   IDE_FILE_SETTINGS_EXTENSION_POINT".gsettings",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]