1 # This file adds the functions to build the MPFR library
2 # Copyright 2008 Yann E. MORIN
3 # Licensed under the GPL v2. See COPYING in the root of this package
6 do_mpfr_extract() { :; }
8 do_mpfr_target() { :; }
10 # Overide function depending on configuration
11 if [ "${CT_GMP_MPFR}" = "y" ]; then
15 CT_GetFile "mpfr-${CT_MPFR_VERSION}" http://www.mpfr.org/mpfr-current/ \
16 http://www.mpfr.org/mpfr-${CT_MPFR_VERSION}/
21 CT_ExtractAndPatch "mpfr-${CT_MPFR_VERSION}"
23 # OK, Gentoo have a sanity check that libtool.m4 and ltmain.sh have the
24 # same version number. Unfortunately, some tarballs of MPFR are not
25 # built sanely, and thus ./configure fails on Gentoo.
26 # See: http://sourceware.org/ml/crossgcc/2008-05/msg00080.html
27 # and: http://sourceware.org/ml/crossgcc/2008-06/msg00005.html
28 # This hack is not bad per se, but the MPFR guys would be better not to
29 # do that in the future...
30 CT_Pushd "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}"
31 if [ ! -f .autotools.ct-ng ]; then
32 CT_DoLog DEBUG "Re-building autotools files"
33 CT_DoExecLog ALL autoreconf -fi
34 # Starting with libtool-1.9f, config.{guess,sub} are no longer
35 # installed without -i, but starting with libtool-2.2.6, they
36 # are no longer removed without -i. Sight... Just use -i with
38 # See: http://sourceware.org/ml/crossgcc/2008-11/msg00046.html
39 # and: http://sourceware.org/ml/crossgcc/2008-11/msg00048.html
41 case "$(libtoolize --version |head -n 1 |gawk '{ print $(NF); }')" in
44 *) libtoolize_opt=-i;;
46 CT_DoExecLog ALL libtoolize -f ${libtoolize_opt}
47 touch .autotools.ct-ng
53 mkdir -p "${CT_BUILD_DIR}/build-mpfr"
54 cd "${CT_BUILD_DIR}/build-mpfr"
56 CT_DoStep INFO "Installing MPFR"
58 CT_DoLog EXTRA "Configuring MPFR"
59 CFLAGS="${CT_CFLAGS_FOR_HOST}" \
61 "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}/configure" \
64 --prefix="${CT_PREFIX_DIR}" \
65 --enable-thread-safe \
66 --disable-shared --enable-static \
67 --with-gmp="${CT_PREFIX_DIR}"
69 CT_DoLog EXTRA "Building MPFR"
70 CT_DoExecLog ALL make ${PARALLELMFLAGS}
72 if [ "${CT_MPFR_CHECK}" = "y" ]; then
73 CT_DoLog EXTRA "Checking MPFR"
74 CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
77 CT_DoLog EXTRA "Installing MPFR"
78 CT_DoExecLog ALL make install
83 if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then
86 mkdir -p "${CT_BUILD_DIR}/build-mpfr-target"
87 cd "${CT_BUILD_DIR}/build-mpfr-target"
89 CT_DoStep INFO "Installing MPFR for the target"
91 CT_DoLog EXTRA "Configuring MPFR"
92 CFLAGS="${CT_CFLAGS_FOR_TARGET}" \
94 "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}/configure" \
98 --enable-thread-safe \
99 --disable-shared --enable-static \
100 --with-gmp="${CT_SYSROOT_DIR}/usr"
102 CT_DoLog EXTRA "Building MPFR"
103 CT_DoExecLog ALL make ${PARALLELMFLAGS}
105 # Not possible to check MPFR while X-compiling
107 CT_DoLog EXTRA "Installing MPFR"
108 CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install
113 fi # CT_GMP_MPFR_TARGET == y
115 fi # CT_GMP_MPFR == y