How to build LO headless (no deps on X libraries)?

I want to install LO on a webserver and only use command-line mode to convert documents to pdf. The webserver is headless and does not have libXinerama etc. (and I can’t install them).

Is it possible to build from source with options which exclude the GUI?