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 do_gmp_backend "${gmp_opts[@]}"
46 # Build GMP for running on host
50 CT_DoStep INFO "Installing GMP for host"
51 CT_mkdir_pushd "${CT_BUILD_DIR}/build-gmp-host-${CT_HOST}"
53 gmp_opts+=( "host=${CT_HOST}" )
54 gmp_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
55 gmp_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
56 do_gmp_backend "${gmp_opts[@]}"
63 # Parameter : description : type : default
64 # host : machine to run on : tuple : (none)
65 # prefix : prefix to install into : dir : (none)
66 # cflags : host cflags to use : string : (empty)
77 CT_DoLog EXTRA "Configuring GMP"
80 CFLAGS="${cflags} -fexceptions" \
81 "${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \
84 --prefix="${prefix}" \
91 CT_DoLog EXTRA "Building GMP"
92 CT_DoExecLog ALL make ${JOBSFLAGS}
94 if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
95 CT_DoLog EXTRA "Checking GMP"
96 CT_DoExecLog ALL make ${JOBSFLAGS} -s check
99 CT_DoLog EXTRA "Installing GMP"
100 CT_DoExecLog ALL make install