New version of the patch attached: Tom Tromey wrote: >>>>>> "David" == David Daney writes: >>>>>> > > David> New version of the patch: > > Thanks. I'm afraid I have one blocking concern. > > David> Index: libjava/classpath/lib/Makefile.am > [...] > David> +gcj_tools_classpath = $(top_srcdir)/tools/classes > David> +compile_classpath = $(vm_classes):$(top_srcdir):$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax:$(top_srcdir)/external/relaxngDatatype:$(top_srcdir)/external/jsr166:.:$(USER_CLASSLIB):$(PATH_TO_ESCHER):$(gcj_tools_classpath) > > We purposely avoid putting the tools classes into the core class path. > This avoids any chance of a dependency on tools stuff by the core; > this would be bad due to the use of ASM in the tools. > > I wonder if we could fix this by putting the new tool code into > standard.omit, and then compile it separately using a special rule of > some kind, with a classpath pointing to the tools zip. > Ok, I added some rules to classpath/lib/Makefile.am, that parallel the special libgcj rules, to build gcj tools with a different classpath. To build more packages this way (i.e. gcj_dbtool), it should be as simple as adding the package name to the list in libjava's configure.ac. There will no longer be any excuses to prevent us from converting gcj_dbtool to use the getopt things. > David> + if (rest.length != 1) > David> + { > David> + optionParser.printHelp(); > David> + System.exit(1); > David> + } > > It is somewhat better to put checking code like this into a validate() > method which throws OptionException. This yields more "GNU like" > output. > > Done (I hope). > Tom > Java-maintainer-mode seems to work, currently testing non-maintainer mode build on i686-pc-linux-gnu and x86_64-pc-linux-gnu. OK to commit if no regressions? gcc/java: 2007-02-12 David Daney * Make-lang.in (JAVA_MANFILES): Add doc/gc-analyze.1. (java.maintainer-clean):Add gc-analyze.1. (.INTERMEDIATE): Add gc-analyze.pod. (gc-analyze.pod): New rule. (java.install-man): Install gc-analyze.1 * gcj.texi: Add new section for the gc-analyze program. libjava: 2007-02-12 Johannes Schmidt David Daney * configure.ac: Create gcj-tools-packages file. Add gnu/gcj/tools/gc_analyze to standard.omit and gcj-tools-packages. Check for /proc/self/maps. * Makefile.am (bin_PROGRAMS): Added gc-analyze. (AM_GCJFLAGS): Set classpath to $(srcdir)/classpath/tools/classes. (gcjh.stamp): Same. (gc_analyze_SOURCES): New. (gc_analyze_LDFLAGS): New. (gc_analyze_LINK): New. (gc_analyze_LDADD): New. (gc_analyze_DEPENDENCIES): New. (nat_source_files): Added gnu/gcj/util/natGCInfo.cc. * Makefile.in: Regenerated. * configure: Regenerated. * include/config.h.in: Regenerated. * sources.am: Regenerated. * scripts/makemake.tcl: Don't include gc-analyze classes in libgcj. * gnu/classpath/tools/getopt/Parser.h: New. * gnu/classpath/tools/getopt/FileArgumentCallback.h: New. * gnu/classpath/tools/getopt/Parser$1.h: New. * gnu/classpath/tools/getopt/Parser$2.h: New. * gnu/classpath/tools/getopt/Parser$3.h: New. * gnu/classpath/tools/getopt/OptionGroup.h: New. * gnu/classpath/tools/getopt/OptionException.h: New. * gnu/classpath/tools/getopt/Messages.h: New. * gnu/classpath/tools/getopt/Option.h: New. * gnu/gcj/tools/gc_analyze/MemoryAnalyze$SubstringComparator.h: New. * gnu/gcj/tools/gc_analyze/SymbolLookup.java: New. * gnu/gcj/tools/gc_analyze/BytePtr.h: New. * gnu/gcj/tools/gc_analyze/ItemList.h: New. * gnu/gcj/tools/gc_analyze/ToolPrefix.h: New. * gnu/gcj/tools/gc_analyze/MemoryAnalyze.h: New. * gnu/gcj/tools/gc_analyze/MemoryAnalyze$1.h: New * gnu/gcj/tools/gc_analyze/MemoryAnalyze$2.h: New * gnu/gcj/tools/gc_analyze/MemoryAnalyze$3.h: New * gnu/gcj/tools/gc_analyze/MemoryAnalyze$4.h: New * gnu/gcj/tools/gc_analyze/MemoryAnalyze$OptionParser.h: New. * gnu/gcj/tools/gc_analyze/BlockMap$SizeKind.h: New. * gnu/gcj/tools/gc_analyze/ObjectMap.java: New. * gnu/gcj/tools/gc_analyze/SymbolLookup.h: New. * gnu/gcj/tools/gc_analyze/MemoryMap.java: New. * gnu/gcj/tools/gc_analyze/MemoryAnalyze$1$Info.h: New. * gnu/gcj/tools/gc_analyze/ObjectMap.h: New. * gnu/gcj/tools/gc_analyze/MemoryMap.h: New. * gnu/gcj/tools/gc_analyze/SymbolTable.java: New. * gnu/gcj/tools/gc_analyze/SymbolTable.h: New. * gnu/gcj/tools/gc_analyze/ObjectMap$ObjectItem.h: New. * gnu/gcj/tools/gc_analyze/MemoryMap$RangeComparator.h: New. * gnu/gcj/tools/gc_analyze/BlockMap$PtrMarks.h: New. * gnu/gcj/tools/gc_analyze/BlockMap.java: New. * gnu/gcj/tools/gc_analyze/BytePtr.java: New. * gnu/gcj/tools/gc_analyze/ItemList.java: New. * gnu/gcj/tools/gc_analyze/ToolPrefix.java: New. * gnu/gcj/tools/gc_analyze/MemoryAnalyze.java: New. * gnu/gcj/tools/gc_analyze/MemoryMap$Range.h: New. * gnu/gcj/tools/gc_analyze/BlockMap.h: New. * gnu/gcj/util/GCInfo.java: New. * gnu/gcj/util/GCInfo.h: New. * gnu/gcj/util/natGCInfo.cc: New. * gnu/gcj/util/UtilPermission.java: New. * gnu/gcj/util/UtilPermission.h: New. * classpath/lib/gnu/gcj/tools/gc_analyze/SymbolTable.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/ObjectMap$ObjectItem.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/MemoryMap$RangeComparator.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/BlockMap$PtrMarks.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/MemoryMap$Range.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/BlockMap.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/BytePtr.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/MemoryAnalyze$SubstringComparator.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/ItemList.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/ToolPrefix.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/MemoryAnalyze.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/MemoryAnalyze$1$Info.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/MemoryAnalyze$1.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/MemoryAnalyze$2.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/MemoryAnalyze$3.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/MemoryAnalyze$4.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/MemoryAnalyze$OptionParser.class * classpath/lib/gnu/gcj/tools/gc_analyze/BlockMap$SizeKind.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/SymbolLookup.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/ObjectMap.class: New. * classpath/lib/gnu/gcj/tools/gc_analyze/MemoryMap.class: New. * classpath/lib/gnu/gcj/util/GCInfo.class: New. * classpath/lib/gnu/gcj/util/UtilPermission.class: New. libjava/classpath: 2007-02-12 David Daney * configure.ac (AC_CONFIG_FILES): Add lib/gen-gcj-tools-classlist.sh. * lib/Makefile.am (GCJ_TOOLS_COMPILE): New variable. (noinst_DATA): Add compile-gcj-tools-classes. (install-data-local): Add dependency on compile-gcj-tools-classes. (gcj-tools-classes): New target. (compile-gcj-tools-classes): New target. (CLEANFILES): Add compile-gcj-tools-classes and gcj-tools-classes. * lib/gen-gcj-tools-classlist.sh.in: New. * lib/Makefile.in: Regenerated. * configure: Regenerated.