>From b1868f638efb9ded052eb956fd496c1ee98ab16d Mon Sep 17 00:00:00 2001
From: Quentin Glidic <sardemff7+git@sardemff7.net>
Date: Sat, 19 May 2012 15:09:09 +0200
Subject: [PATCH 8/9] Autotools: Conditionally add plugins to SUBDIRS

Automake will automatically generate a DIST_SUBDIRS variable to get
everything right for "make dist"
---
 Makefile.am                             |  152 ++++++++++++++++++++++++-------
 addons/Makefile.am                      |    2 -
 addons/src/Makefile.am                  |    2 -
 codenav/Makefile.am                     |    2 -
 codenav/src/Makefile.am                 |    2 -
 debugger/Makefile.am                    |    2 -
 debugger/img/Makefile.am                |    2 -
 debugger/src/Makefile.am                |    2 -
 devhelp/Makefile.am                     |    2 -
 devhelp/data/Makefile.am                |    3 -
 devhelp/devhelp/Makefile.am             |    2 -
 devhelp/src/Makefile.am                 |    2 -
 geanydoc/Makefile.am                    |    2 -
 geanydoc/src/Makefile.am                |    2 -
 geanyextrasel/Makefile.am               |    2 -
 geanyextrasel/src/Makefile.am           |    2 -
 geanygdb/Makefile.am                    |    2 -
 geanygdb/src/Makefile.am                |    2 -
 geanygendoc/Makefile.am                 |    2 -
 geanygendoc/data/filetypes/Makefile.am  |    3 -
 geanygendoc/docs/Makefile.am            |    3 -
 geanygendoc/src/Makefile.am             |    2 -
 geanyinsertnum/Makefile.am              |    2 -
 geanyinsertnum/src/Makefile.am          |    2 -
 geanylatex/Makefile.am                  |    2 -
 geanylatex/doc/Makefile.am              |    3 -
 geanylatex/src/Makefile.am              |    2 -
 geanylipsum/Makefile.am                 |    2 -
 geanylipsum/src/Makefile.am             |    2 -
 geanylua/Makefile.am                    |    6 --
 geanylua/docs/Makefile.am               |    3 -
 geanylua/examples/dialogs/Makefile.am   |    3 -
 geanylua/examples/edit/Makefile.am      |    3 -
 geanylua/examples/info/Makefile.am      |    3 -
 geanylua/examples/scripting/Makefile.am |    3 -
 geanylua/examples/work/Makefile.am      |    3 -
 geanymacro/Makefile.am                  |    2 -
 geanymacro/src/Makefile.am              |    2 -
 geanyminiscript/Makefile.am             |    2 -
 geanyminiscript/src/Makefile.am         |    2 -
 geanynumberedbookmarks/Makefile.am      |    2 -
 geanynumberedbookmarks/src/Makefile.am  |    2 -
 geanypg/Makefile.am                     |    2 -
 geanypg/src/Makefile.am                 |    2 -
 geanyprj/Makefile.am                    |    2 -
 geanyprj/src/Makefile.am                |    2 -
 geanysendmail/Makefile.am               |    2 -
 geanysendmail/src/Makefile.am           |    2 -
 geanyvc/Makefile.am                     |    2 -
 geanyvc/src/Makefile.am                 |    2 -
 geanyvc/tests/Makefile.am               |    2 -
 geniuspaste/Makefile.am                 |    2 -
 geniuspaste/src/Makefile.am             |    2 -
 gproject/Makefile.am                    |    2 -
 gproject/icons/Makefile.am              |    3 -
 gproject/src/Makefile.am                |    2 -
 multiterm/Makefile.am                   |    2 -
 multiterm/src/Makefile.am               |    2 -
 pretty-printer/src/Makefile.am          |    2 -
 shiftcolumn/Makefile.am                 |    2 -
 shiftcolumn/src/Makefile.am             |    2 -
 spellcheck/Makefile.am                  |    3 -
 spellcheck/src/Makefile.am              |    2 -
 tableconvert/Makefile.am                |    2 -
 tableconvert/src/Makefile.am            |    2 -
 treebrowser/Makefile.am                 |    2 -
 treebrowser/src/Makefile.am             |    2 -
 updatechecker/Makefile.am               |    2 -
 updatechecker/src/Makefile.am           |    2 -
 webhelper/Makefile.am                   |    2 -
 webhelper/src/Makefile.am               |    2 -
 xmlsnippets/Makefile.am                 |    2 -
 xmlsnippets/src/Makefile.am             |    2 -
 73 files changed, 118 insertions(+), 194 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index f6d203c..4700853 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,39 +1,123 @@
