1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-28 10:55:48 +01:00

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 <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2021-05-13 17:20:24 +02:00
committed by Carlos R. Mafra
parent eb2a9d97a2
commit fc63d72032
5 changed files with 19 additions and 10 deletions

View File

@@ -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 $@ $<

View File

@@ -5,9 +5,7 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#ifdef USE_PANGO
#include <pango/pango.h>
#endif
@USE_PANGO@#include <pango/pango.h>
#include <WINGs/WINGs.h>
@@ -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