scripts/build/libc/eglibc.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 31 00:20:44 2011 +0200 (2011-05-31)
changeset 2495 98b02f85db29
parent 2483 fa3a18f9abcf
child 2496 cc9b84a83b34
permissions -rw-r--r--
libc/eglibc: use generic SVN functions

eglibc is only available from SVN. The script currently calls svn
in its own tortuous and convoluted way.

Use the egeneric SVN extract functions, and sinplify the eglibc
download function.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 # eglibc build functions (initially by Thomas JOURDAN).
     2 
     3 # Add the definitions common to glibc and eglibc
     4 #   do_libc_extract
     5 #   do_libc_start_files
     6 #   do_libc
     7 #   do_libc_finish
     8 #   do_libc_add_ons_list
     9 #   do_libc_min_kernel_config
    10 . "${CT_LIB_DIR}/scripts/build/libc/glibc-eglibc.sh-common"
    11 
    12 # Download glibc
    13 # eglibc is only available through subversion, there are no
    14 # snapshots available.
    15 do_libc_get() {
    16     local addon
    17     local svn_base="svn://svn.eglibc.org"
    18 
    19     case "${CT_LIBC_VERSION}" in
    20         trunk)  svn_base+="/trunk";;
    21         *)      svn_base+="/branches/eglibc-${CT_LIBC_VERSION}";;
    22     esac
    23 
    24     CT_GetSVN "eglibc-${CT_LIBC_VERSION}"   \
    25               "${svn_base}/libc"            \
    26               "${CT_EGLIBC_REVISION:-HEAD}"
    27 
    28     for addon in $(do_libc_add_ons_list " "); do
    29         CT_GetSVN "eglibc-${addon}-${CT_LIBC_VERSION}"  \
    30                   "${svn_base}/${addon}"                \
    31                   "${CT_EGLIBC_REVISION:-HEAD}"
    32     done
    33 }
    34 
    35 # Copy user provided eglibc configuration file if provided
    36 do_libc_check_config() {
    37     if [ "${CT_EGLIBC_CUSTOM_CONFIG}" != "y" ]; then
    38         return 0
    39     fi
    40 
    41     CT_DoStep INFO "Checking C library configuration"
    42 
    43     CT_TestOrAbort "You did not provide an eglibc config file!" \
    44         -n "${CT_EGLIBC_OPTION_GROUPS_FILE}" -a \
    45         -f "${CT_EGLIBC_OPTION_GROUPS_FILE}"
    46 
    47     CT_DoExecLog ALL cp "${CT_EGLIBC_OPTION_GROUPS_FILE}" "${CT_CONFIG_DIR}/eglibc.config"
    48 
    49     # NSS configuration
    50     if grep -E '^OPTION_EGLIBC_NSSWITCH[[:space:]]*=[[:space:]]*n' "${CT_EGLIBC_OPTION_GROUPS_FILE}" >/dev/null 2>&1; then
    51         CT_DoLog DEBUG "Using fixed-configuration nsswitch facility"
    52 
    53         if [ "${CT_EGLIBC_BUNDLED_NSS_CONFIG}" = "y" ]; then
    54             nss_config="${CT_SRC_DIR}/eglibc-${CT_LIBC_VERSION}/nss/fixed-nsswitch.conf"
    55         else
    56             nss_config="${CT_EGLIBC_NSS_CONFIG_FILE}"
    57         fi
    58         CT_TestOrAbort "NSS config file not found!" -n "${nss_config}" -a -f "${nss_config}"
    59 
    60         CT_DoExecLog ALL cp "${nss_config}" "${CT_CONFIG_DIR}/nsswitch.config"
    61         echo "OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG = ${CT_CONFIG_DIR}/nsswitch.config" \
    62             >> "${CT_CONFIG_DIR}/eglibc.config"
    63 
    64         if [ "${CT_EGLIBC_BUNDLED_NSS_FUNCTIONS}" = "y" ]; then
    65             nss_functions="${CT_SRC_DIR}/eglibc-${CT_LIBC_VERSION}/nss/fixed-nsswitch.functions"
    66         else
    67             nss_functions="${CT_EGLIBC_NSS_FUNCTIONS_FILE}"
    68         fi
    69         CT_TestOrAbort "NSS functions file not found!" -n "${nss_functions}" -a -f "${nss_functions}"
    70 
    71         CT_DoExecLog ALL cp "${nss_functions}" "${CT_CONFIG_DIR}/nsswitch.functions"
    72         echo "OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS = ${CT_CONFIG_DIR}/nsswitch.functions" \
    73             >> "${CT_CONFIG_DIR}/eglibc.config"
    74     else
    75         CT_DoLog DEBUG "Using full-blown nsswitch facility"
    76     fi
    77 
    78     CT_EndStep
    79 }