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() { :; }
|
|
|
|
|
|
|
|
# Overide functions depending on configuration
|
2010-08-23 21:18:49 +00:00
|
|
|
if [ "${CT_GMP}" = "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}"
|
2010-04-11 21:18:10 +00:00
|
|
|
CT_Patch "gmp" "${CT_GMP_VERSION}"
|
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" \
|
2010-10-22 20:02:57 +00:00
|
|
|
CT_DoExecLog CFG \
|
2009-01-04 14:25:58 +00:00
|
|
|
"${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \
|
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${CT_HOST} \
|
2010-04-11 09:10:06 +00:00
|
|
|
--prefix="${CT_COMPLIBS_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"
|
2011-01-22 21:35:43 +00:00
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS}
|
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"
|
2011-01-22 21:35:43 +00:00
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS} -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
|