crosstool-ng/scripts/build/companion_libs/libelf.sh
Yann E. MORIN" 5e27ad1e5a complibs: disable building shared libs
Managing the shared version of the companion libraries
has become cumbersome.

Also, it will one day be possible to use the companion
libraries from the host distribution, and then we will
be able to easily use either shared or static libs.

As a side note, while working on the canadian-rework
series, it has become quite more complex to properly
handle shared companion libraries, as they need to be
built both for the build and gost systems. That's not
easy to handle. At all.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-04-06 22:30:57 +02:00

92 lines
3.0 KiB
Bash

# Build script for libelf
do_libelf_get() { :; }
do_libelf_extract() { :; }
do_libelf() { :; }
do_libelf_target() { :; }
if [ "${CT_LIBELF}" = "y" -o "${CT_LIBELF_TARGET}" = "y" ]; then
do_libelf_get() {
# The server hosting libelf will return an "HTTP 300 : Multiple Choices"
# error code if we try to download a file that does not exists there.
# So we have to request the file with an explicit extension.
CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/
}
do_libelf_extract() {
CT_Extract "libelf-${CT_LIBELF_VERSION}"
CT_Patch "libelf" "${CT_LIBELF_VERSION}"
}
if [ "${CT_LIBELF}" = "y" ]; then
do_libelf() {
CT_DoStep INFO "Installing libelf"
mkdir -p "${CT_BUILD_DIR}/build-libelf"
CT_Pushd "${CT_BUILD_DIR}/build-libelf"
CT_DoLog EXTRA "Configuring libelf"
CT_DoExecLog CFG \
CC="${CT_HOST}-gcc" \
CFLAGS="-fPIC" \
"${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \
--build=${CT_BUILD} \
--host=${CT_HOST} \
--target=${CT_TARGET} \
--prefix="${CT_COMPLIBS_DIR}" \
--enable-compat \
--enable-elf64 \
--enable-extended-format \
--disable-shared \
--enable-static
CT_DoLog EXTRA "Building libelf"
CT_DoExecLog ALL make
CT_DoLog EXTRA "Installing libelf"
CT_DoExecLog ALL make install
CT_Popd
CT_EndStep
}
fi # CT_LIBELF
if [ "${CT_LIBELF_TARGET}" = "y" ]; then
do_libelf_target() {
CT_DoStep INFO "Installing libelf for the target"
mkdir -p "${CT_BUILD_DIR}/build-libelf-for-target"
CT_Pushd "${CT_BUILD_DIR}/build-libelf-for-target"
CT_DoLog EXTRA "Configuring libelf"
CT_DoExecLog CFG \
CC="${CT_TARGET}-gcc" \
CFLAGS="-fPIC" \
"${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \
--build=${CT_BUILD} \
--host=${CT_TARGET} \
--target=${CT_TARGET} \
--prefix=/usr \
--enable-compat \
--enable-elf64 \
--enable-shared \
--enable-extended-format \
--enable-static
CT_DoLog EXTRA "Building libelf"
CT_DoExecLog ALL make
CT_DoLog EXTRA "Installing libelf"
CT_DoExecLog ALL make instroot="${CT_SYSROOT_DIR}" install
CT_Popd
CT_EndStep
}
fi # CT_LIBELF_TARGET
fi # CT_LIBELF || CT_LIBELF_TARGET