Remove redundant C locale settings.

Various glibc build / install / test code has C locale settings that
are redundant with LC_ALL=C.

LC_ALL takes precedence over LANG, so anywhere that sets LC_ALL=C
(explicitly, or through it being in the default environment for
running tests) does not need to set LANG=C.  LC_ALL=C also takes
precedence over LANGUAGE, since

2001-01-02  Ulrich Drepper  <drepper@redhat.com>

	* intl/dcigettext.c (guess_category_value): Rewrite so that LANGUAGE
	value is ignored if the selected locale is the C locale.
	* intl/tst-gettext.c: Set locale for above change.
	* intl/tst-translit.c: Likewise.

and so settings of LANGUAGE=C are also redundant when LC_ALL=C is
set.  One test also had LC_ALL=C in its -ENV setting, although it's
part of the default environment used for tests.

This patch removes the redundant settings.  It removes a suggestion in
install.texi of setting LANGUAGE=C LC_ALL=C for "make install"; the
Makefile.in target "install" already sets LC_ALL_C so there's no need
for the user to set it (and nor should there be any need for the user
to set it).

If some build machine tool used by "make install" uses a version of
libintl predating that 2001 change, and the user has LANGUAGE set, the
removal of LANGUAGE=C from the Makefile.in "install" rule could in
principle affect the user's installation.  However, I don't think we
need to be concerned about pre-2001 build tools.

Tested x86_64.

	* Makefile (install): Don't set LANGUAGE.
	* Makefile.in (install): Likewise.
	* assert/Makefile (test-assert-ENV): Remove variable.
	(test-assert-perr-ENV): Likewise.
	* elf/Makefile (neededtest4-ENV): Likewise.
	* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Don't set LANGUAGE.
	* io/ftwtest-sh (LANG): Remove variable.
	* libio/Makefile (tst-widetext-ENV): Likewise.
	* manual/install.texi (Running make install): Don't refer to
	environment settings for make install.
	* INSTALL: Regenerated.
	* nptl/tst-tls6.sh: Don't set LANG.
	* posix/globtest.sh (LANG): Remove variable.
	* string/Makefile (tester-ENV): Likewise.
	(inl-tester-ENV): Likewise.
	(noinl-tester-ENV): Likewise.
	* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Don't set LANGUAGE.
	* timezone/Makefile (build-testdata): Use $(built-program-cmd)
	without explicit environment settings.

localedata/ChangeLog:
	* tst-fmon.sh: Don't set LANGUAGE.
	* tst-locale.sh: Likewise.
This commit is contained in:
Joseph Myers 2014-06-07 19:58:36 +00:00
parent 68e6b6b1bf
commit 686554bff6
18 changed files with 48 additions and 32 deletions

View file

@ -1,3 +1,27 @@
2014-06-07 Joseph Myers <joseph@codesourcery.com>
* Makefile (install): Don't set LANGUAGE.
* Makefile.in (install): Likewise.
* assert/Makefile (test-assert-ENV): Remove variable.
(test-assert-perr-ENV): Likewise.
* elf/Makefile (neededtest4-ENV): Likewise.
* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules)
[$(cross-compiling) = no]: Don't set LANGUAGE.
* io/ftwtest-sh (LANG): Remove variable.
* libio/Makefile (tst-widetext-ENV): Likewise.
* manual/install.texi (Running make install): Don't refer to
environment settings for make install.
* INSTALL: Regenerated.
* nptl/tst-tls6.sh: Don't set LANG.
* posix/globtest.sh (LANG): Remove variable.
* string/Makefile (tester-ENV): Likewise.
(inl-tester-ENV): Likewise.
(noinl-tester-ENV): Likewise.
* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules)
[$(cross-compiling) = no]: Don't set LANGUAGE.
* timezone/Makefile (build-testdata): Use $(built-program-cmd)
without explicit environment settings.
2014-06-06 Roland McGrath <roland@hack.frob.com> 2014-06-06 Roland McGrath <roland@hack.frob.com>
* nptl/sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Moved ... * nptl/sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Moved ...

