@@ -32,6 +32,7 @@ PKG_PROG_PKG_CONFIG([0.20])
AC_C_CONST
AC_C_INLINE
+AC_CHECK_FUNC(nl_langinfo)
# ===============
# Gettext support
@@ -30,7 +30,9 @@
#include <time.h>
#include <getopt.h>
#include <locale.h>
+#ifdef HAVE_NL_LANGINFO
#include <langinfo.h>
+#endif
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/utsname.h>
@@ -723,10 +725,12 @@ static int readconfigfile(const char *filename, struct configparams *config)
(config->charset)[0] = '\0';
setlocale(LC_ALL, NULL);
locale = setlocale(LC_MESSAGES, NULL);
+#ifdef HAVE_NL_LANGINFO
if (locale && strcasecmp(locale, "posix") && strcasecmp(locale, "c")) {
locale = nl_langinfo(CODESET);
sstrncpy(config->charset, locale, CNF_BUFFER);
}
+#endif
maildev[0] = 0;
config->user_signature = config->user_message = config->group_signature = config->group_message = NULL;
config->cc_before = -1;
Add a configure check and skip use of nl_langinfo if it is not present. Signed-off-by: Theodore Ts'o <tytso@mit.edu> --- configure.ac | 1 + warnquota.c | 4 ++++ 2 files changed, 5 insertions(+)