Merge pull request #567 from stilor/fix-build-manuals

Fix build manuals
This commit is contained in:
Alexey Neyman 2017-01-30 12:48:47 -08:00 committed by GitHub
commit 1baddb19ee
4 changed files with 38 additions and 36 deletions

View File

@ -7,17 +7,18 @@
## help A memory bound checker, with additional features.
## help Formerly known as Electric Fence.
config DUMA_A
bool
prompt "Build a static library"
default y
config DUMA_SO
bool
prompt "Build a shared library"
depends on SHARED_LIBS
default y
config DUMA_CUSTOM_WRAPPER
bool
prompt "Install custom D.U.M.A wrapper"
default y
depends on DUMA_SO
choice
bool
prompt "D.U.M.A. version"

View File

@ -246,8 +246,8 @@ do_binutils_backend() {
if [ "${CT_BINUTILS_LINKER_GOLD}" = "y" ]; then
manuals_for+=( gold )
fi
manuals_install=( "${manuals_for[@]/\#/install-pdf-}" )
manuals_install+=( "${manuals_for[@]/\#/install-html-}" )
manuals_install=( "${manuals_for[@]/#/install-pdf-}" )
manuals_install+=( "${manuals_for[@]/#/install-html-}" )
CT_DoExecLog ALL make ${JOBSFLAGS} pdf html
CT_DoExecLog ALL make "${manuals_install[@]}"
fi

View File

@ -22,42 +22,43 @@ do_debug_duma_extract() {
}
do_debug_duma_build() {
local -a make_args
CT_DoStep INFO "Installing D.U.M.A."
CT_DoLog EXTRA "Copying sources"
cp -a "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}/." "${CT_BUILD_DIR}/build-duma"
CT_Pushd "${CT_BUILD_DIR}/build-duma"
DUMA_CPP=
[ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
make_args=(
prefix="${CT_DEBUGROOT_DIR}/usr"
HOSTCC="${CT_BUILD}-gcc"
CC="${CT_TARGET}-${CT_CC}"
CXX="${CT_TARGET}-g++"
RANLIB="${CT_TARGET}-ranlib"
OS="${CT_KERNEL}"
)
[ "${CT_CC_LANG_CXX}" = "y" ] && make_args+=( DUMA_CPP=1 )
[ "${CT_DUMA_SO}" = "y" ] || make_args+=( DUMASO= )
# The shared library needs some love: some version have libduma.so.0.0,
# while others have libduma.so.0.0.0
duma_so=$(make -n -p 2>&1 |grep -E '^libduma.so[^:]*:' |head -n 1 |cut -d : -f 1)
CT_DoLog EXTRA "Building D.U.M.A"
CT_DoExecLog ALL make "${make_args[@]}" all
CT_DoLog EXTRA "Installing D.U.M.A"
CT_DoExecLog ALL make "${make_args[@]}" install
if [ "${CT_DUMA_CUSTOM_WRAPPER}" = "y" ]; then
# The shared library needs some love: some version have libduma.so.0.0,
# while others have libduma.so.0.0.0
duma_so=$( make "${make_args[@]}" printvars | sed -n -r -e 's/^DUMASO \[(.*)\]$/\1/p' )
libs=
[ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
[ "${CT_DUMA_SO}" = "y" ] && libs="${libs} ${duma_so}"
libs="${libs# }"
CT_DoLog EXTRA "Building libraries '${libs}'"
CT_DoExecLog ALL \
make HOSTCC="${CT_BUILD}-gcc" \
CC="${CT_TARGET}-${CT_CC}" \
CXX="${CT_TARGET}-g++" \
RANLIB="${CT_TARGET}-ranlib" \
DUMA_CPP="${DUMA_CPP}" \
${libs}
CT_DoLog EXTRA "Installing libraries '${libs}'"
CT_DoExecLog ALL install -m 644 ${libs} "${CT_SYSROOT_DIR}/usr/lib"
if [ "${CT_DUMA_SO}" = "y" ]; then
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_DEBUGROOT_DIR}/usr/bin"
CT_DoExecLog ALL 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_DEBUGROOT_DIR}/usr/bin/duma"
chmod 755 "${CT_DEBUGROOT_DIR}/usr/bin/duma"
CT_DoExecLog ALL rm -f "${CT_DEBUGROOT_DIR}/usr/bin/duma"
CT_DoExecLog ALL cp "${CT_LIB_DIR}/scripts/build/debug/duma.in" \
"${CT_DEBUGROOT_DIR}/usr/bin/duma"
CT_DoExecLog ALL sed -i -r -e "s:^LIBDUMA_SO=.*:LIBDUMA_SO=/usr/lib/${duma_so}:;" \
"${CT_DEBUGROOT_DIR}/usr/bin/duma"
CT_DoExecLog ALL chmod 755 "${CT_DEBUGROOT_DIR}/usr/bin/duma"
fi
CT_Popd

View File

@ -392,8 +392,8 @@ do_libc_backend_once() {
# manuals in parallel
CT_DoExecLog ALL make pdf html
CT_DoExecLog ALL mkdir -p ${CT_PREFIX_DIR}/share/doc
CT_DoExecLog ALL cp -av ${src_dir}/manual/*.pdf \
${src_dir}/manual/libc \
CT_DoExecLog ALL cp -av manual/*.pdf \
manual/libc \
${CT_PREFIX_DIR}/share/doc
fi