Include the top level header of each xcb module used One xcb module, one header file: <xcb/xcb.h> should to be included directly, instead of relying on other modules dragging it in; on the other hand, it's okay to include just the top level <xcb/xcb_util.h> instead of the three separate sub-headers. [rk@rejii.com: skip xcb_util.h since it breaks xcb-util < 0.3.8] closes #142
linux: Enable PIE PIE (position-independent executables) is a security feature that has been made reasonably cheap by recent improvements in GCC; as a result, more and more Linux distributions are pushing for its adoption. Unfortunately, PIE and PIC are not compatible, so we have to manage the CFLAGS and LDFLAGS used to compile the library and the executable indipendently.
linux: Use --as-needed when linking Using this flag will cause the linker to ignore any libraries that have been listed on the command line but whose symbols are not actually used. Right now, it just gets rid of the unnecessary linking against xcb-render (see https://bugs.debian.org/829709), but it might catch missing dependencies in the future, and it will generally keep the resulting binaries nice and tidy. Ubuntu and Arch are both using --as-needed by default already, and other distributions will probably switch at some point.
linux: Reduce linking for libswmhack The libswmhack library uses dlopen() and friends, so it needs to link against libdl; on the other hand, it doesn't use nearly as many library as spectrwm itself, so linking against them is pointless. Split MAINT_LDLIBS into BIN_LDLIBS and LIB_LDLIBS, and use them for spectrwm and libswmhack respectively.