mirror of
https://github.com/vale981/spectrwm
synced 2025-03-04 09:21:39 -05:00
linux: Accept user-provided pkg-config command
When cross-building, it's necessary to use versions of the various toolchain commands that have been built specifically to target the desired architecture, and that are named accordingly. In practice, the make invocation will look something like $ make CC=aarch64-linux-gnu-gcc \ PKG_CONFIG=aarch64-linux-gnu-pkg-config However, whereas $(CC) is a built-in make variable and so it behaves correctly out of the box, for $(PKG_CONFIG) we have to do some work ourselves.
This commit is contained in:
parent
f0584c7fdd
commit
ceaf8699f8
1 changed files with 5 additions and 4 deletions
|
@ -6,6 +6,7 @@ DATAROOTDIR ?= $(PREFIX)/share
|
|||
MANDIR ?= $(DATAROOTDIR)/man
|
||||
DOCDIR ?= $(DATAROOTDIR)/doc/spectrwm
|
||||
XSESSIONSDIR ?= $(DATAROOTDIR)/xsessions
|
||||
PKG_CONFIG ?= pkg-config
|
||||
|
||||
BUILDVERSION = $(shell sh $(CURDIR)/../buildver.sh)
|
||||
LIBVERSION = $(shell . $(CURDIR)/../lib/shlib_version; echo $$major.$$minor)
|
||||
|
@ -21,12 +22,12 @@ endif
|
|||
|
||||
BIN_CFLAGS = -fPIE
|
||||
BIN_LDFLAGS = -fPIE -pie
|
||||
BIN_CPPFLAGS = $(shell pkg-config --cflags x11 x11-xcb xcb-icccm xcb-keysyms xcb-randr xcb-util xcb-xinput xcb-xtest xcursor xft)
|
||||
BIN_LDLIBS = $(shell pkg-config --libs x11 x11-xcb xcb-icccm xcb-keysyms xcb-randr xcb-util xcb-xinput xcb-xtest xcursor xft)
|
||||
BIN_CPPFLAGS = $(shell $(PKG_CONFIG) --cflags x11 x11-xcb xcb-icccm xcb-keysyms xcb-randr xcb-util xcb-xinput xcb-xtest xcursor xft)
|
||||
BIN_LDLIBS = $(shell $(PKG_CONFIG) --libs x11 x11-xcb xcb-icccm xcb-keysyms xcb-randr xcb-util xcb-xinput xcb-xtest xcursor xft)
|
||||
LIB_CFLAGS = -fPIC
|
||||
LIB_LDFLAGS = -fPIC -shared
|
||||
LIB_CPPFLAGS = $(shell pkg-config --cflags x11)
|
||||
LIB_LDLIBS = $(shell pkg-config --libs x11) -ldl
|
||||
LIB_CPPFLAGS = $(shell $(PKG_CONFIG) --cflags x11)
|
||||
LIB_LDLIBS = $(shell $(PKG_CONFIG) --libs x11) -ldl
|
||||
|
||||
all: spectrwm libswmhack.so.$(LIBVERSION)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue