Hello Bruno, Thanks for investigating further and the clear explanation.
On 2019-04-07 5:08 a.m., Bruno Haible wrote: [....]
So, these are the libraries that are needed. Apparently libselinux is built in such a way that it needs libdl in the shared build, but libsepol in the static build.
Indeed, I now see they use dlopen/dlsym when building as a shared library, but direct linking when static: https://github.com/SELinuxProject/selinux/blob/5d59284381193d5a6806e7fa310ed4c4064d225d/libselinux/src/load_policy.c#L56 [...]
It would be better to instead set LIB_SELINUX to "-lselinux -lpcre -lsepol -lpthread" (in the static case).
This is a better solution, sadly I do not know how to implement this in M4 (e.g. detecting a static build, then deducing the required static libraries...). regards, - assaf