From 4824e81a7e9e5ac10c3a58ecac1b6c16987363fc Mon Sep 17 00:00:00 2001
From: Martin Stjernholm <mast@lysator.liu.se>
Date: Tue, 4 Jul 2006 22:45:27 +0200
Subject: [PATCH] Fixed AC_CHECK_HEADERS tests before AC_CHECK_FUNCS.

Rev: src/modules/Gettext/configure.in:1.7
Rev: src/modules/Mysql/configure.in:1.50
Rev: src/post_modules/Bz2/configure.in:1.8
Rev: src/post_modules/GTK/configure.in:1.52
Rev: src/post_modules/GTK2/configure.in:1.15
Rev: src/post_modules/Nettle/configure.in:1.18
---
 src/modules/Gettext/configure.in     | 4 ++--
 src/modules/Mysql/configure.in       | 5 ++++-
 src/post_modules/Bz2/configure.in    | 6 ++++--
 src/post_modules/GTK/configure.in    | 5 +++--
 src/post_modules/GTK2/configure.in   | 5 +++--
 src/post_modules/Nettle/configure.in | 3 ++-
 6 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/src/modules/Gettext/configure.in b/src/modules/Gettext/configure.in
index 74aa44039a..7eb0375b77 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 f8d0babb97..e4bf871d76 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 d4e0ad62f4..99a2708bf7 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 7d07b1669e..cce0daa800 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 1fbd958556..869675eaea 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 24b3a68454..febe1401db 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])
-- 
GitLab