Introduce option to build without X11 libs
Currently we are very inconsistent with how we handle our various X11 dependencies.
Some places check whether specific sub-libraries are found and disable parts of the code accordingly.
Sometimes this is controlled by whether X11 is found at all, sometimes it depends on the sublibrary being present.
Some of this is obviously broken, e.g. in one like we check whether X11 is there and then use it unconditionally a few lines down.
Instead of the current system of optional deps and deps being conditional on other deps I propose that we introduce an explicit build option that controls the X11 support.
If on (the default) then all X11 libs are required.
If off then no X11 libs are searched for. Currently this results in a broken build since some places use X11 stuff unconditionally, but it gives us an easier way to test and fix those cases.