it includes another AU defined macro.
* autoupdate.sh (input.m4:_au_defun): New macro.
(au.m4): Use it instead of inlining _au_enable/_au_disable
invocations in the definition of all these macros.
(input.m4:__au_enable, input.m4:__au_disable): New macros.
(input.m4:_au_enable, input.m4:_au_disable): Use them.
* tests/mktests.sh (update_exclude_list): Add `AC_OUTPUT'.
Running it twice in a configure.in is not valid.
Add `AC_LINK_FILES' since it requires arguments.
* tests/tools.m4 (autoupdating AC_LINK_FILES): New test.
+2000-10-17 Akim Demaille <akim@epita.fr>
+
+ Fix autoupdate: updating `AC_OUTPUT_COMMANDS' was failing because
+ it includes another AU defined macro.
+
+ * autoupdate.sh (input.m4:_au_defun): New macro.
+ (au.m4): Use it instead of inlining _au_enable/_au_disable
+ invocations in the definition of all these macros.
+ (input.m4:__au_enable, input.m4:__au_disable): New macros.
+ (input.m4:_au_enable, input.m4:_au_disable): Use them.
+ * tests/mktests.sh (update_exclude_list): Add `AC_OUTPUT'.
+ Running it twice in a configure.in is not valid.
+ Add `AC_LINK_FILES' since it requires arguments.
+ * tests/tools.m4 (autoupdating AC_LINK_FILES): New test.
+
+2000-10-17 Raja R Harinath <harinath@cs.umn.edu>
+
+ * Makefile.am (MAINTAINERCLEANFILES): Add acversion.m4.
+ (INSTALL.txt): Put into $(srcdir).
+ (acversion.m4): Build here ...
+ * configure.in (AC_OUTPUT): Not here.
+
+ * tests/Makefile.am (MACRO_FILES): Don't use $(top_srcdir).
+ (syntax.m4): Create in $(srcdir).
+ (update.m4): Likewise.
+ * tests/atspecific.m4 (AT_CHECK_UPDATE): Look for autoconf
+ macros in the top source directory.
+
2000-10-16 Akim Demaille <akim@epita.fr>
* aclang.m4 (_AC_LANG_COMPILER_GNU): New macro, which unifies...
CLEANFILES = autoconf.m4f \
$(bin_SCRIPTS)
-## --------- ##
+
+## ------------------ ##
+## Maintainer rules. ##
+## ------------------ ##
+
+## acversion.m4. ##
+
+# - acversion.m4 needs to be updated only once, since it depends on
+# configure.in, not on the results of a 'configure' run.
+# - It is guaranteed (with GNU Make) that when the version in configure.in
+# is changed, acversion.m4 is built only after the new version number is
+# propagated to the Makefile. (Libtool uses the same guarantee.)
+
+acversion.m4: $(srcdir)/acversion.m4.in $(srcdir)/configure.in
+ sed -e 's,@''VERSION@,$(VERSION),' $(srcdir)/acversion.m4.in > acversion.tm4
+ cp acversion.tm4 $(srcdir)/acversion.m4
+ rm -f acversion.tm4
+
## INSTALL. ##
-## --------- ##
# INSTALL is a special case. Automake seems to have a single name space
# for both targets and variables. If we just use INSTALL, then the var
INSTALL.txt: $(top_srcdir)/doc/install.texi
$(MAKEINFO) $< --no-headers --no-validate --no-split --output=$@
+ if test '$(srcdir)' != '.'; then cp $@ $(srcdir); rm -f $@; fi
+
+MAINTAINERCLEANFILES = acversion.m4 INSTALL.txt
+
+
+## ----------------------------------- ##
+## Special installation instructions. ##
+## ----------------------------------- ##
install-data-hook: INSTALL.txt
@$(NORMAL_INSTALL)
$(INSTALL_DATA) $$d$$p.txt $(DESTDIR)$(pkgdatadir)/$$f; \
done
-MAINTAINERCLEANFILES = INSTALL.txt
## ------------- ##
## The scripts. ##
CLEANFILES = autoconf.m4f $(bin_SCRIPTS)
-MAINTAINERCLEANFILES = INSTALL.txt
+MAINTAINERCLEANFILES = acversion.m4 INSTALL.txt
editsh = sed -e 's,@datadir\@,$(pkgdatadir),g' -e 's,@M4\@,$(M4),g' -e 's,@AWK\@,$(AWK),g' -e 's,@SHELL\@,$(SHELL),g' -e 's,@VERSION\@,$(VERSION),g' -e 's,@PACKAGE\@,$(PACKAGE),g' -e 's,@bindir\@,$(bindir),g' -e 's,@autoconf-name\@,'`echo autoconf | sed '$(transform)'`',g' -e 's,@autoheader-name\@,'`echo autoheader | sed '$(transform)'`',g'
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_CLEAN_FILES = acversion.m4
+CONFIG_CLEAN_FILES =
SCRIPTS = $(bin_SCRIPTS)
DATA = $(pkgdata_DATA)
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
-Makefile.in NEWS README-alpha THANKS TODO aclocal.m4 acversion.m4.in \
-config.guess config.sub configure configure.in install-sh mdate-sh \
-missing mkinstalldirs
+Makefile.in NEWS README-alpha THANKS TODO aclocal.m4 config.guess \
+config.sub configure configure.in install-sh mdate-sh missing \
+mkinstalldirs
PACKAGE = @PACKAGE@
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
-acversion.m4: $(top_builddir)/config.status acversion.m4.in
- cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+# - acversion.m4 needs to be updated only once, since it depends on
+# configure.in, not on the results of a 'configure' run.
+# - It is guaranteed (with GNU Make) that when the version in configure.in
+# is changed, acversion.m4 is built only after the new version number is
+# propagated to the Makefile. (Libtool uses the same guarantee.)
+
+acversion.m4: $(srcdir)/acversion.m4.in $(srcdir)/configure.in
+ sed -e 's,@''VERSION@,$(VERSION),' $(srcdir)/acversion.m4.in > acversion.tm4
+ cp acversion.tm4 $(srcdir)/acversion.m4
+ rm -f acversion.tm4
+
# INSTALL is a special case. Automake seems to have a single name space
# for both targets and variables. If we just use INSTALL, then the var
# $(INSTALL) is not defined, and the install target fails.
INSTALL.txt: $(top_srcdir)/doc/install.texi
$(MAKEINFO) $< --no-headers --no-validate --no-split --output=$@
+ if test '$(srcdir)' != '.'; then cp $@ $(srcdir); rm -f $@; fi
install-data-hook: INSTALL.txt
@$(NORMAL_INSTALL)
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_gnu_compiler=$ac_cv_prog_gcc
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
*c*,-n*) ECHO_N= ECHO_C='
# autoheader scripts.
for ac_prog in gm4 gnum4 m4
do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo "configure:1032: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
esac
fi
M4=$ac_cv_path_M4
+
if test -n "$M4"; then
- echo "configure:1058: result: $M4" >&5
+ echo "configure:1059: result: $M4" >&5
echo "${ECHO_T}$M4" >&6
else
- echo "configure:1061: result: no" >&5
+ echo "configure:1062: result: no" >&5
echo "${ECHO_T}no" >&6
fi
-test -n "$M4" && break
+ test -n "$M4" && break
done
test -n "$M4" || M4="m4"
-echo "configure:1069: checking whether m4 supports frozen files" >&5
+echo "configure:1070: checking whether m4 supports frozen files" >&5
echo $ECHO_N "checking whether m4 supports frozen files... $ECHO_C" >&6
if test "${ac_cv_prog_gnu_m4+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
esac
fi
fi
-echo "configure:1081: result: $ac_cv_prog_gnu_m4" >&5
+echo "configure:1082: result: $ac_cv_prog_gnu_m4" >&5
echo "${ECHO_T}$ac_cv_prog_gnu_m4" >&6
if test x"$ac_cv_prog_gnu_m4" != xyes; then
{ echo "configure: error: GNU m4 1.4 is required" >&2; exit 1; }
# `autoconf' and `ifnames' use AWK.
for ac_prog in mawk gawk nawk awk
do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "configure:1094: checking for $ac_word" >&5
+echo "configure:1095: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_AWK+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- echo "configure:1116: result: $AWK" >&5
+ echo "configure:1117: result: $AWK" >&5
echo "${ECHO_T}$AWK" >&6
else
- echo "configure:1119: result: no" >&5
+ echo "configure:1120: result: no" >&5
echo "${ECHO_T}no" >&6
fi
-test -n "$AWK" && break
+ test -n "$AWK" && break
done
# Generating man pages.
-echo "configure:1127: checking for working help2man" >&5
+echo "configure:1128: checking for working help2man" >&5
echo $ECHO_N "checking for working help2man... $ECHO_C" >&6
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
if (help2man --version) < /dev/null > /dev/null 2>&1; then
HELP2MAN=help2man
- echo "configure:1134: result: found" >&5
+ echo "configure:1135: result: found" >&5
echo "${ECHO_T}found" >&6
else
HELP2MAN="$SHELL $missing_dir/missing help2man"
- echo "configure:1138: result: missing" >&5
+ echo "configure:1139: result: missing" >&5
echo "${ECHO_T}missing" >&6
fi
# We use a path for perl so the #! line in autoscan will work.
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
-echo "configure:1145: checking for $ac_word" >&5
+echo "configure:1146: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_PERL+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
esac
fi
PERL=$ac_cv_path_PERL
+
if test -n "$PERL"; then
- echo "configure:1172: result: $PERL" >&5
+ echo "configure:1174: result: $PERL" >&5
echo "${ECHO_T}$PERL" >&6
else
- echo "configure:1175: result: no" >&5
+ echo "configure:1177: result: no" >&5
echo "${ECHO_T}no" >&6
fi
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
-echo "configure:1197: checking for a BSD compatible install" >&5
+echo "configure:1199: checking for a BSD compatible install" >&5
echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_install_sh
fi
fi
-echo "configure:1246: result: $INSTALL" >&5
+echo "configure:1248: result: $INSTALL" >&5
echo "${ECHO_T}$INSTALL" >&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
standards_texi=standards.texi
fi
-ac_config_files="$ac_config_files acversion.m4 Makefile m4/Makefile man/Makefile doc/Makefile
+ac_config_files="$ac_config_files Makefile m4/Makefile man/Makefile doc/Makefile
tests/Makefile tests/atconfig"
trap '' 1 2 15
cat >confcache <<\EOF
ac_need_defaults=false;;
# Handling of arguments.
- 'acversion.m4' ) CONFIG_FILES="$CONFIG_FILES acversion.m4" ;;
'Makefile' ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
'm4/Makefile' ) CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
'man/Makefile' ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
AC_SUBST(standards_texi, standards.texi)dnl
fi
-AC_OUTPUT(acversion.m4 Makefile m4/Makefile man/Makefile doc/Makefile
+AC_OUTPUT(Makefile m4/Makefile man/Makefile doc/Makefile
tests/Makefile tests/atconfig)
# The files which contains macro we check for syntax.
-MACRO_FILES = $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 \
- $(top_srcdir)/acfunctions.m4 $(top_srcdir)/aclang.m4
+MACRO_FILES = ../acgeneral.m4 ../acspecific.m4 \
+ ../acfunctions.m4 ../aclang.m4
syntax.m4: mktests.sh $(MACRO_FILES)
- ./mktests.sh $(MACRO_FILES)
+ cd $(srcdir) && ./mktests.sh $(MACRO_FILES)
update.m4: mktests.sh $(MACRO_FILES)
- ./mktests.sh $(MACRO_FILES)
+ cd $(srcdir) && ./mktests.sh $(MACRO_FILES)
CLEANFILES = debug-*.sh macro configure configure.in config.status \
config.cache config.log config.h.in config.h
# The files which contains macro we check for syntax.
-MACRO_FILES = $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 $(top_srcdir)/acfunctions.m4 $(top_srcdir)/aclang.m4
+MACRO_FILES = ../acgeneral.m4 ../acspecific.m4 ../acfunctions.m4 ../aclang.m4
CLEANFILES = debug-*.sh macro configure configure.in config.status config.cache config.log config.h.in config.h
DISTCLEANFILES = atconfig testsuite
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES = atconfig
-DIST_COMMON = Makefile.am Makefile.in atconfig.in
+DIST_COMMON = Makefile.am Makefile.in atconfig.in configure.in
PACKAGE = @PACKAGE@
mv $@-tmp $@
syntax.m4: mktests.sh $(MACRO_FILES)
- ./mktests.sh $(MACRO_FILES)
+ cd $(srcdir) && ./mktests.sh $(MACRO_FILES)
update.m4: mktests.sh $(MACRO_FILES)
- ./mktests.sh $(MACRO_FILES)
+ cd $(srcdir) && ./mktests.sh $(MACRO_FILES)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
[AT_SETUP([the autoupdating of $1])
_AT_CHECK_AC_MACRO([$1],
-[AT_CHECK([autoupdate --autoconf-dir ..], 0,
+[AT_CHECK([autoupdate --autoconf-dir $at_top_srcdir], 0,
[], [autoupdate: `configure.in' is updated
])])
AT_CHECK_MACRO([AC_ARG_PROGRAM])
AT_CHECK_MACRO([AC_ARG_WITH])
AT_CHECK_MACRO([AC_CANONICAL_TARGET])
+AT_CHECK_MACRO([AC_CHECK_TOOL_PREFIX])
+AT_CHECK_MACRO([AC_COMPILE_CHECK])
AT_CHECK_MACRO([AC_C_BIGENDIAN])
AT_CHECK_MACRO([AC_C_CHAR_UNSIGNED])
AT_CHECK_MACRO([AC_C_CROSS])
-AT_CHECK_MACRO([AC_CHECK_TOOL_PREFIX])
AT_CHECK_MACRO([AC_C_LONG_DOUBLE])
-AT_CHECK_MACRO([AC_COMPILE_CHECK])
AT_CHECK_MACRO([AC_C_PROTOTYPES])
AT_CHECK_MACRO([AC_C_STRINGIZE])
AT_CHECK_MACRO([AC_DECL_SYS_SIGLIST])
## autoupdate. ##
## ------------ ##
-# Check that AC_LINK_FILES and AC_OUTPUT are properly updated.
+# Check that AC_CANONICAL_SYSTEM and AC_OUTPUT are properly updated.
AT_SETUP(autoupdate)
AT_DATA(configure.in,
AT_CLEANUP
+AT_SETUP([autoupdating AC_LINK FILES])
+
+AT_DATA(configure.in,
+[[AC_INIT
+AC_LINK_FILES(dst1 dst2, src1 src2)
+AC_OUTPUT
+]])
+
+AT_DATA(dst1, dst1
+)
+AT_DATA(dst2, dst2
+)
+
+# Checking `autoupdate'.
+AT_CHECK([../autoupdate --autoconf-dir $top_srcdir], 0, [],
+ [autoupdate: `configure.in' is updated
+])
+AT_CHECK([../autoconf --autoconf-dir $top_srcdir], 0)
+AT_CHECK([./configure], 0, ignore)
+AT_CHECK([cat src1], 0, [dst1
+])
+AT_CHECK([cat src2], 0, [dst2
+])
+
+AT_CLEANUP
## ------------------ ##