aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-12-16 21:22:41 -0500
committerMike Frysinger <vapier@gentoo.org>2015-12-16 21:22:41 -0500
commitdbf8ea54cb9bfb309dde721cde4ccec594da2010 (patch)
tree87b6f05fb578875bfcb6378bb13bdb36acac85e1
parentgitignore: add generated scripts (diff)
downloadpax-utils-dbf8ea54cb9bfb309dde721cde4ccec594da2010.tar.gz
pax-utils-dbf8ea54cb9bfb309dde721cde4ccec594da2010.tar.bz2
pax-utils-dbf8ea54cb9bfb309dde721cde4ccec594da2010.zip
build: pull in ax macros recursively
Make sure we also get the files that the ax macros themselves need.
-rwxr-xr-xautogen.sh24
1 files changed, 21 insertions, 3 deletions
diff --git a/autogen.sh b/autogen.sh
index 3d49418..f552d22 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -40,10 +40,28 @@ v --fold="gnulib-tool" gnulib-tool \
# not everyone has sys-devel/autoconf-archive installed
v tar xf travis/autotools.tar.xz
-for macro in $(grep -o '\<AX[A-Z_]*\>' configure.ac | sort -u) ; do
- if m4=$(grep -rl "\[${macro}\]" /usr/share/aclocal/) ; then
- v cp $m4 ${m4dir}/
+has() { [[ " ${*:2} " == *" $1 "* ]] ; }
+import_ax() {
+ local macro content m4 lm4s=()
+ content=$(sed -e '/^[[:space:]]*#/d' -e 's:\<dnl\>.*::' "$@")
+ for macro in $(echo "${content}" | grep -o '\<AX[A-Z_]*\>' | sort -u) ; do
+ for m4 in $(grep -rl "\[${macro}\]" /usr/share/aclocal/) ; do
+ has ${m4} "${m4s[@]}" || lm4s+=( ${m4} )
+ done
+ done
+ if [[ ${#lm4s[@]} -gt 0 ]] ; then
+ cp -v `printf '%s\n' ${lm4s[@]} | sort -u` autotools/m4/
+ m4s+=( "${lm4s[@]}" )
fi
+}
+m4s=()
+import_ax configure.ac
+curr=1
+new=0
+while [[ ${curr} -ne ${new} ]] ; do
+ curr=${#m4s[@]}
+ import_ax autotools/m4/ax_*.m4
+ new=${#m4s[@]}
done
export AUTOMAKE="automake --foreign"