-plugins = \
-	addons \
-	codenav \
-	debugger \
-	devhelp \
-	geanydoc \
-	geanyextrasel \
-	geanygdb \
-	geanygendoc \
-	geanyinsertnum \
-	geanylatex \
-	geanylipsum \
-	geanylua \
-	geanymacro \
-	geanyminiscript \
-	geanynumberedbookmarks \
-	geanypg \
-	geanyprj \
-	geanysendmail \
-	geanyvc \
-	gproject \
-	multiterm \
-	pretty-printer \
-	shiftcolumn \
-	spellcheck \
-	tableconvert \
-	treebrowser \
-	updatechecker \
-	webhelper \
-	xmlsnippets
-
 ACLOCAL_AMFLAGS = -I build/cache -I build -I build/bundled --install
 
-SUBDIRS = \
-	po \
-	$(plugins)
+SUBDIRS = po
+
+if ENABLE_ADDONS
+SUBDIRS += addons
+endif
+
+if ENABLE_CODENAV
+SUBDIRS += codenav
+endif
+
+if ENABLE_DEBUGGER
+SUBDIRS += debugger
+endif
+
+if ENABLE_DEVHELP
+SUBDIRS += devhelp
+endif
+
+if ENABLE_GEANYDOC
+SUBDIRS += geanydoc
+endif
+
+if ENABLE_GEANYEXTRASEL
+SUBDIRS += geanyextrasel
+endif
+
+if ENABLE_GEANYGDB
+SUBDIRS += geanygdb
+endif
+
+if ENABLE_GEANYGENDOC
+SUBDIRS += geanygendoc
+endif
+
+if ENABLE_GEANYINSERTNUM
+SUBDIRS += geanyinsertnum
+endif
+
+if ENABLE_GEANYLATEX
+SUBDIRS += geanylatex
+endif
+
+if ENABLE_GEANYLIPSUM
+SUBDIRS += geanylipsum
+endif
+
+if ENABLE_GEANYLUA
+SUBDIRS += geanylua
+endif
+
+if ENABLE_GEANYMACRO
+SUBDIRS += geanymacro
+endif
+
+if ENABLE_GEANYMINISCRIPT
+SUBDIRS += geanyminiscript
+endif
+
+if ENABLE_GEANYNUMBEREDBOOKMARKS
+SUBDIRS += geanynumberedbookmarks
+endif
+
+if ENABLE_GEANYPG
+SUBDIRS += geanypg
+endif
+
+if ENABLE_GEANYPRJ
+SUBDIRS += geanyprj
+endif
+
+if ENABLE_GEANYSENDMAIL
+SUBDIRS += geanysendmail
+endif
+
+if ENABLE_GEANYVC
+SUBDIRS += geanyvc
+endif
+
+if ENABLE_GPROJECT
+SUBDIRS += gproject
+endif
+
+if ENABLE_MULTITERM
+SUBDIRS += multiterm
+endif
+
+if ENABLE_PRETTY_PRINTER
+SUBDIRS += pretty-printer
+endif
+
+if ENABLE_SHIFTCOLUMN
+SUBDIRS += shiftcolumn
+endif
+
+if ENABLE_SPELLCHECK
+SUBDIRS += spellcheck
+endif
+
+if ENABLE_TABLECONVERT
+SUBDIRS += tableconvert
+endif
+
+if ENABLE_TREEBROWSER
+SUBDIRS += treebrowser
+endif
+
+if ENABLE_UPDATECHECKER
+SUBDIRS += updatechecker
+endif
+
+if ENABLE_WEBHELPER
+SUBDIRS += webhelper
+endif
+
+if ENABLE_XMLSNIPPETS
+SUBDIRS += xmlsnippets
+endif
+
 
 EXTRA_DIST = \
 	build/__init__.py \
diff --git a/addons/Makefile.am b/addons/Makefile.am
index 5c6a543..535fd18 100644
--- a/addons/Makefile.am
+++ b/addons/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_ADDONS
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = addons
diff --git a/addons/src/Makefile.am b/addons/src/Makefile.am
index 6b7c278..3d91aa6 100644
--- a/addons/src/Makefile.am
+++ b/addons/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_ADDONS
 geanyplugins_LTLIBRARIES = addons.la
-endif
 
 addons_la_SOURCES = \
 	addons.h \
diff --git a/codenav/Makefile.am b/codenav/Makefile.am
index aae9a8f..ba8ab22 100644
--- a/codenav/Makefile.am
+++ b/codenav/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_CODENAV
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = codenav
diff --git a/codenav/src/Makefile.am b/codenav/src/Makefile.am
index 98c7c1c..99e1f17 100644
--- a/codenav/src/Makefile.am
+++ b/codenav/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_CODENAV
 geanyplugins_LTLIBRARIES = codenav.la
-endif
 
 codenav_la_SOURCES = \
 	codenavigation.c \
diff --git a/debugger/Makefile.am b/debugger/Makefile.am
index aef6163..b428991 100644
--- a/debugger/Makefile.am
+++ b/debugger/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_DEBUGGER
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src img
 plugin = debugger
