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 # Build script for libelf
4 do_libelf_extract() { :; }
6 do_libelf_target() { :; }
8 if [ "${CT_LIBELF}" = "y" -o "${CT_LIBELF_TARGET}" = "y" ]; then
11 # The server hosting libelf will return an "HTTP 300 : Multiple Choices"
12 # error code if we try to download a file that does not exists there.
13 # So we have to request the file with an explicit extension.
14 CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/
18 CT_Extract "libelf-${CT_LIBELF_VERSION}"
19 CT_Patch "libelf" "${CT_LIBELF_VERSION}"
22 if [ "${CT_LIBELF}" = "y" ]; then
25 CT_DoStep INFO "Installing libelf"
26 mkdir -p "${CT_BUILD_DIR}/build-libelf"
27 CT_Pushd "${CT_BUILD_DIR}/build-libelf"
29 CT_DoLog EXTRA "Configuring libelf"
34 "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \
37 --target=${CT_TARGET} \
38 --prefix="${CT_COMPLIBS_DIR}" \
41 --enable-extended-format \
45 CT_DoLog EXTRA "Building libelf"
48 CT_DoLog EXTRA "Installing libelf"
49 CT_DoExecLog ALL make install
57 if [ "${CT_LIBELF_TARGET}" = "y" ]; then
60 CT_DoStep INFO "Installing libelf for the target"
61 mkdir -p "${CT_BUILD_DIR}/build-libelf-for-target"
62 CT_Pushd "${CT_BUILD_DIR}/build-libelf-for-target"
64 CT_DoLog EXTRA "Configuring libelf"
66 CC="${CT_TARGET}-gcc" \
68 RANLIB="${CT_TARGET}-ranlib" \
69 "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \
72 --target=${CT_TARGET} \
77 --enable-extended-format \
80 CT_DoLog EXTRA "Building libelf"
83 CT_DoLog EXTRA "Installing libelf"
84 CT_DoExecLog ALL make instroot="${CT_SYSROOT_DIR}" install
92 fi # CT_LIBELF || CT_LIBELF_TARGET