Index: configure.in
===================================================================
--- configure.in	(revision 68639)
+++ configure.in	(working copy)
@@ -321,6 +321,9 @@
 LOC_ARG_WITH_INC(readline, Readline)
 LOC_ARG_WITH_LIB(readline, Readline)
 
+LOC_ARG_WITH_INC(nls, NLS)
+LOC_ARG_WITH_LIB(nls, NLS)
+
 LOC_ARG_WITH_INC(tiff, TIFF)
 LOC_ARG_WITH_LIB(tiff, TIFF)
 
@@ -1652,20 +1655,28 @@
 
 LOC_CHECK_USE(nls,NLS,USE_NLS)
 
+if test -n "${USE_NLS}" ; then
+    AC_DEFINE(USE_NLS)
+
+INTLINC=
+
+LOC_CHECK_INC_PATH(nls,NLS,INTLINC)
+
+LOC_CHECK_INCLUDES(libintl.h,NSL,$INTLINC)
+
 INTLLIB=
 HAVE_NLS=
 
-if test -n "${USE_NLS}" ; then
-    AC_DEFINE(USE_NLS)
+LOC_CHECK_LIB_PATH(nsl,NLS,INTLLIB)
 
-AC_CHECK_FUNC(gettext, INTLLIB=, [
-AC_CHECK_LIB(intl, gettext, INTLLIB=-lintl, [
-    AC_MSG_ERROR([*** Unable to locate gettext() function.])
-])])
+LOC_CHECK_FUNC(gettext,NLS,INTLLIB,,,,,[
+LOC_CHECK_LIBS(intl,gettext,NLS,$INTLLIB,INTLLIB,,,)
+])
 
     HAVE_NLS=1
 fi
 
+AC_SUBST(INTLINC)
 AC_SUBST(INTLLIB)
 AC_SUBST(HAVE_NLS)
 
