Index: glibc-2.14.ebuild =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.14.ebuild,v --- glibc-2.14.ebuild 1 Sep 2011 05:09:07 -0000 1.9 +++ glibc-2.14.ebuild 20 Sep 2011 01:54:10 -0000 @@ -39,7 +39,7 @@ LT_VER="" NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires #LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires -IUSE="debug gd glibc-omitfp hardened multilib nls selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl nptlonly}" +IUSE="compile-locales debug gd glibc-omitfp hardened multilib nls profile selinux vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl nptlonly}" [[ -n ${RELEASE_VER} ]] && S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}} # Here's how the cross-compile logic breaks down ... Index: metadata.xml =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-libs/glibc/metadata.xml,v --- metadata.xml 3 Sep 2011 09:11:04 -0000 1.6 +++ metadata.xml 20 Sep 2011 01:54:10 -0000 @@ -3,8 +3,11 @@ toolchain - Configure glibc with --enable-omitfp which lets - the build system determine when it is safe to use + build *all* locales in src_install; this + is generally meant for stage building only as it ignores the user's + /etc/locale.gen file and can be pretty slow + Configure glibc with --enable-omitfp which + lets the build system determine when it is safe to use -fomit-frame-pointer Index: files/eblits/common.eblit =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit,v --- files/eblits/common.eblit 19 Aug 2011 23:03:11 -0000 1.22 +++ files/eblits/common.eblit 20 Sep 2011 01:54:10 -0000 @@ -287,6 +287,20 @@ setup_env() { export __GLIBC_CC CC="${__GLIBC_CC} ${!VAR}" } +run_locale_gen() { + # if the host locales.gen contains no entries, we'll install everything + local root="$1" + local locale_list="${root}/etc/locale.gen" + if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then + ewarn "Generating all locales; edit /etc/locale.gen to save time/space" + locale_list="${root}/usr/share/i18n/SUPPORTED" + fi + + local x jobs + for x in ${MAKEOPTS} ; do [[ ${x} == -j* ]] && jobs=${x#-j} ; done + locale-gen -j ${jobs:-1} --config "${locale_list}" +} + just_headers() { is_crosscompile && use crosscompile_opts_headers-only } Index: files/eblits/pkg_postinst.eblit =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_postinst.eblit,v --- files/eblits/pkg_postinst.eblit 1 Mar 2009 21:06:22 -0000 1.1 +++ files/eblits/pkg_postinst.eblit 20 Sep 2011 01:54:10 -0000 @@ -16,14 +16,6 @@ eblit-glibc-pkg_postinst() { # errors from this step #253697 /sbin/telinit U 2>/dev/null - # if the host locales.gen contains no entries, we'll install everything - local locale_list="${ROOT}etc/locale.gen" - if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then - ewarn "Generating all locales; edit /etc/locale.gen to save time/space" - locale_list="${ROOT}usr/share/i18n/SUPPORTED" - fi - local x jobs - for x in ${MAKEOPTS} ; do [[ ${x} == -j* ]] && jobs=${x#-j} ; done - locale-gen -j ${jobs:-1} --config "${locale_list}" + use compile-locales || run_locale_gen "${ROOT}" fi } Index: files/eblits/src_install.eblit =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_install.eblit,v --- files/eblits/src_install.eblit 8 Jul 2011 15:38:29 -0000 1.15 +++ files/eblits/src_install.eblit 20 Sep 2011 01:54:10 -0000 @@ -170,6 +170,11 @@ toolchain-glibc_src_install() { # Prevent overwriting of the /etc/localtime symlink. We'll handle the # creation of the "factory" symlink in pkg_postinst(). rm -f "${D}"/etc/localtime + + # Generate all locales if this is a native build as locale generation + if use compile-locales && ! is_crosscompile ; then + run_locale_gen "${D}" + fi } toolchain-glibc_headers_install() {