From patchwork Fri Nov 27 15:21:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 549498 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 950E31402DD for ; Sat, 28 Nov 2015 02:21:49 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=ZCXGJC07; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=gk0 wSLzXNb11um19C2QLW27Gy6z8OxfP+DlP2J39xMcJNT4++/JyjgamPwukuJnVhEK 4GoGXtRB2d9ndDApNQr2ArVkAI9F/bCZe37nhfVYh1F0RkXe8un2q8SPOiC7ERhG +52fKwwi8eRafikriLyjv9NrLAw1G7JnfzAGY+ss= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type:content-transfer-encoding; s=default; bh=jcKaiPXsz 5cvSytZ0eM73qZVqME=; b=ZCXGJC07w6KCoOGie8wyc9Zt1Sf8asDuZJBwOJHyA vx5AaGcXjreAZ74Sma8kzyPWnagZ/m8qU7pFREdDxe9xJWSAV//y+9dvKj3a0ket 8sAlHqOzwxHWrxLueXm1zHqaUXRydX0Ot/30jZwjyxDHm02DVV7KUdVdFhDZW6gr Ts= Received: (qmail 89274 invoked by alias); 27 Nov 2015 15:21:43 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 89258 invoked by uid 89); 27 Nov 2015 15:21:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com To: GNU C Library From: "Carlos O'Donell" Subject: [COMMITTED] BZ #14259: Rename localedir to complocaledir. X-Enigmail-Draft-Status: N1110 Message-ID: <56587503.90009@redhat.com> Date: Fri, 27 Nov 2015 10:21:39 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 Rename localedir to complocaledir (bug 14259). In preparation to fix the --localedir configure argument we must move the existing conflicting definition of localedir to a more appropriate name. Given that all current internal uses of localedir relate to the compiled locales we rename to complocaledir. 2015-11-27 Carlos O'Donell [BZ #14259] * Makeconfig: Rename localedir to complocaledir. Rename inst_localedir to inst_complocaledir. * aclocal.m4: Rename libc_cv_localedir to libc_cv_complocaledir. * config.make.in: Use complocaledir and libc_cv_complocaledir. * configure.ac: Use libc_cv_complocaledir. * configure: Regenerate. * locale/Makefile: Use complocaledir. Rename define -DLOCALEDIR to -DCOMPLOCALEDIR. * locale/findlocale.c: Use COMPLOCALEDIR. * locale/loadarchive.c: Likewise. * locale/programs/locale.c: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locarchive.c: Likewise. * localedata/Makefile: Use inst_complocaledir. * sysdeps/gnu/configure: Regenerate. * sysdeps/hppa/configure: Regenerate. * sysdeps/unix/sysv/linux/aarch64/configure: Regenerate. * sysdeps/unix/sysv/linux/mips/configure: Regenerate. * sysdeps/unix/sysv/linux/powerpc/powerpc64/configure: Regenerate. * sysdeps/unix/sysv/linux/s390/s390-64/configure: Regenerate. * sysdeps/unix/sysv/linux/sparc/sparc64/configure: Regenerate. * sysdeps/unix/sysv/linux/x86_64/64/configure: Regenerate. * sysdeps/unix/sysv/linux/x86_64/x32/configure: Regenerate. diff --git a/Makeconfig b/Makeconfig index 3c5d71e..76947c6 100644 --- a/Makeconfig +++ b/Makeconfig @@ -190,11 +190,12 @@ zonedir = $(datadir)/zoneinfo endif inst_zonedir = $(install_root)$(zonedir) -# Where to install the locale files. -ifndef localedir -localedir = $(libdir)/locale +# Where to install the compiled binary locale archive and compiled +# binary locale files. +ifndef complocaledir +complocaledir = $(libdir)/locale endif -inst_localedir = $(install_root)$(localedir) +inst_complocaledir = $(install_root)$(complocaledir) # Where to install the message catalog data files (which are # machine-independent). diff --git a/aclocal.m4 b/aclocal.m4 index abc34d2..3d64f77 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -296,7 +296,7 @@ case "$prefix" in if test "$libdir" = '${exec_prefix}/lib'; then libdir='${exec_prefix}/$1'; # Locale data can be shared between 32-bit and 64-bit libraries. - libc_cv_localedir='${exec_prefix}/lib/locale' + libc_cv_complocaledir='${exec_prefix}/lib/locale' fi ;; esac]) diff --git a/config.make.in b/config.make.in index ba9c60d..05ed6ec 100644 --- a/config.make.in +++ b/config.make.in @@ -12,7 +12,7 @@ datadir = @datadir@ libdir = @libdir@ slibdir = @libc_cv_slibdir@ rtlddir = @libc_cv_rtlddir@ -localedir = @libc_cv_localedir@ +complocaledir = @libc_cv_complocaledir@ sysconfdir = @libc_cv_sysconfdir@ libexecdir = @libexecdir@ rootsbindir = @libc_cv_rootsbindir@ diff --git a/configure.ac b/configure.ac index cd37433..ab18e5d 100644 --- a/configure.ac +++ b/configure.ac @@ -1763,7 +1763,7 @@ fi AC_SUBST(libc_cv_slibdir) AC_SUBST(libc_cv_rtlddir) -AC_SUBST(libc_cv_localedir) +AC_SUBST(libc_cv_complocaledir) AC_SUBST(libc_cv_sysconfdir) AC_SUBST(libc_cv_localstatedir) AC_SUBST(libc_cv_rootsbindir) diff --git a/locale/Makefile b/locale/Makefile index f1b4343..75afbe1 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -76,12 +76,15 @@ C-translit.h: C-translit.h.in gen-translit.pl $(PERL) gen-translit.pl < $< > $@.tmp mv -f $@.tmp $@ -localepath = "$(localedir):$(i18ndir)" +# The path to the compiled binary locale archive or compiled locales, +# along with the parent path to the source locales and source +# charmaps. +localepath = "$(complocaledir):$(i18ndir)" # -Iprograms doesn't really belong here, but this gets it at the head # of the list instead of the tail, where CPPFLAGS-$(lib) gets added. # We need it before the standard -I's to see programs/config.h first. -locale-CPPFLAGS = -DLOCALEDIR='"$(localedir)"' \ +locale-CPPFLAGS = -DCOMPLOCALEDIR='"$(complocaledir)"' \ -DLOCALE_ALIAS_PATH='"$(msgcatdir)"' \ -Iprograms diff --git a/locale/findlocale.c b/locale/findlocale.c index 9e7df12..b96e593 100644 --- a/locale/findlocale.c +++ b/locale/findlocale.c @@ -56,7 +56,7 @@ struct __locale_data *const _nl_C[] attribute_hidden = which are somehow addressed. */ struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST]; -const char _nl_default_locale_path[] attribute_hidden = LOCALEDIR; +const char _nl_default_locale_path[] attribute_hidden = COMPLOCALEDIR; /* Checks if the name is actually present, that is, not NULL and not empty. */ diff --git a/locale/loadarchive.c b/locale/loadarchive.c index 3e18cf0..744b61f 100644 --- a/locale/loadarchive.c +++ b/locale/loadarchive.c @@ -42,7 +42,7 @@ /* Name of the locale archive file. */ -static const char archfname[] = LOCALEDIR "/locale-archive"; +static const char archfname[] = COMPLOCALEDIR "/locale-archive"; /* Size of initial mapping window, optimal if large enough to cover the header plus the initial locale. */ diff --git a/locale/programs/locale.c b/locale/programs/locale.c index b1de17f..c8995ad 100644 --- a/locale/programs/locale.c +++ b/locale/programs/locale.c @@ -45,7 +45,7 @@ #include "../locarchive.h" #include -#define ARCHIVE_NAME LOCALEDIR "/locale-archive" +#define ARCHIVE_NAME COMPLOCALEDIR "/locale-archive" /* If set print the name of the category. */ static int show_category_name; @@ -325,9 +325,11 @@ select_dirs (const struct dirent *dirent) #endif { struct stat64 st; - char buf[sizeof (LOCALEDIR) + strlen (dirent->d_name) + 1]; + char buf[sizeof (COMPLOCALEDIR) + + strlen (dirent->d_name) + 1]; - stpcpy (stpcpy (stpcpy (buf, LOCALEDIR), "/"), dirent->d_name); + stpcpy (stpcpy (stpcpy (buf, COMPLOCALEDIR), "/"), + dirent->d_name); if (stat64 (buf, &st) == 0) mode = st.st_mode; @@ -444,17 +446,21 @@ write_locales (void) first_locale = 0; /* Now we can look for all files in the directory. */ - ndirents = scandir (LOCALEDIR, &dirents, select_dirs, alphasort); + ndirents = scandir (COMPLOCALEDIR, &dirents, select_dirs, + alphasort); for (cnt = 0; cnt < ndirents; ++cnt) { /* Test whether at least the LC_CTYPE data is there. Some directories only contain translations. */ - char buf[sizeof (LOCALEDIR) + strlen (dirents[cnt]->d_name) - + sizeof "/LC_IDENTIFICATION"]; + char buf[sizeof (COMPLOCALEDIR) + + strlen (dirents[cnt]->d_name) + + sizeof "/LC_IDENTIFICATION"]; char *enddir; struct stat64 st; - stpcpy (enddir = stpcpy (stpcpy (stpcpy (buf, LOCALEDIR), "/"), + stpcpy (enddir = stpcpy (stpcpy (stpcpy (buf, + COMPLOCALEDIR), + "/"), dirents[cnt]->d_name), "/LC_IDENTIFICATION"); diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c index c8da20b..fd6ca51 100644 --- a/locale/programs/localedef.c +++ b/locale/programs/localedef.c @@ -457,11 +457,11 @@ construct_output_path (char *path) '/'. */ ssize_t n; if (normal == NULL) - n = asprintf (&result, "%s%s/%s%c", - output_prefix ?: "", LOCALEDIR, path, '\0'); + n = asprintf (&result, "%s%s/%s%c", output_prefix ?: "", + COMPLOCALEDIR, path, '\0'); else n = asprintf (&result, "%s%s/%.*s%s%s%c", - output_prefix ?: "", LOCALEDIR, + output_prefix ?: "", COMPLOCALEDIR, (int) (startp - path), path, normal, endp, '\0'); if (n < 0) diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c index 345f9b7..5f91d71 100644 --- a/locale/programs/locarchive.c +++ b/locale/programs/locarchive.c @@ -57,7 +57,7 @@ extern const char *output_prefix; -#define ARCHIVE_NAME LOCALEDIR "/locale-archive" +#define ARCHIVE_NAME COMPLOCALEDIR "/locale-archive" static const char *locnames[] = { diff --git a/localedata/Makefile b/localedata/Makefile index ebf6ac9..8406e73 100644 --- a/localedata/Makefile +++ b/localedata/Makefile @@ -199,7 +199,7 @@ $(rtld-prefix) $(common-objpfx)locale/localedef install-locales: $(INSTALL-SUPPORTED-LOCALES) install-locales-dir: - $(..)./scripts/mkinstalldirs $(inst_localedir) + $(..)./scripts/mkinstalldirs $(inst_complocaledir) $(INSTALL-SUPPORTED-LOCALES): install-locales-dir @locale=`echo $@ | sed -e 's/^install-//'`; \