1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/scripts/build/companion_libs/libelf.sh Mon Mar 29 20:15:25 2010 +0200
1.3 @@ -0,0 +1,91 @@
1.4 +# Build script for libelf
1.5 +
1.6 +do_libelf_get() { :; }
1.7 +do_libelf_extract() { :; }
1.8 +do_libelf() { :; }
1.9 +do_libelf_target() { :; }
1.10 +
1.11 +if [ "${CT_LIBELF}" = "y" -o "${CT_LIBELF_TARGET}" = "y" ]; then
1.12 +
1.13 +do_libelf_get() {
1.14 + # The server hosting libelf will return an "HTTP 300 : Multiple Choices"
1.15 + # error code if we try to download a file that does not exists there.
1.16 + # So we have to request the file with an explicit extension.
1.17 + CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/
1.18 +}
1.19 +
1.20 +do_libelf_extract() {
1.21 + CT_Extract "libelf-${CT_LIBELF_VERSION}"
1.22 + CT_Patch "libelf-${CT_LIBELF_VERSION}"
1.23 +}
1.24 +
1.25 +if [ "${CT_LIBELF}" = "y" ]; then
1.26 +
1.27 +# Uncomment when we need it for gcc-4.5
1.28 +# WARNING! This function is absolutely UNTESTED yet!
1.29 +do_libelf() {
1.30 + : # Remove this line!
1.31 +# CT_DoStep INFO "Installing libelf"
1.32 +# mkdir -p "${CT_BUILD_DIR}/build-libelf"
1.33 +# CT_Pushd "${CT_BUILD_DIR}/build-libelf"
1.34 +#
1.35 +# CT_DoLog EXTRA "Configuring libelf"
1.36 +# CC="${CT_TARGET}-gcc" \
1.37 +# CT_DoExecLog ALL \
1.38 +# "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \
1.39 +# --build=${CT_BUILD} \
1.40 +# --host=${CT_HOST} \
1.41 +# --target=${CT_TARGET} \
1.42 +# --prefix="${CT_PREFIX_DIR}" \
1.43 +# --enable-compat \
1.44 +# --enable-elf64 \
1.45 +# --enable-static \
1.46 +# --enable-shared \
1.47 +# --enable-extended-format
1.48 +#
1.49 +# CT_DoLog EXTRA "Building libelf"
1.50 +# CT_DoExecLog ALL make
1.51 +#
1.52 +# CT_DoLog EXTRA "Installing libelf"
1.53 +# CT_DoExecLog ALL make instroot="${CT_SYSROOT_DIR}" install
1.54 +#
1.55 +# CT_Popd
1.56 +# CT_EndStep
1.57 +}
1.58 +
1.59 +fi # CT_LIBELF
1.60 +
1.61 +if [ "${CT_LIBELF_TARGET}" = "y" ]; then
1.62 +
1.63 +do_libelf_target() {
1.64 + CT_DoStep INFO "Installing libelf for the target"
1.65 + mkdir -p "${CT_BUILD_DIR}/build-libelf"
1.66 + CT_Pushd "${CT_BUILD_DIR}/build-libelf"
1.67 +
1.68 + CT_DoLog EXTRA "Configuring libelf"
1.69 + CC="${CT_TARGET}-gcc" \
1.70 + CT_DoExecLog ALL \
1.71 + "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \
1.72 + --build=${CT_BUILD} \
1.73 + --host=${CT_TARGET} \
1.74 + --target=${CT_TARGET} \
1.75 + --prefix=/usr \
1.76 + --enable-compat \
1.77 + --enable-elf64 \
1.78 + --enable-shared \
1.79 + --enable-extended-format \
1.80 + --enable-static
1.81 +
1.82 + CT_DoLog EXTRA "Building libelf"
1.83 + CT_DoExecLog ALL make
1.84 +
1.85 + CT_DoLog EXTRA "Installing libelf"
1.86 + CT_DoExecLog ALL make instroot="${CT_SYSROOT_DIR}" install
1.87 +
1.88 + CT_Popd
1.89 + CT_EndStep
1.90 +}
1.91 +
1.92 +fi # CT_LIBELF_TARGET
1.93 +
1.94 +fi # CT_LIBELF || CT_LIBELF_TARGET