unset ary(_)
}
+global is_verbose
+set is_verbose 0
+
# Verbose printer.
proc verbose {text} {
-# puts stderr $text
+ global is_verbose
+ if {$is_verbose} {
+ puts stderr $text
+ }
}
# This maps a name to its style:
set package_map(gnu/test) ignore
set package_map(gnu/javax/swing/plaf/gtk) ignore
+set package_map(gnu/java/awt/peer/swing) bc
+
set package_map(gnu/xml) bc
set package_map(javax/imageio) bc
set package_map(javax/xml) bc
set package_map(gnu/java/beans) bc
+set package_map(gnu/java/awt/dnd/peer/gtk) bc
+set package_map(gnu/java/util/prefs/gconf) bc
set package_map(gnu/java/awt/peer/gtk) bc
+set package_map(gnu/java/awt/dnd/peer/gtk) bc
+set package_map(gnu/java/awt/peer/qt) bc
+set package_map(gnu/java/awt/peer/x) bc
+set package_map(gnu/java/util/prefs/gconf) bc
+set package_map(gnu/javax/sound/midi) bc
set package_map(org/xml) bc
set package_map(org/w3c) bc
-
-# This is handled specially by the Makefile.
-# We still want it byte-compiled so it isn't in the .omit file.
-set package_map(gnu/gcj/tools/gcj_dbtool/Main.java) ignore
-
-# These are handled specially. If we list Class.java with other files
-# in java.lang, we hit a compiler bug.
-set package_map(java/lang/Class.java) ignore
-set package_map(java/lang/Object.java) ignore
+set package_map(org/relaxng) bc
+set package_map(javax/rmi) bc
+set package_map(org/omg) bc
+set package_map(gnu/CORBA) bc
+set package_map(gnu/javax/rmi) bc
+
+# parser/HTML_401F.class is really big, and there have been complaints
+# about this package requiring too much memory to build. So, we
+# compile it as separate objects. But, we're careful to compile the
+# sub-packages as packages.
+set package_map(gnu/javax/swing/text/html/parser) ordinary
+set package_map(gnu/javax/swing/text/html/parser/models) package
+set package_map(gnu/javax/swing/text/html/parser/support) package
# More special cases. These end up in their own library.
# Note that if we BC-compile AWT we must update these as well.
-set package_map(gnu/gcj/xlib) ignore
-set package_map(gnu/awt/xlib) ignore
+set package_map(gnu/gcj/xlib) package
+set package_map(gnu/awt/xlib) package
# Some BC ABI packages have classes which must not be compiled BC.
# This maps such packages to a grep expression for excluding such
global dir_map
makearray dir_map
+# An entry in this map means that all .properties files in the
+# corresponding directory should be ignored.
+global properties_map
+makearray properties_map
+
+# logging.properties is installed and is editable.
+set properties_map(java/util/logging) _
+# We haven't merged locale resources yet.
+set properties_map(gnu/java/locale) _
+
+
+# List of all properties files.
+set properties_files {}
+
# List of all '@' files that we are going to compile.
set package_files {}
set pkg $file
while {1} {
if {[info exists package_map($pkg)]} {
- # If the entry for '.' is 'package', then set up a new entry for
- # the file's package.
- if {$pkg == "." && $package_map($pkg) == "package"} {
+ # If the entry is 'package', then set up a new entry for the
+ # file's package.
+ if {$package_map($pkg) == "package"} {
set pkg [file dirname $file]
set package_map($pkg) package
}
error "can't happen"
}
-# Scan a directory and its subdirectories for .java source files.
-# Note that we keep basedir and subdir separate so we can properly
-# update our global data structures.
+# Scan a directory and its subdirectories for .java source files or
+# .properties files. Note that we keep basedir and subdir separate so
+# we can properly update our global data structures.
proc scan_directory {basedir subdir} {
- global dir_map
+ global dir_map properties_map properties_files
set subdirs {}
set files {}
set here [pwd]
cd $basedir/$subdir
- foreach file [lsort [glob *]] {
+ foreach file [lsort [glob -nocomplain *]] {
if {[string match *.java $file]} {
lappend files $subdir/$file
+ } elseif {[string match *.properties $file]} {
+ if {! [info exists properties_map($subdir)]} {
+ # We assume there aren't any overrides.
+ lappend properties_files $basedir/$subdir/$file
+ }
} elseif {[file isdirectory $file]} {
lappend subdirs $subdir/$file
+ } elseif {$subdir == "META-INF/services"} {
+ # All service files are included as properties.
+ lappend properties_files $basedir/$subdir/$file
}
}
cd $here
# Scan known packages beneath the base directory for .java source
# files.
proc scan_packages {basedir} {
- foreach subdir {gnu java javax org} {
+ foreach subdir {gnu java javax org sun META-INF} {
if {[file exists $basedir/$subdir]} {
scan_directory $basedir $subdir
}
if {[info exists exclusion_map($package)]} {
set omit "| grep -v $exclusion_map($package)"
}
- puts "\t@find classpath/lib/$package -name '*.class'${omit} > $tname"
- puts "\t\$(LTGCJCOMPILE) -fjni -findirect-dispatch -c -o $loname @$tname"
+ puts "\t@find \$(srcdir)/classpath/lib/$package -name '*.class'${omit} > $tname"
+ puts "\t\$(LTGCJCOMPILE) -fjni -findirect-dispatch -fno-indirect-classes -c -o $loname @$tname"
puts "\t@rm -f $tname"
puts ""
- # We skip this one because it is built into its own library and is
- # handled specially in Makefile.am.
- if {$loname != "gnu-java-awt-peer-gtk.lo"} {
+ # We skip these because they are built into their own libraries and
+ # are handled specially in Makefile.am.
+ if {$loname != "gnu-java-awt-peer-qt.lo" && $loname != "gnu-java-awt-peer-x.lo"} {
lappend bc_objects $loname
}
}
set lname $base.list
set dname $base.deps
+ if {$pkgname == "java/lang"} {
+ # Object and Class are special cases due to an apparent compiler
+ # bug. Process is a special case because we don't build all
+ # concrete implementations of Process on all platforms.
+ set omit "| tr ' ' '\\n' | fgrep -v Object.class | fgrep -v Class.class | grep -v '\[^/\]Process' "
+ } else {
+ set omit ""
+ }
+
# A rule to make the phony file we are going to compile.
puts "$lname: \$($varname)"
puts "\t@\$(mkinstalldirs) \$(dir \$@)"
- puts "\t@for file in \$($varname); do \\"
- puts "\t if test -f \$(srcdir)/\$\$file; then \\"
- puts "\t echo \$(srcdir)/\$\$file; \\"
- puts "\t else echo \$\$file; fi; \\"
- puts "\tdone > $lname"
+ puts "\techo \$(srcdir)/classpath/lib/$package/*.class $omit> $lname"
puts ""
puts "-include $dname"
puts ""
puts ""
- lappend package_files $lname
+ if {$pkgname != "gnu/gcj/xlib" && $pkgname != "gnu/awt/xlib"
+ && $pkgname != "gnu/gcj/tools/gcj_dbtool"} {
+ lappend package_files $lname
+ }
+}
+
+# Emit a rule to build a package full of 'ordinary' files, that is,
+# one .o for each .java.
+proc emit_ordinary_rule {package} {
+ global name_map package_files
+
+ foreach file $name_map($package) {
+ # Strip off the '.java'.
+ set root [file rootname $file]
+
+ # Look for all included .class files. Assumes that we don't have
+ # multiple top-level classes in a .java file.
+ set lname $root.list
+ set dname $root.deps
+
+ puts "$lname: classpath/$file"
+ puts "\t@\$(mkinstalldirs) \$(dir \$@)"
+ puts "\techo \$(srcdir)/classpath/lib/${root}*.class> $lname"
+ puts ""
+ puts "-include $dname"
+ puts ""
+ puts ""
+
+ lappend package_files $lname
+ }
+}
+
+# Emit a package-like rule for a platform-specific Process
+# implementation.
+proc emit_process_package_rule {platform} {
+ set base "java/process-$platform"
+ set lname $base.list
+ set dname $base.deps
+
+ puts "$lname: java/lang/${platform}Process.java"
+ puts "\t@\$(mkinstalldirs) \$(dir \$@)"
+ puts "\techo \$(srcdir)/classpath/lib/java/lang/${platform}Process*.class > $lname"
+ puts ""
+ puts "-include $dname"
+ puts ""
+ puts ""
}
# Emit a source file variable for a package, and corresponding header
if {$package_map($package) != "bc"} {
# Ugly code to build up the appropriate patsubst.
set result "\$(patsubst %.java,%.h,\$($varname))"
- foreach dir [lsort [array names dirs]] {
+ # We use -decreasing so that classpath/external will be stripped
+ # before classpath.
+ foreach dir [lsort -decreasing [array names dirs]] {
if {$dir != "."} {
set result "\$(patsubst $dir/%,%,$result)"
}
}
puts "${uname}_header_files = $result"
- lappend header_vars "${uname}_header_files"
puts ""
+ if {$pkgname != "gnu/gcj/xlib" && $pkgname != "gnu/awt/xlib"} {
+ lappend header_vars "${uname}_header_files"
+ }
}
}
puts ""
}
+global argv
+if {[llength $argv] > 0 && [lindex $argv 0] == "-verbose"} {
+ set is_verbose 1
+}
+
# Read the proper .omit files.
-read_omit_file standard.omit
-read_omit_file classpath/lib/standard.omit
+read_omit_file standard.omit.in
+read_omit_file classpath/lib/standard.omit.in
# Scan classpath first.
scan_packages classpath
scan_packages classpath/external/sax
scan_packages classpath/external/w3c_dom
+scan_packages classpath/external/relaxngDatatype
+scan_packages classpath/external/jsr166
+# Resource files.
+scan_packages classpath/resource
# Now scan our own files; this will correctly override decisions made
# when scanning classpath.
scan_packages .
# Files created by the build.
-classify_source_file . java/lang/ConcreteProcess.java
-classify_source_file classpath java/util/LocaleData.java
-classify_source_file classpath gnu/classpath/Configuration.java
+classify_source_file classpath gnu/java/locale/LocaleData.java
+classify_source_file classpath gnu/java/security/Configuration.java
puts "## This file was automatically generated by scripts/makemake.tcl"
puts "## Do not edit!"
if {$package_map($package) == "bc"} {
emit_bc_rule $package
} elseif {$package_map($package) == "ordinary"} {
- # Nothing in particular to do here.
+ emit_ordinary_rule $package
} elseif {$package_map($package) == "package"} {
emit_package_rule $package
} else {
}
}
+emit_process_package_rule Ecos
+emit_process_package_rule Win32
+emit_process_package_rule Posix
+
pp_var all_packages_source_files $package_files
pp_var ordinary_header_files $header_vars "\$(" ")"
pp_var bc_objects $bc_objects
+pp_var property_files $properties_files