--- configure.orig	2022-09-12 11:40:15 UTC
+++ configure
@@ -6563,13 +6563,15 @@ tools are selected during the Xcode/Deve
     fi
     ;;
 
-*-freebsd*)
+*-midnightbsd*)
     if test -z "$USE_NSPR_THREADS"; then
         USE_PTHREADS=1
     fi
     $as_echo "#define XP_UNIX 1" >>confdefs.h
 
     $as_echo "#define FREEBSD 1" >>confdefs.h
+    
+    $as_echo "#define MIDNIGHTBSD 1" >>confdefs.h
 
     $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
 
@@ -7936,7 +7938,7 @@ $as_echo_n "checking whether ${CC-cc} ac
 	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
 	    ac_cv_have_dash_pthread=yes
 		case "$target_os" in
-	    freebsd*)
+	    freebsd*|midnightbsd*)
 # Freebsd doesn't use -pthread for compiles, it uses them for linking
             ;;
 	    *)
@@ -7974,7 +7976,7 @@ $as_echo "$ac_cv_have_dash_pthreads" >&6
             _PTHREAD_LDFLAGS=
         fi
 	    ;;
-    *-freebsd*)
+    *-freebsd*|*-midnightbsd*)
 	    $as_echo "#define _REENTRANT 1" >>confdefs.h
 
 	    $as_echo "#define _THREAD_SAFE 1" >>confdefs.h
@@ -8064,7 +8066,7 @@ case "$target" in
 
     fi
     ;;
-*-freebsd*)
+*-freebsd*|*-midnightbsd*)
     if test -n "$USE_NSPR_THREADS"; then
         $as_echo "#define _PR_LOCAL_THREADS_ONLY 1" >>confdefs.h
 
