diff --git a/cmd/Makefile b/cmd/Makefile index 959c2158..b38926ff 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -37,5 +37,5 @@ wmii/x11.o wmii/map.o: dall O9MENU=wmii9menu.o clientutil.o wmii/x11.o wmii/map.o $(OFILES) $(LIBIXP) wmii9menu.O: $(O9MENU) - $(LINK) $@ $(O9MENU) $(LIBX11) -lXext -lbio + $(LINK) $@ $(O9MENU) $$(pkg-config --libs $(X11PACKAGES)) -lXext -lbio diff --git a/cmd/click/Makefile b/cmd/click/Makefile index e5e5fb3e..b446d90e 100644 --- a/cmd/click/Makefile +++ b/cmd/click/Makefile @@ -7,10 +7,11 @@ main.c: ${ROOT}/mk/wmii.mk TARG = click HFILES= dat.h fns.h -LIB = ${LIBIXP} -LDFLAGS += -lm ${LIBX11} -lXext -lXtst -lregexp9 -lbio -lfmt -lutf -CFLAGS += ${INCX11} -DVERSION=\"${VERSION}\" \ - -DIXP_NEEDAPI=86 +PACKAGES += $(X11PACKAGES) xext xrandr xrender xinerama + +LIB = $(LIBIXP) +LDFLAGS += -lm -lXtst -lregexp9 -lbio -lfmt -lutf +CFLAGS += -DVERSION=\"$(VERSION)\" -DIXP_NEEDAPI=86 OBJ = main \ _util \ ../wmii/map \ diff --git a/cmd/menu/Makefile b/cmd/menu/Makefile index 2f296c82..a043b74c 100644 --- a/cmd/menu/Makefile +++ b/cmd/menu/Makefile @@ -12,11 +12,11 @@ bindings.c: keys.txt Makefile TARG = wimenu HFILES= dat.h fns.h +PACKAGES += $(X11PACKAGES) xext xrandr xrender xinerama + LIB = $(LIBIXP) -LDFLAGS += -lm $(LIBX11) -lXext -lXrandr -LXrender -lXinerama \ - -lregexp9 -lbio -lfmt -lutf -CFLAGS += $(INCX11) -DVERSION=\"$(VERSION)\" \ - -DIXP_NEEDAPI=86 +LDFLAGS += -lm -lregexp9 -lbio -lfmt -lutf +CFLAGS += -DVERSION=\"$(VERSION)\" -DIXP_NEEDAPI=86 OBJ = main \ caret \ history \ diff --git a/cmd/strut/Makefile b/cmd/strut/Makefile index 732fb7cc..58a8beed 100644 --- a/cmd/strut/Makefile +++ b/cmd/strut/Makefile @@ -7,10 +7,11 @@ main.c: ${ROOT}/mk/wmii.mk TARG = wistrut HFILES= dat.h fns.h -LIB = ${LIBIXP} -LDFLAGS += -lm ${LIBX11} -lXext -lXrandr -lregexp9 -lbio -lfmt -lutf -CFLAGS += ${INCX11} -DVERSION=\"${VERSION}\" \ - -DIXP_NEEDAPI=86 +PACKAGES += $(X11PACKAGES) xext xrandr xinerama + +LIB = $(LIBIXP) +LDFLAGS += -lm -lregexp9 -lbio -lfmt -lutf +CFLAGS += -DVERSION=\"$(VERSION)\" -DIXP_NEEDAPI=86 OBJ = main \ event \ ewmh \ diff --git a/cmd/wmii/Makefile b/cmd/wmii/Makefile index 810b90ae..d5073717 100644 --- a/cmd/wmii/Makefile +++ b/cmd/wmii/Makefile @@ -7,11 +7,12 @@ main.c: $(ROOT)/mk/wmii.mk TARG = wmii HFILES= dat.h fns.h -LIB = $(LIBIXP) -LDFLAGS += -lm $(LIBX11) -lXext -lXrandr -lXrender -lXinerama \ - $(LIBICONV) -lregexp9 -lbio -lfmt -lutf +PACKAGES += $(X11PACKAGES) xext xrandr xrender xinerama -CFLAGS += $(INCX11) $(INCICONV) -DVERSION=\"$(VERSION)\" \ +LIB = $(LIBIXP) +LDFLAGS += -lm $(LIBICONV) -lregexp9 -lbio -lfmt -lutf + +CFLAGS += $(INCICONV) -DVERSION=\"$(VERSION)\" \ -DIXP_NEEDAPI=97 OBJ = area \ bar \ diff --git a/config.mk b/config.mk index 64019b7b..0b6bf813 100644 --- a/config.mk +++ b/config.mk @@ -33,8 +33,8 @@ P9PATHS = ${PLAN9}:"'$${HOME}/plan9'":/usr/local/plan9:/usr/local/9:/opt/plan9:/ # are painfully slow, and should be avoided. #BINSH = /bin/ash -INCX11 = $$(pkg-config --cflags xft) -LIBX11 = $$(pkg-config --libs xft) +X11PACKAGES = xft +INCX11 = $$(pkg-config --cflags $(X11PACKAGES)) LIBICONV = # Leave blank if your libc includes iconv (glibc does) LIBIXP = $(LIBDIR)/libixp.a diff --git a/mk/hdr.mk b/mk/hdr.mk index 1df813d1..a1fc0414 100644 --- a/mk/hdr.mk +++ b/mk/hdr.mk @@ -1,12 +1,14 @@ FILTER = cat EXCFLAGS = -I$$(echo $(INCPATH)|sed 's/:/ -I/g') -D_XOPEN_SOURCE=600 -COMPILE= CC="$(CC)" CFLAGS="$(EXCFLAGS) $(CFLAGS)" $(ROOT)/util/compile -COMPILEPIC= CC="$(CC)" CFLAGS="$(EXCFLAGS) $(CFLAGS) $(SOCFLAGS)" $(ROOT)/util/compile -LINK= LD="$(LD)" LDFLAGS="$(LDFLAGS)" $(ROOT)/util/link -LINKSO= LD="$(LD)" LDFLAGS="$(SOLDFLAGS) $(SHARED)" $(ROOT)/util/link +COMPILE= CC="$(CC)" CFLAGS="$(EXCFLAGS) $(CFLAGS) $$(pkg-config --cflags $(PACKAGES))" $(ROOT)/util/compile +COMPILEPIC= CC="$(CC)" CFLAGS="$(EXCFLAGS) $(CFLAGS) $$(pkg-config --cflags $(PACKAGES)) $(SOCFLAGS)" $(ROOT)/util/compile +LINK= LD="$(LD)" LDFLAGS="$(LDFLAGS) $$(pkg-config --libs $(PACKAGES))" $(ROOT)/util/link +LINKSO= LD="$(LD)" LDFLAGS="$(SOLDFLAGS) $(SHARED) $$(pkg-config --libs $(PACKAGES))" $(ROOT)/util/link CLEANNAME=$(ROOT)/util/cleanname SOEXT=so +PACKAGES = 2>/dev/null + include $(ROOT)/config.mk # I hate this.