Library compilation support

On behalf of Jérôme.