4.5 Linking plugins

In contrast to data files and fonts, plugins aren't automatically linked to your executable when you require them in the preprocessor commands. The following code, for example, will not force the linker to link jpeg2000.hwp into your executable:

 
@REQUIRE "jpeg2000"

If you want to have jpeg2000.hwp linked into your executable, you have to set the Link tag to True. The code looks like this then:

 
@REQUIRE "jpeg2000", {Link = True}

In that case, jpeg2000.hwp will be linked to your executable and the user won't need to keep a copy of jpeg2000.hwp because it has already been linked into the executable.

Alternatively, you can also use the ‘-linkplugins’ console argument to link plugins into your executable. See Console arguments for details.

Note that plugins can only be linked to executables, not to applets, since applets are platform-independent and plugins are not.

Before you can use the plugin linker, you first have to copy the plugins for all platforms you would like to link into a directory named LinkerPlugins. The location of this directory differs from platform to platform. Here is a breakdown of where the Hollywood linker will look for this directory:

Note that all these search paths can also be modified by editing the file sysroot.conf that is part of the Hollywood installation. Alternatively, you can also use the ‘-sysroot’ and ‘-postsysroot’ console arguments to modify Hollywood's search paths. See Console arguments for details.

Inside the LinkerPlugins directory there should be the following subdirectories. If they don't exist, just create them. You only need the directories for the platforms you want to compile executables for. The following platform directories inside LinkerPlugins are currently supported:

 
arm-android-v7a
arm64-android-v8a
arm64-linux
arm64-macos
arm-ios
arm-linux
m68k-amigaos
m881-amigaos
ppc-amigaos
ppc-linux
ppc-macos
ppc-morphos
ppc-warpup
x86-aros
x86-macos
x86-linux
x86-windows
x64-linux
x64-macos
x64-windows

After creating those subdirectories, you have to copy the plugins you want to link to them. You need to copy plugins for all the architectures you want to compile executables for. If you don't do that, the linker won't be able to find the plugins to link. Note that the linker will look for plugins only inside the LinkerPlugins directory. It won't look anywhere else, in particular not in the standard plugins location.

Note that when creating executables for the m881-amigaos architecture, the linker will also look for plugins in the m68k-amigaos directory because both architectures are completely compatible. The same is true for ppc-warpup which will also take both, the m68k-amigaos and m881-amigaos architectures, into account.

Important note: Make sure to carefully read the license of every plugin you link to your executable because many licenses are very restrictive when it comes to static linking. For example, if you link a plugin that is licensed under the LGPL license, then your complete project automatically becomes LGPL as well and you must provide all sources and data files. So make sure to study plugin licenses before you link them to your executables. You have been warned.


Show TOC