# HG changeset patch # User "Yann E. MORIN" # Date 1228860140 0 # Node ID c6a08b4c488c9e160fbc088f4408a9558a6556ce # Parent de1b8818d39b889bba7e29862d7f77700eb0c488 Sanity-check CT_TARGET_VENDOR, CT_TARGET_ALIAS and CT_TARGET_ALIAS_SED_EXPR: - vendor and alias must not contain spaces - vendor must not contain dashes '-' - sed_expr must not generate an alias with a space in it /trunk/scripts/functions | 17 16 1 0 ++++++++++++++++- /trunk/config/toolchain.in | 1 1 0 0 + 2 files changed, 17 insertions(+), 1 deletion(-) diff -r de1b8818d39b -r c6a08b4c488c config/toolchain.in --- a/config/toolchain.in Tue Dec 09 21:25:29 2008 +0000 +++ b/config/toolchain.in Tue Dec 09 22:02:20 2008 +0000 @@ -33,6 +33,7 @@ A tuple is of the form arch-vendor-kernel-system. You can set the second part, vendor, to whatever you see fit. Use a single word, or use underscores "_" to separate words. + Use neither dash nor space, as it breaks things. Keep the default (unkown) if you don't know better. diff -r de1b8818d39b -r c6a08b4c488c scripts/functions --- a/scripts/functions Tue Dec 09 21:25:29 2008 +0000 +++ b/scripts/functions Tue Dec 09 22:02:20 2008 +0000 @@ -697,7 +697,22 @@ CT_DoKernelTupleValues # Finish the target tuple construction - CT_TARGET=$(CT_DoConfigSub "${CT_TARGET_ARCH}-${CT_TARGET_VENDOR:-unknown}-${CT_TARGET_KERNEL}${CT_TARGET_KERNEL:+-}${CT_TARGET_SYS}") + CT_TARGET="${CT_TARGET_ARCH}-${CT_TARGET_VENDOR:-unknown}-${CT_TARGET_KERNEL}${CT_TARGET_KERNEL:+-}${CT_TARGET_SYS}" + + # Sanity checks + __sed_alias="" + if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then + __sed_alias=$(echo "${CT_TARGET}" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}") + fi + case ":${CT_TARGET_VENDOR}:${CT_TARGET_ALIAS}:${__sed_alias}:" in + :*" "*:*:*:) CT_Abort "Don't use spaces in the vendor string, it breaks things.";; + :*"-"*:*:*:) CT_Abort "Don't use dashes in the vendor string, it breaks things.";; + :*:*" "*:*:) CT_Abort "Don't use spaces in the target alias, it breaks things.";; + :*:*:*" "*:) CT_Abort "Don't use spaces in the target sed transform, it breaks things.";; + esac + + # Canonicalise it + CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}") # Prepare the target CFLAGS CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_ENDIAN_CFLAG}"