diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-12-16 21:22:41 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-12-16 21:22:41 -0500 |
commit | dbf8ea54cb9bfb309dde721cde4ccec594da2010 (patch) | |
tree | 87b6f05fb578875bfcb6378bb13bdb36acac85e1 | |
parent | gitignore: add generated scripts (diff) | |
download | pax-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-x | autogen.sh | 24 |
1 files changed, 21 insertions, 3 deletions
@@ -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" |