From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RXU4n-0003jJ-0Q for garchives@archives.gentoo.org; Mon, 05 Dec 2011 08:39:05 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CCFF421C04E; Mon, 5 Dec 2011 08:38:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9DCCE21C042 for ; Mon, 5 Dec 2011 08:38:28 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 218C71B4030 for ; Mon, 5 Dec 2011 08:38:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 941958004C for ; Mon, 5 Dec 2011 08:38:27 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: Subject: [gentoo-commits] dev/mgorny:master commit in: eclass/ X-VCS-Repository: dev/mgorny X-VCS-Files: eclass/autotools-utils.eclass X-VCS-Directories: eclass/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: c90d731df39a9970030d494c3e524f31514c0f36 Date: Mon, 5 Dec 2011 08:38:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 66227573-070f-44c8-8d49-50510a02ad9b X-Archives-Hash: befe5c7efab8a9af89c0f0f761dbba48 commit: c90d731df39a9970030d494c3e524f31514c0f36 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Thu Dec 1 19:00:41 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Thu Dec 1 19:00:41 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Ddev/mgorny.git;a=3D= commit;h=3Dc90d731d autotools-utils: rewrite some more autotools code to make it faster. Now we don't run aclocal multiple times, and we don't need to call autoconf to check for various macros. Of course, there is a number of corner cases where we will fail terribly. --- eclass/autotools-utils.eclass | 33 +++++++++++++++++++++++++++------ 1 files changed, 27 insertions(+), 6 deletions(-) diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclas= s index 71b0bfc..54b7d6e 100644 --- a/eclass/autotools-utils.eclass +++ b/eclass/autotools-utils.eclass @@ -274,14 +274,26 @@ remove_libtool_files() { autotools-utils_autoreconf() { debug-print-function ${FUNCNAME} "$@" =20 - einfo "Autoreconfiguring '${PWD}' ..." + # Override this func to not require unnecessary eaclocal calls. + autotools_check_macro() { + local x + + # Add a few additional variants as we don't get expansions. + [[ ${1} =3D AC_CONFIG_HEADERS ]] && set -- "${@}" AC_CONFIG_HEADER =20 - local auxdir=3D$(autotools_get_auxdir) - [[ ${auxdir} ]] && mkdir -p ${auxdir} + for x; do + grep -h "^${x}" configure.{ac,in} 2>/dev/null + done + } + + einfo "Autoreconfiguring '${PWD}' ..." =20 - # XXX: avoid calling this twice somehow... - eaclocal - _elibtoolize --copy --force --install + local auxdir=3D$(sed -n -e 's/^AC_CONFIG_AUX_DIR(\(.*\))$/\1/p' \ + configure.{ac,in} 2>/dev/null) + if [[ ${auxdir} ]]; then + auxdir=3D${auxdir%%]} + mkdir -p ${auxdir##[} + fi =20 # Support running additional tools like gnome-autogen.sh. # Note: you need to add additional depends to the ebuild. @@ -309,6 +321,15 @@ autotools-utils_autoreconf() { autotools_run_tool gnome-doc-prepare --copy fi =20 + # We need to perform the check twice to know whether to run eaclocal. + # (_elibtoolize does that itself) + if [[ $(autotools_check_macro AC_PROG_LIBTOOL AM_PROG_LIBTOOL LT_INIT) = ]] + then + _elibtoolize --copy --force --install + else + eaclocal + fi + eautoconf eautoheader eautomake