From: Mike Frysinger Date: Fri, 7 Sep 2007 00:30:16 +0000 (-0400) Subject: build-sys: nls/locale handling in util-linux-ng general X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b7f16fc375a0314fe4d45c591706538a2c65871;p=util-linux build-sys: nls/locale handling in util-linux-ng general 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 --- diff --git a/configure.ac b/configure.ac index 6e212ea9..e7cfca3c 100644 --- a/configure.ac +++ b/configure.ac @@ -41,6 +41,7 @@ AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h], [], [], [ AC_CHECK_HEADERS( [scsi/scsi.h \ langinfo.h \ + locale.h \ sys/user.h \ rpcsvc/nfs_prot.h \ sys/io.h \ diff --git a/include/nls.h b/include/nls.h index f571ca50..dd0440c9 100644 --- a/include/nls.h +++ b/include/nls.h @@ -7,6 +7,13 @@ int main(int argc, char *argv[]); #define LOCALEDIR "/usr/share/locale" #endif +#ifdef HAVE_LOCALE_H +# include +#else +# undef setlocale +# define setlocale(Category, Locale) /* empty */ +#endif + #ifdef ENABLE_NLS # include # define _(Text) gettext (Text) @@ -16,7 +23,6 @@ int main(int argc, char *argv[]); # define N_(String) (String) # endif #else -# include # undef bindtextdomain # define bindtextdomain(Domain, Directory) /* empty */ # undef textdomain diff --git a/misc-utils/cal.c b/misc-utils/cal.c index f5ede93d..77333d81 100644 --- a/misc-utils/cal.c +++ b/misc-utils/cal.c @@ -63,7 +63,6 @@ #include #include #include -#include #include "errs.h" #include "nls.h" diff --git a/misc-utils/look.c b/misc-utils/look.c index 5c7e30c7..9e255965 100644 --- a/misc-utils/look.c +++ b/misc-utils/look.c @@ -59,7 +59,6 @@ #include #include #include -#include #include "pathnames.h" #include "nls.h" diff --git a/misc-utils/write.c b/misc-utils/write.c index b3c96d14..46b8f0ac 100644 --- a/misc-utils/write.c +++ b/misc-utils/write.c @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include diff --git a/text-utils/colrm.c b/text-utils/colrm.c index 5e18a6ff..e8b1ea4a 100644 --- a/text-utils/colrm.c +++ b/text-utils/colrm.c @@ -40,8 +40,8 @@ #include #include -#include +#include "nls.h" #include "widechar.h" /* diff --git a/text-utils/more.c b/text-utils/more.c index 19c44178..5dcae7b8 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -55,7 +55,6 @@ #include #include #include -#include #include "xstrncpy.h" #include "nls.h" #include "widechar.h" diff --git a/text-utils/pg.c b/text-utils/pg.c index 10bdd159..3e1b25ea 100644 --- a/text-utils/pg.c +++ b/text-utils/pg.c @@ -49,8 +49,6 @@ #include #include #include -#include -#include #include #ifdef HAVE_NCURSES_H