summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-02-17 22:41:17 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-02-17 22:41:17 (GMT)
commit991b90f2425a6f14115efee2456919063d4e1a2b (patch)
treef165dbbc68303aac3b97516a5ef2da457c24c646 /scripts
parent2949150cbe92e9e90e9738a2b77489cb0593b5a7 (diff)
comp-libs: make libelf a companion library
When gcc-4.5 is out, it will require libelf. So better make it a companion library now rather than postponing the ineluctable.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/companion_libs/libelf.sh91
-rw-r--r--scripts/build/tools/100-libelf.sh43
-rw-r--r--scripts/crosstool-NG.sh.in3
3 files changed, 94 insertions, 43 deletions
diff --git a/scripts/build/companion_libs/libelf.sh b/scripts/build/companion_libs/libelf.sh
new file mode 100644
index 0000000..ecda8ff
--- /dev/null
+++ b/scripts/build/companion_libs/libelf.sh
@@ -0,0 +1,91 @@
+# 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
+
+# Uncomment when we need it for gcc-4.5
+# WARNING! This function is absolutely UNTESTED yet!
+do_libelf() {
+ : # Remove this line!
+# CT_DoStep INFO "Installing libelf"
+# mkdir -p "${CT_BUILD_DIR}/build-libelf"
+# CT_Pushd "${CT_BUILD_DIR}/build-libelf"
+#
+# CT_DoLog EXTRA "Configuring libelf"
+# CC="${CT_TARGET}-gcc" \
+# CT_DoExecLog ALL \
+# "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \
+# --build=${CT_BUILD} \
+# --host=${CT_HOST} \
+# --target=${CT_TARGET} \
+# --prefix="${CT_PREFIX_DIR}" \
+# --enable-compat \
+# --enable-elf64 \
+# --enable-static \
+# --enable-shared \
+# --enable-extended-format
+#
+# 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
+
+if [ "${CT_LIBELF_TARGET}" = "y" ]; then
+
+do_libelf_target() {
+ CT_DoStep INFO "Installing libelf for the target"
+ mkdir -p "${CT_BUILD_DIR}/build-libelf"
+ CT_Pushd "${CT_BUILD_DIR}/build-libelf"
+
+ CT_DoLog EXTRA "Configuring libelf"
+ CC="${CT_TARGET}-gcc" \
+ CT_DoExecLog ALL \
+ "${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
diff --git a/scripts/build/tools/100-libelf.sh b/scripts/build/tools/100-libelf.sh
deleted file mode 100644
index 2ee9292..0000000
--- a/scripts/build/tools/100-libelf.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-# Build script for libelf
-
-do_tools_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_tools_libelf_extract() {
- CT_Extract "libelf-${CT_LIBELF_VERSION}"
- CT_Patch "libelf-${CT_LIBELF_VERSION}"
-}
-
-do_tools_libelf_build() {
- CT_DoStep INFO "Installing libelf"
- mkdir -p "${CT_BUILD_DIR}/build-libelf"
- CT_Pushd "${CT_BUILD_DIR}/build-libelf"
-
- CT_DoLog EXTRA "Configuring libelf"
- CC="${CT_TARGET}-gcc" \
- CT_DoExecLog ALL \
- "${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
-}
-
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index 34d1f69..69b1072 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -118,6 +118,7 @@ CT_DoLog INFO "Building environment variables"
. "${CT_LIB_DIR}/scripts/build/companion_libs/ppl.sh"
. "${CT_LIB_DIR}/scripts/build/companion_libs/cloog.sh"
. "${CT_LIB_DIR}/scripts/build/companion_libs/mpc.sh"
+. "${CT_LIB_DIR}/scripts/build/companion_libs/libelf.sh"
. "${CT_LIB_DIR}/scripts/build/binutils/binutils.sh"
. "${CT_LIB_DIR}/scripts/build/binutils/elf2flt.sh"
. "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh"
@@ -500,6 +501,7 @@ if [ -z "${CT_RESTART}" ]; then
do_ppl_get
do_cloog_get
do_mpc_get
+ do_libelf_get
do_binutils_get
do_elf2flt_get
do_cc_get
@@ -529,6 +531,7 @@ if [ -z "${CT_RESTART}" ]; then
do_ppl_extract
do_cloog_extract
do_mpc_extract
+ do_libelf_extract
do_binutils_extract
do_elf2flt_extract
do_cc_extract