From 8f32ebcc88e6597dc16e59789ca1f63909d28215 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 29 May 2011 19:24:41 +0200 Subject: libc/glibc: commonalise extraction btw glibc and eglibc glibc and eglibc have a very similar extraction process, so it makes sense to commonalise it. Signed-off-by: "Yann E. MORIN" diff --git a/scripts/build/libc/eglibc.sh b/scripts/build/libc/eglibc.sh index 680d6c4..ea68b22 100644 --- a/scripts/build/libc/eglibc.sh +++ b/scripts/build/libc/eglibc.sh @@ -1,10 +1,12 @@ # eglibc build functions (initially by Thomas JOURDAN). # Add the definitions common to glibc and eglibc +# do_libc_extract # do_libc_start_files # do_libc # do_libc_finish # do_libc_add_ons_list +# do_libc_min_kernel_config . "${CT_LIB_DIR}/scripts/build/libc/glibc-eglibc.sh-common" # Download eglibc repository @@ -98,48 +100,6 @@ do_libc_get() { return 0 } -# Extract eglibc -do_libc_extract() { - CT_Extract "eglibc-${CT_LIBC_VERSION}" - CT_Patch "eglibc" "${CT_LIBC_VERSION}" - - # C library addons - for addon in $(do_libc_add_ons_list " "); do - # NPTL addon is not to be extracted, in any case - [ "${addon}" = "nptl" ] && continue || true - CT_Pushd "${CT_SRC_DIR}/eglibc-${CT_LIBC_VERSION}" - CT_Extract nochdir "eglibc-${addon}-${CT_LIBC_VERSION}" - - CT_TestAndAbort "Error in add-on '${addon}': both short and long names in tarball" \ - -d "${addon}" -a -d "eglibc-${addon}-${CT_LIBC_VERSION}" - - # Some addons have the 'long' name, while others have the - # 'short' name, but patches are non-uniformly built with - # either the 'long' or 'short' name, whatever the addons name - # but we prefer the 'short' name and avoid duplicates. - if [ -d "eglibc-${addon}-${CT_LIBC_VERSION}" ]; then - mv "eglibc-${addon}-${CT_LIBC_VERSION}" "${addon}" - fi - - ln -s "${addon}" "eglibc-${addon}-${CT_LIBC_VERSION}" - - CT_Patch nochdir "eglibc" "${addon}-${CT_LIBC_VERSION}" - - # Remove the long name since it can confuse configure scripts to run - # the same source twice. - rm "eglibc-${addon}-${CT_LIBC_VERSION}" - - CT_Popd - done - - # The configure files may be older than the configure.in files - # if using a snapshot (or even some tarballs). Fake them being - # up to date. - find "${CT_SRC_DIR}/eglibc-${CT_LIBC_VERSION}" -type f -name configure -exec touch {} \; 2>&1 |CT_DoLog ALL - - return 0 -} - # Copy user provided eglibc configuration file if provided do_libc_check_config() { if [ "${CT_EGLIBC_CUSTOM_CONFIG}" != "y" ]; then diff --git a/scripts/build/libc/glibc-eglibc.sh-common b/scripts/build/libc/glibc-eglibc.sh-common index f200ef5..8306f82 100644 --- a/scripts/build/libc/glibc-eglibc.sh-common +++ b/scripts/build/libc/glibc-eglibc.sh-common @@ -1,5 +1,49 @@ # This file contains the functions common to glibc and eglibc +# Extract the C library tarball(s) +do_libc_extract() { + local addon + + # Extract the main tarball + CT_Extract "${CT_LIBC}-${CT_LIBC_VERSION}" + CT_Pushd "${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}" + CT_Patch nochdir "${CT_LIBC}" "${CT_LIBC_VERSION}" + + # Extract the add-opns + for addon in $(do_libc_add_ons_list " "); do + # NPTL addon is not to be extracted, in any case + [ "${addon}" = "nptl" ] && continue || true + + CT_Extract nochdir "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" + + CT_TestAndAbort "Error in add-on '${addon}': both short and long names in tarball" \ + -d "${addon}" -a -d "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" + + # Some addons have the 'long' name, while others have the + # 'short' name, but patches are non-uniformly built with + # either the 'long' or 'short' name, whatever the addons name + # but we prefer the 'short' name and avoid duplicates. + if [ -d "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" ]; then + mv "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" "${addon}" + fi + + ln -s "${addon}" "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" + + CT_Patch nochdir "${CT_LIBC}" "${addon}-${CT_LIBC_VERSION}" + + # Remove the long name since it can confuse configure scripts to run + # the same source twice. + rm "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" + done + + # The configure files may be older than the configure.in files + # if using a snapshot (or even some tarballs). Fake them being + # up to date. + find . -type f -name configure -exec touch {} \; 2>&1 |CT_DoLog ALL + + CT_Popd +} + # Build and install headers and start files do_libc_start_files() { local src_dir="${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}" diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index 00f5d4b..4473138 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -3,6 +3,7 @@ # Licensed under the GPL v2. See COPYING in the root of this package # Add the definitions common to glibc and eglibc +# do_libc_extract # do_libc_start_files # do_libc # do_libc_finish @@ -37,54 +38,6 @@ do_libc_get() { return 0 } -# Extract glibc -do_libc_extract() { - local -a addons_list - - addons_list=($(do_libc_add_ons_list " ")) - - CT_Extract "glibc-${CT_LIBC_VERSION}" - - CT_Pushd "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}" - CT_Patch nochdir "glibc" "${CT_LIBC_VERSION}" - - # C library addons - for addon in "${addons_list[@]}"; do - # NPTL addon is not to be extracted, in any case - [ "${addon}" = "nptl" ] && continue || true - CT_Extract nochdir "glibc-${addon}-${CT_LIBC_VERSION}" - - CT_TestAndAbort "Error in add-on '${addon}': both short and long names in tarball" \ - -d "${addon}" -a -d "glibc-${addon}-${CT_LIBC_VERSION}" - - # Some addons have the 'long' name, while others have the - # 'short' name, but patches are non-uniformly built with - # either the 'long' or 'short' name, whatever the addons name - # but we prefer the 'short' name and avoid duplicates. - if [ -d "glibc-${addon}-${CT_LIBC_VERSION}" ]; then - mv "glibc-${addon}-${CT_LIBC_VERSION}" "${addon}" - fi - - ln -s "${addon}" "glibc-${addon}-${CT_LIBC_VERSION}" - - CT_Patch nochdir "glibc" "${addon}-${CT_LIBC_VERSION}" - - # Remove the long name since it can confuse configure scripts to run - # the same source twice. - rm "glibc-${addon}-${CT_LIBC_VERSION}" - done - - # The configure files may be older than the configure.in files - # if using a snapshot (or even some tarballs). Fake them being - # up to date. - sleep 2 - find . -type f -name configure -exec touch {} \; 2>&1 |CT_DoLog ALL - - CT_Popd - - return 0 -} - # There is nothing to do for glibc check config do_libc_check_config() { : -- cgit v0.10.2-6-g49f6