+2001-08-31 Akim Demaille <akim@epita.fr>
+
+ * bin/autoconf.in: Don't bother with `acsite.m4' and `aclocal.m4'.
+ * bin/autom4te.in (&find_file): Support `FILE?' standing for
+ optionally `FILE'.
+ Use -e, not -f, since /dev/null for instance is OK.
+ (&parse_args): Adjust.
+ * lib/autom4te.in (Autoconf): Add `acsite.m4?' and `aclocal.m4?'.
+
+
2001-08-31 Akim Demaille <akim@epita.fr>
* configure.ac: Also find tested executables in bin.
"--include=$localdir "\
`test -n "$warnings" && echo "--warning=$warnings "`\
"--output=$outfile "\
-`$initialization && echo "--melt "`\
-`test -f "$autoconf_dir/acsite.m4" && echo "$autoconf_dir/acsite.m4"`" "\
-`test -f "$localdir/aclocal.m4" && echo "$localdir/aclocal.m4"`
+`$initialization && echo "--melt "`
# Autom4te expansion.
eval set dummy "$traces"
# We match exactly the behavior of GNU m4: first look in the current
# directory (which includes the case of absolute file names), and, if
# the file is not absolute, just fail. Otherwise, look in the path.
+#
+# If the file is flagged as optional (ends with `?'), then return undef
+# if absent.
sub find_file ($)
{
my ($filename) = @_;
+ my $optional = 0;
+
+ $optional = 1
+ if $filename =~ s/\?$//;
return File::Spec->canonpath ($filename)
- if -f $filename;
+ if -e $filename;
- die "$me: no such file or directory: $filename\n"
- if File::Spec->file_name_is_absolute ($filename);
+ if (File::Spec->file_name_is_absolute ($filename))
+ {
+ die "$me: no such file or directory: $filename\n"
+ unless $optional;
+ return undef;
+ }
foreach my $path (@include)
{
return File::Spec->canonpath (File::Spec->catfile ($path, $filename))
- if -f File::Spec->catfile ($path, $filename)
+ if -e File::Spec->catfile ($path, $filename)
}
- die "$me: no such file or directory: $filename\n";
+ die "$me: no such file or directory: $filename\n"
+ unless $optional;
+
+ return undef;
}
Run GNU M4 on the FILES, avoiding useless runs. If tracing, the output
consists of the traces only, otherwise output the expansion of the FILES.
The first of the FILES may be an M4 frozen file, but then must end in \`.m4f\'.
+Some files may be optional, i.e., will only be processed if found in the
+include path, but then must end in \`.m4?\'; the question mark is not part of
+the actual file name.
Operation modes:
-h, --help print this help, then exit
if $melt;
# We don't want to depend upon m4's --include to find the top level
- # files. Try to get a canonical name, as it's part of the key for caching.
- for (my $i = 0; $i < $#ARGV; ++$i)
- {
- $ARGV[$i] = find_file ($ARGV[$i]);
- }
+ # files. Try to get a canonical name, as it's part of the key for
+ # caching. And some files are optional.
+ @ARGV = grep { defined $_ } map { find_file ($_) } @ARGV;
}
# some platforms.
# Initialize the test suite.
+# Some of our bins are location independant, e.g., ifnames.
+# We don't need wrappers for them.
ac_config_commands="$ac_config_commands tests/atconfig"
if test -f $srcdir/tests/atlocal.in; then
# Extract the first word of "expr", so it can be a program name with args.
set dummy expr; ac_word=$2
-echo "$as_me:1255: checking for $ac_word" >&5
+echo "$as_me:1257: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_EXPR+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
test -z "$ac_dir" && ac_dir=.
if $as_executable_p "$ac_dir/$ac_word"; then
ac_cv_path_EXPR="$ac_dir/$ac_word"
- echo "$as_me:1272: found $ac_dir/$ac_word" >&5
+ echo "$as_me:1274: found $ac_dir/$ac_word" >&5
break
fi
done
EXPR=$ac_cv_path_EXPR
if test -n "$EXPR"; then
- echo "$as_me:1283: result: $EXPR" >&5
+ echo "$as_me:1285: result: $EXPR" >&5
echo "${ECHO_T}$EXPR" >&6
else
- echo "$as_me:1286: result: no" >&5
+ echo "$as_me:1288: result: no" >&5
echo "${ECHO_T}no" >&6
fi
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:1298: checking for $ac_word" >&5
+echo "$as_me:1300: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_M4+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
test -z "$ac_dir" && ac_dir=.
if $as_executable_p "$ac_dir/$ac_word"; then
ac_cv_path_M4="$ac_dir/$ac_word"
- echo "$as_me:1315: found $ac_dir/$ac_word" >&5
+ echo "$as_me:1317: found $ac_dir/$ac_word" >&5
break
fi
done
M4=$ac_cv_path_M4
if test -n "$M4"; then
- echo "$as_me:1326: result: $M4" >&5
+ echo "$as_me:1328: result: $M4" >&5
echo "${ECHO_T}$M4" >&6
else
- echo "$as_me:1329: result: no" >&5
+ echo "$as_me:1331: result: no" >&5
echo "${ECHO_T}no" >&6
fi
done
test -n "$M4" || M4="m4"
-echo "$as_me:1337: checking whether m4 supports frozen files" >&5
+echo "$as_me:1339: 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 "$as_me:1349: result: $ac_cv_prog_gnu_m4" >&5
+echo "$as_me:1351: 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 "$as_me:1352: error: GNU M4 1.4 is required" >&5
+ { { echo "$as_me:1354: error: GNU M4 1.4 is required" >&5
echo "$as_me: error: GNU M4 1.4 is required" >&2;}
{ (exit 1); exit 1; }; }
fi
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:1364: checking for $ac_word" >&5
+echo "$as_me:1366: 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
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_AWK="$ac_prog"
-echo "$as_me:1379: found $ac_dir/$ac_word" >&5
+echo "$as_me:1381: found $ac_dir/$ac_word" >&5
break
done
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- echo "$as_me:1387: result: $AWK" >&5
+ echo "$as_me:1389: result: $AWK" >&5
echo "${ECHO_T}$AWK" >&6
else
- echo "$as_me:1390: result: no" >&5
+ echo "$as_me:1392: result: no" >&5
echo "${ECHO_T}no" >&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 "$as_me:1404: checking for $ac_word" >&5
+echo "$as_me:1406: 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
test -z "$ac_dir" && ac_dir=.
if $as_executable_p "$ac_dir/$ac_word"; then
ac_cv_path_PERL="$ac_dir/$ac_word"
- echo "$as_me:1421: found $ac_dir/$ac_word" >&5
+ echo "$as_me:1423: found $ac_dir/$ac_word" >&5
break
fi
done
PERL=$ac_cv_path_PERL
if test -n "$PERL"; then
- echo "$as_me:1433: result: $PERL" >&5
+ echo "$as_me:1435: result: $PERL" >&5
echo "${ECHO_T}$PERL" >&6
else
- echo "$as_me:1436: result: no" >&5
+ echo "$as_me:1438: result: no" >&5
echo "${ECHO_T}no" >&6
fi
if test "$PERL" = no; then
- { { echo "$as_me:1441: error: perl is not found" >&5
+ { { echo "$as_me:1443: error: perl is not found" >&5
echo "$as_me: error: perl is not found" >&2;}
{ (exit 1); exit 1; }; }
fi
$PERL -e 'require 5.005;' || {
- { { echo "$as_me:1446: error: Perl 5.005 or better is required" >&5
+ { { echo "$as_me:1448: error: Perl 5.005 or better is required" >&5
echo "$as_me: error: Perl 5.005 or better is required" >&2;}
{ (exit 1); exit 1; }; }
}
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:1565: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:1567: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
echo "$ac_cs_version"; exit 0 ;;
--he | --h)
# Conflict between --help and --header
- { { echo "$as_me:1760: error: ambiguous option: $1
+ { { echo "$as_me:1762: error: ambiguous option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2;}
ac_need_defaults=false;;
# This is an error.
- -*) { { echo "$as_me:1779: error: unrecognized option: $1
+ -*) { { echo "$as_me:1781: error: unrecognized option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2;}
"bin/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
"tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
"tests/atconfig" ) CONFIG_COMMANDS="$CONFIG_COMMANDS tests/atconfig" ;;
- *) { { echo "$as_me:1830: error: invalid argument: $ac_config_target" >&5
+ *) { { echo "$as_me:1832: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
as_incr_dir=$as_incr_dir/$as_mkdir_dir
test -d "$as_incr_dir" ||
mkdir "$as_incr_dir" ||
- { { echo "$as_me:2018: error: cannot create \"$ac_dir\"" >&5
+ { { echo "$as_me:2020: error: cannot create \"$ac_dir\"" >&5
echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
if test x"$ac_file" != x-; then
- { echo "$as_me:2055: creating $ac_file" >&5
+ { echo "$as_me:2057: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
rm -f "$ac_file"
fi
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:2073: error: cannot find input file: $f" >&5
+ test -f "$f" || { { echo "$as_me:2075: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
echo $srcdir/$f
else
# /dev/null tree
- { { echo "$as_me:2086: error: cannot find input file: $f" >&5
+ { { echo "$as_me:2088: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
- { echo "$as_me:2158: executing $ac_dest commands" >&5
+ { echo "$as_me:2160: executing $ac_dest commands" >&5
echo "$as_me: executing $ac_dest commands" >&6;}
case $ac_dest in
tests/atconfig ) cat >tests/atconfig <<ATEOF
top_srcdir='$ac_top_srcdir'
top_builddir='$ac_top_builddir'
-AUTOTEST_PATH='bin'
+AUTOTEST_PATH='tests:bin'
SHELL=\${CONFIG_SHELL-'$at_shell'}
PATH_SEPARATOR='$at_path_separator'
# patterns: "configure.in"
args: --include @datadir@
args: autoconf/autoconf.m4f
+args: acsite.m4?
+args: aclocal.m4?
args: --mode 777
args: --warning syntax
args: --normalize
config.sub.1: $(srcdir)/config.sub.x $(top_srcdir)/config/config.sub
.x.1:
- test -f $(top_builddir)/bin/$* && prog=$(top_builddir)/bin/$*; \
- test -f $(top_srcdir)/config/$* && prog=$(top_srcdir)/config/$*; \
- if test -n "$$prog"; then \
- echo "Updating man page $@"; \
- autom4te_perllibdir="$(top_srcdir)/lib" \
- AUTOM4TE_CFG="$(top_builddir)/lib/autom4te.cfg" \
- $(HELP2MAN) \
+ echo "Updating man page $@"
+ PATH=$(top_builddir)/bin:$(top_srcdir)/config:$$PATH ;\
+ export PATH ;\
+ $(HELP2MAN) \
--include=$(srcdir)/$*.x \
--include=$(srcdir)/common.x \
- --output=$@ $$prog; \
- else \
- echo "WARNING: The man page $@ cannot be updated yet."; \
- echo " Retry once the corresponding executable is built."; \
- fi
+ --output=$@ $*
# 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.
.NOEXPORT:
Run GNU M4 on the FILES, avoiding useless runs. If tracing, the output
consists of the traces only, otherwise output the expansion of the FILES.
The first of the FILES may be an M4 frozen file, but then must end in `.m4f'.
+Some files may be optional, i.e., will only be processed if found in the
+include path, but then must end in `.m4?'; the question mark is not part of
+the actual file name.
.SS "Operation modes:"
.TP
\fB\-h\fR, \fB\-\-help\fR
@SET_MAKE@
+# We don't actually distribute the testsuite, since one only
+# needs m4 to build it, m4 being required anyway to install Autoconf.
+
SHELL = @SHELL@
srcdir = @srcdir@
PERL = @PERL@
VERSION = @VERSION@
-AUTOMAKE_OPTIONS = gnits
+EXTRA_DIST = $(WRAPPERS) $(TESTSUITE_AT) atspecific.m4 aclocal.m4 mktests.sh \
+ atlocal.in
+
+
+# Running the uninstalled scripts.
+WRAPPERS = autoconf autoheader autoreconf autom4te autoupdate
-SUITE_GENERATED = \
+DISTCLEANFILES = atconfig atlocal $(TESTSUITE)
+
+TESTSUITE_GENERATED_AT = \
aclang.at acc.at acfortran.at \
acgeneral.at acstatus.at \
acautoheader.at acautoupdate.at \
aclibs.at acprograms.at
-SUITE = suite.at \
+TESTSUITE_HAND_AT = \
+ suite.at \
m4sugar.at m4sh.at \
base.at tools.at torture.at \
compile.at \
- $(SUITE_GENERATED) \
semantics.at \
foreign.at
-# We don't actually distribute the testsuite, since one only
-# needs m4 to build it, m4 being required anyway to install Autoconf.
-# atlocal.in is to be listed, since Automake doesn't see it...
-EXTRA_DIST = README \
- atspecific.m4 aclocal.m4 \
- atlocal.in $(SUITE) mktests.sh
+TESTSUITE_AT = $(TESTSUITE_GENERATED_AT) $(TESTSUITE_HAND_AT)
+TESTSUITE = ./testsuite
+# Run the non installed autom4te.
+AUTOM4TE = $(srcdir)/autom4te
+AUTOTEST = $(AUTOM4TE) --language=autotest
-AUTOM4TE = AUTOM4TE_CFG='$(top_builddir)/lib/autom4te.cfg' \
- AC_MACRODIR='$(top_srcdir)/lib' \
- ../bin/autom4te
-
+MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE_GENERATED_AT)
# The files which contains macro we check for syntax. Don't use $(top_srcdir)
# here since below we explicitly `cd' to $srcdir. As for the dependencies,
# thanks God for VPATH. Hm...
-MACRO_FILES = $(top_srcdir)/lib/autoconf/general.m4 \
- $(top_srcdir)/lib/autoconf/status.m4 \
- $(top_srcdir)/lib/autoconf/autoheader.m4 \
- $(top_srcdir)/lib/autoconf/autoupdate.m4 \
- $(top_srcdir)/lib/autoconf/specific.m4 \
- $(top_srcdir)/lib/autoconf/functions.m4 \
- $(top_srcdir)/lib/autoconf/lang.m4 \
- $(top_srcdir)/lib/autoconf/c.m4 \
- $(top_srcdir)/lib/autoconf/fortran.m4 \
- $(top_srcdir)/lib/autoconf/headers.m4 \
- $(top_srcdir)/lib/autoconf/libs.m4 \
- $(top_srcdir)/lib/autoconf/types.m4 \
- $(top_srcdir)/lib/autoconf/programs.m4
-
-
-DISTCLEANFILES = atconfig atlocal testsuite
+autoconfdir = $(top_srcdir)/lib/autoconf
+AUTOCONF_FILES = $(autoconfdir)/general.m4 \
+ $(autoconfdir)/status.m4 \
+ $(autoconfdir)/autoheader.m4 \
+ $(autoconfdir)/autoupdate.m4 \
+ $(autoconfdir)/specific.m4 \
+ $(autoconfdir)/functions.m4 \
+ $(autoconfdir)/lang.m4 \
+ $(autoconfdir)/c.m4 \
+ $(autoconfdir)/fortran.m4 \
+ $(autoconfdir)/headers.m4 \
+ $(autoconfdir)/libs.m4 \
+ $(autoconfdir)/types.m4 \
+ $(autoconfdir)/programs.m4
+
# The hairy heredoc is more robust than using echo.
CLEANFILES = expr
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
CONFIG_CLEAN_FILES =
DIST_SOURCES =
-DIST_COMMON = README Makefile.am Makefile.in configure configure.ac
+DIST_COMMON = README Makefile.am Makefile.in
all: all-am
.SUFFIXES:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
clean-am: clean-generic clean-local mostlyclean-am
install-man:
-installcheck-am:
+installcheck-am: installcheck-local
maintainer-clean: maintainer-clean-am
info-am install install-am install-data install-data-am \
install-exec install-exec-am install-info install-info-am \
install-man install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic uninstall uninstall-am \
- uninstall-info-am
+ installcheck-local installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ uninstall uninstall-am uninstall-info-am
-
-check-local: atconfig atlocal testsuite
- $(SHELL) testsuite
testsuite: $(top_srcdir)/lib/m4sugar/m4sugar.m4 \
$(top_srcdir)/lib/m4sugar/m4sh.m4 \
$(top_srcdir)/lib/autotest/autotest.m4 \
$(top_srcdir)/lib/autotest/general.m4 \
atspecific.m4 \
- $(SUITE)
- $(AUTOM4TE) --language=autotest -I $(srcdir) -I $(top_srcdir)/lib \
- suite.at -o $@.tmp
+ $(TESTSUITE_AT)
+ $(AUTOTEST) -I $(srcdir) suite.at -o $@.tmp
mv $@.tmp $@
-$(SUITE_GENERATED): mktests.sh $(MACRO_FILES)
- cd $(srcdir) && ./mktests.sh $(MACRO_FILES)
+atconfig: $(top_builddir)/config.status
+ cd $(top_builddir) && ./config.status tests/$@
+
+atlocal: $(srcdir)/atlocal.in $(top_builddir)/config.status
+ cd $(top_builddir) && ./config.status tests/$@
+
+clean-local:
+ $(SHELL) $(TESTSUITE) --clean
+ rm -rf autom4te.cache
+
+check-local: atconfig atlocal $(TESTSUITE)
+ $(SHELL) $(TESTSUITE)
+
+# Run the test suite on the *installed* tree.
+installcheck-local:
+ $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
+
+$(TESTSUITE_GENERATED_AT): mktests.sh $(AUTOCONF_FILES)
+ cd $(srcdir) && ./mktests.sh $(AUTOCONF_FILES)
maintainer-check: maintainer-check-posix maintainer-check-c++
expr:
# Try using G++ as a C compiler.
maintainer-check-c++:
CC=g++ make check
-
-clean-local:
- ./testsuite --clean
- -rm -rf autom4te.cache
# 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.
.NOEXPORT: