diff options
| author | Maciej Mrozowski <reavertm@gentoo.org> | 2010-07-14 04:02:06 +0200 |
|---|---|---|
| committer | Maciej Mrozowski <reavertm@gentoo.org> | 2010-07-14 05:27:47 +0200 |
| commit | 9946479b376b8f2595ef02f866f75ad4278c589d (patch) | |
| tree | d0151077b7e49e0113acbad03a2976d040ffe243 /eclass | |
| parent | 99c45867349f5181aee3a63809a296a23cc6683a (diff) | |
| download | kde-9946479b376b8f2595ef02f866f75ad4278c589d.tar.gz kde-9946479b376b8f2595ef02f866f75ad4278c589d.tar.bz2 kde-9946479b376b8f2595ef02f866f75ad4278c589d.zip | |
[eclass/autotools-utils] Add --disable-dependency-tracking to default args, fix remove_libtool_files. It now accepts 'all' or 'none' as optional argument for removing all and none .la files respectively.
Diffstat (limited to 'eclass')
| -rw-r--r-- | eclass/autotools-utils.eclass | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass index 8d9c00bbafe..6a1824033d0 100644 --- a/eclass/autotools-utils.eclass +++ b/eclass/autotools-utils.eclass @@ -131,22 +131,36 @@ _check_build_dir() { } # @FUNCTION: remove_libtool_files -# @USAGE: [all] +# @USAGE: [all|none] # @DESCRIPTION: # Determines useless libtool files (.la) and libtool static archives (.a) # and removes them from installation image. # To unconditionally remove all libtool files, pass 'all' as argument. +# To leave all libtool files alone, pass 'none' as argument. +# Unnecessary static archives are removed in any case. # # In most cases it's not necessary to manually invoke this function. # See autotools-utils_src_install for reference. remove_libtool_files() { + debug-print-function ${FUNCNAME} "$@" + local f for f in $(find "${D}" -type f -name '*.la'); do # Keep only .la files with shouldnotlink=yes - likely plugins local shouldnotlink=$(sed -ne '/^shouldnotlink=yes$/p' "${f}") - [[ "$1" != 'all' && -n ${shouldnotlink} ]] || rm -f "${f}" + if [[ "$1" == 'all' || -z ${shouldnotlink} ]]; then + if [[ "$1" != 'none' ]]; then + echo "Removing unnecessary ${f}" + rm -f "${f}" + fi + fi # Remove static libs we're not supposed to link against - [[ -n ${shouldnotlink} ]] && rm -f "${f/%.la/.a}" + if [[ -n ${shouldnotlink} ]]; then + local remove=${f/%.la/.a} + [[ "${f}" != "${remove}" ]] || die 'regex sanity check failed' + echo "Removing unnecessary ${remove}" + rm -f "${remove}" + fi done } @@ -175,7 +189,8 @@ autotools-utils_src_prepare() { autotools-utils_src_configure() { debug-print-function ${FUNCNAME} "$@" - local econfargs=(${myeconfargs[@]}) + # Common args + local econfargs=(--disable-dependency-tracking) # Handle debug found in IUSE if has debug ${IUSE//+}; then @@ -190,6 +205,9 @@ autotools-utils_src_configure() { ) fi + # Append user args + econfargs+=(${myeconfargs[@]}) + _check_build_dir mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed" pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null @@ -224,14 +242,10 @@ autotools-utils_src_install() { base_src_install popd > /dev/null - # Remove unnecessary static libs we're not supposed to link against anyway - local f - for f in $(find "${D}" -type f -name '*.la'); do - [[ -n $(sed -ne '/^shouldnotlink=yes$/p' "${f}") ]] && rm -f "${f/#.la/.a}" - done - - # Remove libtool files - has static-libs ${IUSE//+} && ! use static-libs && remove_libtool_files + # Remove libtool files and unnecessary static libs + local args + has static-libs ${IUSE//+} && ! use static-libs || args='none' + remove_libtool_files ${args} } # @FUNCTION: autotools-utils_src_test |
