--- ../dist/configure.orig	2007-11-18 08:43:54.000000000 -0800
+++ ../dist/configure	2008-06-15 11:35:32.000000000 -0700
@@ -19433,10 +19433,10 @@ fi
 
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+LIBTOOL_DEPS=" %%LTMAIN%%"
 
 # Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+LIBTOOL='$(SHELL) %%LIBTOOL%%'
 
 # Prevent multiple expansion
 
@@ -22335,6 +22335,7 @@
 #define USE_ICONV 1
 _ACEOF
 
+LIBS="${LIBS} -liconv"
 
 for ac_func in iswblank
 do
@@ -27631,6 +27632,8 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdio.h>
 main(){char buf[20]; exit(sprintf(buf, "XXX") != 3);}
 _ACEOF
 rm -f conftest$ac_exeext
@@ -28624,7 +28627,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <stdio.h>
-int fprintf ();
+/*int fprintf ();*/
 
 int
 main ()
@@ -28755,5 +28758,6 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <sys/stddef.h>
 #include <db.h>
 int
 main ()
