# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.95 2011/11/14 17:08:49 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.96 2011/11/18 17:32:14 vapier Exp $
# @ECLASS: libtool.eclass
# @MAINTAINER:
# generated libtool files. We do not run the libtoolize program because that
# requires a regeneration of the main autotool files in order to work properly.
+# If an overlay has eclass overrides, but doesn't actually override the
+# libtool.eclass, we'll have ECLASSDIR pointing to the active overlay's
+# eclass/ dir, but libtool.eclass is still in the main Gentoo tree. So
+# add a check to locate the ELT-patches/ regardless of what's going on.
+ECLASSDIR_LOCAL=${BASH_SOURCE[0]%/*}
+elt_patch_dir() {
+ local d="${ECLASSDIR}/ELT-patches"
+ if [[ ! -d ${d} ]] ; then
+ d="${ECLASSDIR_LOCAL}/ELT-patches"
+ fi
+ echo "${d}"
+}
+
DESCRIPTION="Based on the ${ECLASS} eclass"
inherit multilib toolchain-funcs
-ELT_PATCH_DIR="${ECLASSDIR}/ELT-patches"
-
#
# See if we can apply $2 on $1, and if so, do it
#
local ret=1
local file=$1
local patch_set=$2
- local patch_dir="${ELT_PATCH_DIR}/${patch_set}"
+ local patch_dir="$(elt_patch_dir)/${patch_set}"
local rem_int_dep=$3
[[ -z ${patch_set} ]] && return 1
sed_args+=( -e "s|@REM_INT_DEP@|${rem_int_dep}|g" )
fi
- pushd "${ELT_PATCH_DIR}" >/dev/null || die
+ pushd "$(elt_patch_dir)" >/dev/null || die
# Go through the patches in reverse order (newer version to older)
for patch in $(find "${patch_set}" -maxdepth 1 -type f | LC_ALL=C sort -r) ; do