diff --git a/debugger/img/Makefile.am b/debugger/img/Makefile.am
index 704f2f8..084234e 100644
--- a/debugger/img/Makefile.am
+++ b/debugger/img/Makefile.am
@@ -2,7 +2,6 @@ include $(top_srcdir)/build/vars.docs.mk
 
 plugin = debugger
 
-if ENABLE_DEBUGGER
 dist_plugindata_DATA = \
 	continue.png \
 	restart.gif \
@@ -13,4 +12,3 @@ dist_plugindata_DATA = \
 	step_over.gif \
 	stop.gif \
 	tabs.gif
-endif
diff --git a/debugger/src/Makefile.am b/debugger/src/Makefile.am
index 7f4757b..40f4239 100644
--- a/debugger/src/Makefile.am
+++ b/debugger/src/Makefile.am
@@ -1,9 +1,7 @@
 include $(top_srcdir)/build/vars.build.mk
 include $(top_srcdir)/build/vars.docs.mk
 
-if ENABLE_DEBUGGER
 geanyplugins_LTLIBRARIES = debugger.la
-endif
 
 plugin = debugger
 
diff --git a/devhelp/Makefile.am b/devhelp/Makefile.am
index 96f8aee..7bc6d5f 100644
--- a/devhelp/Makefile.am
+++ b/devhelp/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_DEVHELP
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = devhelp src data
 plugin = devhelp
diff --git a/devhelp/data/Makefile.am b/devhelp/data/Makefile.am
index bcc1538..56b1a16 100644
--- a/devhelp/data/Makefile.am
+++ b/devhelp/data/Makefile.am
@@ -1,4 +1,3 @@
-if ENABLE_DEVHELP
 include $(top_srcdir)/build/vars.docs.mk
 
 plugin = devhelp
@@ -9,5 +8,3 @@ dist_plugindata_DATA = \
 	geany-devhelp-plugin.png \
 	home.html \
 	devhelp.conf
-
-endif
diff --git a/devhelp/devhelp/Makefile.am b/devhelp/devhelp/Makefile.am
index a289e23..a962dc9 100644
--- a/devhelp/devhelp/Makefile.am
+++ b/devhelp/devhelp/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_DEVHELP
 noinst_LTLIBRARIES = libdevhelp-2.la
-endif
 
 dh_headers = \
 	dh-assistant.h \
diff --git a/devhelp/src/Makefile.am b/devhelp/src/Makefile.am
index 870462c..ac15bb8 100644
--- a/devhelp/src/Makefile.am
+++ b/devhelp/src/Makefile.am
@@ -2,9 +2,7 @@ include $(top_srcdir)/build/vars.build.mk
 
 plugin = devhelp
 
-if ENABLE_DEVHELP
 geanyplugins_LTLIBRARIES = devhelp.la
-endif
 
 devhelp_la_SOURCES = \
 	dhp-manpages.c \
diff --git a/geanydoc/Makefile.am b/geanydoc/Makefile.am
index 2df6fc3..49639df 100644
--- a/geanydoc/Makefile.am
+++ b/geanydoc/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYDOC
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src tests
 plugin = geanydoc
diff --git a/geanydoc/src/Makefile.am b/geanydoc/src/Makefile.am
index 2e98e63..fb624ca 100644
--- a/geanydoc/src/Makefile.am
+++ b/geanydoc/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYDOC
 geanyplugins_LTLIBRARIES = geanydoc.la
-endif
 
 geanydoc_la_SOURCES = \
 	config.c \
diff --git a/geanyextrasel/Makefile.am b/geanyextrasel/Makefile.am
index 9f24a90..5febcd4 100644
--- a/geanyextrasel/Makefile.am
+++ b/geanyextrasel/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYEXTRASEL
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = geanyextrasel
diff --git a/geanyextrasel/src/Makefile.am b/geanyextrasel/src/Makefile.am
index 0931dcc..36e9bc2 100644
--- a/geanyextrasel/src/Makefile.am
+++ b/geanyextrasel/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYEXTRASEL
 geanyplugins_LTLIBRARIES = geanyextrasel.la
-endif
 
 geanyextrasel_la_SOURCES = extrasel.c
 geanyextrasel_la_LIBADD = $(COMMONLIBS)
diff --git a/geanygdb/Makefile.am b/geanygdb/Makefile.am
index dd6dd09..9386f6e 100644
--- a/geanygdb/Makefile.am
+++ b/geanygdb/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYGDB
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src tests
 plugin = geanygdb
diff --git a/geanygdb/src/Makefile.am b/geanygdb/src/Makefile.am
index 0f27137..bdf1776 100644
--- a/geanygdb/src/Makefile.am
+++ b/geanygdb/src/Makefile.am
@@ -1,10 +1,8 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYGDB
 geanygdbdir = $(libexecdir)/geany-plugins/geanygdb
 geanyplugins_LTLIBRARIES = geanygdb.la
 geanygdb_PROGRAMS = ttyhelper
