Issue 5949: Add option to use Ghostscript API instead of forking
This is much more efficient than the current scheme when converting many PostScript files, for example when building the documentation. For the Notation Reference, lilypond-book now takes ~2m30s instead of 5m to compile all snippets from the notation.tely file. Other manuals benefit less, but still the time for 'make doc' on my system improves by one third from around 33m to 22m. An alternative would have been to always call gsapi_init_with_args with the same arguments used until now. This indeed works and avoids the overhead of forking, but the instance cannot be reused. Calling gsapi_new_instance -> gsapi_init_with_args -> gsapi_delete_instance for every conversion still means a lot of overhead and a prototype suggested only a small gain compared to the previous solution. This is not the default because recent versions of Ghostscript are distributed under the AGPL and it's unclear what the implications of linking to the library is. If built with support for the API, use -dgs-api=#f to still fork the gs command.
Showing with 232 additions and 27 deletions