1.1 --- a/scripts/functions Sat Jun 16 22:23:53 2007 +0000
1.2 +++ b/scripts/functions Sun Jul 01 19:04:20 2007 +0000
1.3 @@ -425,7 +425,9 @@
1.4 cd "${file}"
1.5 fi
1.6
1.7 - [ "${CUSTOM_PATCH_ONLY}" = "y" ] || official_patch_dir="${CT_TOP_DIR}/patches/${base_file}/${ver_file}"
1.8 + official_patch_dir=
1.9 + custom_patch_dir=
1.10 + [ "${CUSTOM_PATCH_ONLY}" = "y" ] || official_patch_dir="${CT_LIB_DIR}/patches/${base_file}/${ver_file}"
1.11 [ "${CT_CUSTOM_PATCH}" = "y" ] && custom_patch_dir="${CT_CUSTOM_PATCH_DIR}/${base_file}/${ver_file}"
1.12 for patch_dir in "${official_patch_dir}" "${custom_patch_dir}"; do
1.13 if [ -n "${patch_dir}" -a -d "${patch_dir}" ]; then
1.14 @@ -442,6 +444,24 @@
1.15 CT_Popd
1.16 }
1.17
1.18 +# Two wrappers to call config.(guess|sub) either from CT_TOP_DIR or CT_LIB_DIR.
1.19 +# Those from CT_TOP_DIR, if they exist, will be be more recent than those from CT_LIB_DIR.
1.20 +CT_DoConfigGuess() {
1.21 + if [ -x "${CT_TOP_DIR}/tools/config.guess" ]; then
1.22 + "${CT_TOP_DIR}/tools/config.guess"
1.23 + else
1.24 + "${CT_LIB_DIR}/tools/config.guess"
1.25 + fi
1.26 +}
1.27 +
1.28 +CT_DoConfigSub() {
1.29 + if [ -x "${CT_TOP_DIR}/tools/config.sub" ]; then
1.30 + "${CT_TOP_DIR}/tools/config.sub" "$@"
1.31 + else
1.32 + "${CT_LIB_DIR}/tools/config.sub" "$@"
1.33 + fi
1.34 +}
1.35 +
1.36 # Compute the target triplet from what is provided by the user
1.37 # Usage: CT_DoBuildTargetTriplet
1.38 # In fact this function takes the environment variables to build the target
1.39 @@ -482,7 +502,7 @@
1.40 glibc) CT_TARGET="${CT_TARGET}-gnu";;
1.41 uClibc) CT_TARGET="${CT_TARGET}-uclibc";;
1.42 esac
1.43 - CT_TARGET="`${CT_TOP_DIR}/tools/config.sub ${CT_TARGET}`"
1.44 + CT_TARGET=`CT_DoConfigSub "${CT_TARGET}"`
1.45 }
1.46
1.47 # This function does pause the build until the user strikes "Return"