+
+# Utility to run autoconf in each directory that uses the common framework.
+# This is intended to be invoked in $srcdir as
+# "make -f Makefile.in autoconf-common SHELL=/bin/sh".
+.PHONY: autoconf-common autoheader-common
+autoconf-common autoheader-common:
+ for d in * ; \
+ do \
+ if [ -d $$d -a -f $$d/configure.ac ] ; \
+ then \
+ echo "Running autoconf in $$d ..." ; \
+ (cd $$d && autoconf --force) ; \
+ if [ $@ = autoheader-common ] && [ -f $$d/config.in ] ; \
+ then \
+ echo "Running autoheader in $$d ..." ; \
+ (cd $$d && autoheader --force) ; \
+ fi ; \
+ fi ; \
+ done
+
+autoconf-changelog autoheader-changelog:
+ id=$(ID) ; \
+ test x$$id = x && id="`id | sed -e 's/^[^(]*(\([^)]*\).*$$/\1/'`" ; \
+ name=$(NAME) ; \
+ test x$$name = x && name=`grep "^$$id:" /etc/passwd | cut -f 5 -d ':'` ; \
+ host=$(HOST) ; \
+ test x$$host = x && host="`hostname`" ; \
+ date=$(DATE) ; \
+ test x$$date = x && date="`date +%Y-%m-%d`" ; \
+ echo "$$date $$name $$id@$$host" ; \
+ for d in * ; \
+ do \
+ if [ -d $$d -a -f $$d/configure.ac ] ; \
+ then \
+ echo "Creating new-$(ChangeLog) in $$d ..." ; \
+ ( echo "$$date $$name <$$id@$$host>" ; \
+ echo "" ; \
+ echo " * configure: Regenerated to track ../common/aclocal.m4 changes." ; \
+ if [ $@ = autoheader-changelog ] ; \
+ then \
+ echo " * config.in: Ditto." ; \
+ fi ; \
+ echo "" ; \
+ cat $$d/$(ChangeLog) \
+ ) > $$d/new-$(ChangeLog) ; \
+ fi ; \
+ done
+
+autoconf-install autoheader-install:
+ for d in * ; \
+ do \
+ if [ -d $$d -a -f $$d/configure.ac ] ; \
+ then \
+ echo "Moving $$d/new-$(ChangeLog) to $$d/$(ChangeLog) ..." ; \
+ mv $$d/new-$(ChangeLog) $$d/$(ChangeLog) ; \
+ fi ; \
+ done