-endif
 
 geanygdb_la_SOURCES = \
 	gdb-io.h \
diff --git a/geanygendoc/Makefile.am b/geanygendoc/Makefile.am
index e4de74c..724556f 100644
--- a/geanygendoc/Makefile.am
+++ b/geanygendoc/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYGENDOC
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src docs data
 plugin = geanygendoc
diff --git a/geanygendoc/data/filetypes/Makefile.am b/geanygendoc/data/filetypes/Makefile.am
index b1463e0..f66dfaa 100644
--- a/geanygendoc/data/filetypes/Makefile.am
+++ b/geanygendoc/data/filetypes/Makefile.am
@@ -1,4 +1,3 @@
-if ENABLE_GEANYGENDOC
 include $(top_srcdir)/build/vars.docs.mk
 
 plugin = geanygendoc
@@ -7,5 +6,3 @@ filetypesdir = $(plugindatadir)/filetypes
 dist_filetypes_DATA = \
 	c.conf \
 	vala.conf
-
-endif
diff --git a/geanygendoc/docs/Makefile.am b/geanygendoc/docs/Makefile.am
index 1d536e5..a5dfed3 100644
--- a/geanygendoc/docs/Makefile.am
+++ b/geanygendoc/docs/Makefile.am
@@ -1,4 +1,3 @@
-if ENABLE_GEANYGENDOC
 include $(top_srcdir)/build/vars.docs.mk
 plugin = geanygendoc
 pluginhtmldocdir = $(plugindocdir)/html
@@ -17,5 +16,3 @@ if BUILD_RST
 manual.html: manual.rst manual.css
 	$(AM_V_GEN) $(RST2HTML) -d --strict --stylesheet-path manual.css $< $@
 endif BUILD_RST
-
-endif ENABLE_GEANYGENDOC
diff --git a/geanygendoc/src/Makefile.am b/geanygendoc/src/Makefile.am
index 45b33dd..63449ce 100644
--- a/geanygendoc/src/Makefile.am
+++ b/geanygendoc/src/Makefile.am
@@ -1,9 +1,7 @@
 include $(top_srcdir)/build/vars.build.mk
 plugin = geanygendoc
 
-if ENABLE_GEANYGENDOC
 geanyplugins_LTLIBRARIES = geanygendoc.la
-endif
 
 geanygendoc_la_SOURCES = \
 	ggd.c \
diff --git a/geanyinsertnum/Makefile.am b/geanyinsertnum/Makefile.am
index 3a21014..abee54e 100644
--- a/geanyinsertnum/Makefile.am
+++ b/geanyinsertnum/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYINSERTNUM
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = geanyinsertnum
diff --git a/geanyinsertnum/src/Makefile.am b/geanyinsertnum/src/Makefile.am
index 3614f75..04caa29 100644
--- a/geanyinsertnum/src/Makefile.am
+++ b/geanyinsertnum/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYINSERTNUM
 geanyplugins_LTLIBRARIES = geanyinsertnum.la
-endif
 
 geanyinsertnum_la_SOURCES = insertnum.c
 geanyinsertnum_la_LIBADD = $(COMMONLIBS)
diff --git a/geanylatex/Makefile.am b/geanylatex/Makefile.am
index 34c0e2d..1035680 100644
--- a/geanylatex/Makefile.am
+++ b/geanylatex/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYLATEX
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src doc
 plugin = geanylatex
diff --git a/geanylatex/doc/Makefile.am b/geanylatex/doc/Makefile.am
index a6d9111..362579f 100644
--- a/geanylatex/doc/Makefile.am
+++ b/geanylatex/doc/Makefile.am
@@ -1,4 +1,3 @@
-if ENABLE_GEANYLATEX
 include $(top_srcdir)/build/vars.docs.mk
 
 dist_plugindoc_DATA = \
@@ -17,5 +16,3 @@ dist_plugindoc_DATA = \
 	img/latexwizard.png \
 	img/plugin_manager.png \
 	img/toolbar.png
-
-endif
diff --git a/geanylatex/src/Makefile.am b/geanylatex/src/Makefile.am
index 393de25..99ffa4a 100644
--- a/geanylatex/src/Makefile.am
+++ b/geanylatex/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYLATEX
 geanyplugins_LTLIBRARIES = geanylatex.la
-endif
 
 geanylatex_la_SOURCES = \
 	bibtex.c \
diff --git a/geanylipsum/Makefile.am b/geanylipsum/Makefile.am
index 9654227..b04cccf 100644
--- a/geanylipsum/Makefile.am
+++ b/geanylipsum/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYLIPSUM
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = geanylipsum
diff --git a/geanylipsum/src/Makefile.am b/geanylipsum/src/Makefile.am
index 2146b3a..969b2ee 100644
--- a/geanylipsum/src/Makefile.am
+++ b/geanylipsum/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYLIPSUM
 geanyplugins_LTLIBRARIES = geanylipsum.la
