1.1 --- a/scripts/build/libc/glibc.sh Sat Jun 04 17:15:58 2011 +0200
1.2 +++ b/scripts/build/libc/glibc.sh Mon Feb 13 21:51:48 2012 +0100
1.3 @@ -55,3 +55,73 @@
1.4 do_libc_check_config() {
1.5 :
1.6 }
1.7 +
1.8 +# Extract the files required for the libc locales
1.9 +# Nothing to do
1.10 +do_libc_locales_extract() {
1.11 + :
1.12 +}
1.13 +
1.14 +# Build and install the libc locales
1.15 +do_libc_locales() {
1.16 + local src_dir="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}"
1.17 + local -a extra_config
1.18 + local glibc_cflags
1.19 +
1.20 + mkdir -p "${CT_BUILD_DIR}/build-localedef"
1.21 + cd "${CT_BUILD_DIR}/build-localedef"
1.22 +
1.23 + CT_DoLog EXTRA "Configuring C library localedef"
1.24 +
1.25 + if [ "${CT_LIBC_EGLIBC_HAS_PKGVERSION_BUGURL}" = "y" ]; then
1.26 + extra_config+=("--with-pkgversion=${CT_PKGVERSION}")
1.27 + [ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}")
1.28 + fi
1.29 +
1.30 + CT_DoLog DEBUG "Extra config args passed: '${extra_config[*]}'"
1.31 +
1.32 + glibc_cflags="-O2 -fno-stack-protector"
1.33 + case "${CT_LIBC_ENABLE_FORTIFIED_BUILD}" in
1.34 + y) ;;
1.35 + *) glibc_cflags+=" -U_FORTIFY_SOURCE";;
1.36 + esac
1.37 +
1.38 + # ./configure is misled by our tools override wrapper for bash
1.39 + # so just tell it where the real bash is _on_the_target_!
1.40 + # Notes:
1.41 + # - ${ac_cv_path_BASH_SHELL} is only used to set BASH_SHELL
1.42 + # - ${BASH_SHELL} is only used to set BASH
1.43 + # - ${BASH} is only used to set the shebang
1.44 + # in two scripts to run on the target
1.45 + # So we can safely bypass bash detection at compile time.
1.46 + # Should this change in a future eglibc release, we'd better
1.47 + # directly mangle the generated scripts _after_ they get built,
1.48 + # or even after they get installed... eglibc is such a sucker...
1.49 + echo "ac_cv_path_BASH_SHELL=/bin/bash" >>config.cache
1.50 +
1.51 + # Configure with --prefix the way we want it on the target...
1.52 +
1.53 + CT_DoExecLog CFG \
1.54 + CFLAGS="${glibc_cflags}" \
1.55 + "${src_dir}/configure" \
1.56 + --prefix=/usr \
1.57 + --cache-file="$(pwd)/config.cache" \
1.58 + --without-cvs \
1.59 + --disable-profile \
1.60 + --without-gd \
1.61 + --disable-debug \
1.62 + "${extra_config[@]}"
1.63 +
1.64 + CT_DoLog EXTRA "Building C library localedef"
1.65 + CT_DoExecLog ALL make ${JOBSFLAGS}
1.66 +
1.67 + # The target's endianness and uint32_t alignment should be passed as options
1.68 + # to localedef, but glibc's localedef does not support these options, which
1.69 + # means that the locale files generated here will be suitable for the target
1.70 + # only if it has the same endianness and uint32_t alignment as the host's.
1.71 +
1.72 + CT_DoLog EXTRA "Installing C library locales"
1.73 + CT_DoExecLog ALL make ${JOBSFLAGS} \
1.74 + install_root="${CT_SYSROOT_DIR}" \
1.75 + localedata/install-locales
1.76 +}