companion_tools/autoconf: add autoconf tool
authorRichard Strand <richard.strand@icomera.com>
Tue Jan 12 21:09:30 2010 +0100 (2010-01-12)
changeset 17275f222264bb54
parent 1726 f581da7fe34e
child 1728 60b7ebc4709a
companion_tools/autoconf: add autoconf tool

Initial version of adding autoconf as a companion tool.

Signed-off-by: Richard Strand <richard.strand@icomera.com>
[yann.morin.1998@anciens.enib.fr: use generic overide tools dir]
[yann.morin.1998@anciens.enib.fr: update menu entries]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
config/companion_tools.in
config/config.in
scripts/build/companion_tools.sh
scripts/build/companion_tools/200-autoconf.sh
scripts/crosstool-NG.sh.in
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/config/companion_tools.in	Tue Jan 12 21:09:30 2010 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +# Companion tools config options
     1.5 +
     1.6 +if EXPERIMENTAL
     1.7 +
     1.8 +menu "Companion tools"
     1.9 +
    1.10 +comment "READ HELP before you say 'Y' below !!!"
    1.11 +config COMP_TOOLS
    1.12 +    bool
    1.13 +    prompt "Build some companion tools"
    1.14 +    help
    1.15 +      Crosstool-NG relies on some external tools to be recent enough, namely:
    1.16 +        autoconf >= 2.63
    1.17 +      
    1.18 +      If your system has older versions, we can build them for you,
    1.19 +      but you are strongly encouraged to update your system instead!
    1.20 +
    1.21 +if COMP_TOOLS
    1.22 +
    1.23 +config COMP_TOOLS_autoconf
    1.24 +    bool
    1.25 +    prompt "autoconf"
    1.26 +
    1.27 +endif
    1.28 +
    1.29 +endmenu
    1.30 +
    1.31 +endif
     2.1 --- a/config/config.in	Tue Jan 12 21:21:39 2010 +0100
     2.2 +++ b/config/config.in	Tue Jan 12 21:09:30 2010 +0100
     2.3 @@ -8,3 +8,4 @@
     2.4  source config/debug.in
     2.5  source config/tools.in
     2.6  source config/companion_libs.in
     2.7 +source config/companion_tools.in
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/scripts/build/companion_tools.sh	Tue Jan 12 21:09:30 2010 +0100
     3.3 @@ -0,0 +1,38 @@
     3.4 +# Wrapper to build the companion tools facilities
     3.5 +
     3.6 +# List all companion tools facilities, and parse their scripts
     3.7 +CT_COMP_TOOLS_FACILITY_LIST=
     3.8 +for f in "${CT_LIB_DIR}/scripts/build/companion_tools/"*.sh; do
     3.9 +    _f="$(basename "${f}" .sh)"
    3.10 +    _f="${_f#???-}"
    3.11 +    __f="CT_COMP_TOOLS_${_f}"
    3.12 +    if [ "${!__f}" = "y" ]; then
    3.13 +        CT_DoLog DEBUG "Enabling companion tools '${_f}'"
    3.14 +        . "${f}"
    3.15 +        CT_COMP_TOOLS_FACILITY_LIST="${CT_COMP_TOOLS_FACILITY_LIST} ${_f}"
    3.16 +    else
    3.17 +        CT_DoLog DEBUG "Disabling companion tools '${_f}'"
    3.18 +    fi
    3.19 +done
    3.20 +
    3.21 +# Download the companion tools facilities
    3.22 +do_companion_tools_get() {
    3.23 +    for f in ${CT_COMP_TOOLS_FACILITY_LIST}; do
    3.24 +        do_companion_tools_${f}_get
    3.25 +    done
    3.26 +}
    3.27 +
    3.28 +# Extract and patch the companion tools facilities
    3.29 +do_companion_tools_extract() {
    3.30 +    for f in ${CT_COMP_TOOLS_FACILITY_LIST}; do
    3.31 +        do_companion_tools_${f}_extract
    3.32 +    done
    3.33 +}
    3.34 +
    3.35 +# Build the companion tools facilities
    3.36 +do_companion_tools() {
    3.37 +    for f in ${CT_COMP_TOOLS_FACILITY_LIST}; do
    3.38 +        do_companion_tools_${f}_build
    3.39 +    done
    3.40 +}
    3.41 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/scripts/build/companion_tools/200-autoconf.sh	Tue Jan 12 21:09:30 2010 +0100
     4.3 @@ -0,0 +1,32 @@
     4.4 +# Build script for autoconf
     4.5 +
     4.6 +CT_AUTOCONF_VERSION=2.65
     4.7 +
     4.8 +do_companion_tools_autoconf_get() {
     4.9 +    CT_GetFile "autoconf-${CT_AUTOCONF_VERSION}" \
    4.10 +               {ftp,http}://ftp.gnu.org/gnu/autoconf
    4.11 +}
    4.12 +
    4.13 +do_companion_tools_autoconf_extract() {
    4.14 +    CT_Extract "autoconf-${CT_AUTOCONF_VERSION}"
    4.15 +    CT_Patch "autoconf-${CT_AUTOCONF_VERSION}"
    4.16 +}
    4.17 +
    4.18 +do_companion_tools_autoconf_build() {
    4.19 +    CT_DoStep EXTRA "Installing autoconf"
    4.20 +    mkdir -p "${CT_BUILD_DIR}/build-autoconf"
    4.21 +    CT_Pushd "${CT_BUILD_DIR}/build-autoconf"
    4.22 +    
    4.23 +    # Ensure configure gets run using the CONFIG_SHELL as configure seems to
    4.24 +    # have trouble when CONFIG_SHELL is set and /bin/sh isn't bash
    4.25 +    # For reference see:
    4.26 +    # http://www.gnu.org/software/autoconf/manual/autoconf.html#CONFIG_005fSHEL
    4.27 +    
    4.28 +    CT_DoExecLog ALL ${CONFIG_SHELL} \
    4.29 +    "${CT_SRC_DIR}/autoconf-${CT_AUTOCONF_VERSION}/configure" \
    4.30 +        --prefix="${CT_TOOLS_OVERIDE_DIR}"
    4.31 +    CT_DoExecLog ALL make
    4.32 +    CT_DoExecLog ALL make install
    4.33 +    CT_Popd
    4.34 +    CT_EndStep
    4.35 +}
     5.1 --- a/scripts/crosstool-NG.sh.in	Tue Jan 12 21:21:39 2010 +0100
     5.2 +++ b/scripts/crosstool-NG.sh.in	Tue Jan 12 21:09:30 2010 +0100
     5.3 @@ -114,6 +114,7 @@
     5.4  # export any variable, nor re-parse the configuration and functions files.
     5.5  . "${CT_LIB_DIR}/scripts/build/internals.sh"
     5.6  . "${CT_LIB_DIR}/scripts/build/arch/${CT_ARCH}.sh"
     5.7 +. "${CT_LIB_DIR}/scripts/build/companion_tools.sh"
     5.8  . "${CT_LIB_DIR}/scripts/build/kernel/${CT_KERNEL}.sh"
     5.9  . "${CT_LIB_DIR}/scripts/build/companion_libs/gmp.sh"
    5.10  . "${CT_LIB_DIR}/scripts/build/companion_libs/mpfr.sh"
    5.11 @@ -493,6 +494,7 @@
    5.12          CT_DoLog INFO "Downloading forbidden by configuration, skipping downloads"
    5.13      else
    5.14          CT_DoStep INFO "Retrieving needed toolchain components' tarballs"
    5.15 +        do_companion_tools_get
    5.16          do_kernel_get
    5.17          do_gmp_get
    5.18          do_mpfr_get
    5.19 @@ -512,6 +514,14 @@
    5.20              CT_DoForceRmdir "${CT_SRC_DIR}"
    5.21              CT_DoExecLog ALL mkdir -p "${CT_SRC_DIR}"
    5.22          fi
    5.23 +
    5.24 +        if [ "${CT_COMP_TOOLS}" = "y" ]; then
    5.25 +          CT_DoStep INFO "Extracting, patching and installing companion tools"
    5.26 +          do_companion_tools_extract
    5.27 +          do_companion_tools
    5.28 +          CT_EndStep
    5.29 +        fi
    5.30 +
    5.31          CT_DoStep INFO "Extracting and patching toolchain components"
    5.32          do_kernel_extract
    5.33          do_gmp_extract