This patch is applied on top of the other two patches.
https://sourceforge.net/p/libsnet/patches/4/
https://sourceforge.net/p/libsnet/patches/5/
This patch finishes what was started with the earlier two builds. The legacy osx macros are totally broken and probably would need to be written from scratch. Since I don't use apple products someone else will need to work on that assuming anyone cares. For now lets just remove it.
The legacy CHECK_SASL, CHECK_SSL and CHECK_ZLIB macros have problems with adding hardcoded -L linker directories to the LDFLAGS which is inappropriate on modern systems. Using pkg-config avoids this problem.
When setting LIBTOOL in the environment to slibtool the profiled libraries will fail to build because of the ../ prepended to the $(LIBTOOL) variable. This was expoed when building radmind which includes libsnet as a submodule.
Apologies. I had to update the patch by adding --tag=CC to the $(LIBTOOL) commands for GNU libtool. Not sure why it worked without that before, but its not important...
Gentoo bug report for radmind where this was exposed.
https://bugs.gentoo.org/779664
Third version of the patch.
After removing the hardcoded value for $(LIBTOOL) the profiled libraries needed to be worked around to not change directories when being built.
I don't think I can close this, but see https://sourceforge.net/p/libsnet/patches/7/ instead.