This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 104-handle-languages-morphing-5.patch


>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:

Tom> It has been hard for me to figure out what the patches preceding
Tom> this one did.

I understand.

Tom> I'm guessing that we still include depend2 multiple times, but
Tom> that the loop is not visible in this patch?

In fact, this is what happens before my patch:

    foreach my $ext (sort keys %extension_seen)
      {
	my $lang = $languages{$extension_map{$ext}};
...
	if ($use_dependencies && $lang->autodep ne 'no')
	  {
...
	    foreach my $ext (grep ($extension_seen{$_},
				   @{$lang->extensions}))
	      {
		$output_rules .= (&file_contents ('depend2',
						  (%transform,
						   'EXT' => $ext))
				  . "\n");
	      }
	  }
	elsif (defined $lang->compile)
	  {
...
	  }

and now it's becoming:

    foreach my $ext (sort keys %extension_seen)
      {
	my $lang = $languages{$extension_map{$ext}};

	if ($use_dependencies && $lang->autodep ne 'no')
	  {
...
	    $output_rules .= (&file_contents ('depend2',
...
			      . "\n");
	  }
	elsif (defined $lang->compile)
	  {
...
	  }


We are already looping over the extensions, we don't need to loop
again over a language's extensions.

Tom> I think this is ok.  The important thing is that we understand
Tom> that a given language can have multiple extensions in a single
Tom> package, so we might have to emit rules more than once per
Tom> language.

Aaah, yes, now I remember this was the thing I had not understood.

The test that check this (which I now ) are

src/am/tests % grep .cc *.test |grep cxx                         nostromo 19:53
compile_f_c_cxx.test:foo_SOURCES  = foo.f bar.c baz.cc
compile_f_c_cxx.test:: > baz.cc
subobj2.test:wish_SOURCES = generic/a.cc generic/b.cxx

and they both `pass' happily.

PASS: compile_f_c_cxx.test
XFAIL: subobj2.test
=====================================================
All 2 tests behaved as expected (1 expected failures)
=====================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]