by DavidEGrayson · 10y ago · 0 comments
FHS is just the split up at the top level into bin, lib, include, etc, share as opposed to having a folder called, e.g. MyApplication. Some people hate it, but it allows sharing libraries easily. Apple go for something of a hybrid with Frameworks. MSYS2 goes full Linux-style, even for our mingw-w64 (native) softare. "C:\Program Files\MyApplication" is the complete opposite. No sharing. No good for anyone.
Usually software is configured so that at `make install` time it will pull the DLLs of its dependencies beside its executables on Windows, so that, for example a Qt-based game would be packaged with the Qt DLLs in the same folder as the executable.
On MSYS2 we disable this code-path (ok, build-system code-path) and adopt the Linux path instead, so that our final package contains only the executable and a record to say "I also need the Qt shared libraries package version 5.5-3".
In fact, pacman doesn't allow us to make two packages with the same final files in it since it's a System Package Manager and it disallows such conflicts (unless the packages are marked as conflicting).
The other common thing you'll see with Windows software is people compiling and linking to static libraries because it's safer than DLL hell. It might be safer in that regard, but it's a security nightmare for the user (though they often can't know it), so we don't do that either. Our library packages do tend to come with static libraries, but our executables link to shared libraries by default which are also provided.
This way, when a security issue is found in a library, we don't need to update a load of packages containing executables that linked to that library statically, since none (or very few, some may slip through by mistake) do.
Windows isn't the only one non POSIX and even POSIX ones do have substantial differences.
OS X is POSIX certified, and Linux and BSD are obviously UNIX-like and mostly compliant.
Apart from the precise meaning of POSIX, windows is the only OS in widespread use not part of the UNIX-like family.
Not so niche are iOS and Android, which aren't fully POSIX compliant.
Then being POSIX compliant is only half of the story, because each OS tends to be certified to specific versions and there is room for implementation specific behaviours.
For example, Aix used to have Windows like model for dynamic libraries. OS X and its derivatives have Frameworks and so on.
Finally POSIX only applications are constrained to CLI and daemons only, as everything else falls outside POSIX.
That is not a small group, especially as it includes your build environment. In Windows, many times I had a problem that I cannot run ./configure (or worse: the package used a home grown build system that assumed unix-y environment; py2cairo, I'm looking at you), not only because of bash/sed/m4/awk/etc, but also not counting with cl.exe (VS compiler).
Side note: OSX has not only frameworks, but also dylibs. You can treat existing framework as dylib, it will link fine.