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
5 do_print_filename() { :; }
7 do_mpfr_extract() { :; }
9 do_mpfr_target() { :; }
11 # Overide function depending on configuration
12 if [ "${CT_GMP_MPFR}" = "y" ]; then
15 [ "${CT_GMP_MPFR}" = "y" ] || return 0
16 echo "mpfr-${CT_MPFR_VERSION}"
21 CT_GetFile "${CT_MPFR_FILE}" http://www.mpfr.org/mpfr-current/ \
22 http://www.mpfr.org/mpfr-${CT_MPFR_VERSION}/
27 CT_ExtractAndPatch "${CT_MPFR_FILE}"
29 # OK, Gentoo have a sanity check that libtool.m4 and ltmain.sh have the
30 # same version number. Unfortunately, some tarballs of MPFR are not
31 # built sanely, and thus ./configure fails on Gentoo.
32 # See: http://sourceware.org/ml/crossgcc/2008-05/msg00080.html
33 # and: http://sourceware.org/ml/crossgcc/2008-06/msg00005.html
34 # This hack is not bad per se, but the MPFR guys would be better not to
35 # do that in the future...
36 CT_Pushd "${CT_SRC_DIR}/${CT_MPFR_FILE}"
37 if [ ! -f .autotools.ct-ng ]; then
38 CT_DoLog DEBUG "Re-building autotools files"
39 CT_DoExecLog ALL autoreconf -fi
40 # Starting with libtool-1.9f, config.{guess,sub} are no longer
41 # installed without -i, but starting with libtool-2.2.6, they
42 # are no longer removed without -i. Sight... Just use -i with
44 # See: http://sourceware.org/ml/crossgcc/2008-11/msg00046.html
45 # and: http://sourceware.org/ml/crossgcc/2008-11/msg00048.html
47 case "$(libtoolize --version |head -n 1 |gawk '{ print $(NF); }')" in
50 *) libtoolize_opt=-i;;
52 CT_DoExecLog ALL libtoolize -f ${libtoolize_opt}
53 touch .autotools.ct-ng
59 mkdir -p "${CT_BUILD_DIR}/build-mpfr"
60 cd "${CT_BUILD_DIR}/build-mpfr"
62 CT_DoStep INFO "Installing MPFR"
64 CT_DoLog EXTRA "Configuring MPFR"
65 CFLAGS="${CT_CFLAGS_FOR_HOST}" \
67 "${CT_SRC_DIR}/${CT_MPFR_FILE}/configure" \
70 --prefix="${CT_PREFIX_DIR}" \
71 --enable-thread-safe \
72 --disable-shared --enable-static \
73 --with-gmp="${CT_PREFIX_DIR}"
75 CT_DoLog EXTRA "Building MPFR"
76 CT_DoExecLog ALL make ${PARALLELMFLAGS}
78 if [ "${CT_MPFR_CHECK}" = "y" ]; then
79 CT_DoLog EXTRA "Checking MPFR"
80 CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
83 CT_DoLog EXTRA "Installing MPFR"
84 CT_DoExecLog ALL make install
89 if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then
92 mkdir -p "${CT_BUILD_DIR}/build-mpfr-target"
93 cd "${CT_BUILD_DIR}/build-mpfr-target"
95 CT_DoStep INFO "Installing MPFR for the target"
97 CT_DoLog EXTRA "Configuring MPFR"
98 CFLAGS="${CT_CFLAGS_FOR_TARGET}" \
100 "${CT_SRC_DIR}/${CT_MPFR_FILE}/configure" \
101 --build=${CT_BUILD} \
102 --host=${CT_TARGET} \
104 --enable-thread-safe \
105 --disable-shared --enable-static \
106 --with-gmp="${CT_SYSROOT_DIR}/usr"
108 CT_DoLog EXTRA "Building MPFR"
109 CT_DoExecLog ALL make ${PARALLELMFLAGS}
111 # Not possible to check MPFR while X-compiling
113 CT_DoLog EXTRA "Installing MPFR"
114 CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install
119 fi # CT_GMP_MPFR_TARGET == y
121 fi # CT_GMP_MPFR == y