Bug 3474 - targets for installed .jar's ; rule causes re-build
Summary: targets for installed .jar's ; rule causes re-build
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Stepan Kasal
URL:
Keywords:
Depends on:
Blocks: 2235
  Show dependency treegraph
 
Reported: 2006-11-07 15:38 UTC by Andrew Cagney
Modified: 2006-11-14 21:00 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cagney 2006-11-07 15:38:45 UTC
A common complaint is that, after an update installed java packages which leads
to a changed name of the installed .jar files the build fails.

Can be "fixed" by generating rules like:

<<installed>>.jar:
        re-configure

while it will normally do zip, when the jar disappears a re-configure (and hence
re-generate) will occure causing the Makefile to be updated to the new versions
of the files.
Comment 1 Stepan Kasal 2006-11-07 18:03:01 UTC
I gather that the idea is that the re-generate command will refresh all the
makefiles, which will get automatically noticed by GNU make.  (Users of other
make implementations, if any, might be out of luck, but that does not matter.)

But there is one pitfall: the Makefile has to be updated as a target.

Here is an example what not to do:

$ cat Makefile
foo: bar
        : One
bar:
        sed -i 's/[O]ne/Two/' Makefile
$ make
sed -i 's/[O]ne/Two/' Makefile
: One
$

Make has not noticed that the Makefile has changed.

OTOH, if the makefile is listed as a target, GNU make checks if it is
up-to-date, even though it is not a prerequisite:

$ cat Makefile
foo:
        : One
Makefile: nonexistent
        sed -i 's/[O]ne/Two/' Makefile
nonexistent:
        touch nonexistent
$ make
touch nonexistent
sed -i 's/[O]ne/Two/' Makefile
: Two

The final ``Two'' shows that make has re-read the Makefile.

So the installed .jar's have to be made pre-requisities of Makefile. Automake
does not provide any way to list such dependencies, but Makefile already depends
on $(top_builddir)/config.status, and Automake supports
CONFIG_STATUS_DEPENDENCIES.  Moreover, if the .jar's are added to
CONFIG_STATUS_DEPENDENCIES, then their absence will trigger re-configuration
automatically.  And if CONFIG_STATUS_DEPENDENCIES is set by AC_SUBST, it will be
automatically present in all Makefiles.

I'll implement this.
Comment 2 Andrew Cagney 2006-11-07 18:08:59 UTC
CONFIGURE_DEPENDENCIES, or CONFIG_STATUS_DEPENDENCIES?  Does config-status
re-check for the correct .jar file.

Also, I've a feeling that a dummy rule for the installed .jar is going to be
needed.  Otherwize make will fail complaining about the .jar being missing for
config.status.

With some tweeks looks like it can be made to work; good find!
Comment 3 Stepan Kasal 2006-11-14 19:25:34 UTC
(In reply to comment #2)
> CONFIGURE_DEPENDENCIES, or CONFIG_STATUS_DEPENDENCIES?  Does config-status
> re-check for the correct .jar file.

If one of CONFIGURE_DEPENDENCIES is touched, autoconf is run to re-create configure.

If one of CONFIG_STATUS_DEPENDENCIES is touched, ./configure is re-run to
refresh config.status, Makefile, etc.

This means that CONFIG_STATUS_DEPENDENCIES is really the right one here.

> [...] a dummy rule for the installed .jar is going to be needed.

Indeed, I forgot to mention it.
Comment 4 Stepan Kasal 2006-11-14 19:26:36 UTC
Fixed in CVS.
Comment 5 Stepan Kasal 2006-11-14 21:00:28 UTC
The change log entries are:

frysk-gtk/ChangeLog

2006-11-14  Stepan Kasal  <skasal@redhat.com>

        * configure.ac: Put the jars reported by pkg-config to
        CONFIG_STATUS_DEPENDENCIES, so that the project gets reconfigured
        if the java-gnome packages are upraded later.
        * Makefile.am (FRYSK_GTK_JARS): Add fake rules for the installed jars.
        * tlwidgets/Makefile (FRYSK_GTK_JARS): Likewise.
        * tests/Makefile (FRYSK_GTK_JARS): Likewise.

frysk-gui/ChangeLog

2006-11-14  Stepan Kasal  <skasal@redhat.com>

        * configure.ac: Put the jars reported by pkg-config to
        CONFIG_STATUS_DEPENDENCIES, so that the project gets reconfigured
        if the java-gnome packages are upraded later.
        * Makefile.am (FRYSK_GUI_JARS): Add fake rules for the installed jars.