Re: [Module::Build] Does ./Build work on Windows?
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <ke...@ma...> - 2006-01-31 01:51:27
|
On Jan 30, 2006, at 5:33 PM, Andreas J. Koenig wrote:
>
>> The en_GB.utf8 locale isn't recognized on my platform (Mac OS X
>> 10.3.9) so I get a million warnings about it during the build & tests.
>
> This is completely incomprehensible to me. The LC_ALL macro is only
> used during 'make chlog' which you certainly have not called.
The problem is that there's an unholy incestuous relationship between
make variables and environment variables. Setting LC_ALL as a macro
sets it as an environment variable for all subprocesses too, whether
their actions use the macro or not:
----------------------------------------------------
[scotchie:/tmp] ken% cat Makefile
FOOENV=HiMom
LC_ALL=en_GB.utf8
testenv:
perl -le 'print "$$_: $$ENV{$$_}" for "FOOENV", "LC_ALL"'
[scotchie:/tmp] ken% make testenv
perl -le 'print "$_: $ENV{$_}" for "FOOENV", "LC_ALL"'
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = "en_GB.utf8",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
FOOENV:
LC_ALL: en_GB.utf8
[scotchie:/tmp] ken%
----------------------------------------------------
It only does this if the variable is already defined in the user's
shell:
----------------------------------------------------
[scotchie:/tmp] ken% unsetenv LC_ALL
[scotchie:/tmp] ken% make testenv
perl -le 'print "$_: $ENV{$_}" for "FOOENV", "LC_ALL"'
FOOENV:
LC_ALL:
----------------------------------------------------
(I just learned this last fact myself.)
>
> 'make', 'make test', and 'make install' should not be influenced by
> this macro. Is it so on OS X that macros are magically transposed into
> environment variables?
Not just on OS X, lots of platforms - OS X just uses the standard GNU
make, version 3.79 in my case. The GNU make manual says:
Except by explicit request, make exports a variable only if it is
either defined in the environment initially or set on the command
line,
and if its name consists only of letters, numbers, and underscores.
[http://www.gnu.org/software/make/manual/html_chapter/
make_5.html#SEC60]
For the record, I hate this behavior of make.
>
> What if you rename the macro like in this pseudo patch?
>
> -LC_ALL=en_GB.utf8
> +LC_ALL_XXX=en_GB.utf8
Yup, then I get no complaints at all.
-Ken
|