diff --git a/src/acconfig.h b/src/acconfig.h
index a1c68174e3293a83966272f173c75743eeac1e8a..03985c67b565a50c3d9c41b3997be5f4447e74fa 100644
--- a/src/acconfig.h
+++ b/src/acconfig.h
@@ -62,6 +62,12 @@
 /* Define if you have memmem.  */
 #undef HAVE_MEMMEM
 
+/* Define if you have ldexp.  */
+#undef HAVE_LDEXP
+
+/* Define if you have frexp.  */
+#undef HAVE_FREXP
+
 /* Define if your signals are one-shot */
 #undef SIGNAL_ONESHOT
 
diff --git a/src/configure.in b/src/configure.in
index 99c5ccdaf3c1eade9c4b685e0ab9a89387f6df08..81e18580e906a97c51351f7e9fd697b337ae3d28 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1,4 +1,4 @@
-AC_REVISION("$Id: configure.in,v 1.88 1997/04/17 05:08:29 hubbe Exp $")
+AC_REVISION("$Id: configure.in,v 1.89 1997/04/22 01:39:42 hubbe Exp $")
 AC_INIT(interpret.c)
 AC_CONFIG_HEADER(machine.h)
 
@@ -262,6 +262,19 @@ fi
 
 #############################################################################
 
+if test ! -f confdefs.h ; then
+  AC_MSG_WARN([Warning, lost confdefs.h, testing will be flawed!!
+You might need to use bash instead of /bin/sh to get correct results.
+To do this, please type the following at an sh prompt:
+	\$ rm ./config.cache
+	\$ CONFIG_SHELL=/path/to/bash
+	\$ export CONFIG_SHELL
+	\$ $CONFIG_SHELL ./configure
+])
+fi
+
+#############################################################################
+
 AC_MSG_CHECKING(ansi prototype capability)
 AC_CACHE_VAL(pike_cv_sys_ansi_prototypes,
 [
@@ -634,14 +647,12 @@ AC_CHECK_FUNCS(
  clock \
  crypt \
  fchmod \
- frexp \
  getenv \
  getrlimit \
  getrusage \
  gettimeofday \
  index \
  localtime \
- ldexp \
  memchr \
  memcpy \
  memset \
@@ -678,7 +689,6 @@ if test $ac_cv_func_crypt$ac_cv_func__crypt = nono ; then
 fi
 
 
-
 AC_STRUCT_TM
 
 #############################################################################
@@ -939,12 +949,57 @@ pike_cv_hardware_byteorder=0
 AC_MSG_RESULT($pike_cv_hardware_byteorder)
 AC_DEFINE_UNQUOTED(BYTEORDER,$pike_cv_hardware_byteorder)
 
+dnl#####################################################################
+
+define(MY_CHECK_FUNCTION,[
+AC_MSG_CHECKING(for working $1)
+AC_CACHE_VAL(pike_cv_have_func_$1,[
+AC_TRY_RUN([$2],pike_cv_func_$1=yes,pike_cv_func_$1=no)
+AC_MSG_RESULT([$]pike_cv_func_$1)
+if test [$]pike_cv_func_$1 = yes; then
+AC_DEFINE(translit(HAVE_$1,[a-z],[A-Z]))
+fi])])
+
 ########################################################################
 
-AC_MSG_CHECKING(for working memmem)
-AC_CACHE_VAL(pike_cv_func_memmem,
+MY_CHECK_FUNCTION(ldexp,
+[
+#include <math.h>
+int main()
+{
+  double x;
+  int p;
+
+  for(x=0.0;x<2.0;x+=1.0/64.0)
+    for(p=-6;p<7;p++)
+      if(ldexp(x,p) != x*pow(2.0, (double)p))
+	exit(1);
+    exit(0);
+}])
+
+########################################################################
+
+MY_CHECK_FUNCTION(frexp,
+[
+#include <math.h>
+int main()
+{
+  double x,y;
+  int p=-7;
+
+  for(x=3.0/4.0*pow(2.0,(double)p);x<50000.0;x*=2.0,p++)
+  {
+    int e;
+    if(frexp(x, &e)!=3.0/4.0) exit(1);
+    if(e!=p) exit(1);
+  }
+  exit(0);
+}])
+
+########################################################################
+
+MY_CHECK_FUNCTION(memmem,
 [
-AC_TRY_RUN([
 #include <string.h>
 char *a="foo bar gazonk";
 char *b="foo";
@@ -960,19 +1015,12 @@ int main()
     exit(1);
   exit(0);
 }
-],pike_cv_func_memmem=yes,pike_cv_func_memmem=no)])
+])
 
-if test "$pike_cv_func_memmem" = yes; then
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(HAVE_MEMMEM)
-else
-  AC_MSG_RESULT(no)
-fi
+########################################################################
 
-AC_MSG_CHECKING(for working memmove)
-AC_CACHE_VAL(pike_cv_func_memmove,
+MY_CHECK_FUNCTION(memmove,
 [
-AC_TRY_RUN([
 #include <string.h>
 char buf[100];
 int main()
@@ -987,17 +1035,23 @@ int main()
   if(strcmp(buf,"ooo bar  gaznk elefantsnabel.")) exit(1);
   exit(0);
 }
-],pike_cv_func_memmove=yes,pike_cv_func_memmove=no)])
-
-if test "$pike_cv_func_memmove" = yes; then
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(HAVE_MEMMOVE)
-else
-  AC_MSG_RESULT(no)
-fi
+])
 
 ########################################################################
 
+MY_CHECK_FUNCTION(isspace,
+[
+#include <ctype.h>
+int main()
+{
+  if(isspace(' ')) exit(0);
+  exit(1);
+}
+])
+
+#############################################################################
+
+
 AC_MSG_CHECKING(how to extract an unsigned char)
 AC_CACHE_VAL(pike_cv_method_extract_uchar,
 [
@@ -1232,28 +1286,7 @@ else
   AC_MSG_RESULT(no)
 fi
 
-
-AC_MSG_CHECKING(for isspace)
-AC_CACHE_VAL(pike_cv_have_func_isspace,
-[
-AC_TRY_LINK([
-#include <ctype.h>
-],[
-  if(isspace(' ')) exit(0);
-],
-  pike_cv_have_func_isspace=yes
-,
-  pike_cv_have_func_isspace=no
-)])
-
-if test "$pike_cv_have_func_isspace" = yes; then
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(HAVE_ISSPACE)
-else
-  AC_MSG_RESULT(no)
-fi
-
-
+#############################################################################
 
 AC_MSG_CHECKING(checking for volatile)
 AC_CACHE_VAL(pike_cv_volatile,
@@ -1269,6 +1302,8 @@ else
  AC_DEFINE(VOLATILE,)
 fi
 
+#############################################################################
+
 AC_MSG_CHECKING(for gcc function attributes)
 AC_CACHE_VAL(pike_cv_gcc_attributes,
 [
@@ -1296,6 +1331,8 @@ if test "$pike_cv_gcc_attributes" = yes; then
  AC_DEFINE(HAVE_FUNCTION_ATTRIBUTES)
 fi
 
+#############################################################################
+
 AC_MSG_CHECKING(how to set things nonblocking)
 AC_CACHE_VAL(pike_cv_sys_nonblock,
 [