lib/Automake/tests/ConditionalSet.pl: New files.
* lib/Automake/Makefile.am (SUBDIRS): New variable.
* configure.in: Output lib/Automake/tests/Makefile.
* lib/Automake/ConditionalSet.pm (by_conditions): Delete.
(conds): Don't use by_conditions, sort alphabetically, and
return sorted conds.
(string): Call ->string on each Conditional.
* tests/Makefile.am (TESTS): Remove cond12.test.
* tests/cond12.test: Remove, moved to
lib/Automake/tests/ConditionalSet.pl.
* tests/cond3.test: Adjust conditional ordering.
+2002-11-18 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * lib/Automake/tests/Makefile.am, lib/Automake/tests/Conditional.pl,
+ lib/Automake/tests/ConditionalSet.pl: New files.
+ * lib/Automake/Makefile.am (SUBDIRS): New variable.
+ * configure.in: Output lib/Automake/tests/Makefile.
+ * lib/Automake/ConditionalSet.pm (by_conditions): Delete.
+ (conds): Don't use by_conditions, sort alphabetically, and
+ return sorted conds.
+ (string): Call ->string on each Conditional.
+ * tests/Makefile.am (TESTS): Remove cond12.test.
+ * tests/cond12.test: Remove, moved to
+ lib/Automake/tests/ConditionalSet.pl.
+ * tests/cond3.test: Adjust conditional ordering.
+
2002-11-15 Alexandre Duret-Lutz <adl@gnu.org>
* lib/Automake/ConditionalSet.pm (_permutations_worker): Ignore TRUE
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN = @LN@
LTLIBOBJS = @LTLIBOBJS@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.54c for GNU Automake 1.7a.
+# Generated by GNU Autoconf 2.56 for GNU Automake 1.7a.
#
# Report bugs to <bug-automake@gnu.org>.
#
PS4='+ '
# NLS nuisances.
-for as_var in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_NUMERIC LC_MESSAGES LC_TIME
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
do
if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
if $ac_init_version; then
cat <<\_ACEOF
GNU Automake configure 1.7a
-generated by GNU Autoconf 2.54c
+generated by GNU Autoconf 2.56
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
running configure, to aid debugging if configure makes a mistake.
It was created by GNU Automake $as_me 1.7a, which was
-generated by GNU Autoconf 2.54c. Invocation command line was
+generated by GNU Autoconf 2.56. Invocation command line was
$ $0 $@
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
# Also quote any args containing shell meta-characters.
# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
do
case $ac_arg in
-no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
*" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
test -n "$AWK" && break
done
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.make <<\_ACEOF
all:
- @echo 'ac_maketemp="${MAKE}"'
+ @echo 'ac_maketemp="$(MAKE)"'
_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
- ac_config_files="$ac_config_files Makefile lib/Automake/Makefile lib/Makefile lib/am/Makefile m4/Makefile m4/amversion.m4:m4/amversion.in tests/Makefile tests/defs"
+ ac_config_files="$ac_config_files Makefile lib/Automake/Makefile lib/Automake/tests/Makefile lib/Makefile lib/am/Makefile m4/Makefile m4/amversion.m4:m4/amversion.in tests/Makefile tests/defs"
cat >confcache <<\_ACEOF
# configure, is in config.log if it exists.
debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
_ACEOF
PS4='+ '
# NLS nuisances.
-for as_var in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_NUMERIC LC_MESSAGES LC_TIME
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
do
if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
cat >&5 <<_CSEOF
This file was extended by GNU Automake $as_me 1.7a, which was
-generated by GNU Autoconf 2.54c. Invocation command line was
+generated by GNU Autoconf 2.56. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
-h, --help print this help, then exit
-V, --version print version number, then exit
+ -q, --quiet do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
GNU Automake config.status 1.7a
-configured by $0, generated by GNU Autoconf 2.54c,
+configured by $0, generated by GNU Autoconf 2.56,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
case $ac_option in
# Handling of the options.
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
- exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
-_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
--version | --vers* | -V )
echo "$ac_cs_version"; exit 0 ;;
--he | --h)
$ac_shift
CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
# This is an error.
-*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
shift
done
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
_ACEOF
# Handling of arguments.
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"lib/Automake/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Automake/Makefile" ;;
+ "lib/Automake/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Automake/tests/Makefile" ;;
"lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
"lib/am/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/am/Makefile" ;;
"m4/Makefile" ) CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
# need to make the FD available again.
if test "$no_create" != yes; then
ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
exec 5>/dev/null
- $SHELL $CONFIG_STATUS || ac_cs_success=false
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
AC_CONFIG_FILES([
Makefile
lib/Automake/Makefile
+ lib/Automake/tests/Makefile
lib/Makefile
lib/am/Makefile
m4/Makefile
return $self;
}
-# Compare condition names.
-# Issue them in alphabetical order, foo_TRUE before foo_FALSE.
-sub by_condition
-{
- # Be careful we might be comparing `' or `#'.
- $a->string =~ /^(.*)_(TRUE|FALSE)$/;
- my ($aname, $abool) = ($1 || '', $2 || '');
- $b->string =~ /^(.*)_(TRUE|FALSE)$/;
- my ($bname, $bbool) = ($1 || '', $2 || '');
- return ($aname cmp $bname
- # Don't bother with IFs, given that TRUE is after FALSE
- # just cmp in the reverse order.
- || $bbool cmp $abool
- # Just in case...
- || $a cmp $b);
-}
-
-=item C<@conds = $set-$<gt>conds>
+=item C<@conds = $set-E<gt>conds>
Return the list of C<Conditional> objects involved in C<$set>.
my ($self) = @_;
return @{$self->{'conds'}} if exists $self->{'conds'};
my @conds = map { $self->{'hash'}{$_} } (keys %{$self->{'hash'}});
- $self->{'conds'} = [sort by_condition @conds];
+ @conds = sort { $a->string cmp $b->string } @conds;
+ $self->{'conds'} = [@conds];
return @conds;
}
-=item C<$cond = $set-$<gt>one_cond>
+=item C<$cond = $set-E<gt>one_cond>
Return one C<Conditional> object involved in C<$set>.
return (%{$self->{'hash'}},)[1];
}
-=item C<$et = $set-$<gt>false>
+=item C<$et = $set-E<gt>false>
Return 1 iff the C<ConditionalSet> object is always false (i.e., if it
is empty, or if it contains only false C<Conditional>s). Return 0
return 0 == keys %{$self->{'hash'}};
}
-=item C<$et = $set-$<gt>true>
+=item C<$et = $set-E<gt>true>
Return 1 iff the C<ConditionalSet> object is always true (i.e. covers all
conditions). Return 0 otherwise.
}
else
{
- $res = join (',', $self->conds);
+ $res = join (' | ', map { $_->string } $self->conds);
}
$self->{'string'} = $res;
(new Automake::Conditional ("COND1_TRUE", "COND2_TRUE"),
new Automake::Conditional ("COND3_FALSE", "COND2_TRUE"));
-Calling $<$set-E<gt>permutations> will return the following Conditional set.
+Calling C<$set-E<gt>permutations> will return the following Conditional set.
new Automake::ConditionalSet
(new Automake::Conditional ("COND1_TRUE", "COND2_TRUE", "COND3_TRUE"),
## Process this file with automake to create Makefile.in
+SUBDIRS = tests
+
perllibdir = $(pkgvdatadir)/Automake
dist_perllib_DATA = \
Channels.pm \
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN = @LN@
LTLIBOBJS = @LTLIBOBJS@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+SUBDIRS = tests
+
perllibdir = $(pkgvdatadir)/Automake
dist_perllib_DATA = \
Channels.pm \
DIST_SOURCES =
DATA = $(dist_perllib_DATA)
+
+RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
+ ps-recursive install-info-recursive uninstall-info-recursive \
+ all-recursive install-data-recursive install-exec-recursive \
+ installdirs-recursive install-recursive uninstall-recursive \
+ check-recursive installcheck-recursive
DIST_COMMON = $(dist_perllib_DATA) Makefile.am Makefile.in
-all: all-am
+DIST_SUBDIRS = tests
+all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
echo " rm -f $(DESTDIR)$(perllibdir)/$$f"; \
rm -f $(DESTDIR)$(perllibdir)/$$f; \
done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
tags: TAGS
-TAGS:
-ctags: CTAGS
-CTAGS:
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../..
|| exit 1; \
fi; \
done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" \
+ distdir=../$(distdir)/$$subdir \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
check-am: all-am
-check: check-am
+check: check-recursive
all-am: Makefile $(DATA)
-
-installdirs:
+installdirs: installdirs-recursive
+installdirs-am:
$(mkinstalldirs) $(DESTDIR)$(perllibdir)
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-installcheck: installcheck-am
+installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
+clean: clean-recursive
clean-am: clean-generic mostlyclean-am
-distclean: distclean-am
+distclean: distclean-recursive
-distclean-am: clean-am distclean-generic
+distclean-am: clean-am distclean-generic distclean-tags
-dvi: dvi-am
+dvi: dvi-recursive
dvi-am:
-info: info-am
+info: info-recursive
info-am:
install-exec-am:
-install-info: install-info-am
+install-info: install-info-recursive
install-man:
installcheck-am:
-maintainer-clean: maintainer-clean-am
+maintainer-clean: maintainer-clean-recursive
maintainer-clean-am: distclean-am maintainer-clean-generic
-mostlyclean: mostlyclean-am
+mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
-pdf: pdf-am
+pdf: pdf-recursive
pdf-am:
-ps: ps-am
+ps: ps-recursive
ps-am:
uninstall-am: uninstall-dist_perllibDATA uninstall-info-am
-.PHONY: all all-am check check-am clean clean-generic distclean \
- distclean-generic distdir dvi dvi-am info info-am install \
- install-am install-data install-data-am \
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
+ clean-generic clean-recursive ctags ctags-recursive distclean \
+ distclean-generic distclean-recursive distclean-tags distdir \
+ dvi dvi-am dvi-recursive info info-am info-recursive install \
+ install-am install-data install-data-am install-data-recursive \
install-dist_perllibDATA 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 pdf \
- pdf-am ps ps-am uninstall uninstall-am \
- uninstall-dist_perllibDATA uninstall-info-am
+ install-exec-recursive install-info install-info-am \
+ install-info-recursive install-man install-recursive \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am installdirs-recursive maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive mostlyclean \
+ mostlyclean-generic mostlyclean-recursive pdf pdf-am \
+ pdf-recursive ps ps-am ps-recursive tags tags-recursive \
+ uninstall uninstall-am uninstall-dist_perllibDATA \
+ uninstall-info-am uninstall-info-recursive uninstall-recursive
# 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.
--- /dev/null
+# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with autoconf; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+use Automake::Conditional qw/TRUE FALSE/;
+
+sub test_basics ()
+{
+ my @tests = (# [[Conditions], is_true?, is_false?, string, subst-string]
+ [[], 1, 0, 'TRUE', ''],
+ [['TRUE'], 1, 0, 'TRUE', ''],
+ [['FALSE'], 0, 1, 'FALSE', '#'],
+ [['A_TRUE'], 0, 0, 'A_TRUE', '@A_TRUE@'],
+ [['A_TRUE', 'B_FALSE'],
+ 0, 0, 'A_TRUE B_FALSE', '@A_TRUE@@B_FALSE@'],
+ [['B_TRUE', 'FALSE'], 0, 1, 'FALSE', '#'],
+ [['B_TRUE', 'B_FALSE'], 0, 1, 'FALSE', '#']);
+
+ for (@tests)
+ {
+ my $a = new Automake::Conditional @{$_->[0]};
+ return 1 if $_->[1] != $a->true;
+ return 1 if $_->[1] != ($a == TRUE);
+ return 1 if $_->[2] != $a->false;
+ return 1 if $_->[2] != ($a == FALSE);
+ return 1 if $_->[3] ne $a->string;
+ return 1 if $_->[4] ne $a->subst_string;
+ }
+ return 0;
+}
+
+sub test_true_when ()
+{
+ my $failed = 0;
+
+ my @tests = (# [When,
+ # [Implied-Conditionals],
+ # [Not-Implied-Conditionals]]
+ [['TRUE'],
+ [['TRUE']],
+ [['A_TRUE'], ['A_TRUE', 'B_FALSE'], ['FALSE']]],
+ [['A_TRUE'],
+ [['TRUE'], ['A_TRUE']],
+ [['A_TRUE', 'B_FALSE'], ['FALSE']]],
+ [['A_TRUE', 'B_FALSE'],
+ [['TRUE'], ['A_TRUE'], ['B_FALSE'], ['A_TRUE', 'B_FALSE']],
+ [['FALSE'], ['C_FALSE'], ['C_FALSE', 'A_TRUE']]]);
+
+ for my $t (@tests)
+ {
+ my $a = new Automake::Conditional @{$t->[0]};
+ for my $u (@{$t->[1]})
+ {
+ my $b = new Automake::Conditional @$u;
+ if (! $b->true_when ($a))
+ {
+ print "`" . $b->string .
+ "' not implied by `" . $a->string . "'?\n";
+ $failed = 1;
+ }
+ }
+ for my $u (@{$t->[2]})
+ {
+ my $b = new Automake::Conditional @$u;
+ if ($b->true_when ($a))
+ {
+ print "`" . $b->string .
+ "' implied by `" . $a->string . "'?\n";
+ $failed = 1;
+ }
+
+ return 1 if $b->true_when ($a);
+ }
+ }
+ return $failed;
+}
+
+sub test_reduce ()
+{
+ my @tests = (# If no conditions are given, TRUE should be returned
+ [[""], ["TRUE"]],
+ # A single condition should be passed through unchanged
+ [["FOO"], ["FOO"]],
+ [["FALSE"], ["FALSE"]],
+ [["TRUE"], ["TRUE"]],
+ # TRUE and false should be discarded and overwhelm
+ # the result, respectively
+ [["FOO", "TRUE"], ["FOO"]],
+ [["FOO", "FALSE"], ["FALSE"]],
+ # Repetitions should be removed
+ [["FOO", "FOO"], ["FOO"]],
+ [["TRUE", "FOO", "FOO"], ["FOO"]],
+ [["FOO", "TRUE", "FOO"], ["FOO"]],
+ [["FOO", "FOO", "TRUE"], ["FOO"]],
+ # Two different conditions should be preserved,
+ # but TRUEs should be removed
+ [["FOO", "BAR"], ["BAR,FOO"]],
+ [["TRUE", "FOO", "BAR"], ["BAR,FOO"]],
+ [["FOO", "TRUE", "BAR"], ["BAR,FOO"]],
+ [["FOO", "BAR", "TRUE"], ["BAR,FOO"]],
+ # A condition implied by another condition should be removed.
+ [["FOO BAR", "BAR"], ["FOO BAR"]],
+ [["BAR", "FOO BAR"], ["FOO BAR"]],
+ [["TRUE", "FOO BAR", "BAR"], ["FOO BAR"]],
+ [["FOO BAR", "TRUE", "BAR"], ["FOO BAR"]],
+ [["FOO BAR", "BAR", "TRUE"], ["FOO BAR"]],
+
+ [["BAR FOO", "BAR"], ["BAR FOO"]],
+ [["BAR", "BAR FOO"], ["BAR FOO"]],
+ [["TRUE", "BAR FOO", "BAR"], ["BAR FOO"]],
+ [["BAR FOO", "TRUE", "BAR"], ["BAR FOO"]],
+ [["BAR FOO", "BAR", "TRUE"], ["BAR FOO"]],
+
+ # Check that reduction happens even when there are
+ # two conditionals to remove.
+ [["FOO", "FOO BAR", "BAR"], ["FOO BAR"]],
+ [["FOO", "FOO BAR", "BAZ", "FOO BAZ"], ["FOO BAR", "FOO BAZ"]],
+ [["FOO", "FOO BAR", "BAZ", "FOO BAZ", "FOO BAZ BAR"],
+ ["FOO BAZ BAR"]],
+
+ # Duplicated condionals should be removed
+ [["FOO", "BAR", "BAR"], ["BAR,FOO"]],
+
+ # Equivalent conditionals in different forms should be
+ # reduced: which one is left is unfortunately order
+ # dependent.
+ [["BAR FOO", "FOO BAR"], ["FOO BAR"]],
+ [["FOO BAR", "BAR FOO"], ["BAR FOO"]]);
+
+ my $failed = 0;
+ foreach (@tests)
+ {
+ my ($inref, $outref) = @$_;
+ my @inconds = map { new Automake::Conditional $_ } @$inref;
+ my @outconds = map { (new Automake::Conditional $_)->string } @$outref;
+ my @res =
+ map { $_->string } (Automake::Conditional::reduce (@inconds));
+ my $result = join (",", sort @res);
+ my $exresult = join (",", @outconds);
+
+ if ($result ne $exresult)
+ {
+ print '"'.join(",", @$inref) . '" => "' .
+ $result . '" expected "' .
+ $exresult . '"' . "\n";
+ $failed = 1;
+ }
+ }
+ return $failed;
+}
+
+exit (test_basics || test_true_when || test_reduce);
+
+### Setup "GNU" style for perl-mode and cperl-mode.
+## Local Variables:
+## perl-indent-level: 2
+## perl-continued-statement-offset: 2
+## perl-continued-brace-offset: 0
+## perl-brace-offset: 0
+## perl-brace-imaginary-offset: 0
+## perl-label-offset: -2
+## cperl-indent-level: 2
+## cperl-brace-offset: 0
+## cperl-continued-brace-offset: 0
+## cperl-label-offset: -2
+## cperl-extra-newline-before-brace: t
+## cperl-merge-trailing-else: nil
+## cperl-continued-statement-offset: 2
+## End:
--- /dev/null
+# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with autoconf; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+use Automake::Conditional qw/TRUE FALSE/;
+use Automake::ConditionalSet;
+
+sub test_basics ()
+{
+ my $cond = new Automake::Conditional "COND1_TRUE", "COND2_FALSE";
+ my $other = new Automake::Conditional "COND3_FALSE";
+ my $set1 = new Automake::ConditionalSet $cond, $other;
+ my $set2 = new Automake::ConditionalSet $other, $cond;
+ return 1 unless $set1 == $set2;
+ return 1 if $set1->false;
+ return 1 if $set1->true;
+ return 1 unless (new Automake::ConditionalSet)->false;
+ return 1 if (new Automake::ConditionalSet)->true;
+}
+
+sub build_set (@)
+{
+ my @conds = @_;
+ my @set = ();
+ for my $cond (@conds)
+ {
+ push @set, new Automake::Conditional @$cond;
+ }
+ return new Automake::ConditionalSet @set;
+}
+
+sub test_permutations ()
+{
+ my @tests = ([[["FALSE"]],
+ [["TRUE"]]],
+
+ [[["TRUE"]],
+ [["TRUE"]]],
+
+ [[["COND1_TRUE", "COND2_TRUE"],
+ ["COND3_FALSE", "COND2_TRUE"]],
+ [["COND1_FALSE","COND2_FALSE","COND3_FALSE"],
+ ["COND1_TRUE", "COND2_FALSE","COND3_FALSE"],
+ ["COND1_FALSE","COND2_TRUE", "COND3_FALSE"],
+ ["COND1_TRUE", "COND2_TRUE", "COND3_FALSE"],
+ ["COND1_FALSE","COND2_FALSE","COND3_TRUE"],
+ ["COND1_TRUE", "COND2_FALSE","COND3_TRUE"],
+ ["COND1_FALSE","COND2_TRUE", "COND3_TRUE"],
+ ["COND1_TRUE", "COND2_TRUE", "COND3_TRUE"]]],
+
+ [[["COND1_TRUE", "COND2_TRUE"],
+ ["TRUE"]],
+ [["COND1_TRUE", "COND2_TRUE"],
+ ["COND1_FALSE", "COND2_TRUE"],
+ ["COND1_FALSE", "COND2_FALSE"],
+ ["COND1_TRUE", "COND2_FALSE"]]],
+
+ [[["COND1_TRUE", "COND2_TRUE"],
+ ["FALSE"]],
+ [["COND1_TRUE", "COND2_TRUE"],
+ ["COND1_FALSE", "COND2_TRUE"],
+ ["COND1_FALSE", "COND2_FALSE"],
+ ["COND1_TRUE", "COND2_FALSE"]]],
+
+ [[["COND1_TRUE"],
+ ["COND2_FALSE"]],
+ [["COND1_TRUE", "COND2_TRUE"],
+ ["COND1_FALSE", "COND2_TRUE"],
+ ["COND1_FALSE", "COND2_FALSE"],
+ ["COND1_TRUE", "COND2_FALSE"]]]
+ );
+
+ for my $t (@tests)
+ {
+ my $set = build_set @{$t->[0]};
+ my $res = build_set @{$t->[1]};
+ my $per = $set->permutations;
+ if ($per != $res)
+ {
+ print $per->string . ' != ' . $res->string . "\n";
+ return 1;
+ }
+ }
+ return 0;
+}
+
+sub test_invert ()
+{
+ my @tests = ([[["FALSE"]],
+ [["TRUE"]]],
+
+ [[["TRUE"]],
+ [["FALSE"]]],
+
+ [[["COND1_TRUE", "COND2_TRUE"],
+ ["COND3_FALSE", "COND2_TRUE"]],
+ [["COND1_FALSE","COND2_FALSE","COND3_FALSE"],
+ ["COND1_TRUE", "COND2_FALSE","COND3_FALSE"],
+ ["COND1_FALSE","COND2_FALSE","COND3_TRUE"],
+ ["COND1_TRUE", "COND2_FALSE","COND3_TRUE"],
+ ["COND1_FALSE","COND2_TRUE", "COND3_TRUE"]]],
+
+ [[["COND1_TRUE", "COND2_TRUE"],
+ ["TRUE"]],
+ [["FALSE"]]],
+
+ [[["COND1_TRUE", "COND2_TRUE"],
+ ["FALSE"]],
+ [["COND1_FALSE", "COND2_TRUE"],
+ ["COND1_FALSE", "COND2_FALSE"],
+ ["COND1_TRUE", "COND2_FALSE"]]],
+
+ [[["COND1_TRUE"],
+ ["COND2_FALSE"]],
+ [["COND1_FALSE", "COND2_TRUE"]]]
+ );
+
+ for my $t (@tests)
+ {
+ my $set = build_set @{$t->[0]};
+ my $res = build_set @{$t->[1]};
+ my $inv = $set->invert;
+ if ($inv != $res)
+ {
+ print $inv->string . ' != ' . $res->string . "\n";
+ return 1;
+ }
+ }
+ return 0;
+}
+
+exit (test_basics || test_permutations || test_invert);
+
+### Setup "GNU" style for perl-mode and cperl-mode.
+## Local Variables:
+## perl-indent-level: 2
+## perl-continued-statement-offset: 2
+## perl-continued-brace-offset: 0
+## perl-brace-offset: 0
+## perl-brace-imaginary-offset: 0
+## perl-label-offset: -2
+## cperl-indent-level: 2
+## cperl-brace-offset: 0
+## cperl-continued-brace-offset: 0
+## cperl-label-offset: -2
+## cperl-extra-newline-before-brace: t
+## cperl-merge-trailing-else: nil
+## cperl-continued-statement-offset: 2
+## End:
--- /dev/null
+## Process this file with automake to create Makefile.in
+
+## Copyright (C) 2002 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+## 02111-1307, USA.
+
+TESTS_ENVIRONMENT = $(PERL) -Mstrict -I $(top_srcdir)/lib -w
+TESTS = \
+Conditional.pl \
+ConditionalSet.pl
+
+EXTRA_DIST = $(TESTS)
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN = @LN@
LTLIBOBJS = @LTLIBOBJS@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN = @LN@
LTLIBOBJS = @LTLIBOBJS@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN = @LN@
LTLIBOBJS = @LTLIBOBJS@
-@set UPDATED 13 November 2002
+@set UPDATED 17 November 2002
@set UPDATED-MONTH November 2002
@set EDITION 1.7a
@set VERSION 1.7a
cond9.test \
cond10.test \
cond11.test \
-cond12.test \
cond13.test \
cond14.test \
cond15.test \
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN = @LN@
LTLIBOBJS = @LTLIBOBJS@
cond9.test \
cond10.test \
cond11.test \
-cond12.test \
cond13.test \
cond14.test \
cond15.test \
+++ /dev/null
-#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-#
-# This file is part of GNU Automake.
-#
-# GNU Automake is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# GNU Automake is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# This checks the result of Automake::Conditional::reduce() for
-# a wide variety of cases.
-
-. ./defs || exit 1
-
-set -e
-
-cat << 'END' > run
-use Automake::Conditional;
-
-my $failed = 0;
-sub check_reduce($$) {
- my ($inref, $outref) = @_;
- my @inconds = map { new Automake::Conditional $_ } @$inref;
- my @outconds = map { (new Automake::Conditional $_)->string } @$outref;
- my @res =
- map { $_->string } (Automake::Conditional::reduce (@inconds));
- my $result = join (",", sort @res);
- my $exresult = join (",", @outconds);
-
- if ($result ne $exresult)
- {
- print '"'.join(",", @$inref) . '" => "' .
- $result . '" expected "' .
- $exresult . '"' . "\n";
- $failed = 1;
- }
-}
-
-# If no conditions are given, TRUE should be returned
-check_reduce([""], ["TRUE"]);
-# A single condition should be passed through unchanged
-check_reduce(["FOO"], ["FOO"]);
-check_reduce(["FALSE"], ["FALSE"]);
-check_reduce(["TRUE"], ["TRUE"]);
-
-# TRUE and false should be discarded and overwhelm the result, respectively
-check_reduce(["FOO", "TRUE"], ["FOO"]);
-check_reduce(["FOO", "FALSE"], ["FALSE"]);
-
-# Repetitions should be removed
-check_reduce(["FOO", "FOO"], ["FOO"]);
-check_reduce(["TRUE", "FOO", "FOO"], ["FOO"]);
-check_reduce(["FOO", "TRUE", "FOO"], ["FOO"]);
-check_reduce(["FOO", "FOO", "TRUE"], ["FOO"]);
-
-# Two different conditions should be preserved, but TRUEs should be removed
-check_reduce(["FOO", "BAR"], ["BAR,FOO"]);
-check_reduce(["TRUE", "FOO", "BAR"], ["BAR,FOO"]);
-check_reduce(["FOO", "TRUE", "BAR"], ["BAR,FOO"]);
-check_reduce(["FOO", "BAR", "TRUE"], ["BAR,FOO"]);
-
-# A condition implied by another condition should be removed.
-check_reduce(["FOO BAR", "BAR"], ["FOO BAR"]);
-check_reduce(["BAR", "FOO BAR"], ["FOO BAR"]);
-check_reduce(["TRUE", "FOO BAR", "BAR"], ["FOO BAR"]);
-check_reduce(["FOO BAR", "TRUE", "BAR"], ["FOO BAR"]);
-check_reduce(["FOO BAR", "BAR", "TRUE"], ["FOO BAR"]);
-
-check_reduce(["BAR FOO", "BAR"], ["BAR FOO"]);
-check_reduce(["BAR", "BAR FOO"], ["BAR FOO"]);
-check_reduce(["TRUE", "BAR FOO", "BAR"], ["BAR FOO"]);
-check_reduce(["BAR FOO", "TRUE", "BAR"], ["BAR FOO"]);
-check_reduce(["BAR FOO", "BAR", "TRUE"], ["BAR FOO"]);
-
-# Check that reduction happens even when there are two conditionals to remove.
-check_reduce(["FOO", "FOO BAR", "BAR"], ["FOO BAR"]);
-check_reduce(["FOO", "FOO BAR", "BAZ", "FOO BAZ"], ["FOO BAR", "FOO BAZ"]);
-check_reduce(["FOO", "FOO BAR", "BAZ", "FOO BAZ", "FOO BAZ BAR"], ["FOO BAZ BAR"]);
-
-# Duplicated condionals should be removed
-check_reduce(["FOO", "BAR", "BAR"], ["BAR,FOO"]);
-
-# Equivalent conditionals in different forms should be reduced: which one is
-# left is unfortunately order dependent.
-check_reduce(["BAR FOO", "FOO BAR"], ["FOO BAR"]);
-check_reduce(["FOO BAR", "BAR FOO"], ["BAR FOO"]);
-
-exit $failed;
-END
-chmod +x run
-$PERL -w -I $perllibdir ./run
}' Makefile.in >produced
cat >expected << 'EOF'
-@ONE_TRUE@am__objects_1 = one.$(OBJEXT)
@ONE_FALSE@am__objects_1 =
-@TWO_TRUE@am__objects_2 = two.$(OBJEXT)
+@ONE_TRUE@am__objects_1 = one.$(OBJEXT)
@TWO_FALSE@am__objects_2 =
-@THREE_TRUE@am__objects_3 = three.$(OBJEXT)
+@TWO_TRUE@am__objects_2 = two.$(OBJEXT)
@THREE_FALSE@am__objects_3 =
+@THREE_TRUE@am__objects_3 = three.$(OBJEXT)
am_targ_OBJECTS = $(am__objects_1) $(am__objects_2) $(am__objects_3)
targ_OBJECTS = $(am_targ_OBJECTS)
EOF
-@set UPDATED 13 November 2002
+@set UPDATED 17 November 2002
@set UPDATED-MONTH November 2002
@set EDITION 1.7a
@set VERSION 1.7a