From 98680cf1c8b0b79b90ff0f352c977ebf5bfcae96 Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Wed, 13 Oct 2021 23:30:57 +1100 Subject: [PATCH 1/2] graph/x11/rules.mk: Use standard pkg-config variable naming X11_CFLAGS and X11_LIBS conform to standard pkg-config variable naming. Users can specify these variables on the command line if they have the X11 development headers and library in a non-standard location. --- graph/x11/rules.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/graph/x11/rules.mk b/graph/x11/rules.mk index 9072f98..e58c8e8 100644 --- a/graph/x11/rules.mk +++ b/graph/x11/rules.mk @@ -9,14 +9,14 @@ ifeq ($(PKG_CONFIG),) PKG_CONFIG = pkg-config endif -X11_INCLUDE := $(shell $(PKG_CONFIG) --cflags x11) -X11_LIB := $(shell $(PKG_CONFIG) --libs x11) +X11_CFLAGS ?= $(shell $(PKG_CONFIG) --cflags x11) +X11_LIBS ?= $(shell $(PKG_CONFIG) --libs x11) -ifneq ($(X11_LIB),) +ifneq ($(X11_LIBS),) # The GRAPH_LINK variable is expanded each time an executable is linked # against the graphics library. # - GRAPH_LINK += $(X11_LIB) + GRAPH_LINK += $(X11_LIBS) # Solaris needs a -lsocket in GRAPH_LINK. # @@ -41,12 +41,12 @@ ifneq ($(X11_LIB),) $(LIBTOOL) --mode=compile $(CC) -static $(CFLAGS) \ $(GRAPH_INCLUDES:%=$I%) \ $I$(subst /,$(COMPILER_SEP),$(GR_X11)) \ - $(X11_INCLUDE:%=$I%) \ + $(X11_CFLAGS:%=$I%) \ $T$(subst /,$(COMPILER_SEP),$@ $<) else $(CC) $(CFLAGS) $(GRAPH_INCLUDES:%=$I%) \ $I$(subst /,$(COMPILER_SEP),$(GR_X11)) \ - $(X11_INCLUDE:%=$I%) \ + $(X11_CFLAGS:%=$I%) \ $T$(subst /,$(COMPILER_SEP),$@ $<) endif endif -- GitLab From 8e7f8b7986b73b729f239593fd1103137e0b999e Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Wed, 13 Oct 2021 23:39:02 +1100 Subject: [PATCH 2/2] README: Document that users can specify the paths to the X11 development files Users with X11 installed in a non-standard location can specify the paths to the development headers and library by passing the X11_CFLAGS and X11_LIBS variables on the command line. --- README | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README b/README index 4cfcd3c..325ade0 100644 --- a/README +++ b/README @@ -36,6 +36,10 @@ WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING using pkg-config. If X11 is not found, some demo programs will not be able to display graphics and will fail. + Users with X11 installed in a non-standard location can specify + the paths to the development headers and library by passing the + X11_CFLAGS and X11_LIBS variables on the command line. + If you don't have X11 at all, fix the definition of the `EXES` variable as described in the top-level Makefile. -- GitLab