5.6 Reducing dependencies

Miniwood can also be used to reduce dependencies of your program by just leaving out components you don't need. On Linux, for example, Hollywood depends on Xlib (X11) and won't run on systems that don't have it. Technically speaking, however, the only Hollywood component that actually requires X11 is its display library which is responsible for managing windows. Not all programs might want to open windows, though. Sometimes you just want to write a console program that doesn't have any GUI at all. Still, if you compile it with Hollywood, it will always require X11 to run because Hollywood-compiled programs always contain all libraries.

With Miniwood this is different. If you are writing a console program which doesn't open any windows, your script won't load display library via the @USING preprocessor command which means that it won't have the Xlib dependency on Linux so it will also work on systems without X11, e.g. server or terminal systems. Thus, fine-tuning the components required by your script can increase the compatibility of your final executable so that it runs in more environments. With Hollywood it's impossible to write a program which works without X11, with Miniwood it's easily doable!


Show TOC