bug-automake
[Top][All Lists]
Advanced

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

Re: automake/514: check_JAVA files are always compiled


From: Thomas Schwinge
Subject: Re: automake/514: check_JAVA files are always compiled
Date: Mon, 15 Jan 2007 23:08:47 +0100
User-agent: Mutt/1.5.11

Hello!

On Wed, Jan 10, 2007 at 07:35:35PM +0100, Ralf Wildenhues wrote:
> * Roberto Bagnara wrote on Fri, Dec 22, 2006 at 03:17:21PM CET:
> > 
> > The subject says all.  Is there any workaround?
> 
> > check_JAVA files are always compiled, not only in case of `make check'.
> 
> Quoting 'info Automake Java':
> |    Any `.java' files listed in a `_JAVA' variable will be compiled with
> | `JAVAC' at build time.  By default, `.java' files are not included in
> | the distribution, you should use the `dist_' prefix to distribute them.
> [...]
> |    Currently Automake enforces the restriction that only one `_JAVA'
> | primary can be used in a given `Makefile.am'.  The reason for this
> | restriction is that, in general, it isn't possible to know which
> | `.class' files were generated from which `.java' files, so it would be
> | impossible to know which files to install where.  For instance, a
> | `.java' file can define multiple classes; the resulting `.class' file
> | names cannot be predicted without parsing the `.java' file.
> 
> Seems it's working as documented, no?
> 
> No, I don't know why this limitation exists, or what would be needed to
> lift it.  I don't know Automake's java support very well.

I confirm that compiling a Java source file (`.java') may emit more than
one byte-code file (`.class') with unpredictable names as long as the
source files are not parsed.

What about the following idea: before compiling the source files, a new
temporary directory is created and the compilation is done in there.
Then every newly created file must have been created from the previous
compilation process and can thus be associated with the just-compiled
source file.  After the compilation the resulting `.class' files are
moved to the main build directory, maintaining created subdirectories.

Such a mechanism could also help for other ``producers'' of object files
or other intermediate files and will certainly be handy if a versatile
mechanism of dependency tracking is to be implemented for Automake.
(Think, for example, about code generators that create C files and
accompanying header files from some sort of definition language.)


Regards,
 Thomas

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]