automake
[Top][All Lists]
Advanced

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

[patch] noinst_JAVA


From: Rusty Ballinger
Subject: [patch] noinst_JAVA
Date: Sat, 11 Nov 2000 02:49:15 -0800

Hey, a thing that's bothered me for a while is that noinst_JAVA is
broken.

If you use noinst_JAVA, your .java files are still assigned to
noinst_JAVA, and clean-noinstJAVA removes classnoinst.stamp, but
DIST_COMMON gets $(_JAVA) instead of $(noinst_JAVA), all-am depends
on class.stamp instead of classnoinst.stamp, and instead of this:

    classnoinst.stamp: $(noinst_JAVA)
            ...
            echo timestamp > classnoinst.stamp

you get this:

    class.stamp: $(_JAVA)
            ...
            echo timestamp > class.stamp

which doesn't work because your source files are in noinst_JAVA, not
_JAVA.

Note that this patch breaks (correctly) the one example I saw in the
list archive where someone else was using noinst_JAVA: in
http://sources.redhat.com/ml/automake/2000-01/msg00110.html, Todd
Dukes has both noinst_JAVA and java_JAVA in the same Makefile.am.  An
existing test in handle_java attempts to prevent multiple _JAVA
directories from being given in the same Makefile.am, and I think
this patch causes that test to work (and give an error) when one of
the directories is noinst.  (The reason for this test is that the
install rule in java.am installs *.class; in Todd's case, for example,
any class files which happened to be built for his noinst_JAVA files
would have been installed in javadir.)

It seems like multiple _JAVA directories could be allowed if the
install & uninstall rules transformed each _JAVA file name from
Foo.java to "Foo.class Foo\$*.class"; are there some class files that
would miss?  It would break the case where you have both Foo.java and
Bar.java in a directory, and only Foo.java is listed in java_JAVA, and
javac is generating both Foo.class and Bar.class when you ask it to
compile Foo.java (which is common).  The current behavior installs
both Foo.class and Bar.class, while the new behavior would install
only Foo.class.  That seems like correct behavior to me, though.

(sorry for the stunningly high blather:patch ratio.)

--Rusty


--- automake/automake.in        Thu Jan 14 22:42:36 1999
+++ ../automake-1.4/./automake.in       Sat Nov 11 01:49:46 2000
@@ -3871,8 +3871,7 @@
     local ($dir, $curs);
     foreach $curs (keys %valid)
     {
-       if (! &variable_defined ($curs . '_JAVA') || $curs eq 'noinst'
-           || $curs eq 'EXTRA')
+       if (! &variable_defined ($curs . '_JAVA') || $curs eq 'EXTRA')
        {
            next;
        }



reply via email to

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