mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-01-18 18:56:31 +00:00
gmp: Support building for target
Allow GMP to be build for the target. This will be needed by the up coming gdb-11. Signed-off-by: Chris Packham <judge.packham@gmail.com>
This commit is contained in:
parent
8365a79179
commit
4b2b610b9a
@ -52,6 +52,10 @@ config GMP_NEEDED
|
|||||||
def_bool y
|
def_bool y
|
||||||
select COMP_LIBS_GMP
|
select COMP_LIBS_GMP
|
||||||
|
|
||||||
|
config GMP_TARGET
|
||||||
|
bool
|
||||||
|
select COMP_LIBS_GMP
|
||||||
|
|
||||||
config MPFR_NEEDED
|
config MPFR_NEEDED
|
||||||
def_bool y
|
def_bool y
|
||||||
select GMP_NEEDED
|
select GMP_NEEDED
|
||||||
|
@ -9,7 +9,7 @@ do_gmp_for_host() { :; }
|
|||||||
do_gmp_for_target() { :; }
|
do_gmp_for_target() { :; }
|
||||||
|
|
||||||
# Overide functions depending on configuration
|
# Overide functions depending on configuration
|
||||||
if [ "${CT_GMP}" = "y" ]; then
|
if [ "${CT_GMP_TARGET}" = "y" -o "${CT_GMP}" = "y" ]; then
|
||||||
|
|
||||||
# Download GMP
|
# Download GMP
|
||||||
do_gmp_get() {
|
do_gmp_get() {
|
||||||
@ -61,12 +61,40 @@ do_gmp_for_host() {
|
|||||||
CT_EndStep
|
CT_EndStep
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ "${CT_GMP_TARGET}" = "y" ]; then
|
||||||
|
do_gmp_for_target() {
|
||||||
|
local -a gmp_opts
|
||||||
|
|
||||||
|
CT_DoStep INFO "Installing GMP for target"
|
||||||
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-gmp-target-${CT_HOST}"
|
||||||
|
|
||||||
|
gmp_opts+=( "host=${CT_TARGET}" )
|
||||||
|
case "${CT_TARGET}" in
|
||||||
|
*-*-mingw*)
|
||||||
|
prefix="/mingw"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
prefix="/usr"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
gmp_opts+=( "cflags=${CT_ALL_TARGET_CFLAGS}" )
|
||||||
|
gmp_opts+=( "prefix=${prefix}" )
|
||||||
|
gmp_opts+=( "destdir=${CT_SYSROOT_DIR}" )
|
||||||
|
gmp_opts+=( "shared=${CT_SHARED_LIBS}" )
|
||||||
|
do_gmp_backend "${gmp_opts[@]}"
|
||||||
|
|
||||||
|
CT_Popd
|
||||||
|
CT_EndStep
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
# Build GMP
|
# Build GMP
|
||||||
# Parameter : description : type : default
|
# Parameter : description : type : default
|
||||||
# host : machine to run on : tuple : (none)
|
# host : machine to run on : tuple : (none)
|
||||||
# prefix : prefix to install into : dir : (none)
|
# prefix : prefix to install into : dir : (none)
|
||||||
# cflags : cflags to use : string : (empty)
|
# cflags : cflags to use : string : (empty)
|
||||||
# ldflags : ldflags to use : string : (empty)
|
# ldflags : ldflags to use : string : (empty)
|
||||||
|
# destdir : install destination : dir : (none)
|
||||||
do_gmp_backend() {
|
do_gmp_backend() {
|
||||||
local host
|
local host
|
||||||
local prefix
|
local prefix
|
||||||
@ -127,7 +155,7 @@ do_gmp_backend() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
CT_DoLog EXTRA "Installing GMP"
|
CT_DoLog EXTRA "Installing GMP"
|
||||||
CT_DoExecLog ALL make install
|
CT_DoExecLog ALL make install DESTDIR="${destdir}"
|
||||||
}
|
}
|
||||||
|
|
||||||
fi # CT_GMP
|
fi # CT_GMP
|
||||||
|
Loading…
Reference in New Issue
Block a user