From fc63d72032890cd1923d8157aa9a797d205f6b5d Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Thu, 13 May 2021 17:20:24 +0200 Subject: [PATCH] WINGs: Fix incorrect use of macro USE_PANGO in installed header The header "WINGsP.h" needs different behaviour depending on whether the support for Pango was enabled or not. But the related macro USE_PANGO is defined by WindowMaker's configure, and after this header have been installed the macro is no more valid. This patch makes the "WINGsP.h" a generated file, so it will be different depending on USE_PANGO, but will not make use of the macro itself. As a side effect of being now generated, the include paths in the makefile have been updated to include build-dir too, because for users doing an out-of-tree build the generated file (that is used during compilation) is placed in the build-dir. Signed-off-by: Christophe CURIS --- WINGs/Makefile.am | 3 ++- WINGs/WINGs/Makefile.am | 12 +++++++++++- WINGs/WINGs/{WINGsP.h => WINGsP.h.in} | 8 ++------ WPrefs.app/Makefile.am | 3 ++- src/Makefile.am | 3 ++- 5 files changed, 19 insertions(+), 10 deletions(-) rename WINGs/WINGs/{WINGsP.h => WINGsP.h.in} (99%) diff --git a/WINGs/Makefile.am b/WINGs/Makefile.am index 1f09e7ae..ec9f48eb 100644 --- a/WINGs/Makefile.am +++ b/WINGs/Makefile.am @@ -90,7 +90,8 @@ libWUtil_la_SOURCES = \ AM_CFLAGS = AM_CPPFLAGS = -DRESOURCE_PATH=\"$(datadir)/WINGs\" \ - -I$(top_srcdir)/WINGs/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \ + -I$(top_srcdir)/WINGs/WINGs -I$(top_builddir)/WINGs/WINGs \ + -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \ @XFTFLAGS@ @HEADER_SEARCH_PATH@ pkgconfigdir = $(libdir)/pkgconfig diff --git a/WINGs/WINGs/Makefile.am b/WINGs/WINGs/Makefile.am index 088f1fe7..550028be 100644 --- a/WINGs/WINGs/Makefile.am +++ b/WINGs/WINGs/Makefile.am @@ -5,4 +5,14 @@ AUTOMAKE_OPTIONS = # is this a kluge? if so, how should i do it? includedir = @includedir@/WINGs -include_HEADERS = WINGs.h WUtil.h WINGsP.h +BUILT_SOURCES = WINGsP.h +CLEANFILES = WINGsP.h +include_HEADERS = WINGs.h WUtil.h +nodist_include_HEADERS = WINGsP.h +EXTRA_DIST = WINGsP.h.in + +WINGsP.h: WINGsP.h.in $(top_builddir)/config.h + $(AM_V_GEN)$(top_srcdir)/script/replace-ac-keywords.sh \ + --header "$(top_builddir)/config.h" \ + --filter "USE_PANGO" \ + -o $@ $< diff --git a/WINGs/WINGs/WINGsP.h b/WINGs/WINGs/WINGsP.h.in similarity index 99% rename from WINGs/WINGs/WINGsP.h rename to WINGs/WINGs/WINGsP.h.in index 7ce8df13..477566d4 100644 --- a/WINGs/WINGs/WINGsP.h +++ b/WINGs/WINGs/WINGsP.h.in @@ -5,9 +5,7 @@ #include #include -#ifdef USE_PANGO -#include -#endif +@USE_PANGO@#include #include @@ -459,9 +457,7 @@ typedef struct W_Font { short refCount; char *name; -#ifdef USE_PANGO - PangoLayout *layout; -#endif +@USE_PANGO@ PangoLayout *layout; } W_Font; #define W_FONTID(f) (f)->font->fid diff --git a/WPrefs.app/Makefile.am b/WPrefs.app/Makefile.am index b4f689f5..91b1e968 100644 --- a/WPrefs.app/Makefile.am +++ b/WPrefs.app/Makefile.am @@ -48,7 +48,8 @@ WPrefs_SOURCES = \ AM_CFLAGS = AM_CPPFLAGS = -DRESOURCE_PATH=\"$(wpdatadir)\" -DWMAKER_RESOURCE_PATH=\"$(pkgdatadir)\" \ - -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs @HEADER_SEARCH_PATH@ + -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs -I$(top_builddir)/WINGs \ + @HEADER_SEARCH_PATH@ WPrefs_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la diff --git a/src/Makefile.am b/src/Makefile.am index 515880f2..103c8bb8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -152,7 +152,8 @@ AM_CFLAGS = AM_CPPFLAGS = $(DFLAGS) \ -I$(top_srcdir)/wrlib \ - -I$(top_srcdir)/WINGs @HEADER_SEARCH_PATH@ + -I$(top_srcdir)/WINGs -I$(top_builddir)/WINGs \ + @HEADER_SEARCH_PATH@ wmaker_LDADD = \