-lunistring is only explicitly needed when compiling statically, so
add a AC_SEARCH_LIBS to add it to LIBS if it is found.
Thanks to Fabrice Fontaine for the heads-up about the problem and the
merge request.
AC_SEARCH_LIBS([idn2_check_version], [idn2], [
AC_DEFINE([HAVE_LIBIDN2], 1, [Define to 1 if you have the GNU idn2 library])
+ dnl -lunistring is needed for static linking
+ AC_SEARCH_LIBS([u8_strconv_from_locale], [unistring])
MUTTLIBS="$MUTTLIBS $LIBS"
dnl libidn2 >= 2.0.0 declares compatibility macros in idn2.h