scripts/functions: Fix CT_ExtractGit function.
Change CT_ExtractGit so that it clones the repository, instead of just
symlinking it. After cloning, any given ref is checked out, or if no
ref is given, the HEAD of the repository is checked out.
This makes CT_Extract behave similar for git repositories as it does
for tarballs, so that it for example can be used for passing glibc-ports
as a git repository.
Signed-off-by: "Esben Haabendal" <esben.haabendal@prevas.dk>
[yann.morin.1998@anciens.enib.fr: fix incomplete var rename]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
1 # This file adds the functions to build the MPFR library
2 # Copyright 2008 Yann E. MORIN
3 # Licensed under the GPL v2. See COPYING in the root of this package
6 do_mpfr_extract() { :; }
9 # Overide function depending on configuration
10 if [ "${CT_MPFR}" = "y" ]; then
14 CT_GetFile "mpfr-${CT_MPFR_VERSION}" http://www.mpfr.org/mpfr-current/ \
15 http://www.mpfr.org/mpfr-${CT_MPFR_VERSION}/
20 CT_Extract "mpfr-${CT_MPFR_VERSION}"
21 CT_Patch "mpfr" "${CT_MPFR_VERSION}"
23 # OK, Gentoo have a sanity check that libtool.m4 and ltmain.sh have the
24 # same version number. Unfortunately, some tarballs of MPFR are not
25 # built sanely, and thus ./configure fails on Gentoo.
26 # See: http://sourceware.org/ml/crossgcc/2008-05/msg00080.html
27 # and: http://sourceware.org/ml/crossgcc/2008-06/msg00005.html
28 # This hack is not bad per se, but the MPFR guys would be better not to
29 # do that in the future...
30 # It seems that MPFR >= 2.4.0 do not need this...
31 case "${CT_MPFR_VERSION}" in
33 CT_Pushd "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}"
34 if [ ! -f .autoreconf.ct-ng ]; then
35 CT_DoLog DEBUG "Running autoreconf"
36 CT_DoExecLog ALL autoreconf
37 touch .autoreconf.ct-ng
41 1.*|2.0.*|2.1.*|2.2.*|2.3.*)
42 CT_Pushd "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}"
43 if [ ! -f .autotools.ct-ng ]; then
44 CT_DoLog DEBUG "Re-building autotools files"
45 CT_DoExecLog ALL autoreconf -fi
46 # Starting with libtool-1.9f, config.{guess,sub} are no longer
47 # installed without -i, but starting with libtool-2.2.6, they
48 # are no longer removed without -i. Sight... Just use -i with
50 # See: http://sourceware.org/ml/crossgcc/2008-11/msg00046.html
51 # and: http://sourceware.org/ml/crossgcc/2008-11/msg00048.html
53 case "$(libtoolize --version |head -n 1 |awk '{ print $(NF); }')" in
56 *) libtoolize_opt=-i;;
58 CT_DoExecLog ALL libtoolize -f ${libtoolize_opt}
59 touch .autotools.ct-ng
67 mkdir -p "${CT_BUILD_DIR}/build-mpfr"
68 cd "${CT_BUILD_DIR}/build-mpfr"
70 CT_DoStep INFO "Installing MPFR"
72 # Under Cygwin, we can't build a thread-safe library
74 *cygwin*) mpfr_opts+=( --disable-thread-safe );;
75 *mingw*) mpfr_opts+=( --disable-thread-safe );;
76 *darwin*) mpfr_opts+=( --disable-thread-safe );;
77 *) mpfr_opts+=( --enable-thread-safe );;
81 CT_DoLog EXTRA "Configuring MPFR"
84 CFLAGS="${CT_CFLAGS_FOR_HOST}" \
85 "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}/configure" \
88 --prefix="${CT_COMPLIBS_DIR}" \
89 --with-gmp="${CT_COMPLIBS_DIR}" \
93 CT_DoLog EXTRA "Building MPFR"
94 CT_DoExecLog ALL make ${JOBSFLAGS}
96 if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
97 CT_DoLog EXTRA "Checking MPFR"
98 CT_DoExecLog ALL make ${JOBSFLAGS} -s check
101 CT_DoLog EXTRA "Installing MPFR"
102 CT_DoExecLog ALL make install