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 MPC library
2 # Copyright 2009 Yann E. MORIN
3 # Licensed under the GPL v2. See COPYING in the root of this package
6 do_mpc_extract() { :; }
7 do_mpc_for_build() { :; }
8 do_mpc_for_host() { :; }
10 # Overide functions depending on configuration
11 if [ "${CT_MPC}" = "y" ]; then
15 CT_GetFile "mpc-${CT_MPC_VERSION}" .tar.gz \
16 http://www.multiprecision.org/mpc/download
21 CT_Extract "mpc-${CT_MPC_VERSION}"
22 CT_Patch "mpc" "${CT_MPC_VERSION}"
25 # Build MPC for running on build
26 # - always build statically
27 # - we do not have build-specific CFLAGS
28 # - install in build-tools prefix
32 case "${CT_TOOLCHAIN_TYPE}" in
33 native|cross) return 0;;
36 CT_DoStep INFO "Installing MPC for build"
37 CT_mkdir_pushd "${CT_BUILD_DIR}/build-mpc-build-${CT_BUILD}"
39 mpc_opts+=( "host=${CT_BUILD}" )
40 mpc_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
41 mpc_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
42 mpc_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
43 do_mpc_backend "${mpc_opts[@]}"
49 # Build MPC for running on host
53 CT_DoStep INFO "Installing MPC for host"
54 CT_mkdir_pushd "${CT_BUILD_DIR}/build-mpc-host-${CT_HOST}"
56 mpc_opts+=( "host=${CT_HOST}" )
57 mpc_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
58 mpc_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
59 mpc_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
60 do_mpc_backend "${mpc_opts[@]}"
67 # Parameter : description : type : default
68 # host : machine to run on : tuple : (none)
69 # prefix : prefix to install into : dir : (none)
70 # cflags : cflags to use : string : (empty)
71 # ldflags : ldflags to use : string : (empty)
83 CT_DoLog EXTRA "Configuring MPC"
87 LDFLAGS="${ldflags}" \
88 "${CT_SRC_DIR}/mpc-${CT_MPC_VERSION}/configure" \
91 --prefix="${prefix}" \
92 --with-gmp="${prefix}" \
93 --with-mpfr="${prefix}" \
97 CT_DoLog EXTRA "Building MPC"
98 CT_DoExecLog ALL make ${JOBSFLAGS}
100 if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
101 CT_DoLog EXTRA "Checking MPC"
102 CT_DoExecLog ALL make ${JOBSFLAGS} -s check
105 CT_DoLog EXTRA "Installing MPC"
106 CT_DoExecLog ALL make install