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 do_mpc_backend "${mpc_opts[@]}"
47 # Build MPC for running on host
51 CT_DoStep INFO "Installing MPC for host"
52 CT_mkdir_pushd "${CT_BUILD_DIR}/build-mpc-host-${CT_HOST}"
54 mpc_opts+=( "host=${CT_HOST}" )
55 mpc_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
56 mpc_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
57 do_mpc_backend "${mpc_opts[@]}"
64 # Parameter : description : type : default
65 # host : machine to run on : tuple : (none)
66 # prefix : prefix to install into : dir : (none)
67 # cflags : host cflags to use : string : (empty)
78 CT_DoLog EXTRA "Configuring MPC"
82 "${CT_SRC_DIR}/mpc-${CT_MPC_VERSION}/configure" \
85 --prefix="${prefix}" \
86 --with-gmp="${prefix}" \
87 --with-mpfr="${prefix}" \
91 CT_DoLog EXTRA "Building MPC"
92 CT_DoExecLog ALL make ${JOBSFLAGS}
94 if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
95 CT_DoLog EXTRA "Checking MPC"
96 CT_DoExecLog ALL make ${JOBSFLAGS} -s check
99 CT_DoLog EXTRA "Installing MPC"
100 CT_DoExecLog ALL make install