>
Versioning on a lib is never a good idea. Drop that illusion. It works only for a short time.The use of "soname" and "linkname" is a linux standard, its not some trick dreamed up by me or some FPC or Kylix developers, its the standard way to use libraries under linux and some other Unixes.
https://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html Its a means of enabling a developer, for example, to have installed multiple versions of a library to allow testing of an application. And a way to allow the application to work with existing libraries that have been established are suitable.
libthing.so -> libthing.so.3
libthing.so.1 -> libthing2.so.3
libthing.so.2 -> libthing2.so.3
libthing.so.3
libthing2.so.3
In the above (simplified) case, when I link, I will be using the older library ensuring backwards comparability for users but when I run the same app, I will use the newer library.
This model was widely used in, eg DEC Unix and allowed a high degree of flexibility. Linux uses it now but the rise of packaging has lead people to believe there is only one combination possible. In the "olden days" a sysadmin would build a library, copy it somewhere and make an informed decision about the symlinks necessary.
>
In other Unix operating systems, such as OpenBSD or NetBSD, libfontconfig.so.1 does not exist, nor libfontconfig.so but some like libfontconfig.so.13.1 for OpenBSD. Yes
Fred, Anton's patch does allow for differences between Darwin, Windows, OpenBSD, haiku and "all the rest". Sounds like that is not enough. Far too long since I used any of the *BSDs to tell.
>
Additionally, the libfontconfig-dev package does not exist for these operating systems.Well, -dev or -devel packages are just a simple add add on, all they do in most cases is make that symlink to the linkname and drop a few doc files in place. Arch linux appears always make that default symlink, perhaps a good idea but it would, if reapplied, mess with the example I give above.
Aside : I package the qt5/6Pas libraries and had a (experienced and knowledgeable) user complain to me that the dev packages did not contain any binaries. Sigh ...
Summary, in my infinite wisdom, I believe there should be some function that returns the default (run time) library name for all supported OS, this is far from just a libfontconfig issue.
function LibraryEnding() : string;
begin
{$if defined(darwin) or defined (haiku) or defined(OpenBSD) }
result := '.so';
{$else}
{$if defined(MSWINDOWS)}
result := '.dll');
{$else}
{$if defined(LINUX) }
result := '.so.1';
{$endif} {$endif} {$endif}
end;
DefaultLibName = 'fontconfig' + LibraryEnding();
(untested) Room in there for all supported OS ....
Davo