scripts/functions
changeset 383 f00eb97ff649
parent 373 34612b693dde
child 387 2fa4b675a9a3
     1.1 --- a/scripts/functions	Tue Sep 11 17:24:09 2007 +0000
     1.2 +++ b/scripts/functions	Fri Sep 14 21:17:59 2007 +0000
     1.3 @@ -487,42 +487,32 @@
     1.4  # tuple. It is needed both by the normal build sequence, as well as the
     1.5  # sample saving sequence.
     1.6  CT_DoBuildTargetTuple() {
     1.7 +    # Set the endianness suffix, and the default endianness gcc option
     1.8      case "${CT_ARCH_BE},${CT_ARCH_LE}" in
     1.9 -        y,) target_endian_eb=eb; target_endian_el=;;
    1.10 -        ,y) target_endian_eb=; target_endian_el=el;;
    1.11 +        y,) target_endian_eb=eb
    1.12 +            target_endian_el=
    1.13 +            CT_ARCH_ENDIAN_OPT="-mbig-endian"
    1.14 +            ;;
    1.15 +        ,y) target_endian_eb=
    1.16 +            target_endian_el=el
    1.17 +            CT_ARCH_ENDIAN_OPT="-mlittle-endian"
    1.18 +            ;;
    1.19      esac
    1.20 -    case "${CT_ARCH}" in
    1.21 -        arm)  CT_TARGET="${CT_ARCH}${target_endian_eb}";;
    1.22 -        ia64) CT_TARGET="${CT_ARCH}";;
    1.23 -        mips) CT_TARGET="${CT_ARCH}${target_endian_el}";;
    1.24 -        x86*) # Much love for this one :-(
    1.25 -              arch="${CT_ARCH_ARCH}"
    1.26 -              [ -z "${arch}" ] && arch="${CT_ARCH_TUNE}"
    1.27 -              case "${CT_ARCH}" in
    1.28 -                  x86_64)  CT_TARGET=x86_64;;
    1.29 -              	  *)  case "${arch}" in
    1.30 -                          "")                                       CT_TARGET=i386;;
    1.31 -                          i386|i486|i586|i686)                      CT_TARGET="${arch}";;
    1.32 -                          winchip*)                                 CT_TARGET=i486;;
    1.33 -                          pentium|pentium-mmx|c3*)                  CT_TARGET=i586;;
    1.34 -                          nocona|athlon*64|k8|athlon-fx|opteron)    CT_TARGET=x86_64;;
    1.35 -                          pentiumpro|pentium*|athlon*)              CT_TARGET=i686;;
    1.36 -                          *)                                        CT_TARGET=i586;;
    1.37 -                      esac;;
    1.38 -              esac;;
    1.39 +
    1.40 +    # Set defaults for the system part of the tuple. Can be overriden
    1.41 +    # by architecture-specific values.
    1.42 +    case "${CT_LIBC}" in
    1.43 +        glibc)  CT_TARGET_SYS=gnu;;
    1.44 +        uClibc) CT_TARGET_SYS=uclibc;;
    1.45      esac
    1.46 -    case "${CT_TARGET_VENDOR}" in
    1.47 -        "") CT_TARGET="${CT_TARGET}-unknown";;
    1.48 -        *)  CT_TARGET="${CT_TARGET}-${CT_TARGET_VENDOR}";;
    1.49 +
    1.50 +    # Call the architecture specific settings
    1.51 +    CT_DoArchValues
    1.52 +
    1.53 +    case "${CT_KERNEL}" in
    1.54 +        linux*)  CT_TARGET_KERNEL=linux;;
    1.55      esac
    1.56 -    case "${CT_KERNEL}" in
    1.57 -        linux*)  CT_TARGET="${CT_TARGET}-linux";;
    1.58 -    esac
    1.59 -    case "${CT_LIBC}" in
    1.60 -        glibc)  CT_TARGET="${CT_TARGET}-gnu";;
    1.61 -        uClibc) CT_TARGET="${CT_TARGET}-uclibc";;
    1.62 -    esac
    1.63 -    CT_TARGET=`CT_DoConfigSub "${CT_TARGET}"`
    1.64 +    CT_TARGET=`CT_DoConfigSub "${CT_TARGET_ARCH}-${CT_TARGET_VENDOR:-unknown}-${CT_TARGET_KERNEL}-${CT_TARGET_SYS}"`
    1.65  }
    1.66  
    1.67  # This function does pause the build until the user strikes "Return"