]> code.delx.au - spectrwm/commitdiff
linux: Use pkg-config for dependencies' CPPFLAGS and LDLIBS
authorAndrea Bolognani <eof@kiyuko.org>
Sun, 3 Jul 2016 17:32:38 +0000 (19:32 +0200)
committerAndrea Bolognani <eof@kiyuko.org>
Sun, 3 Jul 2016 20:48:18 +0000 (22:48 +0200)
Instead of hardcoding the information needed to compile and link
against libraries, call pkg-config to retrieve them at runtime.

linux/Makefile

index d7b6917475e2097cc8a3e634aac93002ce5006bf..7ad592bef69f251564b07f478db7dea9ce954f62 100644 (file)
@@ -16,10 +16,10 @@ ifneq ("${BUILDVERSION}", "")
 MAINT_CPPFLAGS += -DSPECTRWM_BUILDSTR=\"$(BUILDVERSION)\"
 endif
 
-BIN_CPPFLAGS = -I/usr/include/freetype2
-BIN_LDLIBS   = -lX11 -lX11-xcb -lxcb -lxcb-icccm -lxcb-randr -lxcb-keysyms -lxcb-util -lxcb-xtest -lXft -lXcursor
-LIB_CPPFLAGS =
-LIB_LDLIBS   = -lX11 -ldl
+BIN_CPPFLAGS = $(shell pkg-config --cflags x11 x11-xcb xcb-icccm xcb-keysyms xcb-randr xcb-util xcb-xtest xcursor xft)
+BIN_LDLIBS   = $(shell pkg-config --libs   x11 x11-xcb xcb-icccm xcb-keysyms xcb-randr xcb-util xcb-xtest xcursor xft)
+LIB_CPPFLAGS = $(shell pkg-config --cflags x11)
+LIB_LDLIBS   = $(shell pkg-config --libs   x11) -ldl
 
 all: spectrwm libswmhack.so.$(LIBVERSION)