Bug 4741 - gcjh doesn't overwrite existing .h file
Summary: gcjh doesn't overwrite existing .h file
Status: NEW
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks: 1839 3620
  Show dependency treegraph
 
Reported: 2007-07-04 21:25 UTC by Andrew Cagney
Modified: 2008-10-21 21:40 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 2007-07-04 21:25:36 UTC
The rule for creating a .h file from a .java file is:

.java.h:
	b=`basename $*` ; \
	d=`dirname $*` ; \
	tmpdir=$$b.tmp ; \
	rm -rf $$tmpdir ; \
	mkdir -p $$tmpdir ; \
	$(GCJCOMPILE) -C -d $$tmpdir '$<' || exit 1 ; \
	classes=`cd $$tmpdir; find $$d/$$b*.class \
		    -name '*\$$[0-9]*' -prune \
		    -o -name $$b.class -print \
		    -o -name $$b'\$$*'.class -print \
		    | sed -e 's,.class$$,,'`; \
	echo $$classes ; \
	for class in $$classes ; do \
		outputdir=`dirname $$class`; \
		outputfile=`basename $$class`.h; \
		echo "$$class => $$outputdir/$$outputfile"; \
		rm -f $$outputdir/$$outputfile ; \ <<<===
		$(GCJH) -I $$tmpdir \
			-o $$outputdir/$$outputfile \
			$(GCJHFLAGS) $$class ; \
	done ; \
	rm -rf $$tmpdir

note the rm -f of the output .h file before GCJH is run.  Without that GCJH
won't write out a new .h file.

cagney@morgan$ gcjh --version
gcjh (GNU Classpath) 0.93

Copyright 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 1 Andrew Cagney 2007-07-04 21:28:46 UTC
Index: frysk-imports/common/ChangeLog
2007-07-04  Andrew Cagney  <cagney@redhat.com>

	* Makefile.rules (.java.h): Remove generated .h file before
	running GCJH.  Work around 4741.