On Wed, Jun 11, 2008 at 12:00 AM, chromatic <[EMAIL PROTECTED]> wrote:
> Could Configure.pl warn when there's no LANG? How portable is that? Actually Configure.pl warns at his start when the value of LANG is not supported by perl, being itself a perl program. But I don't know if this condition can be checked by the program to give a more meaningful message. The no LANG is not a problem, in that case the usual behavior is to silently fall back to the default C or POSIX locale, and perl does not warn in that case. So there are two unrelated problems: - A locale unsupported by the perl config that generates warnings that interferes with perl tests. This one possibly can be detected and warned in Configure.pl - A locale supported by perl that interferes with the output expected by the test for presence and versions of external programs. About the second: It takes me some time to locate the yacc detection problem: the first line of the output with C locale is: bison (GNU Bison) 2.3 And with es_ES.UTF-8 is: bison (GNU bison) 2.3 And the test that fails is: $stdout =~ /Bison .*? (\d+) \. (\d+) (\w)?/x A 'b' instead of a 'B', that's all. I tried a simple solution that may have lesser impact in other OS than prefixing the commands executed: adding $ENV{LANG}='C'; before $conf->runsteps or exit(1); in Configure.pl This solves the problem with bison and my locale, and I think will solve all related problems, but I don't know if it can impact negatively other steps. About the first problem, I've found the following in perldoc perllocale: Perl's moaning about locale problems can be silenced by setting the environment variable PERL_BADLANG to a zero value, for example "0". This method really just sweeps the problem under the carpet: you tell Perl to shut up even when Perl sees that something is wrong. Do not be surprised if later something locale-dependent misbehaves. Supposing that all expected test outputs are locale independent, setting this variable in make test can solve current problems without risk of creating new ones. -- Salu2