Mon Dec 1 13:52:39 1997 Tom Tromey <tromey@cygnus.com>
+ * automake.in (handle_source_transform): Correctly generate
+ _OBJECTS when _SOURCES is defined conditionally. Reported by Rob
+ Savoye. Test cond3.test.
+
Fixes for test objc.test:
* automake.in (initialize_per_input): New global seen_any_source.
(handle_yacc_lex_cxx): Use seen_any_source to decide when to
Phil Nelson phil@cs.wwu.edu
Ralph Schleicher rs@purple.UL.BaWue.DE
Ramón García Fernández ramon@jl1.quim.ucm.es
+Rob Savoye rob@cygnus.com
Steve M. Robbins steve@nyongwa.montreal.qc.ca
Tatu Ylonen ylo@ssh.fi
The Crimson Binome steve@nyongwa.montreal.qc.ca
}
else
{
- local ($cond);
+ local ($cond, $cond_var_name);
+ local ($count) = 0;
+ local (@namelist) = ();
foreach $cond (@conds)
{
@files = &variable_value_as_list ($var, $cond);
($temp, @result) = &handle_single_transform_list (@files);
$linker = $temp if $linker eq '';
- &define_pretty_variable ($one_file . "_OBJECTS", $cond,
- @result)
+
+ # We have to have a new name for each such
+ # variable. Then we define the _OBJECTS variable
+ # as the union of all such variables. Hopefully
+ # this is the Right Thing.
+ $cond_var_name = 'cond' . $count . $one_file . '_OBJECTS';
+ &define_pretty_variable ($cond_var_name, $cond, @result)
unless $prefix eq 'EXTRA_';
+ push (@namelist, '$(' . $cond_var_name . ')');
+ ++$count;
}
+ &define_pretty_variable ($one_file . '_OBJECTS', '',
+ @namelist);
+
next;
}
}
+Mon Dec 1 15:48:16 1997 Tom Tromey <tromey@cygnus.com>
+
+ * cond3.test: New file.
+
Sat Nov 29 22:09:27 1997 Tom Tromey <tromey@cygnus.com>
* objc.test: New file.
seenc.test cygwin32.test lisp.test stamph.test ldadd.test \
version2.test conf2.test cond.test cond2.test xsource.test \
libobj6.test depend3.test output5.test ammissing.test install.test \
-libobj7.test objc.test
+libobj7.test objc.test cond3.test
EXTRA_DIST = defs $(TESTS)
seenc.test cygwin32.test lisp.test stamph.test ldadd.test \
version2.test conf2.test cond.test cond2.test xsource.test \
libobj6.test depend3.test output5.test ammissing.test install.test \
-libobj7.test objc.test
+libobj7.test objc.test cond3.test
EXTRA_DIST = defs $(TESTS)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
--- /dev/null
+#! /bin/sh
+
+# Test sources listed in conditional.
+# Report from Rob Savoye <rob@cygnus.com>.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_PROG_CC
+AM_CONDITIONAL(ONE, true)
+AM_CONDITIONAL(TWO, false)
+AM_CONDITIONAL(THREE, maybe)
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = targ
+
+if ONE
+SONE = one.c
+else
+SONE =
+endif
+
+if TWO
+STWO = two.c
+else
+STWO =
+endif
+
+if THREE
+STHREE = three.c
+else
+STHREE =
+endif
+
+targ_SOURCES = $(SONE) $(STWO) $(STHREE)
+END
+
+$AUTOMAKE || exit 1
+
+test "`grep '^targ_OBJECTS' Makefile.in | wc -l`" -eq 1