-endif
 
 geanylipsum_la_SOURCES = geanylipsum.c
 geanylipsum_la_LIBADD = $(COMMONLIBS)
diff --git a/geanylua/Makefile.am b/geanylua/Makefile.am
index 860fe64..c556722 100644
--- a/geanylua/Makefile.am
+++ b/geanylua/Makefile.am
@@ -1,19 +1,13 @@
-# don't install docs if disabled
-if ENABLE_GEANYLUA
 include $(top_srcdir)/build/vars.build.mk
 include $(top_srcdir)/build/vars.auxfiles.mk
 
 plugin = geanylua
-endif
 
 EXTRA_DIST = util
 
-# don't build if disabled
-if ENABLE_GEANYLUA
 geanyplugins_LTLIBRARIES = geanylua.la
 geanyluadir = $(pkglibdir)/geanylua
 geanylua_LTLIBRARIES = libgeanylua.la
-endif
 
 geanylua_la_SOURCES = geanylua.c
 libgeanylua_la_SOURCES = \
diff --git a/geanylua/docs/Makefile.am b/geanylua/docs/Makefile.am
index dcd3bc6..dc3a433 100644
--- a/geanylua/docs/Makefile.am
+++ b/geanylua/docs/Makefile.am
@@ -1,4 +1,3 @@
-if ENABLE_GEANYLUA
 include $(top_srcdir)/build/vars.docs.mk
 
 plugin = geanylua
@@ -11,5 +10,3 @@ dist_htmldoc_DATA = \
 	geanylua-keys.html \
 	geanylua-ref.html \
 	luarefv51.html
-
-endif
diff --git a/geanylua/examples/dialogs/Makefile.am b/geanylua/examples/dialogs/Makefile.am
index 6d6daa4..d7e41ed 100644
--- a/geanylua/examples/dialogs/Makefile.am
+++ b/geanylua/examples/dialogs/Makefile.am
@@ -1,4 +1,3 @@
-if ENABLE_GEANYLUA
 include $(top_srcdir)/build/vars.docs.mk
 
 plugin = geanylua
@@ -7,5 +6,3 @@ dialogsdir = $(examplesdir)/dialogs
 dist_dialogs_DATA = \
 	basic-dialogs.lua \
 	complex-dialog.lua
-
-endif
diff --git a/geanylua/examples/edit/Makefile.am b/geanylua/examples/edit/Makefile.am
index 28d4886..684bf1f 100644
--- a/geanylua/examples/edit/Makefile.am
+++ b/geanylua/examples/edit/Makefile.am
@@ -1,4 +1,3 @@
-if ENABLE_GEANYLUA
 include $(top_srcdir)/build/vars.docs.mk
 
 plugin = geanylua
@@ -11,5 +10,3 @@ dist_edit_DATA = \
 	reverse.lua \
 	right-trim.lua \
 	select-block.lua
-
-endif
diff --git a/geanylua/examples/info/Makefile.am b/geanylua/examples/info/Makefile.am
index 846ae16..5d4112b 100644
--- a/geanylua/examples/info/Makefile.am
+++ b/geanylua/examples/info/Makefile.am
@@ -1,4 +1,3 @@
-if ENABLE_GEANYLUA
 include $(top_srcdir)/build/vars.docs.mk
 
 plugin = geanylua
@@ -10,5 +9,3 @@ dist_exampleinfo_DATA = \
 	file-information.lua \
 	list-open-files.lua \
 	show-filename.lua
-
-endif
diff --git a/geanylua/examples/scripting/Makefile.am b/geanylua/examples/scripting/Makefile.am
index cb4dc7f..0a62a4d 100644
--- a/geanylua/examples/scripting/Makefile.am
+++ b/geanylua/examples/scripting/Makefile.am
@@ -1,4 +1,3 @@
-if ENABLE_GEANYLUA
 include $(top_srcdir)/build/vars.docs.mk
 
 plugin = geanylua
@@ -9,5 +8,3 @@ dist_scripting_DATA = \
 	open-script.lua \
 	rebuild-menu.lua \
 	show-examples.lua
-
-endif
diff --git a/geanylua/examples/work/Makefile.am b/geanylua/examples/work/Makefile.am
index 0fbf6a0..19200c7 100644
--- a/geanylua/examples/work/Makefile.am
+++ b/geanylua/examples/work/Makefile.am
@@ -1,4 +1,3 @@
-if ENABLE_GEANYLUA
 include $(top_srcdir)/build/vars.docs.mk
 
 plugin = geanylua
@@ -8,5 +7,3 @@ dist_work_DATA = \
 	01.edit-test-script.lua \
 	02.run-test-script.lua \
 	03.install-test-script.lua
