1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

WRaster: Fix incorrect use of macro USE_XSHM in installed header

The header "wraster.h" needs different behaviour depending on whether the
support for X Shared Memory extension was enabled or not; but the related
macro USE_XSHM is defined by WindowMaker's configure. After this header
have been installed, the macro is no more useable.

This patch makes the "wraster.h" a generated file, so it will be different
depending on USE_XSHM, but will not make use of the macro itself.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2021-05-18 18:13:19 +02:00
committed by Carlos R. Mafra
parent 4dfb0dd059
commit 0e274dc979
6 changed files with 22 additions and 17 deletions

View File

@@ -91,7 +91,7 @@ AM_CFLAGS =
AM_CPPFLAGS = -DRESOURCE_PATH=\"$(datadir)/WINGs\" \ AM_CPPFLAGS = -DRESOURCE_PATH=\"$(datadir)/WINGs\" \
-I$(top_srcdir)/WINGs/WINGs -I$(top_builddir)/WINGs/WINGs \ -I$(top_srcdir)/WINGs/WINGs -I$(top_builddir)/WINGs/WINGs \
-I$(top_srcdir)/wrlib -I$(top_srcdir)/src \ -I$(top_builddir)/wrlib -I$(top_srcdir)/src \
@XFTFLAGS@ @HEADER_SEARCH_PATH@ @XFTFLAGS@ @HEADER_SEARCH_PATH@
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig

View File

@@ -48,7 +48,7 @@ WPrefs_SOURCES = \
AM_CFLAGS = AM_CFLAGS =
AM_CPPFLAGS = -DRESOURCE_PATH=\"$(wpdatadir)\" -DWMAKER_RESOURCE_PATH=\"$(pkgdatadir)\" \ AM_CPPFLAGS = -DRESOURCE_PATH=\"$(wpdatadir)\" -DWMAKER_RESOURCE_PATH=\"$(pkgdatadir)\" \
-I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs -I$(top_builddir)/WINGs \ -I$(top_builddir)/wrlib -I$(top_srcdir)/WINGs -I$(top_builddir)/WINGs \
@HEADER_SEARCH_PATH@ @HEADER_SEARCH_PATH@
WPrefs_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la WPrefs_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la

View File

@@ -151,7 +151,7 @@ endif
AM_CFLAGS = AM_CFLAGS =
AM_CPPFLAGS = $(DFLAGS) \ AM_CPPFLAGS = $(DFLAGS) \
-I$(top_srcdir)/wrlib \ -I$(top_builddir)/wrlib \
-I$(top_srcdir)/WINGs -I$(top_builddir)/WINGs \ -I$(top_srcdir)/WINGs -I$(top_builddir)/WINGs \
@HEADER_SEARCH_PATH@ @HEADER_SEARCH_PATH@

View File

@@ -12,7 +12,7 @@ bin_SCRIPTS = wmaker.inst wm-oldmenu2new wkdemenu.pl
EXTRA_DIST = wmaker.inst.in bughint wm-oldmenu2new wkdemenu.pl EXTRA_DIST = wmaker.inst.in bughint wm-oldmenu2new wkdemenu.pl
AM_CPPFLAGS = \ AM_CPPFLAGS = \
$(DFLAGS) -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib \ $(DFLAGS) -I$(top_srcdir)/WINGs -I$(top_builddir)/wrlib \
@HEADER_SEARCH_PATH@ \ @HEADER_SEARCH_PATH@ \
-DETCDIR=\"sysconfdir\" -DDATADIR=\"pkgdatadir\" -DETCDIR=\"sysconfdir\" -DDATADIR=\"pkgdatadir\"

View File

@@ -11,13 +11,17 @@ lib_LTLIBRARIES = libwraster.la
libwraster_la_LDFLAGS = -version-info @WRASTER_VERSION@ libwraster_la_LDFLAGS = -version-info @WRASTER_VERSION@
CLEANFILES = wraster.h
EXTRA_DIST += wraster.h.in
if HAVE_LD_VERSION_SCRIPT if HAVE_LD_VERSION_SCRIPT
libwraster_la_LDFLAGS += -Wl,--version-script=libwraster.map libwraster_la_LDFLAGS += -Wl,--version-script=libwraster.map
EXTRA_libwraster_la_DEPENDENCIES = libwraster.map EXTRA_libwraster_la_DEPENDENCIES = libwraster.map
CLEANFILES = libwraster.map CLEANFILES += libwraster.map
endif endif
include_HEADERS = wraster.h BUILT_SOURCES = wraster.h
nodist_include_HEADERS = wraster.h
libwraster_la_SOURCES = \ libwraster_la_SOURCES = \
imgformat.h \ imgformat.h \
@@ -94,9 +98,15 @@ wrlib.pc: Makefile
@echo 'Libs.private: $(GFXLIBS) $(MAGICKLIBS) $(XLIBS) -lm' >> $@ @echo 'Libs.private: $(GFXLIBS) $(MAGICKLIBS) $(XLIBS) -lm' >> $@
@echo 'Cflags: $(inc_search_path)' >> $@ @echo 'Cflags: $(inc_search_path)' >> $@
wraster.h: wraster.h.in $(top_builddir)/config.h
$(AM_V_GEN)$(top_srcdir)/script/replace-ac-keywords.sh \
--header "$(top_builddir)/config.h" \
--filter "USE_XSHM" \
-o $@ $<
if HAVE_LD_VERSION_SCRIPT if HAVE_LD_VERSION_SCRIPT
libwraster.map: $(include_HEADERS) $(top_srcdir)/script/generate-mapfile-from-header.sh libwraster.map: $(nodist_include_HEADERS) $(top_srcdir)/script/generate-mapfile-from-header.sh
$(AM_V_GEN)$(top_srcdir)/script/generate-mapfile-from-header.sh \ $(AM_V_GEN)$(top_srcdir)/script/generate-mapfile-from-header.sh \
-n LIBWRASTER -v $(WRASTER_VERSION) $(srcdir)/$(include_HEADERS) > libwraster.map -n LIBWRASTER -v $(WRASTER_VERSION) $< > $@
endif endif

View File

@@ -46,10 +46,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
@USE_XSHM@#include <X11/extensions/XShm.h>
#ifdef USE_XSHM
#include <X11/extensions/XShm.h>
#endif
/* /*
@@ -261,11 +258,9 @@ typedef struct RImage {
typedef struct RXImage { typedef struct RXImage {
XImage *image; XImage *image;
/* Private data. Do not access */ @USE_XSHM@ /* Private data. Do not access */
#ifdef USE_XSHM @USE_XSHM@ XShmSegmentInfo info;
XShmSegmentInfo info; @USE_XSHM@ char is_shared;
char is_shared;
#endif
} RXImage; } RXImage;