X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=configure.ac;h=ac8b54248daec13f29617944e17fffafb72f1311;hb=11cc4f3de6f143b1d4d5e71338269d54660c60b6;hp=e816a0ac7469be258fcf97ee93d80f1783831d87;hpb=b09e9b0f93d75ccb48929823741139b9bb8d7363;p=babeltrace.git diff --git a/configure.ac b/configure.ac index e816a0ac..ac8b5424 100644 --- a/configure.ac +++ b/configure.ac @@ -159,6 +159,24 @@ AC_CHECK_HEADERS([ \ AX_APPEND_LINK_FLAGS([-Wl,--no-as-needed], [LD_NO_AS_NEEDED]) AC_SUBST([LD_NO_AS_NEEDED]) +# 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.]) + ] + ) + ] +) + # Initialize and configure libtool LT_INIT([win32-dll])