scripts/build/arch/x86.sh
author Daniel Price <daniel.price@gmail.com>
Tue Nov 20 16:59:17 2012 -0800 (2012-11-20)
changeset 3126 333d3e40cbd1
parent 1635 5d1936ad5ba8
child 3169 9d0b37f08a10
permissions -rw-r--r--
scripts: refine static linking check to better guide the user

The current mechanism to check if static linking is possible, and the mesage
displayed on failure, can be puzzling to the unsuspecting user.

Also, the current implementation is not using the existing infrastructure,
and is thus difficult to enhance with new tests.

So, switch to using the standard CT_DoExecLog infra, and use four tests to
check for the host compiler:
- check we can run it
- check it can build a trivial program
- check it can statically link that program
- check if it statically link with libstdc++

That should cover most of the problems. Hopefully.

(At the same time, fix a typo in a comment)

Signed-off-by: Daniel Price <daniel.price@gmail.com>
[yann.morin.1998@free.fr: split original patch for self-contained changes]
[yann.morin.1998@free.fr: use steps to better see gcc's output]
[yann.morin.1998@free.fr: commit log]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <163f86b5216fc08c672a.1353459722@nipigon.dssd.com>
Patchwork-Id: 200536
yann@383
     1
# Compute x86-specific values
yann@383
     2
yann@1635
     3
# This one really needs a little love! :-(
yann@383
     4
yann@964
     5
CT_DoArchTupleValues() {
yann@383
     6
yann@1635
     7
    # Override the architecture part of the tuple:
yann@1635
     8
    if [ "${CT_ARCH_64}" = "y" ]; then
yann@1635
     9
        CT_TARGET_ARCH=x86_64
yann@1635
    10
    else
yann@1635
    11
        arch="${CT_ARCH_ARCH}"
yann@1635
    12
        [ -z "${arch}" ] && arch="${CT_ARCH_TUNE}"
yann@1635
    13
        case "${arch}" in
yann@1635
    14
            "")                           CT_TARGET_ARCH=i386;;
yann@1635
    15
            i386|i486|i586|i686)          CT_TARGET_ARCH="${arch}";;
yann@1635
    16
            winchip*)                     CT_TARGET_ARCH=i486;;
yann@1635
    17
            pentium|pentium-mmx|c3*)      CT_TARGET_ARCH=i586;;
yann@1635
    18
            pentiumpro|pentium*|athlon*)  CT_TARGET_ARCH=i686;;
titus@2759
    19
            prescott)                     CT_TARGET_ARCH=i686;;
yann@1635
    20
            *)                            CT_TARGET_ARCH=i586;;
yann@1635
    21
        esac
yann@1635
    22
    fi
yann@383
    23
}