-
-endif
diff --git a/geanymacro/Makefile.am b/geanymacro/Makefile.am
index b8cc606..0a52da5 100644
--- a/geanymacro/Makefile.am
+++ b/geanymacro/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYMACRO
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = geanymacro
diff --git a/geanymacro/src/Makefile.am b/geanymacro/src/Makefile.am
index b6120aa..a19baea 100644
--- a/geanymacro/src/Makefile.am
+++ b/geanymacro/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYMACRO
 geanyplugins_LTLIBRARIES = geanymacro.la
-endif
 
 geanymacro_la_SOURCES = geanymacro.c
 geanymacro_la_LIBADD = $(COMMONLIBS)
diff --git a/geanyminiscript/Makefile.am b/geanyminiscript/Makefile.am
index 88d742d..ef4dfbe 100644
--- a/geanyminiscript/Makefile.am
+++ b/geanyminiscript/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYMINISCRIPT
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = geanyminiscript
diff --git a/geanyminiscript/src/Makefile.am b/geanyminiscript/src/Makefile.am
index cd77a84..bc7c7a5 100644
--- a/geanyminiscript/src/Makefile.am
+++ b/geanyminiscript/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYMINISCRIPT
 geanyplugins_LTLIBRARIES = geanyminiscript.la
-endif
 
 geanyminiscript_la_SOURCES = gms.c gms.h gms_gui.c gms_gui.h gms_debug.h
 geanyminiscript_la_LIBADD = $(COMMONLIBS)
diff --git a/geanynumberedbookmarks/Makefile.am b/geanynumberedbookmarks/Makefile.am
index 050d0a1..d2fd310 100644
--- a/geanynumberedbookmarks/Makefile.am
+++ b/geanynumberedbookmarks/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYNUMBEREDBOOKMARKS
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = geanynumberedbookmarks
diff --git a/geanynumberedbookmarks/src/Makefile.am b/geanynumberedbookmarks/src/Makefile.am
index 47e05dc..455aca5 100644
--- a/geanynumberedbookmarks/src/Makefile.am
+++ b/geanynumberedbookmarks/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYNUMBEREDBOOKMARKS
 geanyplugins_LTLIBRARIES = geanynumberedbookmarks.la
-endif
 
 geanynumberedbookmarks_la_SOURCES = geanynumberedbookmarks.c
 geanynumberedbookmarks_la_LIBADD = $(COMMONLIBS)
diff --git a/geanypg/Makefile.am b/geanypg/Makefile.am
index f82dfec..1d801e0 100644
--- a/geanypg/Makefile.am
+++ b/geanypg/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYPG
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = geanypg
diff --git a/geanypg/src/Makefile.am b/geanypg/src/Makefile.am
index 86e769e..f6116fe 100644
--- a/geanypg/src/Makefile.am
+++ b/geanypg/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYPG
 geanyplugins_LTLIBRARIES = geanypg.la
-endif
 
 geanypg_la_SOURCES = \
 	helper_functions.c \
diff --git a/geanyprj/Makefile.am b/geanyprj/Makefile.am
index 45d80bf..9b7cac9 100644
--- a/geanyprj/Makefile.am
+++ b/geanyprj/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYPRJ
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src tests
 plugin = geanyprj
diff --git a/geanyprj/src/Makefile.am b/geanyprj/src/Makefile.am
index 8161a16..53d4e87 100644
--- a/geanyprj/src/Makefile.am
+++ b/geanyprj/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYPRJ
 geanyplugins_LTLIBRARIES = geanyprj.la
-endif
 
 geanyprj_la_SOURCES = geanyprj.c \
 	geanyprj.h \
diff --git a/geanysendmail/Makefile.am b/geanysendmail/Makefile.am
index 58df338..2a1e109 100644
--- a/geanysendmail/Makefile.am
+++ b/geanysendmail/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYSENDMAIL
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = geanysendmail
diff --git a/geanysendmail/src/Makefile.am b/geanysendmail/src/Makefile.am
index b36f3da..d88465d 100644
--- a/geanysendmail/src/Makefile.am
+++ b/geanysendmail/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYSENDMAIL
 geanyplugins_LTLIBRARIES = geanysendmail.la
-endif
 
 geanysendmail_la_SOURCES = geanysendmail.c icon.h
 geanysendmail_la_LIBADD = $(COMMONLIBS)
diff --git a/geanyvc/Makefile.am b/geanyvc/Makefile.am
index da3eda8..24ed6ec 100644
--- a/geanyvc/Makefile.am
+++ b/geanyvc/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GEANYVC
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src tests
 plugin = geanyvc
diff --git a/geanyvc/src/Makefile.am b/geanyvc/src/Makefile.am
index 0359255..39f1a71 100644
--- a/geanyvc/src/Makefile.am
+++ b/geanyvc/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYVC
 geanyplugins_LTLIBRARIES = geanyvc.la
