diff options
Diffstat (limited to 'autogen.sh')
-rwxr-xr-x | autogen.sh | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -7,14 +7,21 @@ touch ChangeLog # whatever updated version is on the host rm -f m4/*.m4 -# not everyone has sys-devel/autoconf-archive installed +# not everyone has dev-build/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 |