Re: [PATCH] Fix preponderance of warnings in libjava from boehm-gc

2004-12-09 Thread Bryce McKinlay
On 9-Dec-04, at 9:51 AM, Kelley Cook wrote:
Third iteration at fixing the duplicate PACKAGE warnings from boehm-gc 
should be the charm.  The change from the second iteration is that 
this time I grab all the GC_*_THREADS definitions too.

Tom,
My first iteration did as you recently suggested and copied everything 
except PACKAGE and VERSION.

Both Nathanael and Bryce said that the logic for the generated file 
should be to only include definitions that we wish to externally 
present as opposed to only excluding those we know are problematic.  I 
personally agree with them.
Indeed. I'd like to "fix" the GC so that it doesn't rely on things like 
THREADS_* being defined when we include its headers. It appears that 
the only problem with my original patch was naming the GC's config file 
"config.h". This meant that the "#include " in gc.h resolved 
to libjava's config.h and not the GC's, when gc.h was included from 
libjava - oops.

Your patch should certainly work, but I don't like it so much because 
doing it with a grep in the Makefile obfuscates things somewhat - ie it 
won't be immediately obvious to future hackers precisely what is going 
on. Note that the only flag that should be needed externally by libjava 
is THREAD_LOCAL_ALLOC, so I think it would be better to make this 
explicit in gc_config.h. ie: use the original patch combined with your 
naming convention for the GC's config files. I'll test a patch to do 
this and post it soon.


Bootstrapped and regtested on powerpc-apple-darwin7.6.0
OK to install?  The hundreds of libjava warnings are a regression that 
I caused, though I do not believe that there is a PR associated with 
the problem.

BTW: Bryce, is CVS's PR18699.out supposed to be a zero byte file?
Yes.
Regards
Bryce


[PATCH] Fix preponderance of warnings in libjava from boehm-gc

2004-12-09 Thread Kelley Cook
Third iteration at fixing the duplicate PACKAGE warnings from boehm-gc 
should be the charm.  The change from the second iteration is that this 
time I grab all the GC_*_THREADS definitions too.

Tom,
My first iteration did as you recently suggested and copied everything 
except PACKAGE and VERSION.

Both Nathanael and Bryce said that the logic for the generated file 
should be to only include definitions that we wish to externally present 
as opposed to only excluding those we know are problematic.  I 
personally agree with them.

Bootstrapped and regtested on powerpc-apple-darwin7.6.0
OK to install?  The hundreds of libjava warnings are a regression that I 
caused, though I do not believe that there is a PR associated with the 
problem.

BTW: Bryce, is CVS's PR18699.out supposed to be a zero byte file?
2004-12-09  Kelley Cook  <[EMAIL PROTECTED]>

* configure.ac: Rename gc_config.h to gc_int_config.h.
* gc_config.h.in: Remove.
* gc_int_config.in: Generate.
* Makefile.in, configure: Regenerate.
* include/gc.h: Include gc_int_config.h.
* include/Makefile.am (gc_config.h): New target.
(stamp-h2): New stampfile target.
(all-local): Always build gc_config.h.
(DISTCLEANFILES): Clean up our mess.
* include/Makefile.in: Regenerate.

diff -Nprud /home/kcook34/gcc-orig/boehm-gc/configure.ac ./configure.ac
--- /home/kcook34/gcc-orig/boehm-gc/configure.ac2004-11-29 
19:38:55.0 -0500
+++ ./configure.ac  2004-12-08 10:53:11.219770400 -0500
@@ -468,7 +468,7 @@ else
   multilib_arg=
 fi
 
-AC_CONFIG_HEADERS([include/gc_config.h])
+AC_CONFIG_HEADERS([include/gc_int_config.h])
 
 AC_CONFIG_FILES(Makefile include/Makefile)
 AC_OUTPUT
diff -Nprud /home/kcook34/gcc-orig/boehm-gc/include/Makefile.am 
./include/Makefile.am
--- /home/kcook34/gcc-orig/boehm-gc/include/Makefile.am 2002-12-31 
12:52:25.0 -0500
+++ ./include/Makefile.am   2004-12-08 13:57:28.007890600 -0500
@@ -3,5 +3,20 @@ AUTOMAKE_OPTIONS = foreign
 noinst_HEADERS = gc.h gc_backptr.h gc_local_alloc.h \
   gc_pthread_redirects.h gc_cpp.h
 
+all-local: gc_config.h
 
+gc_config.h: stamp-h2
+   @if test ! -f $@; then \
+ rm -f stamp-h2; \
+ $(MAKE) stamp-h2; \
+   else :; fi
 
+stamp-h2: gc_int_config.h
+   @rm -f tmp-gc-config 
+   echo "/* include/gc_config.h  Generated by include/Makefile.in */" > 
tmp-gc-config
+   echo "" >> tmp-gc-config
+   $(EGREP) "THREAD_LOCAL_ALLOC|GC_.*THREADS" $< >> tmp-gc-config
+   $(SHELL) $(top_srcdir)/../move-if-change tmp-gc-config gc_config.h
+   touch $@
+ 
+DISTCLEANFILES = stamp-h2 gc_config.h
diff -Nprud /home/kcook34/gcc-orig/boehm-gc/include/gc.h ./include/gc.h
--- /home/kcook34/gcc-orig/boehm-gc/include/gc.h2004-11-29 
19:38:57.0 -0500
+++ ./include/gc.h  2004-12-08 10:53:23.376887800 -0500
@@ -30,7 +30,7 @@
 
 # define _GC_H
 
-# include 
+# include 
 # include "gc_config_macros.h"
 
 # if defined(__STDC__) || defined(__cplusplus)