When building Autopackages, some libraries should always be statically linked. This is for a variety of reasons, but usually because of unstable API/ABI or various interface issues.

Libraries can easily be statically linked with apbuild. Use the $APBUILD_STATIC variable to set which libraries should be statically linked. For example, to statically link libtiff, you would do something like this:

[BuildPrepare]
APBUILD_STATIC="tiff"
# then compile program (e.g., prepareBuild)

You can specify more than one library by seperating them with spaces, ("tiff png"). See the APBuild documentation for more information.

  • wxWidgets: Versions < 2.6.x are very unstable in terms of backwards compatibility, and should always be statically linked. Statically link the libraries wx_gtk2_core and wx_base for a simple wxWidgets application. Since wxWidgets 2.6 binary compatibility is preserved among different releases (e.g. 2.6.1 is binary compatible with 2.6.3, etc) so that you can simply use
[Prepare]
require @gtk.org/gtk 2.0
require @wxwidgets.org/base 26.3
require @wxwidgets.org/core 26.3
require @wxwidgets.org/html 26.3

in your apspec for a wxWidgets-based application. The interface version is what you guess: major and minor digits with no dot between and the release number (in sample above, wx 2.6.3 is the minimal requirement).

  • libtiff: Libtiff has broken ABI compatibility as of version 3.6.1. Statically link "tiff".
  • lcms: LCMS has a versioning system that's hard to check. Statically link "lcms".
  • physfs: Poor versioning system makes it hard to get the installed version. Statically link "physfs-<version>". More info about it here