scripts/addToolsVersion: properly handle .in vs. .in.2
While most components have their version in the .in file, some
have it in the .in.2 (eg. elf2flt).
Currently, to handle this case, we indiscriminately munge both files,
but this is wrong: in the elf2flt case, if we add a binutils version,
we do not want it to be added to elf2flt, and conversely.
So, for each tool, we need to explicitly know what file to munge.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
1 # This file adds the functions to build the GMP library
2 # Copyright 2008 Yann E. MORIN
3 # Licensed under the GPL v2. See COPYING in the root of this package
6 do_gmp_extract() { :; }
7 do_gmp_for_build() { :; }
8 do_gmp_for_host() { :; }
10 # Overide functions depending on configuration
11 if [ "${CT_GMP}" = "y" ]; then
15 CT_GetFile "gmp-${CT_GMP_VERSION}" {ftp,http}://{ftp.sunet.se/pub,ftp.gnu.org}/gnu/gmp
20 CT_Extract "gmp-${CT_GMP_VERSION}"
21 CT_Patch "gmp" "${CT_GMP_VERSION}"
24 # Build GMP for running on build
25 # - always build statically
26 # - we do not have build-specific CFLAGS
27 # - install in build-tools prefix
31 case "${CT_TOOLCHAIN_TYPE}" in
32 native|cross) return 0;;
35 CT_DoStep INFO "Installing GMP for build"
36 CT_mkdir_pushd "${CT_BUILD_DIR}/build-gmp-build-${CT_BUILD}"
38 gmp_opts+=( "host=${CT_BUILD}" )
39 gmp_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
40 gmp_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
41 gmp_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
42 do_gmp_backend "${gmp_opts[@]}"
48 # Build GMP for running on host
52 CT_DoStep INFO "Installing GMP for host"
53 CT_mkdir_pushd "${CT_BUILD_DIR}/build-gmp-host-${CT_HOST}"
55 gmp_opts+=( "host=${CT_HOST}" )
56 gmp_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
57 gmp_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
58 gmp_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
59 do_gmp_backend "${gmp_opts[@]}"
66 # Parameter : description : type : default
67 # host : machine to run on : tuple : (none)
68 # prefix : prefix to install into : dir : (none)
69 # cflags : cflags to use : string : (empty)
70 # ldflags : ldflags to use : string : (empty)
82 CT_DoLog EXTRA "Configuring GMP"
85 CFLAGS="${cflags} -fexceptions" \
86 LDFLAGS="${ldflags}" \
87 "${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \
90 --prefix="${prefix}" \
97 CT_DoLog EXTRA "Building GMP"
98 CT_DoExecLog ALL make ${JOBSFLAGS}
100 if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
101 CT_DoLog EXTRA "Checking GMP"
102 CT_DoExecLog ALL make ${JOBSFLAGS} -s check
105 CT_DoLog EXTRA "Installing GMP"
106 CT_DoExecLog ALL make install