From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11718 invoked by alias); 28 Jul 2011 20:29:24 -0000 Received: (qmail 11708 invoked by uid 22791); 28 Jul 2011 20:29:22 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,TW_SV X-Spam-Check-By: sourceware.org Received: from smtp11.smtpout.orange.fr (HELO smtp.smtpout.orange.fr) (80.12.242.133) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Jul 2011 20:29:05 +0000 Received: from treguer.localnet ([90.32.163.132]) by mwinf5d34 with ME id DYV31h0072riECi03YV4rU; Thu, 28 Jul 2011 22:29:04 +0200 X-ME-engine: default From: "Yann E. MORIN" To: crossgcc@sourceware.org Subject: Re: [PATCH 3 of 5] scripts/eglibc: add support for locales Date: Thu, 28 Jul 2011 20:29:00 -0000 User-Agent: KMail/1.13.5 (Linux/3.0.0-treguer; KDE/4.4.5; x86_64; ; ) Cc: =?utf-8?q?Beno=C3=AEt_TH=C3=89BAUDEAU?= References: <3b3715d0f1d412df91e4.1311880211@advlt005-ubuntu> In-Reply-To: <3b3715d0f1d412df91e4.1311880211@advlt005-ubuntu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201107282229.02984.yann.morin.1998@anciens.enib.fr> Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00050.txt.bz2 Beno=C3=AEt, All, On Thursday 28 July 2011 21:10:11 Beno=C3=AEt TH=C3=89BAUDEAU wrote: > # HG changeset patch > # User "Beno=C3=AEt TH=C3=89BAUDEAU" > # Date 1311851059 -7200 > # Node ID 3b3715d0f1d412df91e472ed563d0cde0afedc6b > # Parent 4fed02058cc3276180d6014899062f83e620eb37 > scripts/eglibc: add support for locales Patch is globally good, but for a few issues, see inlined below. > Signed-off-by: "Beno=C3=AEt TH=C3=89BAUDEAU" >=20 > diff --git a/scripts/build/libc/eglibc.sh b/scripts/build/libc/eglibc.sh > --- a/scripts/build/libc/eglibc.sh > +++ b/scripts/build/libc/eglibc.sh > @@ -14,6 +14,7 @@ > # snapshots available. > do_libc_get() { > local addon > + local -a extra_addons > local svn_base >=20=20 > if [ "${CT_EGLIBC_HTTP}" =3D "y" ]; then > @@ -31,7 +32,11 @@ > "${svn_base}/libc" \ > "${CT_EGLIBC_REVISION:-HEAD}" >=20=20 > - for addon in $(do_libc_add_ons_list " "); do > + if [ "${CT_LIBC_LOCALES}" =3D "y" ]; then > + extra_addons+=3D("localedef") > + fi > + > + for addon in $(do_libc_add_ons_list " ") ${extra_addons[@]}; do Always quote variable expansion, unless it is strictly required not to. In the array-variables, expansion of "${foo[@]}" expands to as many entries there are in the array, not to a single entry, exactly like "$@" does for args. Similarly, "${foo[*]}" behaves like "$*". Here, we want a word for each entry in the array 'extra_addons', even if those entries have embedded spaces (I doubt any sane add-on would ever have a space in its name, but never ever trust developpers' insanity after 10+ coffees and a 20+ hours stuck in front of a screen! :-]) > # Never ever try to download these add-ons, > # they've always been internal > case "${addon}" in > @@ -97,13 +102,69 @@ > } >=20=20 > # Extract the files required for the libc locales > -# Nothing to do > do_libc_locales_extract() { > - : > + CT_Extract "eglibc-localedef-${CT_LIBC_VERSION}" > + CT_Patch "eglibc" "localedef-${CT_LIBC_VERSION}" > } >=20=20 > # Build and install the libc locales > -# Not yet supported > do_libc_locales() { > - : > + local libc_src_dir=3D"${CT_SRC_DIR}/eglibc-${CT_LIBC_VERSION}" > + local src_dir=3D"${CT_SRC_DIR}/eglibc-localedef-${CT_LIBC_VERSION}" > + local -a extra_config > + local -a localedef_opts > + > + mkdir -p "${CT_BUILD_DIR}/build-localedef" > + cd "${CT_BUILD_DIR}/build-localedef" > + > + CT_DoLog EXTRA "Configuring C library localedef" > + > + if [ "${CT_LIBC_EGLIBC_HAS_PKGVERSION_BUGURL}" =3D "y" ]; then > + extra_config+=3D("--with-pkgversion=3D${CT_PKGVERSION}") > + [ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=3D("--with-bugu= rl=3D${CT_TOOLCHAIN_BUGURL}") > + fi > + > + CT_DoLog DEBUG "Extra config args passed: '${extra_config[*]}'" > + > + # ./configure is misled by our tools override wrapper for bash > + # so just tell it where the real bash is _on_the_target_! > + # Notes: > + # - ${ac_cv_path_BASH_SHELL} is only used to set BASH_SHELL > + # - ${BASH_SHELL} is only used to set BASH > + # - ${BASH} is only used to set the shebang > + # in two scripts to run on the target > + # So we can safely bypass bash detection at compile time. > + # Should this change in a future eglibc release, we'd better > + # directly mangle the generated scripts _after_ they get built, > + # or even after they get installed... eglibc is such a sucker... > + echo "ac_cv_path_BASH_SHELL=3D/bin/bash" >>config.cache > + > + # Configure with --prefix the way we want it on the target... > + > + CT_DoExecLog CFG \ > + "${src_dir}/configure" \ > + --prefix=3D/usr \ > + --cache-file=3D"$(pwd)/config.cache" \ > + --with-glibc=3D"${libc_src_dir}" \ > + "${extra_config[@]}" > + > + CT_DoLog EXTRA "Building C library localedef" > + CT_DoExecLog ALL make ${JOBSFLAGS} > + > + # Set the localedef endianness option > + case "${CT_ARCH_BE},${CT_ARCH_LE}" in > + y,) localedef_opts+=3D(--big-endian);; > + ,y) localedef_opts+=3D(--little-endian);; > + esac > + > + # Set the localedef option for the target's uint32_t alignment in by= tes. > + # This is target-specific, but for now, 32-bit alignment should work= for all > + # supported targets, even 64-bit ones. > + localedef_opts+=3D(--uint32-align=3D4) > + > + CT_DoLog EXTRA "Installing C library locales" > + CT_DoExecLog ALL make ${JOBSFLAGS} \ > + "LOCALEDEF_OPTS=3D${localedef_opts[*]}" \ > + install_root=3D"${CT_SYSROOT_DIR}" \ > + install-locales > } Otherwise looks good. Thank you! Regards, Yann E. MORIN. --=20 .-----------------.--------------------.------------------.----------------= ----. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspira= cy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ = | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is = no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspirac= y. | '------------------------------^-------^------------------^----------------= ----' -- For unsubscribe information see http://sourceware.org/lists.html#faq