diff options
author | Michael Haubenwallner <haubi@gentoo.org> | 2013-11-22 09:05:55 +0000 |
---|---|---|
committer | Michael Haubenwallner <haubi@gentoo.org> | 2013-11-22 09:05:55 +0000 |
commit | 980d02a5a925a5f73f289c620fe2c6f9abc882ce (patch) | |
tree | da6df3ac5762bb6fb3363d459d40f161cb931c15 /eclass/libtool.eclass | |
parent | perl eblits v50160001: Support AIX platform (ppc-aix keyword). (diff) | |
download | gentoo-2-980d02a5a925a5f73f289c620fe2c6f9abc882ce.tar.gz gentoo-2-980d02a5a925a5f73f289c620fe2c6f9abc882ce.tar.bz2 gentoo-2-980d02a5a925a5f73f289c620fe2c6f9abc882ce.zip |
libtool.eclass elibtoolize(): Besides ltmain.sh, explicitly locate configure
to apply patches rather than guessing based on where ltmain.sh was found.
Diffstat (limited to 'eclass/libtool.eclass')
-rw-r--r-- | eclass/libtool.eclass | 173 |
1 files changed, 84 insertions, 89 deletions
diff --git a/eclass/libtool.eclass b/eclass/libtool.eclass index 3eea6ad10acc..793741329ed2 100644 --- a/eclass/libtool.eclass +++ b/eclass/libtool.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.106 2013/05/11 11:17:58 aballier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.107 2013/11/22 09:05:55 haubi Exp $ # @ECLASS: libtool.eclass # @MAINTAINER: @@ -204,9 +204,9 @@ elibtoolize() { # Reuse "$@" for dirs to patch set -- if [[ ${do_shallow} == "yes" ]] ; then - [[ -f ${S}/ltmain.sh ]] && set -- "${S}" + [[ -f ${S}/ltmain.sh || -f ${S}/configure ]] && set -- "${S}" else - set -- $(find "${S}" -name ltmain.sh -printf '%h ') + set -- $(find "${S}" '(' -name ltmain.sh -o -name configure ')' -printf '%h\n' | sort -u) fi local d p @@ -225,8 +225,12 @@ elibtoolize() { ewarn " avoid this if possible (perhaps by filing a bug)" fi + local ret + + # patching ltmain.sh + [[ -f ${d}/ltmain.sh ]] && for p in ${elt_patches} ; do - local ret=0 + ret=0 case ${p} in portage) @@ -258,17 +262,6 @@ elibtoolize() { ELT_walk_patches "${d}/ltmain.sh" "${p}" ret=$? ;; - uclibc-conf) - if grep -qs 'Transform linux' "${d}/configure" ; then - ELT_walk_patches "${d}/configure" "${p}" - ret=$? - # ltmain.sh and co might be in a subdirectory ... - elif [[ ! -e ${d}/configure ]] && \ - grep -qs 'Transform linux' "${d}/../configure" ; then - ELT_walk_patches "${d}/../configure" "${p}" - ret=$? - fi - ;; uclibc-ltconf) # Newer libtoolize clears ltconfig, as not used anymore if [[ -s ${d}/ltconfig ]] ; then @@ -276,34 +269,12 @@ elibtoolize() { ret=$? fi ;; - fbsd-conf) - if grep -qs 'version_type=freebsd-' "${d}/configure" ; then - ELT_walk_patches "${d}/configure" "${p}" - ret=$? - # ltmain.sh and co might be in a subdirectory ... - elif [[ ! -e ${d}/configure ]] && \ - grep -qs 'version_type=freebsd-' "${d}/../configure" ; then - ELT_walk_patches "${d}/../configure" "${p}" - ret=$? - fi - ;; fbsd-ltconf) if [[ -s ${d}/ltconfig ]] ; then ELT_walk_patches "${d}/ltconfig" "${p}" ret=$? fi ;; - darwin-conf) - if grep -qs '&& echo \.so ||' "${d}/configure" ; then - ELT_walk_patches "${d}/configure" "${p}" - ret=$? - # ltmain.sh and co might be in a subdirectory ... - elif [[ ! -e ${d}/configure ]] && \ - grep -qs '&& echo \.so ||' "${d}/../configure" ; then - ELT_walk_patches "${d}/../configure" "${p}" - ret=$? - fi - ;; darwin-ltconf) # Newer libtoolize clears ltconfig, as not used anymore if [[ -s ${d}/ltconfig ]] ; then @@ -321,49 +292,6 @@ elibtoolize() { ret=$? fi ;; - aixrtl|hpux-conf) - ret=1 - local subret=0 - # apply multiple patches as often as they match - while [[ $subret -eq 0 ]]; do - subret=1 - if [[ -e ${d}/configure ]]; then - ELT_walk_patches "${d}/configure" "${p}" - subret=$? - # ltmain.sh and co might be in a subdirectory ... - elif [[ ! -e ${d}/configure && -e ${d}/../configure ]] ; then - ELT_walk_patches "${d}/../configure" "${p}" - subret=$? - fi - if [[ $subret -eq 0 ]]; then - # have at least one patch succeeded. - ret=0 - fi - done - ;; - mint-conf|gold-conf|sol2-conf) - ret=1 - local subret=1 - if [[ -e ${d}/configure ]]; then - ELT_walk_patches "${d}/configure" "${p}" - subret=$? - # ltmain.sh and co might be in a subdirectory ... - elif [[ -e ${d}/../configure ]] ; then - ELT_walk_patches "${d}/../configure" "${p}" - subret=$? - elif [[ -e ${d}/../../configure ]] ; then - ELT_walk_patches "${d}/../../configure" "${p}" - subret=$? - fi - if [[ $subret -eq 0 ]]; then - # have at least one patch succeeded. - ret=0 - fi - ;; - target-nm) - ELT_walk_patches "${d}/configure" "${p}" - ret=$? - ;; install-sh) ELT_walk_patches "${d}/install-sh" "${p}" ret=$? @@ -421,15 +349,6 @@ elibtoolize() { uclibc-*) [[ ${CHOST} == *-uclibc ]] && ewarn " uClibc patch set '${p}' failed to apply!" ;; - fbsd-*) - if [[ ${CHOST} == *-freebsd* ]] ; then - if [[ -z $(grep 'Handle Gentoo/FreeBSD as it was Linux' \ - "${d}/configure" "${d}/../configure" 2>/dev/null) ]]; then - eerror " FreeBSD patch set '${p}' failed to apply!" - die "FreeBSD patch set '${p}' failed to apply!" - fi - fi - ;; darwin-*) [[ ${CHOST} == *"-darwin"* ]] && ewarn " Darwin patch set '${p}' failed to apply!" ;; @@ -437,6 +356,8 @@ elibtoolize() { fi done + # makes sense for ltmain.sh patches only + [[ -f ${d}/ltmain.sh ]] && if [[ -z ${ELT_APPLIED_PATCHES} ]] ; then if [[ ${do_portage} == "no" && \ ${do_reversedeps} == "no" && \ @@ -448,6 +369,80 @@ elibtoolize() { fi fi + # patching configure + [[ -f ${d}/configure ]] && + for p in ${elt_patches} ; do + ret=0 + + case ${p} in + uclibc-conf) + if grep -qs 'Transform linux' "${d}/configure" ; then + ELT_walk_patches "${d}/configure" "${p}" + ret=$? + fi + ;; + fbsd-conf) + if grep -qs 'version_type=freebsd-' "${d}/configure" ; then + ELT_walk_patches "${d}/configure" "${p}" + ret=$? + fi + ;; + darwin-conf) + if grep -qs '&& echo \.so ||' "${d}/configure" ; then + ELT_walk_patches "${d}/configure" "${p}" + ret=$? + fi + ;; + aixrtl|hpux-conf) + ret=1 + local subret=0 + # apply multiple patches as often as they match + while [[ $subret -eq 0 ]]; do + subret=1 + if [[ -e ${d}/configure ]]; then + ELT_walk_patches "${d}/configure" "${p}" + subret=$? + fi + if [[ $subret -eq 0 ]]; then + # have at least one patch succeeded. + ret=0 + fi + done + ;; + mint-conf|gold-conf|sol2-conf) + ELT_walk_patches "${d}/configure" "${p}" + ret=$? + ;; + target-nm) + ELT_walk_patches "${d}/configure" "${p}" + ret=$? + ;; + *) + # ltmain.sh patches are applied above + ;; + esac + + if [[ ${ret} -ne 0 ]] ; then + case ${p} in + uclibc-*) + [[ ${CHOST} == *-uclibc ]] && ewarn " uClibc patch set '${p}' failed to apply!" + ;; + fbsd-*) + if [[ ${CHOST} == *-freebsd* ]] ; then + if [[ -z $(grep 'Handle Gentoo/FreeBSD as it was Linux' \ + "${d}/configure" 2>/dev/null) ]]; then + eerror " FreeBSD patch set '${p}' failed to apply!" + die "FreeBSD patch set '${p}' failed to apply!" + fi + fi + ;; + darwin-*) + [[ ${CHOST} == *"-darwin"* ]] && ewarn " Darwin patch set '${p}' failed to apply!" + ;; + esac + fi + done + rm -f "${d}/libtool" > "${d}/.elibtoolized" |