diff --git a/src/configure.in b/src/configure.in
index a73bd44d7254670a66c38da0c4bfbf58b0b8025a..5e22eb37c4a95028e03c2cbf627644302e3d0a67 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1,4 +1,4 @@
-AC_REVISION("$Id: configure.in,v 1.218 1998/07/17 11:40:37 grubba Exp $")
+AC_REVISION("$Id: configure.in,v 1.219 1998/07/22 21:04:52 hubbe Exp $")
 AC_INIT(interpret.c)
 AC_CONFIG_HEADER(machine.h)
 
@@ -686,7 +686,7 @@ locale.h sys/resource.h sys/select.h sys/mman.h setjmp.h limits.h pthread.h \
 thread.h dlfcn.h dld.h dl.h sys/times.h sched.h sys/procfs.h sys/param.h \
 winsock.h sys/ioct.h sys/socket.h malloc.h netinet/in.h sys/wait.h winbase.h \
 grp.h pwd.h passwd.h group.h winsock2.h signal.h sys/file.h poll.h sys/poll.h \
-socket.h ieeefp.h fp_class.h)
+socket.h ieeefp.h fp_class.h ieeefp.h floatingpoint.h)
 
 AC_CHECK_SIZEOF(char *,4)
 AC_CHECK_SIZEOF(long,4)
@@ -813,6 +813,7 @@ int main()
 
       xFreeBSD*)      
 	# Threads on FreeBSD earlier than 1998-06-07 are broken.
+        LIBS="${OLDLIBS}"
         AC_MSG_CHECKING(if this version of FreeBSD may have working threads)
 	AC_CACHE_VAL(pike_cv_freebsd_threads, [
 	  AC_TRY_RUN([
@@ -1075,6 +1076,7 @@ AC_CHECK_FUNCS( \
  finite \
  signbit \
  nice \
+ fpsetmask \
 )
 
 if test x$pike_cv_sys_os = xWindows_NT ; then
@@ -1454,7 +1456,7 @@ int main()
   int p,e;
 
   x=frexp(1.0, &e);
-  if(x * pow(2.0,(double)e) != 1.0) exit(3)
+  if(x * pow(2.0,(double)e) != 1.0) exit(3);
 
   p=-7;
   for(x=3.0/4.0*pow(2.0,(double)p);x<50000.0;x*=2.0,p++)
@@ -1670,11 +1672,22 @@ AC_CACHE_VAL(pike_cv_sys_idiot_sigfpe,
  AC_TRY_RUN([
 #include <math.h>
 
+#ifdef HAVE_FLOATINGPOINT_H
+#include <floatingpoint.h>
+#endif
+
+#ifdef HAVE_IEEEFP_H
+#include <ieeefp.h>
+#endif
+
 float foo_float = 0.0;
 
 int main(int argc, char **argv)
 {
   float x=2.0, y=-128.0;
+#ifdef HAVE_FPSETMASK
+  fpsetmask(0);
+#endif
   x = pow(2.0, -128.0);
   foo_float = x;
   if (x == 2.0) exit(1);
@@ -1707,11 +1720,22 @@ if test $pike_cv_sys_idiot_sigfpe = yes ; then
  AC_TRY_RUN([
 #include <math.h>
 
+#ifdef HAVE_FLOATINGPOINT_H
+#include <floatingpoint.h>
+#endif
+
+#ifdef HAVE_IEEEFP_H
+#include <ieeefp.h>
+#endif
+
 float foo_float = 0.0;
 
 int main(int argc, char **argv)
 {
   float x=2.0, y=-128.0;
+#ifdef HAVE_FPSETMASK
+  fpsetmask(0);
+#endif
   x = pow(2.0, -128.0);
   foo_float = x;
   if (x == 2.0) exit(1);