aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-11-05 20:49:22 -0400
committerMike Frysinger <vapier@gentoo.org>2021-11-05 20:49:22 -0400
commit34bd750be930dee47ba6114f211aa97935939ecc (patch)
treeac9b8abfc9661e7d932d86741ab1a0c72558fab9 /autogen.sh
parentbuild: drop support for ancient C library versions (diff)
downloadsandbox-34bd750be930dee47ba6114f211aa97935939ecc.tar.gz
sandbox-34bd750be930dee47ba6114f211aa97935939ecc.tar.bz2
sandbox-34bd750be930dee47ba6114f211aa97935939ecc.zip
build: slim down autoconf-archive macro search
Only copy in files that define the macros we need and not ones that reference the macros. This avoids copying a lot unused files in. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/autogen.sh b/autogen.sh
index e583300..432152b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -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