mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-02-06 10:59:21 +00:00
debug/gdb: fix $need_expat_src usage for native-gdb
For the native-gdb (ie on the target), we unconditionally need to build expat. Make it a backend, it makes a litle bit cleaner code. Reported-by: Trevor Woerner <twoerner@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
This commit is contained in:
parent
c31652d67d
commit
5b41901f99
@ -280,26 +280,16 @@ do_debug_gdb_build() {
|
|||||||
gdb_native_CFLAGS+=("-L${CT_BUILD_DIR}/static-target/lib")
|
gdb_native_CFLAGS+=("-L${CT_BUILD_DIR}/static-target/lib")
|
||||||
fi # need_ncurses_src
|
fi # need_ncurses_src
|
||||||
|
|
||||||
if [ "${need_expat_src}" = "y" ]; then
|
# Build libexpat
|
||||||
CT_DoLog EXTRA "Building static target expat"
|
CT_DoLog EXTRA "Building static target expat"
|
||||||
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-expat-target-${CT_TARGET}"
|
||||||
mkdir -p "${CT_BUILD_DIR}/expat-build"
|
do_expat_backend host="${CT_TARGET}" \
|
||||||
cd "${CT_BUILD_DIR}/expat-build"
|
prefix="${CT_BUILD_DIR}/static-target" \
|
||||||
|
cflags="" \
|
||||||
CT_DoExecLog CFG \
|
ldflags=""
|
||||||
"${CT_SRC_DIR}/expat-${CT_DEBUG_GDB_EXPAT_VERSION}/configure" \
|
CT_Popd
|
||||||
--build=${CT_BUILD} \
|
native_extra_config+=("--with-expat")
|
||||||
--host=${CT_TARGET} \
|
native_extra_config+=("--with-libexpat-prefix=${CT_BUILD_DIR}/static-target")
|
||||||
--prefix="${CT_BUILD_DIR}/static-target" \
|
|
||||||
--enable-static \
|
|
||||||
--disable-shared
|
|
||||||
|
|
||||||
CT_DoExecLog ALL make ${JOBSFLAGS}
|
|
||||||
CT_DoExecLog ALL make install
|
|
||||||
|
|
||||||
native_extra_config+=("--with-expat")
|
|
||||||
native_extra_config+=("--with-libexpat-prefix=${CT_BUILD_DIR}/static-target")
|
|
||||||
fi # need_expat_src
|
|
||||||
|
|
||||||
CT_DoLog EXTRA "Configuring native gdb"
|
CT_DoLog EXTRA "Configuring native gdb"
|
||||||
|
|
||||||
@ -419,3 +409,32 @@ do_debug_gdb_build() {
|
|||||||
CT_EndStep
|
CT_EndStep
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Build libexpat
|
||||||
|
# Parameter : description : type : default
|
||||||
|
# host : machine to run on : tuple : (none)
|
||||||
|
# prefix : prefix to install into : dir : (none)
|
||||||
|
# cflags : cflags to use : string : (empty)
|
||||||
|
# ldflags : ldflags to use : string : (empty)
|
||||||
|
do_gdb_expat_backend() {
|
||||||
|
local host
|
||||||
|
local prefix
|
||||||
|
local cflags
|
||||||
|
local ldflags
|
||||||
|
local arg
|
||||||
|
|
||||||
|
for arg in "$@"; do
|
||||||
|
eval "${arg// /\\ }"
|
||||||
|
done
|
||||||
|
|
||||||
|
CT_DoExecLog CFG \
|
||||||
|
"${CT_SRC_DIR}/expat-${CT_DEBUG_GDB_EXPAT_VERSION}/configure" \
|
||||||
|
--build=${CT_BUILD} \
|
||||||
|
--host=${host} \
|
||||||
|
--prefix="${prefix}" \
|
||||||
|
--enable-static \
|
||||||
|
--disable-shared
|
||||||
|
|
||||||
|
CT_DoExecLog ALL make ${JOBSFLAGS}
|
||||||
|
CT_DoExecLog ALL make install
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user