diff --git a/src/modules/Gettext/configure.in b/src/modules/Gettext/configure.in
index 74aa44039aaeae37794156383d12fcedd5dd3e03..7eb0375b778ec3e36b0fbbdec0ea6594a590eb61 100644
--- a/src/modules/Gettext/configure.in
+++ b/src/modules/Gettext/configure.in
@@ -1,10 +1,10 @@
-# $Id: configure.in,v 1.6 2006/04/19 14:27:11 nilsson Exp $
+# $Id: configure.in,v 1.7 2006/07/04 20:45:27 mast Exp $
 AC_INIT(gettext.c)
 AC_CONFIG_HEADER(config.h)
 
 AC_MODULE_INIT()
 
-AC_HAVE_HEADERS(locale.h libintl.h)
+AC_HAVE_HEADERS(locale.h libintl.h iconv.h)
 
 ########################################################################
 #   gettext checking (localization)
diff --git a/src/modules/Mysql/configure.in b/src/modules/Mysql/configure.in
index f8d0babb97d1535ac23eb287ec18ab4778f06099..e4bf871d765c82fb69fb04b3d74314ebe90c09d6 100644
--- a/src/modules/Mysql/configure.in
+++ b/src/modules/Mysql/configure.in
@@ -1,5 +1,5 @@
 #
-# $Id: configure.in,v 1.49 2006/07/01 23:53:19 mast Exp $
+# $Id: configure.in,v 1.50 2006/07/04 20:45:27 mast Exp $
 #
 # Configure script for the mysql-module
 #
@@ -198,6 +198,9 @@ AC_MSG_RESULT(no)
     ], [])
   fi
 
+  # Header check necessary for PIKE_FUNCS_NEED_DECLS.
+  AC_CHECK_HEADERS(pthread.h)
+
   # Pthreads is still needed in 3.20.0.
   AC_CHECK_FUNC(pthread_self, [], [
     AC_CHECK_LIB(pthread, pthread_self, [
diff --git a/src/post_modules/Bz2/configure.in b/src/post_modules/Bz2/configure.in
index d4e0ad62f4b1827b1dff3e8628755bef67509e38..99a2708bf75134da8d4a50c34b6462a88f3e7142 100644
--- a/src/post_modules/Bz2/configure.in
+++ b/src/post_modules/Bz2/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.7 2003/01/26 10:10:57 mirar Exp $
+# $Id: configure.in,v 1.8 2006/07/04 20:45:27 mast Exp $
 AC_INIT(libbzip2mod.cmod)
 AC_CONFIG_HEADER(libbzip2mod_config.h)
 AC_ARG_WITH(bz2,     [  --without-bz2       Disable Bz2],[],[with_bz2=yes])
@@ -19,11 +19,13 @@ if test x$with_bz2 = xyes ; then
   if test "x$ac_cv_lib_bz2_BZ2_bzCompressInit" = xyes \
        -o "x$ac_cv_lib_bz2_bzCompressInit" = xyes; then
 
+    # Must be before AC_CHECK_FUNCS for PIKE_FUNCS_NEED_DECLS to work.
+    AC_CHECK_HEADERS(bzlib.h string.h strings.h)
+
     # if BZ2_bzCompressInit exists,
     # it should be used instead of bzCompressInit.
     AC_CHECK_FUNCS(BZ2_bzCompressInit)
 
-    AC_CHECK_HEADERS(bzlib.h string.h strings.h)
     if test $ac_cv_header_bzlib_h = yes ; then
       PIKE_FEATURE(Bz2,[yes (using libbz2)])
       AC_DEFINE(HAVE_BZ2LIB)
diff --git a/src/post_modules/GTK/configure.in b/src/post_modules/GTK/configure.in
index 7d07b1669eb61378cb07829566db427eb45986d1..cce0daa800226717da52fb94374338c92c72e5ce 100644
--- a/src/post_modules/GTK/configure.in
+++ b/src/post_modules/GTK/configure.in
@@ -270,15 +270,16 @@ AC_MODULE_INIT()
 AC_ARG_WITH(GTK, [  --without-GTK           no support for GTK],[],[with_GTK=yes])
 AC_ARG_WITH(GTK, [  --with-GTK2             Use GTK 2.0 if found],[],[with_GTK2=no])
 
-AC_CHECK_FUNCS( gethrtime signal sigaction )
-
 # Force prototypes from X's headerfiles.
 AC_DEFINE(FUNCPROTO)
 
 AC_HEADER_STDC
+
+# Must be before AC_CHECK_FUNCS for PIKE_FUNCS_NEED_DECLS to work.
 AC_CHECK_HEADERS( signal.h netinet/in.h arpa/inet.h sys/types.h sys/stat.h \
 	fcntl.h)
 
+AC_CHECK_FUNCS( gethrtime signal sigaction )
 
 if test "x$with_GTK" = "xyes" ; then
   
diff --git a/src/post_modules/GTK2/configure.in b/src/post_modules/GTK2/configure.in
index 1fbd9585565b9a4e207a9af7048b6a75bba4dc46..869675eaea35de302bf8d0eb1bd6d24e73e77244 100644
--- a/src/post_modules/GTK2/configure.in
+++ b/src/post_modules/GTK2/configure.in
@@ -12,8 +12,6 @@ dnl PIKE_FEATURE_WITHOUT(GTK.Sourceview)
 
 AC_MODULE_INIT()
 
-AC_CHECK_FUNCS( gethrtime signal sigaction )
-
 dnl AC_DEFINE(FUNCPROTO)
 dnl AC_DEFINE(HAVE_GNOME)
 dnl AC_DEFINE(HAVE_DPMS)
@@ -23,8 +21,11 @@ AC_DEFINE(FUNCPROTO)
 
 AC_HEADER_STDC
 
+# Must be before AC_CHECK_FUNCS for PIKE_FUNCS_NEED_DECLS to work.
 AC_CHECK_HEADERS( signal.h netinet/in.h arpa/inet.h sys/types.h sys/stat.h fcntl.h )
 
+AC_CHECK_FUNCS( gethrtime signal sigaction )
+
 AC_PATH_PROG(PKG_CONFIG,${ac_tool_prefix}pkg-config,no)
 
 AC_SUBST(have_x11)
diff --git a/src/post_modules/Nettle/configure.in b/src/post_modules/Nettle/configure.in
index 24b3a68454a2772a11af5ba535769fb431aeb46f..febe1401db1d537465d2705d87b77603c6fffaa9 100644
--- a/src/post_modules/Nettle/configure.in
+++ b/src/post_modules/Nettle/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.17 2004/10/05 10:34:40 mast Exp $
+# $Id: configure.in,v 1.18 2006/07/04 20:45:27 mast Exp $
 AC_INIT(nettle.cmod)
 AC_CONFIG_HEADER(nettle_config.h)
 
@@ -22,6 +22,7 @@ else
     PIKE_FEATURE_OK(Nettle)
 
     # md4 is available in later versions of nettle
+    AC_CHECK_HEADERS(nettle/md4.h)
     AC_CHECK_FUNCS(nettle_md4_init)
 
     AC_MSG_CHECKING([for idea.c])