Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pax-utils:master commit in: /
Date: Thu, 17 Dec 2015 03:24:46
Message-Id: 1450318961.dbf8ea54cb9bfb309dde721cde4ccec594da2010.vapier@gentoo
1 commit: dbf8ea54cb9bfb309dde721cde4ccec594da2010
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 17 02:22:41 2015 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 17 02:22:41 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=dbf8ea54
7
8 build: pull in ax macros recursively
9
10 Make sure we also get the files that the ax macros themselves need.
11
12 autogen.sh | 24 +++++++++++++++++++++---
13 1 file changed, 21 insertions(+), 3 deletions(-)
14
15 diff --git a/autogen.sh b/autogen.sh
16 index 3d49418..f552d22 100755
17 --- a/autogen.sh
18 +++ b/autogen.sh
19 @@ -40,10 +40,28 @@ v --fold="gnulib-tool" gnulib-tool \
20
21 # not everyone has sys-devel/autoconf-archive installed
22 v tar xf travis/autotools.tar.xz
23 -for macro in $(grep -o '\<AX[A-Z_]*\>' configure.ac | sort -u) ; do
24 - if m4=$(grep -rl "\[${macro}\]" /usr/share/aclocal/) ; then
25 - v cp $m4 ${m4dir}/
26 +has() { [[ " ${*:2} " == *" $1 "* ]] ; }
27 +import_ax() {
28 + local macro content m4 lm4s=()
29 + content=$(sed -e '/^[[:space:]]*#/d' -e 's:\<dnl\>.*::' "$@")
30 + for macro in $(echo "${content}" | grep -o '\<AX[A-Z_]*\>' | sort -u) ; do
31 + for m4 in $(grep -rl "\[${macro}\]" /usr/share/aclocal/) ; do
32 + has ${m4} "${m4s[@]}" || lm4s+=( ${m4} )
33 + done
34 + done
35 + if [[ ${#lm4s[@]} -gt 0 ]] ; then
36 + cp -v `printf '%s\n' ${lm4s[@]} | sort -u` autotools/m4/
37 + m4s+=( "${lm4s[@]}" )
38 fi
39 +}
40 +m4s=()
41 +import_ax configure.ac
42 +curr=1
43 +new=0
44 +while [[ ${curr} -ne ${new} ]] ; do
45 + curr=${#m4s[@]}
46 + import_ax autotools/m4/ax_*.m4
47 + new=${#m4s[@]}
48 done
49
50 export AUTOMAKE="automake --foreign"