Re: [Vala] Vala support for automake



Hi Ralf,

On Wed, 2009-04-15 at 20:42 +0200, Ralf Wildenhues wrote:
I'm looking at adding per-target flag support for vala sources.

Say I have baz.vala and want to create from that
  foo-baz.c foo-baz.h

in one valac invocation, as well as
  bar-baz.c bar-baz.h

in another 'valac -D BAR' invocation.  Is there some flag I can pass to
valac that will use these output names for me?  If yes, does it do so
without generating intermediate baz.c baz.h files or any other temporary
files that have a name  which would conflict with parallel make -jN
execution?

valac does not currently support any transformation on the output names
of the .c files. It's not as easy as a simple -o option because you have
multiple input and output files per invocation in general (see below).
If you think it would make sense to add a --suffix option or similar to
valac, I could certainly take a look at it.

Also, I see that your vala compile passes all sources to valac.  Is that
intentional (or just because that was good enough)?  I.e., if you have
  bin_PROGRAMS = foo
  foo_SOURCES = a.c b.vala c.l d.java e.vala

do you really want to invoke
  valac -C a.c b.vala c.l d.java e.vala

That was not intentional. valac won't mind unnecessary .c files but will
reject files with other extensions.

rather than
  valac -C b.vala e.vala

This would be the correct commandline.

or even
  valac -C b.vala
  valac -C e.vala

This would not work, valac requires all Vala source files of the same
program / library on the same commandline. The reason is that the source
files can depend on each other, but there is no header/include
mechanism.

?  And if per-target flags are used with multiple input files, how would
I specify the renamed output files?

We'd probably need to add a new commandline option to valac as suggested
in the first paragraph.

Thanks,
Jürg




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]