Re: nls/locale handling in util-linux general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Wed, Sep 05, 2007 at 11:27:50AM +0200, Karel Zak wrote:
>  it's not completely unusual flag. For example GNU sed has both
>  --disable-nls and --disable-i18n.

I apologize that I jump to the thread so late, but (FWIIW), I'm not
convinced that a new option is necesary.

Two problems were mentioned in this thread:

1) util-linux-ng does not build with -O0

I believe there must be a solution for that problem which does not
require user intervention.

2) building a minimal version against uClibc

Does that installation of uClibc provide locale.h et al.?
Does it define LC_* macros, LC_COLLATE and friends?
If any of these is not available, util-linux-ng should detect it and
behave accordingly.

If all these are provided, yet you want a binary _without_ locale
support, then I have to ask whether it is really necessary.
What does it bring you?  A slightly smaller binary?

If this falls into the category of "special needs", then it might be
adequate to override the tests for this special case, not ato add a
configure option.

Shouldn't it be more adequate to build uClibc w/out locale support at
first place?  (And fixing util-linux-ng so that it is able to adapt?)


------
... And now for something completely different:

I can describe the situation in current gawk:

--disable-nls  disables translations provided by gettext

But this option does not switch off locale support (number
formatting for printf, decimal-dot in input parsing, etc.)

It does not switch off mbcs support either.  (MBCS == multibyte
character set, a generalized term for what was called "unicode" in
this thread; inbcludes wchar_t, wc* functions, etc.)

Both these functions are always compiled into gawk, if the
prerequisities are detected by configure.  If you want to override
this, you can override some of the configure checks.

But in practice, there is no need for that; LC_ALL=C switches all
this off in runtime.

A quick peek into sed-4.1.5 sources does not contradict to the above
definition of --disable-nls.  And --disable-i18n is implemented as:
	if test "x$enable_i18n" = xno; then
	  ac_cv_func_wcscoll=false
	fi
which overrides the check for wcscoll(), it seems to disable mbcs
support.

Back to gawk: as I said, it has no --disable-i18n option.  But the
condition, when mbcs support is enabled, is defined in file
mbsupport.h, which contains the following text:
/*
 * This file is needed because we test for i18n support in 3 different
 * places, and we want a consistent definition in all of them. [...]

So it seems that --disable-i18n might be a good name for disabling
what I called "mbcs support".

But, according to my understanding, this should not include switching
off locale support (LC_COLLATE etc.).

So if I have not convinced you that no option is needed, I'd really
vote for --disable-locale, if you wish to disable all multi-language
support as described in manpage locale(7).

Sorry that I send such a long mail; I don't have enough time/energy
to make it shorter.

Have a nice day,
	Stepan Kasal
-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux