On Monday 03 September 2007, Karel Zak wrote:
> http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/590/focus=592
>
> I agree that we need a better support for compilation without
> locales, but from my point of view NLS != all locales stuff. The NLS
> support is subset only.
thinking about the input from everyone, i'd propose the attached ...
Only pull in locale.h as needed and move it to the common nls.h.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
AC_CHECK_HEADERS(
[scsi/scsi.h \
langinfo.h \
+ locale.h \
sys/user.h \
rpcsvc/nfs_prot.h \
sys/io.h \
#define LOCALEDIR "/usr/share/locale"
#endif
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#else
+# undef setlocale
+# define setlocale(Category, Locale) /* empty */
+#endif
+
#ifdef ENABLE_NLS
# include <libintl.h>
# define _(Text) gettext (Text)
# define N_(String) (String)
# endif
#else
-# include <locale.h>
# undef bindtextdomain
# define bindtextdomain(Domain, Directory) /* empty */
# undef textdomain
#include <string.h>
#include <time.h>
#include <unistd.h>
-#include <locale.h>
#include "errs.h"
#include "nls.h"
#include <strings.h>
#include <ctype.h>
#include <getopt.h>
-#include <locale.h>
#include "pathnames.h"
#include "nls.h"
#include <pwd.h>
#include <string.h>
#include <stdlib.h>
-#include <locale.h>
#include <signal.h>
#include <sys/param.h>
#include <sys/signal.h>
#include <stdio.h>
#include <stdlib.h>
-#include <locale.h>
+#include "nls.h"
#include "widechar.h"
/*
#include <sys/file.h>
#include <sys/wait.h>
#include <a.out.h>
-#include <locale.h>
#include "xstrncpy.h"
#include "nls.h"
#include "widechar.h"
#include <unistd.h>
#include <signal.h>
#include <setjmp.h>
-#include <locale.h>
-#include <nl_types.h>
#include <libgen.h>
#ifdef HAVE_NCURSES_H