summaryrefslogtreecommitdiff
path: root/scripts/build/libc/eglibc.sh
diff options
context:
space:
mode:
authorArnaud Vrac <avrac@freebox.fr>2009-10-09 14:22:09 (GMT)
committerArnaud Vrac <avrac@freebox.fr>2009-10-09 14:22:09 (GMT)
commite11863d1676b57e0df80a6ef5b5d9296d8a176cd (patch)
tree5ce924b6827463300bc0e6b9a4be58b78271bfad /scripts/build/libc/eglibc.sh
parentbc7cfc95ad5509e49075b0d37cdcc279e594179b (diff)
eglibc: add support for user provided option groups
Signed-off-by: Arnaud Vrac <avrac@freebox.fr>
Diffstat (limited to 'scripts/build/libc/eglibc.sh')
-rw-r--r--scripts/build/libc/eglibc.sh53
1 files changed, 51 insertions, 2 deletions
diff --git a/scripts/build/libc/eglibc.sh b/scripts/build/libc/eglibc.sh
index e2bd37b..bea789f 100644
--- a/scripts/build/libc/eglibc.sh
+++ b/scripts/build/libc/eglibc.sh
@@ -122,9 +122,50 @@ do_libc_extract() {
return 0
}
-# There is nothing to do for eglibc check config
+# Copy user provided eglibc configuration file if provided
do_libc_check_config() {
- :
+ if [ "${CT_EGLIBC_CUSTOM_CONFIG}" != "y" ]; then
+ return 0
+ fi
+
+ CT_DoStep INFO "Checking C library configuration"
+
+ CT_TestOrAbort "You did not provide an eglibc config file!" \
+ -n "${CT_EGLIBC_OPTION_GROUPS_FILE}" -a \
+ -f "${CT_EGLIBC_OPTION_GROUPS_FILE}"
+
+ CT_DoExecLog ALL cp "${CT_EGLIBC_OPTION_GROUPS_FILE}" "${CT_CONFIG_DIR}/eglibc.config"
+
+ # NSS configuration
+ if grep -E '^OPTION_EGLIBC_NSSWITCH[[:space:]]*=[[:space:]]*n' "${CT_EGLIBC_OPTION_GROUPS_FILE}" >/dev/null 2>&1; then
+ CT_DoLog DEBUG "Using fixed-configuration nsswitch facility"
+
+ if [ "${CT_EGLIBC_BUNDLED_NSS_CONFIG}" = "y" ]; then
+ nss_config="${CT_SRC_DIR}/eglibc-${CT_LIBC_VERSION}/nss/fixed-nsswitch.conf"
+ else
+ nss_config="${CT_EGLIBC_NSS_CONFIG_FILE}"
+ fi
+ CT_TestOrAbort "NSS config file not found!" -n "${nss_config}" -a -f "${nss_config}"
+
+ CT_DoExecLog ALL cp "${nss_config}" "${CT_CONFIG_DIR}/nsswitch.config"
+ echo "OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG = ${CT_CONFIG_DIR}/nsswitch.config" \
+ >> "${CT_CONFIG_DIR}/eglibc.config"
+
+ if [ "${CT_EGLIBC_BUNDLED_NSS_FUNCTIONS}" = "y" ]; then
+ nss_functions="${CT_SRC_DIR}/eglibc-${CT_LIBC_VERSION}/nss/fixed-nsswitch.functions"
+ else
+ nss_functions="${CT_EGLIBC_NSS_FUNCTIONS_FILE}"
+ fi
+ CT_TestOrAbort "NSS functions file not found!" -n "${nss_functions}" -a -f "${nss_functions}"
+
+ CT_DoExecLog ALL cp "${nss_functions}" "${CT_CONFIG_DIR}/nsswitch.functions"
+ echo "OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS = ${CT_CONFIG_DIR}/nsswitch.functions" \
+ >> "${CT_CONFIG_DIR}/eglibc.config"
+ else
+ CT_DoLog DEBUG "Using full-blown nsswitch facility"
+ fi
+
+ CT_EndStep
}
# This function installs the eglibc headers needed to build the core compiler
@@ -143,6 +184,10 @@ do_libc_start_files() {
CT_DoLog EXTRA "Configuring C library"
+ if [ "${CT_EGLIBC_CUSTOM_CONFIG}" = "y" ]; then
+ CT_DoExecLog ALL cp "${CT_CONFIG_DIR}/eglibc.config" option-groups.config
+ fi
+
cross_cc=$(CT_Which "${CT_TARGET}-gcc")
cross_cxx=$(CT_Which "${CT_TARGET}-g++")
cross_ar=$(CT_Which "${CT_TARGET}-ar")
@@ -210,6 +255,10 @@ do_libc() {
CT_DoLog EXTRA "Configuring C library"
+ if [ "${CT_EGLIBC_CUSTOM_CONFIG}" = "y" ]; then
+ CT_DoExecLog ALL cp "${CT_CONFIG_DIR}/eglibc.config" option-groups.config
+ fi
+
# Add some default glibc config options if not given by user.
# We don't need to be conditional on wether the user did set different
# values, as they CT_LIBC_GLIBC_EXTRA_CONFIG is passed after extra_config