--- configure.orig	2026-01-18 18:19:44 UTC
+++ configure
@@ -5963,7 +5963,7 @@ freebsd* | dragonfly* | midnightbsd*)
     i*86 )
       # Not sure whether the presence of OpenBSD here was a mistake.
       # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_deplibs_check_method='file_magic (MidnightBSD|FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
       lt_cv_file_magic_cmd=$FILECMD
       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
       ;;
@@ -12567,7 +12567,7 @@ printf "%s\n" "yes" >&6; }
       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 printf "%s\n" "yes" >&6; }
       ;;
-    freebsd*)
+    freebsd*|midnightbsd*)
       if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
         old_striplib="$STRIP --strip-debug"
         striplib="$STRIP --strip-unneeded"
