From c79ce843f495b913ddafa383e6cf818ac99b4f15 Mon Sep 17 00:00:00 2001 From: Rainer Müller Date: Tue, 27 Sep 2016 00:29:33 +0200 Subject: build: Reorder includes to avoid installed plugin header When hexchat is already installed into a non-default prefix, a new build could pick up ${prefix}/include/hexchat-plugin.h from the installed version instead of the local header, as configuration variables such as $(GLIB_CFLAGS) would point to -I${prefix}/include. Reordering the includes and moving -I arguments to CPPFLAGS prevents this, as it ensures the local directories are always searched first. This was no problem when compiling for /usr or /usr/local as these directories in the compiler search path are always searched last. Closes #1822 --- plugins/checksum/Makefile.am | 3 ++- plugins/doat/Makefile.am | 3 ++- plugins/fishlim/Makefile.am | 3 ++- plugins/perl/Makefile.am | 3 ++- plugins/python/Makefile.am | 4 ++-- plugins/sysinfo/Makefile.am | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/checksum/Makefile.am b/plugins/checksum/Makefile.am index 4e911f28..a38ab732 100644 --- a/plugins/checksum/Makefile.am +++ b/plugins/checksum/Makefile.am @@ -4,4 +4,5 @@ lib_LTLIBRARIES = checksum.la checksum_la_SOURCES = checksum.c checksum_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module checksum_la_LIBADD = $(GLIB_LIBS) -checksum_la_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)/src/common +checksum_la_CPPFLAGS = -I$(top_srcdir)/src/common +checksum_la_CFLAGS = $(GLIB_CFLAGS) diff --git a/plugins/doat/Makefile.am b/plugins/doat/Makefile.am index a04d2863..d8765946 100644 --- a/plugins/doat/Makefile.am +++ b/plugins/doat/Makefile.am @@ -4,5 +4,6 @@ lib_LTLIBRARIES = doat.la doat_la_SOURCES = doat.c doat_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module doat_la_LIBADD = $(GLIB_LIBS) -doat_la_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)/src/common +doat_la_CPPFLAGS = -I$(top_srcdir)/src/common +doat_la_CFLAGS = $(GLIB_CFLAGS) diff --git a/plugins/fishlim/Makefile.am b/plugins/fishlim/Makefile.am index d8193a6e..95498bf5 100644 --- a/plugins/fishlim/Makefile.am +++ b/plugins/fishlim/Makefile.am @@ -6,4 +6,5 @@ lib_LTLIBRARIES = fishlim.la fishlim_la_SOURCES = fish.c irc.c keystore.c plugin_hexchat.c fishlim_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module fishlim_la_LIBADD = $(GLIB_LIBS) $(OPENSSL_LIBS) -fishlim_la_CFLAGS = $(GLIB_CFLAGS) $(OPENSSL_CFLAGS) -I$(top_srcdir)/src/common +fishlim_la_CPPFLAGS = -I$(top_srcdir)/src/common +fishlim_la_CFLAGS = $(GLIB_CFLAGS) $(OPENSSL_CFLAGS) diff --git a/plugins/perl/Makefile.am b/plugins/perl/Makefile.am index 83239672..af721e7e 100644 --- a/plugins/perl/Makefile.am +++ b/plugins/perl/Makefile.am @@ -8,7 +8,8 @@ lib_LTLIBRARIES = perl.la perl_la_SOURCES = perl.c perl_la_LDFLAGS = $(PERL_LDFLAGS) $(PLUGIN_LDFLAGS) -module perl_la_LIBADD = $(GLIB_LIBS) -perl_la_CFLAGS = $(PERL_CFLAGS) $(GLIB_CFLAGS) -I$(top_srcdir)/src/common +perl_la_CPPFLAGS = -I$(top_srcdir)/src/common +perl_la_CFLAGS = $(PERL_CFLAGS) $(GLIB_CFLAGS) BUILT_SOURCES = hexchat.pm.h irc.pm.h CLEANFILES = $(BUILT_SOURCES) diff --git a/plugins/python/Makefile.am b/plugins/python/Makefile.am index 856c733e..3c574edf 100644 --- a/plugins/python/Makefile.am +++ b/plugins/python/Makefile.am @@ -4,6 +4,6 @@ lib_LTLIBRARIES = python.la python_la_SOURCES = python.c python_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module python_la_LIBADD = $(PYTHON_LIBS) $(GLIB_LIBS) -python_la_CPPFLAGS = $(PYTHON_CPPFLAGS) -python_la_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)/src/common +python_la_CPPFLAGS = -I$(top_srcdir)/src/common $(PYTHON_CPPFLAGS) +python_la_CFLAGS = $(GLIB_CFLAGS) diff --git a/plugins/sysinfo/Makefile.am b/plugins/sysinfo/Makefile.am index bd44a19d..60042018 100644 --- a/plugins/sysinfo/Makefile.am +++ b/plugins/sysinfo/Makefile.am @@ -14,4 +14,4 @@ lib_LTLIBRARIES = sysinfo.la sysinfo_la_SOURCES = $(sources) sysinfo_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module sysinfo_la_LIBADD = $(LIBPCI_LIBS) $(GLIB_LIBS) -AM_CPPFLAGS = $(LIBPCI_CFLAGS) $(GLIB_CFLAGS) -I$(top_srcdir)/src/common -I$(srcdir)/shared +AM_CPPFLAGS = -I$(top_srcdir)/src/common -I$(srcdir)/shared $(LIBPCI_CFLAGS) $(GLIB_CFLAGS) -- cgit 1.4.1