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 1Raa9J-0002sm-1c for garchives@archives.gentoo.org; Tue, 13 Dec 2011 21:44:37 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AC70121C043; Tue, 13 Dec 2011 21:44:25 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8065B21C043 for ; Tue, 13 Dec 2011 21:44:25 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E48A41B400F for ; Tue, 13 Dec 2011 21:44:24 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 559) id E3E592004B; Tue, 13 Dec 2011 21:44:22 +0000 (UTC) From: "Mike Frysinger (vapier)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, vapier@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in eclass: autotools.eclass X-VCS-Repository: gentoo-x86 X-VCS-Files: autotools.eclass X-VCS-Directories: eclass X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger Content-Type: text/plain; charset=utf8 Message-Id: <20111213214422.E3E592004B@flycatcher.gentoo.org> Date: Tue, 13 Dec 2011 21:44:22 +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: 44d7a047-3bd5-498a-9a21-f0b68a49d3aa X-Archives-Hash: f3f1feb3b2f983bfa2f099ee4414eecf vapier 11/12/13 21:44:22 Modified: autotools.eclass Log: unify duplicated code for extracting values from traced variables Revision Changes Path 1.112 eclass/autotools.eclass file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools.e= class?rev=3D1.112&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools.e= class?rev=3D1.112&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools.e= class?r1=3D1.111&r2=3D1.112 Index: autotools.eclass =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v retrieving revision 1.111 retrieving revision 1.112 diff -u -r1.111 -r1.112 --- autotools.eclass 13 Dec 2011 21:27:38 -0000 1.111 +++ autotools.eclass 13 Dec 2011 21:44:22 -0000 1.112 @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.111 2011/= 12/13 21:27:38 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.112 2011/= 12/13 21:44:22 vapier Exp $ =20 # @ECLASS: autotools.eclass # @MAINTAINER: @@ -352,36 +352,23 @@ return 0 } =20 -# Internal function to get additional subdirs to configure -autotools_get_subdirs() { - local subdirs_scan_out - - subdirs_scan_out=3D$(autotools_check_macro "AC_CONFIG_SUBDIRS") - [[ -n ${subdirs_scan_out} ]] || return 0 - - echo "${subdirs_scan_out}" | gawk \ - '($0 !~ /^[[:space:]]*(#|dnl)/) { - if (match($0, /AC_CONFIG_SUBDIRS:(.*)$/, res)) - print res[1] - }' | uniq +# Internal function to look for a macro and extract its value +autotools_check_macro_val() { + local macro=3D$1 scan_out + + autotools_check_macro "${macro}" | \ + gawk -v macro=3D"${macro}" \ + '($0 !~ /^[[:space:]]*(#|dnl)/) { + if (match($0, macro ":(.*)$", res)) + print res[1] + }' | uniq =20 return 0 } =20 -autotools_get_auxdir() { - local auxdir_scan_out - - auxdir_scan_out=3D$(autotools_check_macro "AC_CONFIG_AUX_DIR") - [[ -n ${auxdir_scan_out} ]] || return 0 - - echo ${auxdir_scan_out} | gawk \ - '($0 !~ /^[[:space:]]*(#|dnl)/) { - if (match($0, /AC_CONFIG_AUX_DIR:(.*)$/, res)) - print res[1] - }' | uniq - - return 0 -} +# Internal function to get additional subdirs to configure +autotools_get_subdirs() { autotools_check_macro_val AC_CONFIG_SUBDIRS ; = } +autotools_get_auxdir() { autotools_check_macro_val AC_CONFIG_AUX_DIR ; } =20 autotools_m4dir_include() { [[ -n ${AT_M4DIR} ]] || return