summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-03-03 17:41:59 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-03-03 17:41:59 (GMT)
commit6822fae02e4f32d6cd8475fb79fd10178962c53b (patch)
treeef8a3271d8080f3395c63040fdf6b84795a25ac0
parent4462fcd9951eeaf4e3daeea1e8ee61cf01b2d0ac (diff)
Allow user to add a directory component in the sys-root path.
Rename CT_DEBUG_INSTALL_DIR to CT_DEBUGROOT_DIR (to match CT_SYSROOT_DIR). As a side effect, fix creating lib64->lib symlinks. /trunk/scripts/build/debug/100-dmalloc.sh | 2 1 1 0 +- /trunk/scripts/build/debug/400-ltrace.sh | 2 1 1 0 +- /trunk/scripts/build/debug/300-gdb.sh | 6 3 3 0 +++--- /trunk/scripts/build/debug/500-strace.sh | 2 1 1 0 +- /trunk/scripts/build/debug/200-duma.sh | 6 3 3 0 +++--- /trunk/scripts/crosstool-NG.sh.in | 16 7 9 0 +++++++--------- /trunk/scripts/functions | 2 1 1 0 +- /trunk/config/toolchain.in | 17 17 0 0 +++++++++++++++++ 8 files changed, 34 insertions(+), 19 deletions(-)
-rw-r--r--config/toolchain.in17
-rw-r--r--scripts/build/debug/100-dmalloc.sh2
-rw-r--r--scripts/build/debug/200-duma.sh6
-rw-r--r--scripts/build/debug/300-gdb.sh6
-rw-r--r--scripts/build/debug/400-ltrace.sh2
-rw-r--r--scripts/build/debug/500-strace.sh2
-rw-r--r--scripts/crosstool-NG.sh.in16
-rw-r--r--scripts/functions2
8 files changed, 34 insertions, 19 deletions
diff --git a/config/toolchain.in b/config/toolchain.in
index 61d939d..6a97e4c 100644
--- a/config/toolchain.in
+++ b/config/toolchain.in
@@ -12,6 +12,23 @@ config USE_SYSROOT
You definitely want to say 'Y' here. Yes you do. I know you do. Say 'Y'.
+config SYSROOT_DIR_PREFIX
+ string
+ prompt "sysroot prefix dir (READ HELP)"
+ depends on USE_SYSROOT
+ depends on EXPERIMENTAL
+ default ""
+ help
+ *
+ * Unless you realy know you need that, leave it empty!
+ *
+
+ This string will be interpreted as a directory component to be added
+ to the sysroot path, just before the actual sysroot directory.
+
+ In fact, the sysroot path is constructed as:
+ ${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/sys-root
+
config SHARED_LIBS
bool
prompt "Build shared libraries"
diff --git a/scripts/build/debug/100-dmalloc.sh b/scripts/build/debug/100-dmalloc.sh
index 2766ff8..2c5d80c 100644
--- a/scripts/build/debug/100-dmalloc.sh
+++ b/scripts/build/debug/100-dmalloc.sh
@@ -47,7 +47,7 @@ do_debug_dmalloc_build() {
CT_DoLog EXTRA "Installing dmalloc"
CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" installincs installlib
- CT_DoExecLog ALL make DESTDIR="${CT_DEBUG_INSTALL_DIR}" installutil
+ CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" installutil
CT_EndStep
}
diff --git a/scripts/build/debug/200-duma.sh b/scripts/build/debug/200-duma.sh
index b8ef5a6..a2d6a54 100644
--- a/scripts/build/debug/200-duma.sh
+++ b/scripts/build/debug/200-duma.sh
@@ -47,12 +47,12 @@ do_debug_duma_build() {
CT_DoLog EXTRA "Installing shared library link"
ln -vsf ${duma_so} "${CT_SYSROOT_DIR}/usr/lib/libduma.so" 2>&1 |CT_DoLog ALL
CT_DoLog EXTRA "Installing wrapper script"
- mkdir -p "${CT_DEBUG_INSTALL_DIR}/usr/bin"
+ mkdir -p "${CT_DEBUGROOT_DIR}/usr/bin"
# Install a simpler, smaller, safer wrapper than the one provided by D.U.M.A.
sed -r -e 's:^LIBDUMA_SO=.*:LIBDUMA_SO=/usr/lib/'"${duma_so}"':;' \
"${CT_LIB_DIR}/scripts/build/debug/duma.in" \
- >"${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"
- chmod 755 "${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"
+ >"${CT_DEBUGROOT_DIR}/usr/bin/duma"
+ chmod 755 "${CT_DEBUGROOT_DIR}/usr/bin/duma"
fi
CT_Popd
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh
index 24d87dd..6acb567 100644
--- a/scripts/build/debug/300-gdb.sh
+++ b/scripts/build/debug/300-gdb.sh
@@ -215,10 +215,10 @@ do_debug_gdb_build() {
CT_DoExecLog ALL make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC}
CT_DoLog EXTRA "Installing native gdb"
- CT_DoExecLog ALL make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install
+ CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install
# Building a native gdb also builds a gdbserver
- find "${CT_DEBUG_INSTALL_DIR}" -type f -name gdbserver -exec rm -fv {} \; 2>&1 |CT_DoLog ALL
+ find "${CT_DEBUGROOT_DIR}" -type f -name gdbserver -exec rm -fv {} \; 2>&1 |CT_DoLog ALL
unset ac_cv_func_strncmp_works
@@ -269,7 +269,7 @@ do_debug_gdb_build() {
CT_DoExecLog ALL make ${PARALLELMFLAGS} CC=${CT_TARGET}-${CT_CC}
CT_DoLog EXTRA "Installing gdbserver"
- CT_DoExecLog ALL make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install
+ CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install
CT_EndStep
fi
diff --git a/scripts/build/debug/400-ltrace.sh b/scripts/build/debug/400-ltrace.sh
index 48cbc7b..f1e799c 100644
--- a/scripts/build/debug/400-ltrace.sh
+++ b/scripts/build/debug/400-ltrace.sh
@@ -37,7 +37,7 @@ do_debug_ltrace_build() {
CT_DoExecLog ALL make
CT_DoLog EXTRA "Installing ltrace"
- CT_DoExecLog ALL make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install
+ CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install
CT_Popd
CT_EndStep
diff --git a/scripts/build/debug/500-strace.sh b/scripts/build/debug/500-strace.sh
index 6b1ff4d..174c8dc 100644
--- a/scripts/build/debug/500-strace.sh
+++ b/scripts/build/debug/500-strace.sh
@@ -27,7 +27,7 @@ do_debug_strace_build() {
CT_DoExecLog ALL make
CT_DoLog EXTRA "Installing strace"
- CT_DoExecLog ALL make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install
+ CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install
CT_Popd
CT_EndStep
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index c14fe0c..820dde1 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -32,7 +32,7 @@
CT_WORK_DIR="${CT_WORK_DIR:-${CT_TOP_DIR}/targets}"
# Create the bin-overide early
-# Contains symlinks to the tools found bu ./configure
+# Contains symlinks to the tools found by ./configure
# Note: CT_DoLog and CT_DoExecLog do not use any of those tool, so
# they can be safely used
CT_BIN_OVERIDE_DIR="${CT_WORK_DIR}/bin"
@@ -108,7 +108,6 @@ CT_CC_EXTRA_CONFIG="${CT_ARCH_CC_EXTRA_CONFIG} ${CT_CC_EXTRA_CONFIG}"
CT_TARBALLS_DIR="${CT_WORK_DIR}/tarballs"
CT_SRC_DIR="${CT_WORK_DIR}/src"
CT_BUILD_DIR="${CT_WORK_DIR}/${CT_TARGET}/build"
-CT_DEBUG_INSTALL_DIR="${CT_INSTALL_DIR}/${CT_TARGET}/debug-root"
# Note: we'll always install the core compiler in its own directory, so as to
# not mix the two builds: core and final.
CT_CC_CORE_STATIC_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-static"
@@ -177,9 +176,6 @@ if [ -z "${CT_RESTART}" ]; then
if [ -d "${CT_INSTALL_DIR}" ]; then
CT_DoForceRmdir "${CT_INSTALL_DIR}"
fi
- if [ -d "${CT_DEBUG_INSTALL_DIR}" ]; then
- CT_DoForceRmdir "${CT_DEBUG_INSTALL_DIR}"
- fi
# In case we start anew, get rid of the previously saved state directory
if [ -d "${CT_STATE_DIR}" ]; then
CT_DoForceRmdir "${CT_STATE_DIR}"
@@ -194,7 +190,6 @@ CT_DoExecLog ALL mkdir -p "${CT_SRC_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_BUILD_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_INSTALL_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}"
-CT_DoExecLog ALL mkdir -p "${CT_DEBUG_INSTALL_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_STATE_DIR}"
@@ -229,7 +224,8 @@ if [ -z "${CT_RESTART}" ]; then
# Arrange paths depending on wether we use sys-root or not.
if [ "${CT_USE_SYSROOT}" = "y" ]; then
- CT_SYSROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/sys-root"
+ CT_SYSROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/sys-root"
+ CT_DEBUGROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/debug-root"
CT_HEADERS_DIR="${CT_SYSROOT_DIR}/usr/include"
BINUTILS_SYSROOT_ARG="--with-sysroot=${CT_SYSROOT_DIR}"
CC_CORE_SYSROOT_ARG="--with-sysroot=${CT_SYSROOT_DIR}"
@@ -253,6 +249,8 @@ if [ -z "${CT_RESTART}" ]; then
CC_SYSROOT_ARG="--with-headers=${CT_HEADERS_DIR}"
LIBC_SYSROOT_ARG="prefix="
fi
+ CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}"
+ CT_DoExecLog ALL mkdir -p "${CT_DEBUGROOT_DIR}"
# Prepare the 'lib' directories in sysroot, else the ../lib64 hack used by
# 32 -> 64 bit crosscompilers won't work, and build of final gcc will fail
@@ -264,7 +262,7 @@ if [ -z "${CT_RESTART}" ]; then
CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}/usr/lib"
# Prevent gcc from installing its libraries outside of the sys-root
- CT_DoExecLog ALL ln -sf "sys-root/lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib"
+ CT_DoExecLog ALL ln -sf "./${CT_SYSROOT_DIR_PREFIX}/sys-root/lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib"
# Now, in case we're 64 bits, just have lib64/ be a symlink to lib/
# so as to have all libraries in the same directory (we can do that
@@ -273,7 +271,7 @@ if [ -z "${CT_RESTART}" ]; then
CT_DoExecLog ALL ln -sf "lib" "${CT_PREFIX_DIR}/lib64"
CT_DoExecLog ALL ln -sf "lib" "${CT_SYSROOT_DIR}/lib64"
CT_DoExecLog ALL ln -sf "lib" "${CT_SYSROOT_DIR}/usr/lib64"
- CT_DoExecLog ALL ln -sf "sys-root/lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib64"
+ CT_DoExecLog ALL ln -sf "lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib64"
fi
# Determine build system if not set by the user
diff --git a/scripts/functions b/scripts/functions
index 740db80..4207c35 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -944,7 +944,7 @@ do_finish() {
CT_DoLog EXTRA "Removing installed documentation"
CT_DoForceRmdir "${CT_PREFIX_DIR}/"{,usr/}{man,info}
CT_DoForceRmdir "${CT_SYSROOT_DIR}/"{,usr/}{man,info}
- CT_DoForceRmdir "${CT_DEBUG_INSTALL_DIR}/"{,usr/}{man,info}
+ CT_DoForceRmdir "${CT_DEBUGROOT_DIR}/"{,usr/}{man,info}
fi
CT_EndStep