scripts/build/libc/eglibc.sh
changeset 1569 a4e30d311569
parent 1552 6ee673ab382e
child 1761 88020b2c3246
     1.1 --- a/scripts/build/libc/eglibc.sh	Fri Oct 02 22:10:17 2009 +0200
     1.2 +++ b/scripts/build/libc/eglibc.sh	Fri Oct 09 16:22:09 2009 +0200
     1.3 @@ -122,9 +122,50 @@
     1.4      return 0
     1.5  }
     1.6  
     1.7 -# There is nothing to do for eglibc check config
     1.8 +# Copy user provided eglibc configuration file if provided
     1.9  do_libc_check_config() {
    1.10 -    :
    1.11 +    if [ "${CT_EGLIBC_CUSTOM_CONFIG}" != "y" ]; then
    1.12 +        return 0
    1.13 +    fi
    1.14 +
    1.15 +    CT_DoStep INFO "Checking C library configuration"
    1.16 +
    1.17 +    CT_TestOrAbort "You did not provide an eglibc config file!" \
    1.18 +        -n "${CT_EGLIBC_OPTION_GROUPS_FILE}" -a \
    1.19 +        -f "${CT_EGLIBC_OPTION_GROUPS_FILE}"
    1.20 +
    1.21 +    CT_DoExecLog ALL cp "${CT_EGLIBC_OPTION_GROUPS_FILE}" "${CT_CONFIG_DIR}/eglibc.config"
    1.22 +
    1.23 +    # NSS configuration
    1.24 +    if grep -E '^OPTION_EGLIBC_NSSWITCH[[:space:]]*=[[:space:]]*n' "${CT_EGLIBC_OPTION_GROUPS_FILE}" >/dev/null 2>&1; then
    1.25 +        CT_DoLog DEBUG "Using fixed-configuration nsswitch facility"
    1.26 +
    1.27 +        if [ "${CT_EGLIBC_BUNDLED_NSS_CONFIG}" = "y" ]; then
    1.28 +            nss_config="${CT_SRC_DIR}/eglibc-${CT_LIBC_VERSION}/nss/fixed-nsswitch.conf"
    1.29 +        else
    1.30 +            nss_config="${CT_EGLIBC_NSS_CONFIG_FILE}"
    1.31 +        fi
    1.32 +        CT_TestOrAbort "NSS config file not found!" -n "${nss_config}" -a -f "${nss_config}"
    1.33 +
    1.34 +        CT_DoExecLog ALL cp "${nss_config}" "${CT_CONFIG_DIR}/nsswitch.config"
    1.35 +        echo "OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG = ${CT_CONFIG_DIR}/nsswitch.config" \
    1.36 +            >> "${CT_CONFIG_DIR}/eglibc.config"
    1.37 +
    1.38 +        if [ "${CT_EGLIBC_BUNDLED_NSS_FUNCTIONS}" = "y" ]; then
    1.39 +            nss_functions="${CT_SRC_DIR}/eglibc-${CT_LIBC_VERSION}/nss/fixed-nsswitch.functions"
    1.40 +        else
    1.41 +            nss_functions="${CT_EGLIBC_NSS_FUNCTIONS_FILE}"
    1.42 +        fi
    1.43 +        CT_TestOrAbort "NSS functions file not found!" -n "${nss_functions}" -a -f "${nss_functions}"
    1.44 +
    1.45 +        CT_DoExecLog ALL cp "${nss_functions}" "${CT_CONFIG_DIR}/nsswitch.functions"
    1.46 +        echo "OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS = ${CT_CONFIG_DIR}/nsswitch.functions" \
    1.47 +            >> "${CT_CONFIG_DIR}/eglibc.config"
    1.48 +    else
    1.49 +        CT_DoLog DEBUG "Using full-blown nsswitch facility"
    1.50 +    fi
    1.51 +
    1.52 +    CT_EndStep
    1.53  }
    1.54  
    1.55  # This function installs the eglibc headers needed to build the core compiler
    1.56 @@ -143,6 +184,10 @@
    1.57  
    1.58      CT_DoLog EXTRA "Configuring C library"
    1.59  
    1.60 +    if [ "${CT_EGLIBC_CUSTOM_CONFIG}" = "y" ]; then
    1.61 +        CT_DoExecLog ALL cp "${CT_CONFIG_DIR}/eglibc.config" option-groups.config
    1.62 +    fi
    1.63 +
    1.64      cross_cc=$(CT_Which "${CT_TARGET}-gcc")
    1.65      cross_cxx=$(CT_Which "${CT_TARGET}-g++")
    1.66      cross_ar=$(CT_Which "${CT_TARGET}-ar")
    1.67 @@ -210,6 +255,10 @@
    1.68  
    1.69      CT_DoLog EXTRA "Configuring C library"
    1.70  
    1.71 +    if [ "${CT_EGLIBC_CUSTOM_CONFIG}" = "y" ]; then
    1.72 +        CT_DoExecLog ALL cp "${CT_CONFIG_DIR}/eglibc.config" option-groups.config
    1.73 +    fi
    1.74 +
    1.75      # Add some default glibc config options if not given by user.
    1.76      # We don't need to be conditional on wether the user did set different
    1.77      # values, as they CT_LIBC_GLIBC_EXTRA_CONFIG is passed after extra_config