diff --git a/src/core/Makefile.am b/src/core/Makefile.am
index 447ee8374..297a044b5 100644
--- a/src/core/Makefile.am
+++ b/src/core/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GCRYPT_CFLAGS) $(GNUTLS_CFLAGS) $(CURL_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(GCRYPT_CFLAGS) $(GNUTLS_CFLAGS) $(CURL_CFLAGS)
noinst_LIBRARIES = lib_weechat_core.a
diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am
index 63b40effe..6dc712d70 100644
--- a/src/gui/Makefile.am
+++ b/src/gui/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\"
noinst_LIBRARIES = lib_weechat_gui_common.a
diff --git a/src/gui/curses/Makefile.am b/src/gui/curses/Makefile.am
index 45a21cec7..6cfd5268d 100644
--- a/src/gui/curses/Makefile.am
+++ b/src/gui/curses/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(NCURSES_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(NCURSES_CFLAGS)
bin_PROGRAMS = weechat-curses
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 114442385..46bf7b335 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -18,7 +18,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\"
noinst_LIBRARIES = lib_weechat_plugins.a
diff --git a/src/plugins/alias/Makefile.am b/src/plugins/alias/Makefile.am
index cd77a5388..493107da8 100644
--- a/src/plugins/alias/Makefile.am
+++ b/src/plugins/alias/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(ALIAS_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(ALIAS_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/aspell/Makefile.am b/src/plugins/aspell/Makefile.am
index 218856c5a..aa0068815 100644
--- a/src/plugins/aspell/Makefile.am
+++ b/src/plugins/aspell/Makefile.am
@@ -18,7 +18,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(ASPELL_CFLAGS) $(ENCHANT_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(ASPELL_CFLAGS) $(ENCHANT_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/charset/Makefile.am b/src/plugins/charset/Makefile.am
index f87698224..ef7a19226 100644
--- a/src/plugins/charset/Makefile.am
+++ b/src/plugins/charset/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(CHARSET_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(CHARSET_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/demo/Makefile.am b/src/plugins/demo/Makefile.am
index ff4b97352..d78bb1e95 100644
--- a/src/plugins/demo/Makefile.am
+++ b/src/plugins/demo/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(DEMO_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(DEMO_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/fifo/Makefile.am b/src/plugins/fifo/Makefile.am
index 8ed8c9d0a..84faa671e 100644
--- a/src/plugins/fifo/Makefile.am
+++ b/src/plugins/fifo/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(FIFO_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(FIFO_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/guile/Makefile.am b/src/plugins/guile/Makefile.am
index 189723e39..4e7e13b6f 100644
--- a/src/plugins/guile/Makefile.am
+++ b/src/plugins/guile/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GUILE_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(GUILE_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/irc/Makefile.am b/src/plugins/irc/Makefile.am
index e99cafd45..ba0eabfad 100644
--- a/src/plugins/irc/Makefile.am
+++ b/src/plugins/irc/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GCRYPT_CFLAGS) $(GNUTLS_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(GCRYPT_CFLAGS) $(GNUTLS_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/logger/Makefile.am b/src/plugins/logger/Makefile.am
index 7ebe27ac0..8bb1dce20 100644
--- a/src/plugins/logger/Makefile.am
+++ b/src/plugins/logger/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(LOGGER_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(LOGGER_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/lua/Makefile.am b/src/plugins/lua/Makefile.am
index ee92bddba..ca4faff8d 100644
--- a/src/plugins/lua/Makefile.am
+++ b/src/plugins/lua/Makefile.am
@@ -18,7 +18,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(LUA_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(LUA_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/perl/Makefile.am b/src/plugins/perl/Makefile.am
index 433343dab..f899fa9d0 100644
--- a/src/plugins/perl/Makefile.am
+++ b/src/plugins/perl/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(PERL_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(PERL_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/python/Makefile.am b/src/plugins/python/Makefile.am
index 9aabdefd0..435d6fd2f 100644
--- a/src/plugins/python/Makefile.am
+++ b/src/plugins/python/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(PYTHON_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(PYTHON_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/relay/Makefile.am b/src/plugins/relay/Makefile.am
index a23678ed6..708fef383 100644
--- a/src/plugins/relay/Makefile.am
+++ b/src/plugins/relay/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(ZLIB_CFLAGS) $(GCRYPT_CFLAGS) $(GNUTLS_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(ZLIB_CFLAGS) $(GCRYPT_CFLAGS) $(GNUTLS_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/rmodifier/Makefile.am b/src/plugins/rmodifier/Makefile.am
index b931a9e86..93308d4d3 100644
--- a/src/plugins/rmodifier/Makefile.am
+++ b/src/plugins/rmodifier/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(RMODIFIER_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(RMODIFIER_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/ruby/Makefile.am b/src/plugins/ruby/Makefile.am
index 06203f749..5fc93eb45 100644
--- a/src/plugins/ruby/Makefile.am
+++ b/src/plugins/ruby/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(RUBY_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(RUBY_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/script/Makefile.am b/src/plugins/script/Makefile.am
index a894842d1..fcaa2c4d1 100644
--- a/src/plugins/script/Makefile.am
+++ b/src/plugins/script/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(ZLIB_CFLAGS) $(GCRYPT_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(ZLIB_CFLAGS) $(GCRYPT_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/tcl/Makefile.am b/src/plugins/tcl/Makefile.am
index 3031fd0dc..894b627f9 100644
--- a/src/plugins/tcl/Makefile.am
+++ b/src/plugins/tcl/Makefile.am
@@ -18,7 +18,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(TCL_CFLAGS)
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(TCL_CFLAGS)
libdir = ${weechat_libdir}/plugins
diff --git a/src/plugins/xfer/Makefile.am b/src/plugins/xfer/Makefile.am
index fe4109833..d7f4e5654 100644
--- a/src/plugins/xfer/Makefile.am
+++ b/src/plugins/xfer/Makefile.am
@@ -17,7 +17,7 @@
# along with WeeChat. If not, see .
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
+AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\"
libdir = ${weechat_libdir}/plugins