scripts/build/companion_tools/200-autoconf.sh
author Daniel Price <daniel.price@gmail.com>
Tue Nov 20 16:59:17 2012 -0800 (2012-11-20)
changeset 3126 333d3e40cbd1
parent 2309 2e0f0757289d
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
richard@1727
     1
# Build script for autoconf
richard@1727
     2
richard@1727
     3
CT_AUTOCONF_VERSION=2.65
richard@1727
     4
richard@1727
     5
do_companion_tools_autoconf_get() {
richard@1727
     6
    CT_GetFile "autoconf-${CT_AUTOCONF_VERSION}" \
richard@1727
     7
               {ftp,http}://ftp.gnu.org/gnu/autoconf
richard@1727
     8
}
richard@1727
     9
richard@1727
    10
do_companion_tools_autoconf_extract() {
richard@1727
    11
    CT_Extract "autoconf-${CT_AUTOCONF_VERSION}"
yann@2329
    12
    CT_DoExecLog ALL chmod -R u+w "${CT_SRC_DIR}/autoconf-${CT_AUTOCONF_VERSION}"
yann@1901
    13
    CT_Patch "autoconf" "${CT_AUTOCONF_VERSION}"
richard@1727
    14
}
richard@1727
    15
richard@1727
    16
do_companion_tools_autoconf_build() {
richard@1727
    17
    CT_DoStep EXTRA "Installing autoconf"
richard@1727
    18
    mkdir -p "${CT_BUILD_DIR}/build-autoconf"
richard@1727
    19
    CT_Pushd "${CT_BUILD_DIR}/build-autoconf"
richard@1727
    20
    
richard@1727
    21
    # Ensure configure gets run using the CONFIG_SHELL as configure seems to
richard@1727
    22
    # have trouble when CONFIG_SHELL is set and /bin/sh isn't bash
richard@1727
    23
    # For reference see:
yann@2309
    24
    # http://www.gnu.org/software/autoconf/manual/autoconf.html#CONFIG_005fSHELL
richard@1727
    25
    
anthony@2154
    26
    CT_DoExecLog CFG ${CONFIG_SHELL} \
richard@1727
    27
    "${CT_SRC_DIR}/autoconf-${CT_AUTOCONF_VERSION}/configure" \
yann@2309
    28
        --prefix="${CT_BUILDTOOLS_PREFIX_DIR}"
richard@1727
    29
    CT_DoExecLog ALL make
richard@1727
    30
    CT_DoExecLog ALL make install
richard@1727
    31
    CT_Popd
richard@1727
    32
    CT_EndStep
richard@1727
    33
}