-endif
 
 geanyvc_la_SOURCES = \
 	externdiff.c \
diff --git a/geanyvc/tests/Makefile.am b/geanyvc/tests/Makefile.am
index 14de5e5..8df304d 100644
--- a/geanyvc/tests/Makefile.am
+++ b/geanyvc/tests/Makefile.am
@@ -1,5 +1,4 @@
 if UNITTESTS
-if ENABLE_GEANYVC
 include $(top_srcdir)/build/vars.build.mk
 INCLUDES = $(GEANY_CFLAGS) -DUNITTESTS
 TESTS=unittests
@@ -7,4 +6,3 @@ check_PROGRAMS=unittests
 unittests_SOURCES = unittests.c ../src/utils.c
 unittests_LDADD  = @GEANY_LIBS@ $(INTLLIBS) @CHECK_LIBS@
 endif
-endif
diff --git a/geniuspaste/Makefile.am b/geniuspaste/Makefile.am
index e65680d..ba28f68 100644
--- a/geniuspaste/Makefile.am
+++ b/geniuspaste/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GENIUSPASTE
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = geniuspaste
diff --git a/geniuspaste/src/Makefile.am b/geniuspaste/src/Makefile.am
index 804b4d0..f28694c 100644
--- a/geniuspaste/src/Makefile.am
+++ b/geniuspaste/src/Makefile.am
@@ -1,9 +1,7 @@
 include $(top_srcdir)/build/vars.build.mk
 plugin = geniuspaste
 
-if ENABLE_GENIUSPASTE
 geanyplugins_LTLIBRARIES = geniuspaste.la
-endif
 
 geniuspaste_la_SOURCES = geniuspaste.c
 geniuspaste_la_CPPFLAGS = \
diff --git a/gproject/Makefile.am b/gproject/Makefile.am
index 380199d..60039bc 100644
--- a/gproject/Makefile.am
+++ b/gproject/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_GPROJECT
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src icons
 plugin = gproject
diff --git a/gproject/icons/Makefile.am b/gproject/icons/Makefile.am
index 4c606b1..c07ef75 100644
--- a/gproject/icons/Makefile.am
+++ b/gproject/icons/Makefile.am
@@ -1,4 +1,3 @@
-if ENABLE_GPROJECT
 icondir = $(datadir)/icons/hicolor/16x16/apps
 
 dist_icon_DATA = \
@@ -21,5 +20,3 @@ update-icon-cache:
 		echo "*** Icon cache not updated.  After (un)install, run this:"; \
 		echo "***   $(gtk_update_icon_cache)"; \
 	fi
-
-endif
diff --git a/gproject/src/Makefile.am b/gproject/src/Makefile.am
index 1dea562..cd4177d 100644
--- a/gproject/src/Makefile.am
+++ b/gproject/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GPROJECT
 geanyplugins_LTLIBRARIES = gproject.la
-endif
 
 gproject_la_SOURCES = \
 	gproject-main.c \
diff --git a/multiterm/Makefile.am b/multiterm/Makefile.am
index 101d6b9..2709637 100644
--- a/multiterm/Makefile.am
+++ b/multiterm/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_MULTITERM
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 AUXFILES = TODO
 
diff --git a/multiterm/src/Makefile.am b/multiterm/src/Makefile.am
index 8fc7bd9..70447ff 100644
--- a/multiterm/src/Makefile.am
+++ b/multiterm/src/Makefile.am
@@ -3,9 +3,7 @@ include $(top_srcdir)/build/vars.docs.mk
 
 plugin = multiterm
 
-if ENABLE_MULTITERM
 geanyplugins_LTLIBRARIES = multiterm.la
-endif
 
 multiterm_la_VALAFLAGS = \
 	--vapidir $(top_srcdir)/multiterm/src/vapi \
diff --git a/pretty-printer/src/Makefile.am b/pretty-printer/src/Makefile.am
index 2642444..ee311bb 100644
--- a/pretty-printer/src/Makefile.am
+++ b/pretty-printer/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_PRETTY_PRINTER
 geanyplugins_LTLIBRARIES = pretty-printer.la
-endif
 
 pretty_printer_la_SOURCES = \
 	PluginEntry.h \
diff --git a/shiftcolumn/Makefile.am b/shiftcolumn/Makefile.am
index 68593d6..8cf4f2e 100644
--- a/shiftcolumn/Makefile.am
+++ b/shiftcolumn/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_SHIFTCOLUMN
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = shiftcolumn
diff --git a/shiftcolumn/src/Makefile.am b/shiftcolumn/src/Makefile.am
index 94a87a8..2253824 100644
--- a/shiftcolumn/src/Makefile.am
+++ b/shiftcolumn/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_SHIFTCOLUMN
 geanyplugins_LTLIBRARIES = shiftcolumn.la
