Introduce new config option: CT_TARGET_ALIAS_SED_EXPR
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Aug 07 19:40:38 2007 +0000 (2007-08-07)
changeset 321a7ba1352aee1
parent 320 e585ed10bd5b
child 322 3f14c769a4dc
Introduce new config option: CT_TARGET_ALIAS_SED_EXPR
This option is used as a sed expression to pass onto CT_TARGET to create an alias.
config/toolchain.in
scripts/crosstool.sh
     1.1 --- a/config/toolchain.in	Tue Aug 07 18:05:41 2007 +0000
     1.2 +++ b/config/toolchain.in	Tue Aug 07 19:40:38 2007 +0000
     1.3 @@ -81,12 +81,31 @@
     1.4        
     1.5        Keep the default (unkown) if you don't know better.
     1.6  
     1.7 +config TARGET_ALIAS_SED_EXPR
     1.8 +    string
     1.9 +    prompt "Target sed transform"
    1.10 +    default ""
    1.11 +    help
    1.12 +      Normaly, you'd call your toolchain components (especially gcc) by
    1.13 +      prefixing the target triplet followed by a dash and the component name
    1.14 +      (eg. armeb-unknown-linux-uclibc-gcc).
    1.15 +      
    1.16 +      You can enter here a sed expression to be applied to ${CT_TARGET} to
    1.17 +      create an alias for your toolchain.
    1.18 +      
    1.19 +      For example, "s/${CT_TARGET_VENDOR}/foobar/" (without the double quotes)
    1.20 +      will create the armeb-foobar-linux-uclibc alias to the above-mentioned
    1.21 +      toolchain.
    1.22 +      
    1.23 +      You shouldn't need to enter anything here, unless you plan to manually
    1.24 +      call the tools (autotools-based ./configure will use the standard name).
    1.25 +
    1.26  config TARGET_ALIAS
    1.27      string
    1.28      prompt "Target alias"
    1.29      default ""
    1.30      help
    1.31 -      Normaly, you'd call your toolchain component (especially gcc) by
    1.32 +      Normaly, you'd call your toolchain components (especially gcc) by
    1.33        prefixing the target triplet followed by a dash and the component name
    1.34        (eg. armeb-unknown-linux-uclibc-gcc).
    1.35        
     2.1 --- a/scripts/crosstool.sh	Tue Aug 07 18:05:41 2007 +0000
     2.2 +++ b/scripts/crosstool.sh	Tue Aug 07 19:40:38 2007 +0000
     2.3 @@ -436,16 +436,22 @@
     2.4      chmod 755 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
     2.5  
     2.6      # Create the aliases to the target tools
     2.7 -    if [ -n "${CT_TARGET_ALIAS}" ]; then
     2.8 -        CT_DoLog EXTRA "Creating symlinks from \"${CT_TARGET}-*\" to \"${CT_TARGET_ALIAS}-*\""
     2.9 -        CT_Pushd "${CT_PREFIX_DIR}/bin"
    2.10 -        for t in "${CT_TARGET}-"*; do
    2.11 +    CT_DoStep EXTRA "Creating toolchain aliases"
    2.12 +    CT_Pushd "${CT_PREFIX_DIR}/bin"
    2.13 +    for t in "${CT_TARGET}-"*; do
    2.14 +        if [ -n "${CT_TARGET_ALIAS}" ]; then
    2.15              _t="`echo \"$t\" |sed -r -e 's/^'\"${CT_TARGET}\"'-/'\"${CT_TARGET_ALIAS}\"'-/;'`"
    2.16              CT_DoLog DEBUG "Linking \"${_t}\" -> \"${t}\""
    2.17 -            ln -sv "${t}" "${_t}" 2>&1 |CT_DoLog DEBUG
    2.18 -        done
    2.19 -        CT_Popd
    2.20 -    fi
    2.21 +            ln -sv "${t}" "${_t}" 2>&1 |CT_DoLog ALL
    2.22 +        fi
    2.23 +        if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then
    2.24 +            _t="`echo \"$t\" |sed -r -e \"${CT_TARGET_ALIAS_SED_EXPR}\"`"
    2.25 +            CT_DoLog DEBUG "Linking \"${_t}\" -> \"${t}\""
    2.26 +            ln -sv "${t}" "${_t}" 2>&1 |CT_DoLog ALL
    2.27 +        fi
    2.28 +    done
    2.29 +    CT_Popd
    2.30 +    CT_EndStep
    2.31  
    2.32      # Remove the generated documentation files
    2.33      if [ "${CT_REMOVE_DOCS}" = "y" ]; then