12
INSTALL
View file

@ -254,12 +254,12 @@ Installing the C Library
======================== ========================
To install the library and its header files, and the Info files of the To install the library and its header files, and the Info files of the
manual, type `env LANGUAGE=C LC_ALL=C make install'. This will build manual, type `make install'. This will build things, if necessary,
things, if necessary, before installing them; however, you should still before installing them; however, you should still compile everything
compile everything first. If you are installing the GNU C Library as first. If you are installing the GNU C Library as your primary C
your primary C library, we recommend that you shut the system down to library, we recommend that you shut the system down to single-user mode
single-user mode first, and reboot afterward. This minimizes the risk first, and reboot afterward. This minimizes the risk of breaking
of breaking things when the library changes out from underneath. things when the library changes out from underneath.
`make install' will do the entire job of upgrading from a previous `make install' will do the entire job of upgrading from a previous
installation of the GNU C Library version 2.x. There may sometimes be installation of the GNU C Library version 2.x. There may sometimes be

View file

@ -105,7 +105,7 @@ install-symbolic-link: subdir_install
rm -f $(symbolic-link-list) rm -f $(symbolic-link-list)
install: install:
-test ! -x $(elf-objpfx)ldconfig || LC_ALL=C LANGUAGE=C \ -test ! -x $(elf-objpfx)ldconfig || LC_ALL=C \
$(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \ $(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \
$(slibdir) $(libdir) $(slibdir) $(libdir)
ifneq (no,$(PERL)) ifneq (no,$(PERL))

View file

@ -9,7 +9,7 @@ all .DEFAULT:
$(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@ $(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
install: install:
LANGUAGE=C LC_ALL=C; export LANGUAGE LC_ALL; \ LC_ALL=C; export LC_ALL; \
$(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@ $(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
bench bench-clean: bench bench-clean:

View file

@ -28,6 +28,3 @@ routines := assert assert-perr __assert
tests := test-assert test-assert-perr tests := test-assert test-assert-perr
include ../Rules include ../Rules
test-assert-ENV = LANGUAGE=C
test-assert-perr-ENV = LANGUAGE=C

View file

@ -591,7 +591,6 @@ $(objpfx)neededtest3: $(libdl)
$(objpfx)neededtest3.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ $(objpfx)neededtest3.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
$(objpfx)neededobj3.so $(objpfx)neededobj4.so $(objpfx)neededobj3.so $(objpfx)neededobj4.so
neededtest4-ENV = LC_ALL=C LANGUAGE=C
$(objpfx)neededtest4: $(libdl) $(objpfx)neededobj1.so $(objpfx)neededtest4: $(libdl) $(objpfx)neededobj1.so
$(objpfx)neededtest4.out: $(objpfx)neededobj5.so $(objpfx)neededobj6.so $(objpfx)neededtest4.out: $(objpfx)neededobj5.so $(objpfx)neededobj6.so

View file

@ -251,7 +251,7 @@ ifeq (no,$(cross-compiling))
# Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary # Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
# if this libc has more gconv modules than the previously installed one. # if this libc has more gconv modules than the previously installed one.
if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \ if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
LC_ALL=C LANGUAGE=C \ LC_ALL=C \
$(elf-objpfx)ld.so --library-path $(rpath-link) \ $(elf-objpfx)ld.so --library-path $(rpath-link) \
$(common-objpfx)iconv/iconvconfig \ $(common-objpfx)iconv/iconvconfig \
$(addprefix --prefix=,$(install_root)); \ $(addprefix --prefix=,$(install_root)); \

View file

@ -40,8 +40,6 @@ fi
# Since we use `sort' we must make sure to use the same locale everywhere. # Since we use `sort' we must make sure to use the same locale everywhere.
LC_ALL=C LC_ALL=C
export LC_ALL export LC_ALL
LANG=C
export LANG
# First create our scenario: # First create our scenario:
tmp=${objpfx}io tmp=${objpfx}io

View file

@ -148,7 +148,6 @@ CFLAGS-tst_putwc.c = -DOBJPFX=\"$(objpfx)\"
tst_wprintf2-ARGS = "Some Text" tst_wprintf2-ARGS = "Some Text"
tst-widetext-ENV = LANGUAGE=C
tst-fopenloc-ENV = MALLOC_TRACE=$(objpfx)tst-fopenloc.mtrace tst-fopenloc-ENV = MALLOC_TRACE=$(objpfx)tst-fopenloc.mtrace
generated += tst-fopenloc.mtrace tst-fopenloc.check generated += tst-fopenloc.mtrace tst-fopenloc.check

View file

@ -1,3 +1,8 @@
2014-06-07 Joseph Myers <joseph@codesourcery.com>
* tst-fmon.sh: Don't set LANGUAGE.
* tst-locale.sh: Likewise.
2014-06-06 Joseph Myers <joseph@codesourcery.com> 2014-06-06 Joseph Myers <joseph@codesourcery.com>
* Makefile ($(addprefix $(objpfx),$(CTYPE_FILES))): Use * Makefile ($(addprefix $(objpfx),$(CTYPE_FILES))): Use

View file

@ -37,7 +37,7 @@ for cns in `cd ./tst-fmon-locales && ls tstfmon_*`; do
fn=charmaps/ISO-8859-1 fn=charmaps/ISO-8859-1
${run_program_prefix_before_env} \ ${run_program_prefix_before_env} \
${run_program_env} \ ${run_program_env} \
I18NPATH=. LANGUAGE=C \ I18NPATH=. \
${run_program_prefix_after_env} ${common_objpfx}locale/localedef \ ${run_program_prefix_after_env} ${common_objpfx}locale/localedef \
--quiet -i $cn -f $fn ${common_objpfx}localedata/$cns --quiet -i $cn -f $fn ${common_objpfx}localedata/$cns
done done

View file

@ -36,7 +36,7 @@ test_locale ()
fi fi
${localedef_before_env} \ ${localedef_before_env} \
${run_program_env} \ ${run_program_env} \
I18NPATH=. LANGUAGE=C \ I18NPATH=. \
${localedef_after_env} --quiet -c -f $charmap -i $input \ ${localedef_after_env} --quiet -c -f $charmap -i $input \
${rep} ${common_objpfx}localedata/$out ${rep} ${common_objpfx}localedata/$out

View file

@ -291,7 +291,7 @@ the last assignment specified must take precedence.
@cindex installing @cindex installing
To install the library and its header files, and the Info files of the To install the library and its header files, and the Info files of the
manual, type @code{env LANGUAGE=C LC_ALL=C make install}. This will manual, type @code{make install}. This will
build things, if necessary, before installing them; however, you should build things, if necessary, before installing them; however, you should
still compile everything first. If you are installing @theglibc{} as your still compile everything first. If you are installing @theglibc{} as your
primary C library, we recommend that you shut the system down to primary C library, we recommend that you shut the system down to

View file

@ -36,7 +36,7 @@ for aligned in a e f; do
echo "preload tst-tls5mod{$aligned,b,c,d}.so" >> $logfile echo "preload tst-tls5mod{$aligned,b,c,d}.so" >> $logfile
echo "===============" >> $logfile echo "===============" >> $logfile
${test_wrapper_env} \ ${test_wrapper_env} \
${run_program_env} LANG=C \ ${run_program_env} \
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \ LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \
| sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1 | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
echo >> $logfile echo >> $logfile
@ -44,7 +44,7 @@ for aligned in a e f; do
echo "preload tst-tls5mod{b,$aligned,c,d}.so" >> $logfile echo "preload tst-tls5mod{b,$aligned,c,d}.so" >> $logfile
echo "===============" >> $logfile echo "===============" >> $logfile
${test_wrapper_env} \ ${test_wrapper_env} \
${run_program_env} LANG=C \ ${run_program_env} \
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{b,$aligned,c,d}.so \ LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{b,$aligned,c,d}.so \
| sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1 | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
echo >> $logfile echo >> $logfile
@ -52,7 +52,7 @@ for aligned in a e f; do
echo "preload tst-tls5mod{b,c,d,$aligned}.so" >> $logfile echo "preload tst-tls5mod{b,c,d,$aligned}.so" >> $logfile
echo "===============" >> $logfile echo "===============" >> $logfile
${test_wrapper_env} \ ${test_wrapper_env} \
${run_program_env} LANG=C \ ${run_program_env} \
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{b,c,d,$aligned}.so \ LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{b,c,d,$aligned}.so \
| sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1 | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
echo >> $logfile echo >> $logfile
@ -61,7 +61,7 @@ done
echo "preload tst-tls5mod{d,a,b,c,e}" >> $logfile echo "preload tst-tls5mod{d,a,b,c,e}" >> $logfile
echo "===============" >> $logfile echo "===============" >> $logfile
${test_wrapper_env} \ ${test_wrapper_env} \
${run_program_env} LANG=C \ ${run_program_env} \
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,c,e}.so \ LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,c,e}.so \
| sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1 | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
echo >> $logfile echo >> $logfile
@ -69,7 +69,7 @@ echo >> $logfile
echo "preload tst-tls5mod{d,a,b,e,f}" >> $logfile echo "preload tst-tls5mod{d,a,b,e,f}" >> $logfile
echo "===============" >> $logfile echo "===============" >> $logfile
${test_wrapper_env} \ ${test_wrapper_env} \
${run_program_env} LANG=C \ ${run_program_env} \
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,e,f}.so \ LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,e,f}.so \
| sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1 | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
echo >> $logfile echo >> $logfile

View file

@ -40,8 +40,6 @@ esac
# Since we use `sort' we must make sure to use the same locale everywhere. # Since we use `sort' we must make sure to use the same locale everywhere.
LC_ALL=C LC_ALL=C
export LC_ALL export LC_ALL
LANG=C
export LANG
# Create the arena # Create the arena
testdir=${common_objpfx}posix/globtest-dir testdir=${common_objpfx}posix/globtest-dir

View file

@ -64,9 +64,6 @@ endif
include ../Rules include ../Rules
tester-ENV = LANGUAGE=C
inl-tester-ENV = LANGUAGE=C
noinl-tester-ENV = LANGUAGE=C
CFLAGS-inl-tester.c = -fno-builtin CFLAGS-inl-tester.c = -fno-builtin
CFLAGS-noinl-tester.c = -fno-builtin CFLAGS-noinl-tester.c = -fno-builtin
CFLAGS-tst-strlen.c = -fno-builtin CFLAGS-tst-strlen.c = -fno-builtin

View file

@ -76,7 +76,7 @@ ifeq (no,$(cross-compiling))
# Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary # Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
# if this libc has more gconv modules than the previously installed one. # if this libc has more gconv modules than the previously installed one.
if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \ if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
LC_ALL=C LANGUAGE=C \ LC_ALL=C \
$(elf-objpfx)ld.so --library-path $(rpath-link) \ $(elf-objpfx)ld.so --library-path $(rpath-link) \
$(common-objpfx)iconv/iconvconfig \ $(common-objpfx)iconv/iconvconfig \
$(addprefix --prefix=,$(install_root)); \ $(addprefix --prefix=,$(install_root)); \

View file

@ -80,8 +80,7 @@ CFLAGS-scheck.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT
# Don't add leapseconds here since test-tz made checks that work only without # Don't add leapseconds here since test-tz made checks that work only without
# leapseconds. # leapseconds.
define build-testdata define build-testdata
$(built-program-cmd-before-env) $(run-program-env) LANGUAGE=C \ $(built-program-cmd) -d $(testdata) -y ./yearistype $<; \
$(built-program-cmd-after-env) -d $(testdata) -y ./yearistype $<; \
$(evaluate-test) $(evaluate-test)
endef endef