-LIBS += -lm
-LIBS += -L $(TOPDIR)/libi3 -li3
-LIBS += $(call ldflags_for_lib, xcb-event,xcb-event)
-LIBS += $(call ldflags_for_lib, xcb-keysyms,xcb-keysyms)
-ifeq ($(shell pkg-config --exists xcb-util 2>/dev/null || echo 1),1)
-LIBS += $(call ldflags_for_lib, xcb-atom,xcb-atom)
-LIBS += $(call ldflags_for_lib, xcb-aux,xcb-aux)
-else
-LIBS += $(call ldflags_for_lib, xcb-util)
-endif
-LIBS += $(call ldflags_for_lib, xcb-icccm,xcb-icccm)
-LIBS += $(call ldflags_for_lib, xcb-xinerama,xcb-xinerama)
-LIBS += $(call ldflags_for_lib, xcb-randr,xcb-randr)
-LIBS += $(call ldflags_for_lib, xcb,xcb)
-LIBS += $(call ldflags_for_lib, xcursor,Xcursor)
-LIBS += $(call ldflags_for_lib, x11,X11)
-LIBS += $(call ldflags_for_lib, yajl,yajl)
-LIBS += $(call ldflags_for_lib, libev,ev)
-LIBS += $(call ldflags_for_lib, libpcre,pcre)
-LIBS += $(call ldflags_for_lib, libstartup-notification-1.0,startup-notification-1)
+# startup-notification
+LIBSN_CFLAGS := $(call cflags_for_lib, libstartup-notification-1.0)
+LIBSN_LIBS := $(call ldflags_for_lib, libstartup-notification-1.0,startup-notification-1)
+
+# Pango
+PANGO_CFLAGS := $(call cflags_for_lib, cairo)
+PANGO_CFLAGS += $(call cflags_for_lib, pangocairo)
+I3_CPPFLAGS += -DPANGO_SUPPORT=1
+PANGO_LIBS := $(call ldflags_for_lib, cairo)
+PANGO_LIBS += $(call ldflags_for_lib, pangocairo)
+
+# libi3
+LIBS = -L$(TOPDIR) -li3 -lm
+
+## Platform-specific flags