scripts/build/test_suite.sh
author Yann Diorcet <diorcet.yann@gmail.com>
Fri Nov 16 15:25:57 2012 +0100 (2012-11-16)
changeset 3119 1c56c03b7ed5
permissions -rw-r--r--
scripts: add BUILD/HOST extra cflags/ldflags

On some hosts, and for certain toolchains (eg. toolchain targetting
the upcoming Darwin), it may be necessary to pass arbitrary CFLAGS
and/or LDFLAGS when building the components.

And necessary infrastructure:
- EXTRA_{CFLAGS,LDFLAGS}_FOR_{BUILD,HOST} as config options
- pass those extra flags to components

Fix-up a slight typo in elf2flt at the same time (misnamed cflags).

Signed-off-by: Yann Diorcet <diorcet.yann@gmail.com>
Message-Id: <d24043276c9243a35421.1353077450@macbook-smorlat.local>
Patchwork-Id: 199645
mgl@1965
     1
# Wrapper to build the test suite facilities
mgl@1965
     2
#
mgl@1965
     3
# Current assumption: test suites are independent of each other
mgl@1965
     4
#                     - no order handling required.
mgl@1965
     5
mgl@1965
     6
# List all test suite facilities, and parse their scripts
mgl@1965
     7
CT_TEST_SUITE_FACILITY_LIST=
mgl@1965
     8
for f in "${CT_LIB_DIR}/scripts/build/test_suite/"*.sh; do
mgl@1965
     9
    _f="$(basename "${f}" .sh)"
mgl@1965
    10
    __f="CT_TEST_SUITE_${_f}"
mgl@1965
    11
    __f=`echo ${__f} | tr "[:lower:]" "[:upper:]"`
mgl@1965
    12
    if [ "${!__f}" = "y" ]; then
mgl@1965
    13
        CT_DoLog DEBUG "Enabling test suite '${_f}'"
mgl@1965
    14
        . "${f}"
mgl@1965
    15
        CT_TEST_SUITE_FACILITY_LIST="${CT_TEST_SUITE_FACILITY_LIST} ${_f}"
mgl@1965
    16
    else
mgl@1965
    17
        CT_DoLog DEBUG "Disabling test suite '${_f}'"
mgl@1965
    18
    fi
mgl@1965
    19
done
mgl@1965
    20
mgl@1965
    21
# Download the test suite facilities
mgl@1965
    22
do_test_suite_get() {
mgl@1965
    23
    for f in ${CT_TEST_SUITE_FACILITY_LIST}; do
mgl@1965
    24
        do_test_suite_${f}_get
mgl@1965
    25
    done
mgl@1965
    26
}
mgl@1965
    27
mgl@1965
    28
# Extract and patch the test suite facilities
mgl@1965
    29
do_test_suite_extract() {
mgl@1965
    30
    for f in ${CT_TEST_SUITE_FACILITY_LIST}; do
mgl@1965
    31
        do_test_suite_${f}_extract
mgl@1965
    32
    done
mgl@1965
    33
}
mgl@1965
    34
mgl@1965
    35
# Build the test suite facilities
mgl@1965
    36
do_test_suite() {
mgl@1965
    37
    for f in ${CT_TEST_SUITE_FACILITY_LIST}; do
mgl@1965
    38
        do_test_suite_${f}_build
mgl@1965
    39
    done
mgl@1965
    40
}
mgl@1965
    41