This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] classpath build machinery nits


Two nits related to Autoconf and Automake in classpath build machinery:

1) Autoconf cache variables have to match *_cv_* in order to be saved in
the cache file (Autoconf 2.62 will warn about this).

2) Automake 1.9.6 (and current) has a somewhat peculiar bug in that

-- --
if $condition; then

bin_SCRIPTS = prog
bin_PROGRAMS = prog
prog_SOURCES = ...

will not cause the rules for the prog$(EXEEXT) binary nor those for the
prog script to be disabled if respective condition is not met.  (The
first is a bug, the second a limitation: automake cannot understand
shell conditionals in

This leads to these well-known warnings:
| Makefile:643: warning: overriding commands for target `gappletviewer'
| Makefile:575: warning: ignoring old commands for target `gappletviewer'

In the default configuration (shell wrappers used), it also leads to a
bug: if I happen to update, say, tools/ after
config.status has run, then
  cd tools && make gappletviewer

tries to link a binary from zero objects, and fails.

I am still looking into a proper fix for the bug inside Automake.
Meanwhile, here's a simple workaround that fixes the rebuild rules.
It's somewhat of a hack as it relies on an Automake limitation and
another Automake bug: adding stub dependencies, automake thinks that
these are rules, and will thus hide the prog$(EXEEXT) link rules under
the conditional.  It still won't hide its own-supplied config.status
rules for the prog scripts, however.

In the case where we want the scripts, this results in a Makefile that
does exactly the right thing (and causes no make warnings), in the
--enable-tool-wrappers case, there are still 2 sets of conflicting
rules (thus also warnings), but here we at least now may depend on the
fact that the desirable rules are listed last, thus make does the right
thing again.

OK for trunk?  If yes, can someone push this upstream in classpath for


2008-03-15  Ralf Wildenhues  <>

	* m4/gcc_attribute.m4 (GCC_ATTRIBUTE): Fix cache variable name.
	* tools/ (gappletviewer, gjarsigner, gkeytool, gjar)
	(gnative2ascii, gserialver, gjavah, grmiregistry, gtnameserv)
	(gorbd, grmid, grmic) [!CREATE_WRAPPERS]: Add stub dependencies
	for these scripts, to trick automake into hiding the respective
	rules for the programs below the CREATE_WRAPPERS conditional.

diff --git a/libjava/classpath/m4/gcc_attribute.m4 b/libjava/classpath/m4/gcc_attribute.m4
index f0c2572..f332d21 100644
--- a/libjava/classpath/m4/gcc_attribute.m4
+++ b/libjava/classpath/m4/gcc_attribute.m4
@@ -15,7 +15,7 @@ AC_DEFUN([CACHED_TRY_COMPILE],[
 dnl GCC_ATTRIBUTE(<short-label>,<cachevar>,<func-params>,<attribute>,<HAVE>,<desc>,[<true-cmds>],[<false-cmds>])
-  CACHED_TRY_COMPILE(__attribute__(($1)),cv_c_gcc_attribute_$2,,
+  CACHED_TRY_COMPILE(__attribute__(($1)),gcc_cv_c_gcc_attribute_$2,,
    [extern int testfunction($3) __attribute__(($4))],
diff --git a/libjava/classpath/tools/ b/libjava/classpath/tools/
index de54eed..773157d 100755
--- a/libjava/classpath/tools/
+++ b/libjava/classpath/tools/
@@ -100,6 +100,19 @@ noinst_SCRIPTS = gappletviewer gjarsigner gkeytool \
 	gjar gnative2ascii gserialver gjavah grmiregistry \
 	gtnameserv gorbd grmid grmic
+## FIXME: revisit this with a newer automake.
 EXTRA_DIST = toolwrapper.c \ \

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