scripts/build/arch/sh.sh
author Anthony Foiani <anthony.foiani@gmail.com>
Thu Apr 26 19:55:59 2012 -0600 (2012-04-26)
changeset 2939 58974be61289
parent 2760 b402a49734a3
child 3169 9d0b37f08a10
permissions -rw-r--r--
Allow multi-word "install" command.

Autoconf can determine that the correct install command includes flags,
e.g., "/usr/bin/install -c". When using this as a command, we can't
enclose the value in double-quotes, as that makes some shells use the
whole expression as a filename:

# this is the value returned by autoconf and stored in CT_install
$ ins="/usr/bin/install -c"

# if we call it with quotes, the command is not found
$ "${ins}"
bash: /usr/bin/install -c: No such file or directory

# removing the quotes lets it work as expected
$ ${ins}
/usr/bin/install: missing file operand
Try `/usr/bin/install --help' for more information.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
yann@413
     1
# Compute sh-specific values
yann@413
     2
yann@964
     3
CT_DoArchTupleValues () {
yann@413
     4
    # The architecture part of the tuple:
yann@413
     5
    CT_TARGET_ARCH="${CT_ARCH_SH_VARIANT}${target_endian_eb}"
yann@413
     6
yann@413
     7
    # gcc ./configure flags
yann@413
     8
    CT_ARCH_WITH_ARCH=
yann@413
     9
    CT_ARCH_WITH_ABI=
yann@413
    10
    CT_ARCH_WITH_CPU=
yann@413
    11
    CT_ARCH_WITH_TUNE=
yann@413
    12
    CT_ARCH_WITH_FPU=
yann@413
    13
    CT_ARCH_WITH_FLOAT=
yann@413
    14
yann@413
    15
    # Endianness stuff
yann@2775
    16
    case "${CT_ARCH_ENDIAN}" in
yann@2775
    17
        big)    CT_ARCH_ENDIAN_CFLAG=-mb;;
yann@2775
    18
        little) CT_ARCH_ENDIAN_CFLAG=-ml;;
yann@413
    19
    esac
yann@413
    20
yann@413
    21
    # CFLAGS
yann@1936
    22
    case "${CT_ARCH_SH_VARIANT}" in
yann@413
    23
        sh3)    CT_ARCH_ARCH_CFLAG=-m3;;
yann@413
    24
        sh4*)
yann@2760
    25
            # softfp is not possible for SuperH, no need to test for it.
yann@2760
    26
            case "${CT_ARCH_FLOAT}" in
yann@2760
    27
                hard)
yann@2760
    28
                    CT_ARCH_ARCH_CFLAG="-m4${CT_ARCH_SH_VARIANT##sh?}"
yann@2760
    29
                    ;;
yann@2760
    30
                soft)
yann@2760
    31
                    CT_ARCH_ARCH_CFLAG="-m4${CT_ARCH_SH_VARIANT##sh?}-nofpu"
yann@2760
    32
                    ;;
yann@413
    33
            esac
yann@413
    34
            ;;
yann@413
    35
    esac
yann@413
    36
    CT_ARCH_FLOAT_CFLAG=
yann@413
    37
}