--- configure.orig	2014-09-12 18:03:04.000000000 -0400
+++ configure	2019-10-10 22:36:37.845454000 -0400
@@ -4261,20 +4261,7 @@
  esac
 
     if test "${TEA_PLATFORM}" = "unix" ; then
-
-    #--------------------------------------------------------------------
-    # On a few very rare systems, all of the libm.a stuff is
-    # already in libc.a.  Set compiler flags accordingly.
-    # Also, Linux requires the "ieee" library for math to work
-    # right (and it must appear before "-lm").
-    #--------------------------------------------------------------------
-
     ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin"
-if test "x$ac_cv_func_sin" = xyes; then :
-  MATH_LIBS=""
-else
-  MATH_LIBS="-lm"
-fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lieee" >&5
 $as_echo_n "checking for main in -lieee... " >&6; }
@@ -5836,7 +5823,7 @@
 	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
 	    TCL_LIB_VERSIONS_OK=nodots
 	    ;;
-	FreeBSD-*)
+	MidnightBSD-*|FreeBSD-*)
 	    # FreeBSD 3.* and greater have ELF.
 	    SHLIB_CFLAGS="-fPIC"
 	    SHLIB_LD="ld -Bshareable -x"
@@ -6302,7 +6289,7 @@
 		    ;;
 		IRIX*)
 		    ;;
-		NetBSD-*|FreeBSD-*)
+		NetBSD-*|FreeBSD-*|MidnightBSD-*)
 		    ;;
 		Darwin-*)
 		    ;;