-endif
 
 shiftcolumn_la_SOURCES = shiftcolumn.c
 shiftcolumn_la_LIBADD = $(COMMONLIBS)
diff --git a/spellcheck/Makefile.am b/spellcheck/Makefile.am
index 4b27b4c..2ba187f 100644
--- a/spellcheck/Makefile.am
+++ b/spellcheck/Makefile.am
@@ -1,7 +1,4 @@
-# if spellcheck is disabled, we should distribute its files, but not install
-if ENABLE_SPELLCHECK
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = spellcheck
diff --git a/spellcheck/src/Makefile.am b/spellcheck/src/Makefile.am
index b6d5095..6b98f5b 100644
--- a/spellcheck/src/Makefile.am
+++ b/spellcheck/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_SPELLCHECK
 geanyplugins_LTLIBRARIES = spellcheck.la
-endif
 
 spellcheck_la_SOURCES = \
 	scplugin.h \
diff --git a/tableconvert/Makefile.am b/tableconvert/Makefile.am
index a26cdd4..4818b96 100644
--- a/tableconvert/Makefile.am
+++ b/tableconvert/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_TABLECONVERT
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = tableconvert
diff --git a/tableconvert/src/Makefile.am b/tableconvert/src/Makefile.am
index 862970f..c2c0987 100644
--- a/tableconvert/src/Makefile.am
+++ b/tableconvert/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_TABLECONVERT
 geanyplugins_LTLIBRARIES = tableconvert.la
-endif
 
 tableconvert_la_SOURCES = tableconvert.c
 tableconvert_la_LIBADD = $(COMMONLIBS)
diff --git a/treebrowser/Makefile.am b/treebrowser/Makefile.am
index deb6e38..9165702 100644
--- a/treebrowser/Makefile.am
+++ b/treebrowser/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_TREEBROWSER
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = treebrowser
diff --git a/treebrowser/src/Makefile.am b/treebrowser/src/Makefile.am
index 5328b49..c0211d8 100644
--- a/treebrowser/src/Makefile.am
+++ b/treebrowser/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_TREEBROWSER
 geanyplugins_LTLIBRARIES = treebrowser.la
-endif
 
 treebrowser_la_SOURCES = treebrowser.c
 treebrowser_la_CFLAGS = $(AM_CFLAGS) $(GIO_CFLAGS)
diff --git a/updatechecker/Makefile.am b/updatechecker/Makefile.am
index 89c54e8..02d13f3 100644
--- a/updatechecker/Makefile.am
+++ b/updatechecker/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_UPDATECHECKER
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = updatechecker
diff --git a/updatechecker/src/Makefile.am b/updatechecker/src/Makefile.am
index 8fefa56..dc1a92f 100644
--- a/updatechecker/src/Makefile.am
+++ b/updatechecker/src/Makefile.am
@@ -1,9 +1,7 @@
 include $(top_srcdir)/build/vars.build.mk
 plugin = updatechecker
 
-if ENABLE_UPDATECHECKER
 geanyplugins_LTLIBRARIES = updatechecker.la
-endif
 
 updatechecker_la_SOURCES = updatechecker.c
 updatechecker_la_CPPFLAGS = \
diff --git a/webhelper/Makefile.am b/webhelper/Makefile.am
index 221db3e..daa59dd 100644
--- a/webhelper/Makefile.am
+++ b/webhelper/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_WEBHELPER
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 AUXFILES = TODO
 
diff --git a/webhelper/src/Makefile.am b/webhelper/src/Makefile.am
index 733788a..dd14094 100644
--- a/webhelper/src/Makefile.am
+++ b/webhelper/src/Makefile.am
@@ -1,9 +1,7 @@
 include $(top_srcdir)/build/vars.build.mk
 plugin = webhelper
 
-if ENABLE_WEBHELPER
 geanyplugins_LTLIBRARIES = webhelper.la
-endif
 
 
 GLIB_MKENUMS = @GLIB_MKENUMS@
diff --git a/xmlsnippets/Makefile.am b/xmlsnippets/Makefile.am
index 17c737c..be36185 100644
--- a/xmlsnippets/Makefile.am
+++ b/xmlsnippets/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_XMLSNIPPETS
 include $(top_srcdir)/build/vars.auxfiles.mk
-endif
 
 SUBDIRS = src
 plugin = xmlsnippets
diff --git a/xmlsnippets/src/Makefile.am b/xmlsnippets/src/Makefile.am
index bd8b2e1..fce9266 100644
--- a/xmlsnippets/src/Makefile.am
+++ b/xmlsnippets/src/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_XMLSNIPPETS
 geanyplugins_LTLIBRARIES = xmlsnippets.la
-endif
 
 xmlsnippets_la_SOURCES = \
 	plugin.c plugin.h \
-- 
1.7.10.1

