diff options
Diffstat (limited to 'autogen.sh')
-rwxr-xr-x | autogen.sh | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -10,11 +10,18 @@ rm -f m4/*.m4 # not everyone has sys-devel/autoconf-archive installed has() { [[ " ${*:2} " == *" $1 "* ]] ; } import_ax() { - local macro content m4 lm4s=() + local macro content m4 found 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} ) + if ! found=$(grep -rl "AC_DEFUN(\[${macro}\]" /usr/share/aclocal/) ; then + echo "error: ${macro}: unable to locate m4 definition" + exit 1 + fi + for m4 in ${found} ; do + if ! has ${m4} "${m4s[@]}" "${lm4s[@]}" ; then + echo "$*: ${macro}: ${m4}" + lm4s+=( ${m4} ) + fi done done if [[ ${#lm4s[@]} -gt 0 ]] ; then |