+# Check if the linker supports whole-archive
+AX_CHECK_LINK_FLAG([-Wl,--whole-archive,--no-whole-archive],
+ [
+ AC_SUBST([LD_WHOLE_ARCHIVE], [-Wl,--whole-archive,])
+ AC_SUBST([LD_NO_WHOLE_ARCHIVE], [,--no-whole-archive])
+ ],[
+ # Fallback to force_load for the macOS linker
+ AX_CHECK_LINK_FLAG([-Wl,-force_load],
+ [
+ AC_SUBST([LD_WHOLE_ARCHIVE], [-Wl,-force_load,])
+ AC_SUBST([LD_NO_WHOLE_ARCHIVE], [])
+ ],[
+ AC_MSG_WARN([Can't find a linker option to force the inclusion of the static plugin archive objects.])
+ ]
+ )
+ ]
+)
+