diff options
author | Chris Packham <judge.packham@gmail.com> | 2021-09-16 21:30:46 +1200 |
---|---|---|
committer | Chris Packham <judge.packham@gmail.com> | 2021-09-19 19:50:29 +1200 |
commit | 4b2b610b9a64cef9208912a0858a9087cf089ea4 (patch) | |
tree | 1d60a60f22c81f8447ad5ea33421201c4f8d355e /scripts | |
parent | 8365a791790f9fc270b23234aac842ae206f6d6c (diff) | |
download | crosstool-ng-4b2b610b9a64cef9208912a0858a9087cf089ea4.tar.gz crosstool-ng-4b2b610b9a64cef9208912a0858a9087cf089ea4.tar.bz2 crosstool-ng-4b2b610b9a64cef9208912a0858a9087cf089ea4.zip |
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>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/build/companion_libs/100-gmp.sh | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/scripts/build/companion_libs/100-gmp.sh b/scripts/build/companion_libs/100-gmp.sh index eafe2dd7..36557870 100644 --- a/scripts/build/companion_libs/100-gmp.sh +++ b/scripts/build/companion_libs/100-gmp.sh @@ -9,7 +9,7 @@ do_gmp_for_host() { :; } do_gmp_for_target() { :; } # Overide functions depending on configuration -if [ "${CT_GMP}" = "y" ]; then +if [ "${CT_GMP_TARGET}" = "y" -o "${CT_GMP}" = "y" ]; then # Download GMP do_gmp_get() { @@ -61,12 +61,40 @@ do_gmp_for_host() { 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 # Parameter : description : type : default # host : machine to run on : tuple : (none) # prefix : prefix to install into : dir : (none) # cflags : cflags to use : string : (empty) # ldflags : ldflags to use : string : (empty) +# destdir : install destination : dir : (none) do_gmp_backend() { local host local prefix @@ -127,7 +155,7 @@ do_gmp_backend() { fi CT_DoLog EXTRA "Installing GMP" - CT_DoExecLog ALL make install + CT_DoExecLog ALL make install DESTDIR="${destdir}" } fi # CT_GMP |