This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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] Fix broken $(db_name) target in Makefile.am


Hi People,

The following rule is broken in Makefile.am when host=target
and build!=host:

## The .db file.  This rule is only used for native builds, so it is
## safe to invoke gcj-dbtool.
$(db_name): gcj-dbtool
## In case it exists already.
	@rm -f $(db_name)
## We don't actually care if it fails -- if it does, just make an
## empty file.  This is simpler than trying to discover when mmap is
## not available.
	./gcj-dbtool -n $(db_name) || touch $(db_name)

The following patch is the minimum needed to fix it, and
it is the least intrusive, but I'm not completely happy
with it. (What if the cross compiler builds a gcj-dbtool
which functions correctly on the host machine, but produces
a valid executable on the build machine whose behavior is
to reformat the hard drive or do a DOS attack on gcc.gnu.org?)

The correct, but more intrusive approach, would be do something like
change configure.ac and add a new Makefile.am variable called BUILD_IS_HOST
which, when unset, disables invoking gcj-dbtool. I don't know
if it's too late in the game for 4.0, though. My patch is
against the 4.0 branch - I assume it would need to be applied
to 4.1 too.

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/

2005-03-22  Mohan Embar  <gnustuff@thisiscool.com>

	* Makefile.am ($(db_name)): Add $(EXEEXT) suffix to
	gcj-dbtool dependency

Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.455.2.4
diff -u -2 -r1.455.2.4 Makefile.am
--- Makefile.am	15 Mar 2005 20:56:53 -0000	1.455.2.4
+++ Makefile.am	22 Mar 2005 18:59:39 -0000
@@ -264,5 +264,5 @@
 ## The .db file.  This rule is only used for native builds, so it is
 ## safe to invoke gcj-dbtool.
-$(db_name): gcj-dbtool
+$(db_name): gcj-dbtool$(EXEEXT)
 ## In case it exists already.
 	@rm -f $(db_name)





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