In m4/mydns.m4, -static is added to LDFLAGS, causing a final static link to mysql. This is not just a problem with unshared code, but it also is a risk very similar to bug #252372 for security issues in MySQL that don't get the fix propagated to mydns unless it's explicitly rebuilt. Last GLSA for MySQL is 200809-04, which means this is reasonably a problem.
it is m4/libtool.m4 issue, not m4/mydns.m4. I'll fix it soon.
*** This bug has been marked as a duplicate of bug 183518 ***