2008-04-30 10:43:41 +00:00
|
|
|
# This file adds the functions to build the GMP 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_gmp_get() { :; }
|
|
|
|
do_gmp_extract() { :; }
|
|
|
|
do_gmp() { :; }
|
|
|
|
do_gmp_target() { :; }
|
|
|
|
|
|
|
|
# Overide functions depending on configuration
|
2010-02-17 22:50:49 +00:00
|
|
|
if [ "${CT_GMP}" = "y" -o "${CT_GMP_TARGET}" = "y" ]; then
|
2008-04-30 16:38:06 +00:00
|
|
|
|
2008-04-30 10:43:41 +00:00
|
|
|
# Download GMP
|
|
|
|
do_gmp_get() {
|
2009-01-04 14:25:58 +00:00
|
|
|
CT_GetFile "gmp-${CT_GMP_VERSION}" {ftp,http}://{ftp.sunet.se/pub,ftp.gnu.org}/gnu/gmp
|
2008-04-30 10:43:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Extract GMP
|
|
|
|
do_gmp_extract() {
|
2009-01-05 23:02:43 +00:00
|
|
|
CT_Extract "gmp-${CT_GMP_VERSION}"
|
|
|
|
CT_Patch "gmp-${CT_GMP_VERSION}"
|
2008-04-30 10:43:41 +00:00
|
|
|
}
|
|
|
|
|
2010-02-17 22:50:49 +00:00
|
|
|
if [ "${CT_GMP}" = "y" ]; then
|
|
|
|
|
2008-04-30 10:43:41 +00:00
|
|
|
do_gmp() {
|
2010-04-10 22:47:23 +00:00
|
|
|
local -a gmp_opts
|
2009-05-05 22:04:20 +00:00
|
|
|
|
2008-04-30 10:43:41 +00:00
|
|
|
mkdir -p "${CT_BUILD_DIR}/build-gmp"
|
|
|
|
cd "${CT_BUILD_DIR}/build-gmp"
|
|
|
|
|
|
|
|
CT_DoStep INFO "Installing GMP"
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Configuring GMP"
|
2009-05-05 22:04:20 +00:00
|
|
|
|
2010-04-10 22:47:23 +00:00
|
|
|
if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then
|
|
|
|
gmp_opts+=( --enable-shared --disable-static )
|
|
|
|
else
|
|
|
|
gmp_opts+=( --disable-shared --enable-static )
|
|
|
|
fi
|
|
|
|
|
2009-05-25 17:26:21 +00:00
|
|
|
CFLAGS="${CT_CFLAGS_FOR_HOST} -fexceptions" \
|
2009-01-04 14:25:58 +00:00
|
|
|
CT_DoExecLog ALL \
|
|
|
|
"${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \
|
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${CT_HOST} \
|
|
|
|
--prefix="${CT_PREFIX_DIR}" \
|
2009-05-05 22:04:20 +00:00
|
|
|
--enable-fft \
|
|
|
|
--enable-mpbsd \
|
2010-04-10 22:47:23 +00:00
|
|
|
--enable-cxx \
|
|
|
|
"${gmp_opts[@]}"
|
2008-04-30 10:43:41 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Building GMP"
|
2008-07-14 13:55:30 +00:00
|
|
|
CT_DoExecLog ALL make ${PARALLELMFLAGS}
|
2008-04-30 10:43:41 +00:00
|
|
|
|
2010-04-10 21:42:28 +00:00
|
|
|
if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
|
2008-04-30 10:43:41 +00:00
|
|
|
CT_DoLog EXTRA "Checking GMP"
|
2008-07-14 13:55:30 +00:00
|
|
|
CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
|
2008-04-30 10:43:41 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Installing GMP"
|
2008-07-14 13:55:30 +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
|
|
|
|
2010-02-17 22:50:49 +00:00
|
|
|
fi # CT_GMP
|
|
|
|
|
|
|
|
if [ "${CT_GMP_TARGET}" = "y" ]; then
|
2008-04-30 16:38:06 +00:00
|
|
|
|
2008-06-20 15:16:43 +00:00
|
|
|
do_gmp_target() {
|
|
|
|
mkdir -p "${CT_BUILD_DIR}/build-gmp-target"
|
|
|
|
cd "${CT_BUILD_DIR}/build-gmp-target"
|
|
|
|
|
|
|
|
CT_DoStep INFO "Installing GMP for the target"
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Configuring GMP"
|
2009-01-04 14:25:58 +00:00
|
|
|
CFLAGS="${CT_CFLAGS_FOR_TARGET}" \
|
|
|
|
CT_DoExecLog ALL \
|
|
|
|
"${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \
|
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${CT_TARGET} \
|
|
|
|
--prefix=/usr \
|
2009-05-05 22:04:20 +00:00
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--enable-fft \
|
|
|
|
--enable-mpbsd \
|
2008-06-20 15:16:43 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Building GMP"
|
2008-07-14 21:21:35 +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 GMP"
|
2008-07-14 21:21:35 +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:50:49 +00:00
|
|
|
fi # CT_GMP_TARGET
|
2008-04-30 16:38:06 +00:00
|
|
|
|
2010-02-17 22:50:49 +00:00
|
|
|
fi # CT_GMP || CT_GMP_TARGET
|