diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-07-17 18:56:30 +0200 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-07-17 18:56:30 +0200 |
commit | 2e3cc45633c343e63c84fd35f458a6ea1fdad28b (patch) | |
tree | 31b52a123b0daa335442e1539209c8041c230d22 /scripts/build/companion_libs/mpc.sh | |
parent | 533e5c128c4c955a88c16d7469a569a2c4f8cfe3 (diff) | |
download | crosstool-ng-2e3cc45633c343e63c84fd35f458a6ea1fdad28b.tar.gz crosstool-ng-2e3cc45633c343e63c84fd35f458a6ea1fdad28b.tar.bz2 crosstool-ng-2e3cc45633c343e63c84fd35f458a6ea1fdad28b.zip |
complibs: split companion libraries to backend/frontend, a-la cc_core
Move the actual complibs codes to backend functions that builds the
required combo of build/host/target as requested by a frontend.
This split is currently a no-op, but is required for the upcoming
canadian-cross rework, where we'll be needing to build the complibs
twice, one for build/build, and one for build/host.
This applies to the six companion libraries:
- GMP
- MPFR
- PPL
- Cloog/PPL
- MPC
- libelf
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts/build/companion_libs/mpc.sh')
-rw-r--r-- | scripts/build/companion_libs/mpc.sh | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/scripts/build/companion_libs/mpc.sh b/scripts/build/companion_libs/mpc.sh index f8cc87b0..3236576b 100644 --- a/scripts/build/companion_libs/mpc.sh +++ b/scripts/build/companion_libs/mpc.sh @@ -4,7 +4,7 @@ do_mpc_get() { :; } do_mpc_extract() { :; } -do_mpc() { :; } +do_mpc_for_host() { :; } # Overide functions depending on configuration if [ "${CT_MPC}" = "y" ]; then @@ -21,22 +21,47 @@ do_mpc_extract() { CT_Patch "mpc" "${CT_MPC_VERSION}" } -do_mpc() { - mkdir -p "${CT_BUILD_DIR}/build-mpc" - cd "${CT_BUILD_DIR}/build-mpc" +# Build MPC for running on host +do_mpc_for_host() { + local -a mpc_opts - CT_DoStep INFO "Installing MPC" + CT_DoStep INFO "Installing MPC for host" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-mpc-host-${CT_HOST}" + + mpc_opts+=( "host=${CT_HOST}" ) + mpc_opts+=( "prefix=${CT_COMPLIBS_DIR}" ) + mpc_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) + do_mpc_backend "${mpc_opts[@]}" + + CT_Popd + CT_EndStep +} + +# Build MPC +# Parameter : description : type : default +# host : machine to run on : tuple : (none) +# prefix : prefix to install into : dir : (none) +# cflags : host cflags to use : string : (empty) +do_mpc_backend() { + local host + local prefix + local cflags + local arg + + for arg in "$@"; do + eval "${arg// /\\ }" + done CT_DoLog EXTRA "Configuring MPC" CT_DoExecLog CFG \ - CFLAGS="${CT_CFLAGS_FOR_HOST}" \ + CFLAGS="${cflags}" \ "${CT_SRC_DIR}/mpc-${CT_MPC_VERSION}/configure" \ --build=${CT_BUILD} \ - --host=${CT_HOST} \ - --prefix="${CT_COMPLIBS_DIR}" \ - --with-gmp="${CT_COMPLIBS_DIR}" \ - --with-mpfr="${CT_COMPLIBS_DIR}" \ + --host=${host} \ + --prefix="${prefix}" \ + --with-gmp="${prefix}" \ + --with-mpfr="${prefix}" \ --disable-shared \ --enable-static @@ -50,8 +75,6 @@ do_mpc() { CT_DoLog EXTRA "Installing MPC" CT_DoExecLog ALL make install - - CT_EndStep } fi # CT_MPC |