2008-04-30 10:43:41 +00:00
|
|
|
# This file adds the functions to build the MPFR library
|
|
|
|
# Copyright 2008 Yann E. MORIN
|
|
|
|
# Licensed under the GPL v2. See COPYING in the root of this package
|
|
|
|
|
2008-06-20 15:16:43 +00:00
|
|
|
do_mpfr_get() { :; }
|
|
|
|
do_mpfr_extract() { :; }
|
|
|
|
do_mpfr() { :; }
|
|
|
|
do_mpfr_target() { :; }
|
|
|
|
|
|
|
|
# Overide function depending on configuration
|
2010-02-17 22:47:47 +00:00
|
|
|
if [ "${CT_MPFR}" = "y" ]; then
|
2008-04-30 16:38:06 +00:00
|
|
|
|
2008-04-30 10:43:41 +00:00
|
|
|
# Download MPFR
|
|
|
|
do_mpfr_get() {
|
2009-01-04 14:25:58 +00:00
|
|
|
CT_GetFile "mpfr-${CT_MPFR_VERSION}" http://www.mpfr.org/mpfr-current/ \
|
2008-05-19 21:41:19 +00:00
|
|
|
http://www.mpfr.org/mpfr-${CT_MPFR_VERSION}/
|
2008-04-30 10:43:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Extract MPFR
|
|
|
|
do_mpfr_extract() {
|
2009-01-05 23:02:43 +00:00
|
|
|
CT_Extract "mpfr-${CT_MPFR_VERSION}"
|
|
|
|
CT_Patch "mpfr-${CT_MPFR_VERSION}"
|
2008-04-30 10:43:41 +00:00
|
|
|
|
2008-06-19 21:54:57 +00:00
|
|
|
# OK, Gentoo have a sanity check that libtool.m4 and ltmain.sh have the
|
|
|
|
# same version number. Unfortunately, some tarballs of MPFR are not
|
|
|
|
# built sanely, and thus ./configure fails on Gentoo.
|
|
|
|
# See: http://sourceware.org/ml/crossgcc/2008-05/msg00080.html
|
|
|
|
# and: http://sourceware.org/ml/crossgcc/2008-06/msg00005.html
|
2008-06-20 10:58:45 +00:00
|
|
|
# This hack is not bad per se, but the MPFR guys would be better not to
|
2008-06-19 21:54:57 +00:00
|
|
|
# do that in the future...
|
2009-03-08 22:13:27 +00:00
|
|
|
# It seems that MPFR >= 2.4.0 do not need this...
|
|
|
|
case "${CT_MPFR_VERSION}" in
|
2009-08-02 22:49:25 +00:00
|
|
|
2.4.1)
|
|
|
|
CT_Pushd "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}"
|
|
|
|
if [ ! -f .autoreconf.ct-ng ]; then
|
|
|
|
CT_DoLog DEBUG "Running autoreconf"
|
|
|
|
CT_DoExecLog ALL autoreconf
|
|
|
|
touch .autoreconf.ct-ng
|
|
|
|
fi
|
|
|
|
CT_Popd
|
|
|
|
;;
|
2009-03-08 22:13:27 +00:00
|
|
|
1.*|2.0.*|2.1.*|2.2.*|2.3.*)
|
|
|
|
CT_Pushd "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}"
|
|
|
|
if [ ! -f .autotools.ct-ng ]; then
|
|
|
|
CT_DoLog DEBUG "Re-building autotools files"
|
|
|
|
CT_DoExecLog ALL autoreconf -fi
|
|
|
|
# Starting with libtool-1.9f, config.{guess,sub} are no longer
|
|
|
|
# installed without -i, but starting with libtool-2.2.6, they
|
|
|
|
# are no longer removed without -i. Sight... Just use -i with
|
|
|
|
# libtool >=2
|
|
|
|
# See: http://sourceware.org/ml/crossgcc/2008-11/msg00046.html
|
|
|
|
# and: http://sourceware.org/ml/crossgcc/2008-11/msg00048.html
|
|
|
|
libtoolize_opt=
|
2009-04-20 21:10:03 +00:00
|
|
|
case "$(libtoolize --version |head -n 1 |awk '{ print $(NF); }')" in
|
2009-03-08 22:13:27 +00:00
|
|
|
0.*) ;;
|
|
|
|
1.*) ;;
|
|
|
|
*) libtoolize_opt=-i;;
|
|
|
|
esac
|
|
|
|
CT_DoExecLog ALL libtoolize -f ${libtoolize_opt}
|
|
|
|
touch .autotools.ct-ng
|
|
|
|
fi
|
|
|
|
CT_Popd
|
|
|
|
;;
|
|
|
|
esac
|
2008-06-20 09:17:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_mpfr() {
|
|
|
|
mkdir -p "${CT_BUILD_DIR}/build-mpfr"
|
|
|
|
cd "${CT_BUILD_DIR}/build-mpfr"
|
|
|
|
|
|
|
|
CT_DoStep INFO "Installing MPFR"
|
2008-06-19 21:54:57 +00:00
|
|
|
|
2009-02-07 20:11:13 +00:00
|
|
|
mpfr_opt=
|
2009-03-08 22:13:27 +00:00
|
|
|
# Under Cygwin, we can't build a thread-safe library
|
2009-02-07 20:11:13 +00:00
|
|
|
case "${CT_HOST}" in
|
2009-06-23 20:57:12 +00:00
|
|
|
*cygwin*) mpfr_opt="--disable-thread-safe";;
|
|
|
|
*mingw*) mpfr_opt="--disable-thread-safe";;
|
2010-02-02 23:24:24 +00:00
|
|
|
*darwin*) mpfr_opt="--disable-thread-safe";;
|
2009-02-07 20:11:13 +00:00
|
|
|
*) mpfr_opt="--enable-thread-safe";;
|
|
|
|
esac
|
|
|
|
|
2008-04-30 10:43:41 +00:00
|
|
|
CT_DoLog EXTRA "Configuring MPFR"
|
2009-03-08 22:13:27 +00:00
|
|
|
CC="${CT_HOST}-gcc" \
|
2009-01-04 14:25:58 +00:00
|
|
|
CFLAGS="${CT_CFLAGS_FOR_HOST}" \
|
|
|
|
CT_DoExecLog ALL \
|
|
|
|
"${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}/configure" \
|
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${CT_HOST} \
|
|
|
|
--prefix="${CT_PREFIX_DIR}" \
|
2009-02-07 20:11:13 +00:00
|
|
|
${mpfr_opt} \
|
2009-05-24 21:48:41 +00:00
|
|
|
--enable-shared \
|
|
|
|
--disable-static \
|
2008-07-14 15:15:40 +00:00
|
|
|
--with-gmp="${CT_PREFIX_DIR}"
|
2008-04-30 10:43:41 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Building MPFR"
|
2008-07-14 15:15:40 +00:00
|
|
|
CT_DoExecLog ALL make ${PARALLELMFLAGS}
|
2008-04-30 10:43:41 +00:00
|
|
|
|
2009-05-25 19:46:58 +00:00
|
|
|
if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then
|
2008-04-30 10:43:41 +00:00
|
|
|
CT_DoLog EXTRA "Checking MPFR"
|
2008-07-14 15:15:40 +00:00
|
|
|
CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
|
2008-04-30 10:43:41 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Installing MPFR"
|
2008-07-14 15:15:40 +00:00
|
|
|
CT_DoExecLog ALL make install
|
2008-04-30 10:43:41 +00:00
|
|
|
|
|
|
|
CT_EndStep
|
|
|
|
}
|
2008-04-30 16:38:06 +00:00
|
|
|
|
2009-05-25 19:46:58 +00:00
|
|
|
if [ "${CT_COMP_LIBS_TARGET}" = "y" ]; then
|
2008-04-30 16:38:06 +00:00
|
|
|
|
2008-06-20 15:16:43 +00:00
|
|
|
do_mpfr_target() {
|
|
|
|
mkdir -p "${CT_BUILD_DIR}/build-mpfr-target"
|
|
|
|
cd "${CT_BUILD_DIR}/build-mpfr-target"
|
|
|
|
|
|
|
|
CT_DoStep INFO "Installing MPFR for the target"
|
|
|
|
|
2009-02-07 20:11:13 +00:00
|
|
|
mpfr_opt=
|
2009-03-08 22:13:27 +00:00
|
|
|
# Under Cygwin, we can't build a thread-safe library
|
2009-02-07 20:11:13 +00:00
|
|
|
case "${CT_TARGET}" in
|
|
|
|
*-cygwin) mpfr_opt="--disable-thread-safe";;
|
|
|
|
*) mpfr_opt="--enable-thread-safe";;
|
|
|
|
esac
|
|
|
|
|
2008-06-20 15:16:43 +00:00
|
|
|
CT_DoLog EXTRA "Configuring MPFR"
|
2009-03-08 22:13:27 +00:00
|
|
|
CC="${CT_TARGET}-gcc" \
|
2009-01-04 14:25:58 +00:00
|
|
|
CFLAGS="${CT_CFLAGS_FOR_TARGET}" \
|
|
|
|
CT_DoExecLog ALL \
|
|
|
|
"${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}/configure" \
|
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${CT_TARGET} \
|
|
|
|
--prefix=/usr \
|
2009-02-07 20:11:13 +00:00
|
|
|
${mpfr_opt} \
|
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
2008-07-14 15:15:40 +00:00
|
|
|
--with-gmp="${CT_SYSROOT_DIR}/usr"
|
2008-06-20 15:16:43 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Building MPFR"
|
2008-07-14 15:15:40 +00:00
|
|
|
CT_DoExecLog ALL make ${PARALLELMFLAGS}
|
2008-06-20 15:16:43 +00:00
|
|
|
|
|
|
|
# Not possible to check MPFR while X-compiling
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Installing MPFR"
|
2008-07-14 15:15:40 +00:00
|
|
|
CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install
|
2008-06-20 15:16:43 +00:00
|
|
|
|
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
2010-02-17 22:47:47 +00:00
|
|
|
fi # CT_COMP_LIBS_TARGET == y
|
2008-04-30 16:38:06 +00:00
|
|
|
|
2010-02-17 22:47:47 +00:00
|
|
|
fi # CT_MPFR == y
|