$OpenBSD: patch-configure_in,v 1.2 2003/05/19 16:08:19 pvalchev Exp $
--- configure.in.orig	Sun Dec  1 14:46:02 2002
+++ configure.in	Mon May 19 09:28:02 2003
@@ -58,15 +58,12 @@ else
 fi
 AM_GNU_GETTEXT
 
-AC_CHECK_FUNC(gettext, gettext_without_libintl=true)
-# same trick as with libdl:
-# if gettext() doesn't require linking against libintl,
-# we don't have to check for gettext in libintl. Otherwise
-# we may even require libintl.
-dnl AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
-if test "$gettext_without_libintl" != "true" -a "$USE_NLS" = "yes"; then
-        AC_CHECK_LIB(intl, gettext, [INTLLIBS="$INTLLIBS -lintl"])
-fi
+AC_CHECK_LIB(intl, bindtextdomain,
+  [AC_CACHE_VAL(gt_cv_func_gettext_libintl,
+    [AC_CHECK_LIB(intl, gettext,
+      [gt_cv_func_gettext_libintl=yes; LIBS="$LIBS -lintl"],
+    gt_cv_func_gettext_libintl=no)],
+gt_cv_func_gettext_libintl=no)])
 
 dnl ---------------------------------------------------------------------------
 dnl Turn on debugging and all warnings when using gcc
@@ -326,12 +323,12 @@ dnl Check for sysctl()
 AC_MSG_CHECKING([for sysctl on BSD])
 AC_TRY_COMPILE([
 	#include <unistd.h>
-	#include <sys/sysctl.h>
 	#if __FreeBSD__
 	#	 include <sys/types.h>
 	#elif (__NetBSD__ || __OpenBSD__)
 	#	 include <sys/param.h>
-	#endif],
+	#endif
+	#include <sys/sysctl.h>],
 	[int mib[2] = { CTL_HW, HW_PHYSMEM };
 	int value;
 	size_t valuelen = sizeof(value);
