summaryrefslogtreecommitdiff
path: root/gnulib-tool
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2021-12-19 12:49:16 +0100
committerBruno Haible <bruno@clisp.org>2021-12-19 12:49:16 +0100
commit4bdc327dbda59dcdbfa0f983a4f35c4a4ec3578c (patch)
tree943ae33894b9597955f549140a02f710e505ae82 /gnulib-tool
parent44cda2c371b4373246a18188ead1ba8bbdaf2c98 (diff)
downloadgnulib-4bdc327dbda59dcdbfa0f983a4f35c4a4ec3578c.tar.gz
gnulib-tool: Don't insist on ACLOCAL_AMFLAGS.
Reported by Bjarni Ingi Gislason <bjarniig@rhi.hi.is> in <https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00112.html>. * gnulib-tool (func_import): Mention an AC_CONFIG_MACRO_DIRS invocation as an alternative to augmenting ACLOCAL_AMFLAGS. (--import, --add-import, --remove-import, --update): To find the m4 directories, look also for AC_CONFIG_MACRO_DIR and AC_CONFIG_MACRO_DIRS invocations in configure.ac.
Diffstat (limited to 'gnulib-tool')
-rwxr-xr-xgnulib-tool28
1 files changed, 26 insertions, 2 deletions
diff --git a/gnulib-tool b/gnulib-tool
index 0a0314e3cb..678d334250 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -5606,7 +5606,7 @@ s,^\(.................................................[^ ]*\) *,
func_note_Makefile_am_edit "$testsbase_dir" SUBDIRS "$testsbase_base" true
fi
fi
- func_note_Makefile_am_edit "" ACLOCAL_AMFLAGS "-I ${m4base}"
+ func_note_Makefile_am_edit "" ACLOCAL_AMFLAGS "${m4base}"
{
# Find the first parent directory of $m4base that contains or will contain
# a Makefile.am.
@@ -6267,7 +6267,12 @@ s,//*$,/,'
eval var=\"\$makefile_am_edit${edit}_var\"
eval val=\"\$makefile_am_edit${edit}_val\"
if test -n "$var"; then
- echo " - mention \"${val}\" in ${var} in ${dir}Makefile.am,"
+ if test "$var" = ACLOCAL_AMFLAGS; then
+ echo " - mention \"-I ${val}\" in ${var} in ${dir}Makefile.am"
+ echo " or add an AC_CONFIG_MACRO_DIRS([${val}]) invocation in $configure_ac,"
+ else
+ echo " - mention \"${val}\" in ${var} in ${dir}Makefile.am,"
+ fi
fi
done
if grep '^ *AC_PROG_CC_STDC' "$configure_ac" > /dev/null; then
@@ -7110,6 +7115,7 @@ s/\([.*$]\)/[\1]/g'
# Analyze configure.ac.
guessed_auxdir="."
guessed_libtool=false
+ guessed_m4dirs=
my_sed_traces='
s,#.*$,,
s,^dnl .*$,,
@@ -7119,6 +7125,12 @@ s/\([.*$]\)/[\1]/g'
}
/A[CM]_PROG_LIBTOOL/ {
s,^.*$,guessed_libtool=true,p
+ }
+ /AC_CONFIG_MACRO_DIR/ {
+ s,^.*AC_CONFIG_MACRO_DIR([[ ]*\([^]"$`\\)]*\).*$,guessed_m4dirs="${guessed_m4dirs} \1",p
+ }
+ /AC_CONFIG_MACRO_DIRS/ {
+ s,^.*AC_CONFIG_MACRO_DIRS([[ ]*\([^]"$`\\)]*\).*$,guessed_m4dirs="${guessed_m4dirs} \1",p
}'
eval `sed -n -e "$my_sed_traces" < "$configure_ac"`
@@ -7183,6 +7195,18 @@ s/\([.*$]\)/[\1]/g'
fi
fi
done
+ for arg in $guessed_m4dirs; do
+ # Ignore absolute directory pathnames, like /usr/local/share/aclocal.
+ case "$arg" in
+ /*) ;;
+ *)
+ if test -f "$destdir/$arg"/gnulib-cache.m4; then
+ func_append m4dirs " $arg"
+ m4dirs_count=`expr $m4dirs_count + 1`
+ fi
+ ;;
+ esac
+ done
else
# No Makefile.am! Oh well. Look at the last generated aclocal.m4.
if test -f "$destdir"/aclocal.m4; then