diff options
Diffstat (limited to 'libjava/classpath/lib')
-rw-r--r-- | libjava/classpath/lib/.cvsignore | 30 | ||||
-rw-r--r-- | libjava/classpath/lib/Makefile.am | 152 | ||||
-rw-r--r-- | libjava/classpath/lib/Makefile.gcj | 32 | ||||
-rwxr-xr-x | libjava/classpath/lib/gen-classlist.sh.in | 87 | ||||
-rw-r--r-- | libjava/classpath/lib/jazzlib/index.html | 47 | ||||
-rwxr-xr-x | libjava/classpath/lib/jazzlib/makeJazzlibDist.sh | 121 | ||||
-rwxr-xr-x | libjava/classpath/lib/mkcollections.pl.in | 140 | ||||
-rwxr-xr-x | libjava/classpath/lib/mkdep.pl.in | 336 | ||||
-rwxr-xr-x | libjava/classpath/lib/split-for-gcj.sh | 28 | ||||
-rw-r--r-- | libjava/classpath/lib/standard.omit | 4 |
10 files changed, 977 insertions, 0 deletions
diff --git a/libjava/classpath/lib/.cvsignore b/libjava/classpath/lib/.cvsignore new file mode 100644 index 00000000000..4b623352a07 --- /dev/null +++ b/libjava/classpath/lib/.cvsignore @@ -0,0 +1,30 @@ +Makefile +Makefile.in +com +gnu +java +javax +kaffe +classes +classes.awt +classes.locale +classes.locale1 +classes.locale2 +classes.standard +classes.standardx +classes.xml +glibj.zip +deps.sh +gen-classlist.sh +mkdep.pl +errors.txt +headers.dep +classes.dep +makefile.dep +java.dep +compile-classes +mkcollections.pl +gen_nio.sh +classes.1 +resources +org diff --git a/libjava/classpath/lib/Makefile.am b/libjava/classpath/lib/Makefile.am new file mode 100644 index 00000000000..983622dab56 --- /dev/null +++ b/libjava/classpath/lib/Makefile.am @@ -0,0 +1,152 @@ +JAVA_DEPEND = java.dep + +## silently try to include these, if it fails gnu make +## will remake these 'makefiles' with the rules given in +## this file and restart the make process again +sinclude $(JAVA_DEPEND) + +propertydirs := $(shell cd $(top_srcdir)/resource && $(FIND) gnu java org META-INF -type d ! -name CVS -print) +propertyfiles := $(shell cd $(top_srcdir)/resource && $(FIND) gnu java org -name \*\.properties -print) +metafiles := $(shell cd $(top_srcdir)/resource && $(FIND) META-INF -path \*/CVS -prune -o -type f -print) +iconfiles := $(shell cd $(top_srcdir) && $(FIND) gnu/javax/swing/plaf/gtk/icons -name *.png -type f -print) + +compile_classpath = $(vm_classes):$(top_srcdir):$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax:.:$(USER_CLASSLIB) + +# handling source to bytecode compiler programs like gcj, jikes and kjc +if FOUND_GCJ +# Since we don't feed all classes at once gcj needs to know where to find +# the generated classes (in top_builddir). +JAVAC = $(srcdir)/split-for-gcj.sh && $(MAKE) -f $(srcdir)/Makefile.gcj \ + GCJ='$(GCJ)' compile_classpath='$(top_builddir):$(compile_classpath)' +else +if FOUND_JIKES +JAVAC = $(JIKES) +Pno-shadow +Pno-switchcheck +F $(JIKESENCODING) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(compile_classpath) -d . @classes +else +if FOUND_KJC +## FIXME: from what I can tell, kjc does not support a -encoding option. +JAVAC = $(KJC) -classpath .:$(USER_CLASSLIB) -d . @classes +else +if FOUND_GCJX +JAVAC = $(GCJX) -encoding UTF-8 -classpath .:$(USER_CLASSLIB) -d . @classes +else +if FOUND_ECJ +JAVAC = $(ECJ) -encoding UTF-8 -warn:-deprecation,serial -proceedOnError -bootclasspath '' -classpath $(compile_classpath) -d . @classes +endif # FOUND_ECJ +endif # FOUND_GCJX +endif # FOUND_KJC +endif # FOUND_GCJ +endif # FOUND_JIKES + +JAVAH = $(USER_JAVAH) -jni -classpath .:$(USER_CLASSLIB) + +if INSTALL_GLIBJ_ZIP + +pkgdata_DATA = glibj.zip + +endif # INSTALL_GLIBJ_ZIP + +if BUILD_CLASS_FILES +noinst_DATA = genclasses compile-classes resources +endif # BUILD_CLASS_FILES + +if INSTALL_CLASS_FILES + +install-data-local: genclasses compile-classes + -$(top_srcdir)/mkinstalldirs $(DESTDIR)$(pkgdatadir) + cp -R gnu $(DESTDIR)$(pkgdatadir) + cp -R java $(DESTDIR)$(pkgdatadir) + cp -R javax $(DESTDIR)$(pkgdatadir) + cp -R org $(DESTDIR)$(pkgdatadir) + cp -R META-INF $(DESTDIR)$(pkgdatadir) + +# FIXME - should mimic doc/api/Makefile.am instead... +uninstall-local: + rm -rf $(DESTDIR)$(pkgdatadir)/gnu + rm -rf $(DESTDIR)$(pkgdatadir)/java + rm -rf $(DESTDIR)$(pkgdatadir)/javax + rm -rf $(DESTDIR)$(pkgdatadir)/org + rm -rf $(DESTDIR)$(pkgdatadir)/META-INF + +endif # INSTALL_CLASS_FILES + +.PHONY: genclasses + +glibj.zip: classes compile-classes resources + if test "$(ZIP)" != ""; then $(ZIP) -r -D glibj.zip gnu java javax org META-INF > /dev/null; fi + +resources: + if ! [ -e gnu ]; then mkdir gnu; fi + if ! [ -e gnu/java ]; then mkdir gnu/java; fi + if ! [ -e gnu/java/locale ]; then mkdir gnu/java/locale; fi + if ! [ -e gnu/javax/swing/plaf/gtk/icons ]; then mkdir -p gnu/javax/swing/plaf/gtk/icons; fi + @list='$(propertydirs)'; for p in $$list; do \ + if ! [ -e $$p ]; then mkdir $$p; fi; \ + done + @list='$(propertyfiles)'; for p in $$list; do \ + cp $(top_srcdir)/resource/$$p $$p; \ + done + @list='$(metafiles)'; for p in $$list; do \ + cp $(top_srcdir)/resource/$$p $$p; \ + done + @list='$(iconfiles)'; for p in $$list; do \ + cp $(top_srcdir)/$$p $$p; \ + done + touch resources + +classes: genclasses + +$(top_builddir)/java/util/LocaleData.java: $(top_srcdir)/scripts/generate-locale-list.sh + mkdir -p $(top_builddir)/java/util + $(top_srcdir)/scripts/generate-locale-list.sh > $(top_builddir)/java/util/LocaleData.java + +genclasses: gen-classlist.sh standard.omit $(top_builddir)/java/util/LocaleData.java gen-xpath-parser + top_builddir=$(top_builddir) top_srcdir=$(top_srcdir) $(SHELL) ./gen-classlist.sh standard + +# Only rebuild parsers when explicitly asked to. +if REGEN_PARSERS + +gen-xpath-parser: $(top_srcdir)/gnu/xml/xpath/XPathParser.java + +$(top_srcdir)/gnu/xml/xpath/XPathParser.java: $(top_srcdir)/gnu/xml/xpath/XPathParser.y + ( cd $(top_srcdir)/gnu/xml/xpath; \ + $(JAY) XPathParser.y < $(JAY_SKELETON) > XPathParser.java ) +else + +gen-xpath-parser: + true + +endif # REGEN_PARSER + +$(JAVA_DEPEND): genclasses + +compile-classes: classes $(JAVA_SRCS) Makefile + $(JAVAC) + touch compile-classes + +EXTRA_DIST = standard.omit mkcollections.pl.in Makefile.gcj split-for-gcj.sh +CLEANFILES = compile-classes resources classes \ + classes.standard classes.awt classes.standardx classes.xml \ + glibj.zip classes.1 \ + $(top_builddir)/java/util/LocaleData.java \ + $(JAVA_DEPEND) + +clean-local: + -rm -rf gnu + -rm -rf java + -rm -rf javax + -rm -rf org + -rm -rf META-INF + -rm -rf lists + -rm -f Makefile.deps + +dist-hook: + mkdir -p $(distdir) + cp -dfR $(top_srcdir)/gnu $(top_srcdir)/java $(top_srcdir)/javax $(top_srcdir)/org $(top_srcdir)/vm $(top_srcdir)/resource $(top_distdir) +# Delete not wanted files. + $(FIND) $(top_distdir)/gnu $(top_distdir)/java $(top_distdir)/javax $(top_distdir)/org $(top_distdir)/vm $(top_distdir)/resource -name CVS -print | xargs rm -fr + $(FIND) $(top_distdir)/gnu $(top_distdir)/java $(top_distdir)/javax $(top_distdir)/org $(top_distdir)/vm $(top_distdir)/resource -name .cvsignore -print | xargs rm -f + $(FIND) $(top_distdir)/gnu $(top_distdir)/java $(top_distdir)/javax $(top_distdir)/org $(top_distdir)/vm -name class-dependencies.conf -print | xargs rm -f + rm -f $(top_distdir)/gnu/classpath/Configuration.java + rm -f $(top_distdir)/java/util/LocaleData.java +# Omit files listed in standard.omit. + ( cd $(top_distdir)/lib ; cat $(top_builddir)/lib/standard.omit | sed -e 's/\$$//' | sed -e 's/\/\.\*//' | xargs rm -fr ) diff --git a/libjava/classpath/lib/Makefile.gcj b/libjava/classpath/lib/Makefile.gcj new file mode 100644 index 00000000000..a9d520c73c5 --- /dev/null +++ b/libjava/classpath/lib/Makefile.gcj @@ -0,0 +1,32 @@ +# This Makefile is used when building with gcj. It is separate from +# the ordinary Makefile as it does special GNU-make-specific things, +# and this avoids making other builds unnecessarily ugly. + +# A .list file is made by split-for-gcj.sh. +# It lists all the files in a given package. +all_list_files := $(shell echo lists/*.list) +# The corresponding stamp files. +# Each .class file depends on its package's stamp file. +# Each stamp file depends on the corresponding list file. +# Each list file depends on the java files in its package. +# This way touching a single java source will cause the minimum +# number of rebuilds. +all_stamp_files := $(all_list_files:.list=.stamp) +# The dependency file generated by gcj. +all_deps_files := $(all_list_files:.list=.deps) + +all: $(all_stamp_files) + +-include Makefile.deps $(all_deps_files) + +## Like GCJ but include some common flags. +GCJF = $(GCJ) -Wno-deprecated --encoding=UTF-8 \ + --bootclasspath '' --classpath $(compile_classpath) \ + -C -d . + +# Rule to rebuild a stamp file and update the deps file. Note that we +# make the target be the stamp file. This ensures that if a needed +# source is changed, this rule is re-run for the appropriate package. +%.stamp: %.list + $(GCJF) -MD -MF ${@:.stamp=.deps} -MT $@ @$< + echo timestamp > $@ diff --git a/libjava/classpath/lib/gen-classlist.sh.in b/libjava/classpath/lib/gen-classlist.sh.in new file mode 100755 index 00000000000..c091caa2005 --- /dev/null +++ b/libjava/classpath/lib/gen-classlist.sh.in @@ -0,0 +1,87 @@ +#! @SH@ +# @configure_input@ + +# Make sure sorting is done the same on all configurations +LC_ALL=C; export LC_ALL +LANG=C; export LANG + +echo "Adding java source files from srcdir '@top_srcdir@'." +@FIND@ @top_srcdir@/java @top_srcdir@/javax @top_srcdir@/gnu \ + @top_srcdir@/org \ + @top_srcdir@/external/w3c_dom @top_srcdir@/external/sax \ + -follow -type f -print | sort | grep '\.java$' \ + > ${top_builddir}/lib/classes.1 + +# Generate files for the VM classes. +: > vm.omit +: > vm.add +vm_dirlist=`echo "@vm_classes@" | sed -e 's/:/ /g'` +echo "Adding java source files from VM directory $vm_dirlist" +for dir in $vm_dirlist; do + (cd $dir + for subdir in java javax gnu org; do + if test -d $subdir; then + @FIND@ $subdir -name '*.java' -print + fi + done) | + while read f; do + echo $dir/$f >> vm.add + echo $f >> vm.omit + done +done + +# Only include generated files once. +if test ! "${top_builddir}" -ef "@top_srcdir@"; then + echo "Adding generated files in builddir '${top_builddir}'." + @FIND@ ${top_builddir}/gnu ${top_builddir}/java -follow -type f -print \ + | sort | grep '\.java$' >> ${top_builddir}/lib/classes.1 +fi + + +cat @top_srcdir@/lib/$1.omit vm.omit > tmp.omit +for dir in $vm_dirlist; do + if test -f $dir/$1.omit; then + cat $dir/$1.omit >> tmp.omit + fi +done + +for filexp in `cat tmp.omit`; do + grep -v ${filexp} < ${top_builddir}/lib/classes.1 > ${top_builddir}/lib/classes.2 + mv ${top_builddir}/lib/classes.2 ${top_builddir}/lib/classes.1 +done + + +for dir in $vm_dirlist; do + if test -f $dir/$1.omit; then + for filexp in `cat $dir/$1.omit`; do + grep -v $filexp < vm.add > vm.add.1 + mv vm.add.1 vm.add + done + fi +done +cat vm.add >> classes.1 + +rm vm.omit +rm vm.add +rm tmp.omit + +new= +if test -e ${top_builddir}/lib/classes; then + p=`diff ${top_builddir}/lib/classes ${top_builddir}/lib/classes.1` + if test "$p" != ""; then + new="true" + cp ${top_builddir}/lib/classes.1 ${top_builddir}/lib/classes + fi +else + new="true" + cp ${top_builddir}/lib/classes.1 ${top_builddir}/lib/classes +fi + +if test "$new" = "true"; then + echo "JAVA_SRCS = \\" > ${top_builddir}/lib/java.dep + for i in `cat ${top_builddir}/lib/classes` ; do + echo $i "\\" >> ${top_builddir}/lib/java.dep + done +fi + +exit 0 diff --git a/libjava/classpath/lib/jazzlib/index.html b/libjava/classpath/lib/jazzlib/index.html new file mode 100644 index 00000000000..72ac81613b2 --- /dev/null +++ b/libjava/classpath/lib/jazzlib/index.html @@ -0,0 +1,47 @@ +<html> +<head> +<title>A pure java implementation of java.util.zip library</title> +</head> +<body> +<h1>A pure java implementation of the java.util.zip library</h1> + +This project provides an implementation of the java.util.zip classes. +<br><br> +The code is pure java (no native code is used), and we aim to be compatible with existing java.util.zip implementations. Some code was borrowed from libgcj, almost all the rest was written by Jochen Hoenicke. +<br><br> +There is very similar project at <a href="http://www.jcraft.com/jzlib/index.html">http://www.jcraft.com/jzlib/index.html</a>.<br> +Another project to implement bzip2 is at <a href="http://www.aftexsw.com/aftex/products/java/bzip/">http://www.aftexsw.com/aftex/products/java/bzip/</a>. +<p> +For the latest source, see the classpath CVS repository. On this page you'll find source and binary releases of the code in both the <strong>net.sf.jazzlib</strong> and <strong>java.util.zip</strong> namespaces. +<p> +The <strong>net.sf.jazzlib</strong> namespace is useful for situations where native code isn't allowed (such as in applets) and you need to use zip files. Builds in the <strong>java.util.zip</strong> namespace have a -juz suffix. +<br> +<h3>License</h3> +This code is released under the GPL license with a special exception: +<pre> +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. +</pre> +<h3>Latest release is 0.07</h3> +Download source or binary packages for all releases <a href="http://sourceforge.net/project/showfiles.php?group_id=16807">here</a>. +<p> +There is a md5sums file in each release that you can use to check the integrity of the files. The md5sums is also signed with my public key (finger jewel at debian.org), the signature is in md5sums.asc. +<p> +<h3>Contact information and bug notification</h3> +You should post a message to the jazzlib-developers list (<a href="http://lists.sourceforge.net/mailman/listinfo/jazzlib-developers">subscribe</a>, <a href="http://sourceforge.net/mailarchive/forum.php?forum=jazzlib-developers">archives</a>) to report a bug or contact the developers. + +<br> +The <a href="http://savannah.gnu.org/cvs/?group_id=85">CVS repository</a> for this project is part of the <a href="http://www.gnu.org/software/classpath/">classpath</a> project. +<p> +The files in the SourceForge CVS repository should be considered to be of historical interest only. +<p> +John Leuner (jewel at pixie.co.za) <br> +13 May 2004 + +<hr> +<A href="http://sourceforge.net"> <IMG src="http://sourceforge.net/sflogo.php?group_id=16807" width="88" height="31" border="0" alt="SourceForge Logo"></A> +</body> +</html>
\ No newline at end of file diff --git a/libjava/classpath/lib/jazzlib/makeJazzlibDist.sh b/libjava/classpath/lib/jazzlib/makeJazzlibDist.sh new file mode 100755 index 00000000000..5c75960a2ab --- /dev/null +++ b/libjava/classpath/lib/jazzlib/makeJazzlibDist.sh @@ -0,0 +1,121 @@ +#!/bin/zsh + +echo "----- Run this from the classpath/java/util/zip directory -----" +echo "----- -----" +echo "----- Options: -----" +echo "----- -----" +echo "----- juz -- build .tar.gz and .zip archives in java.util.zip namespace" +echo "----- jar -- build .jar file in java.util.zip and java.util.jar namespaces" +echo "----- -- build .tar.gz. and .zip archive for net.sf.jazzlib namespace" +echo "----- -----" +echo "----- Edit this script to change the release number -----" +echo "----- Do rm -rf dist when you're finished -----" +echo "----- 30 May 2002 John Leuner <jewel@debian.org> -----" + +RELEASE_NUMBER=07 + +# $1 is the archive command, eg "tar czvf" or "zip" or "jar cf" +# $2 is the archive suffix, eg ".zip" or ".tar.gz" +# $3 is the "-binary" flag, which may be empty +# $4 is the "-juz" suffix, which may be empty +# $5 is the set of files that need to be md5-summed +# $6 is the set of files in addition to $5 that are to be archived + +function create_archive { + md5sum ${=5} > md5sums + gpg --clearsign md5sums + ${=1} jazzlib${3}-0.$RELEASE_NUMBER${4}${2} ${=5} ${=6} + rm -f md5sums + rm -f md5sums.asc +} + +# $1 is the package name, ie java.util.zip or net.sf.jazzlib + +function make_javadoc { + rm -rf javadoc + mkdir javadoc + javadoc -sourcepath . -d javadoc/ $1 +} + +case "$1" in + juz) + mkdir -p dist/java/util/zip + + #make source archive + cp *.java dist/java/util/zip + pushd dist + + make_javadoc java.util.zip + + cp ../../../../COPYING . + + foo=(java/util/zip/*.java) + create_archive "tar czvf" ".tar.gz" "" "-juz" "$foo" "javadoc md5sums md5sums.asc COPYING" + create_archive "zip" ".zip" "" "-juz" "$foo" "javadoc md5sums md5sums.asc COPYING" + + popd + + #make binary distro second + cp ../../../lib/java/util/zip/*.class dist/java/util/zip + pushd dist + + foo=(java/util/zip/*.class) + create_archive "tar czvf" ".tar.gz" "-binary" "-juz" "$foo" "javadoc md5sums md5sums.asc COPYING" + create_archive "zip" ".zip" "-binary" "-juz" "$foo" "javadoc md5sums md5sums.asc COPYING" + + popd + ;; + jar) + mkdir -p dist/java/util/zip + mkdir -p dist/java/util/jar + + #make binary distro second + cp ../../../lib/java/util/zip/*.class dist/java/util/zip + cp ../../../lib/java/util/zip/../jar/*.class dist/java/util/jar + pushd dist + + cp ../../../../COPYING . + foo=(java/util/zip/*.class) + foo=($foo java/util/jar/*.class) + + create_archive "fastjar cf" ".jar" "-binary" "-juz" "$foo" "md5sums md5sums.asc COPYING" + + popd + ;; + *) + #copy files to dist directory and make net.sf.jazzlib the package name + + mkdir -p dist/net/sf/jazzlib + cp *.java dist/net/sf/jazzlib + for i in dist/net/sf/jazzlib/*.java ; do + sed -e "s/java\.util\.zip/net.sf.jazzlib/" < $i > $i.tmp ; + mv $i.tmp $i; + done + + pushd dist + + make_javadoc "net.sf.jazzlib" + + cp ../../../../COPYING . + + foo=(net/sf/jazzlib/*.java) + create_archive "tar czvf" ".tar.gz" "" "" "$foo" "javadoc md5sums md5sums.asc COPYING" + create_archive "zip" ".zip" "" "" "$foo" "javadoc md5sums md5sums.asc COPYING" + + #compile the source + javac net/sf/jazzlib/*.java + + foo=(net/sf/jazzlib/*.class) + create_archive "tar czvf" ".tar.gz" "-binary" "" "$foo" "javadoc md5sums md5sums.asc COPYING" + create_archive "zip" ".zip" "-binary" "" "$foo" "javadoc md5sums md5sums.asc COPYING" + + #back to dir + popd + + ;; +esac +ls -la dist/{*.tar.gz,*.jar,*.zip} + + + + diff --git a/libjava/classpath/lib/mkcollections.pl.in b/libjava/classpath/lib/mkcollections.pl.in new file mode 100755 index 00000000000..be81430c7b7 --- /dev/null +++ b/libjava/classpath/lib/mkcollections.pl.in @@ -0,0 +1,140 @@ +#!@PERL@ +# +# mkcollections.pl - small perl script to convert GNU Classpath's +# Collection classes into its own package for java 1.1 +# +# USAGE: mkcollections.pl <Destination-Path> +# +# Copyright (C) 2000 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin St, Fifth Floor, +# Boston, MA 02110-1301 USA + +my $destpath=pop || "gnu/java/util/collections"; +my $classpath=".."; +my @javalangclasses=qw(UnsupportedOperationException + Comparable); +my @javautilclasses=qw(AbstractCollection + AbstractList + AbstractMap + AbstractSequentialList + AbstractSet + ArrayList + Arrays + BasicMapEntry + List + Collection + Collections + Comparator + ConcurrentModificationException + HashMap + HashSet + Hashtable + Iterator + LinkedList + ListIterator + Map + NoSuchElementException + Random + Set + SortedMap + SortedSet + TreeMap + TreeSet + Vector); + +my $destPkg = $destpath; +$destPkg =~ s!/!.!g; + +my %imports = ( "Collections" => [ "Enumeration" ], + "Hashtable" => [ "Dictionary", "Enumeration" ], + "Vector" => [ "Enumeration" ]); + + +sub mymkdir ($) + { + my ($dir) = @_; + if ($dir =~ /^(.*)\/\w+$/) + { + $parentdir = "$1"; + if (! (-d $parentdir)) + { + mymkdir ($parentdir); + } + } + print "$dir"; + mkdir ($dir, 0777); + } + +sub convert($$$) { + my ($file, $infile, $outfile) = @_; + + open (INPUT, "<$infile") || die "Could not open ", $infile, " for reading\n"; + + my $dir = "$outfile"; + $dir =~ /^(.*)\/\S+\.java$/ and + $dir = "$1"; + if (! (-d $dir)) { + mymkdir ($dir); + } + + open (OUTPUT, ">$outfile") || die "Could not open ", $outfile, " for writing\n"; + print OUTPUT <<'EOF'; +/* This file was converted from the GNU Classpath Project by a + * perl script, written by Jochen Hoenicke <jochen\@gnu.org>. + */ +EOF + while (<INPUT>) { + $_ = "package $destPkg;\n" if ($_ =~ /^package java.(lang|util);$/); + + next if $_ =~ /^import java.io.Object.*putStream.*Field;$/; + next if $_ =~ /^import java.io.ObjectStreamField;$/; + + for $clazz (@javalangclasses) { + $_ =~ s/java.lang.$clazz/$clazz/g; + } + for $clazz (@javautilclasses) { + $_ =~ s/java.util.$clazz/$clazz/g; + } + + $_ =~ s/abstract (interface)/$1/g; + + print OUTPUT $_; + if ($_ =~ /^package $destPkg;$/ + && exists $imports{$file}) { + for $imp (@{$imports{$file}}) { + print OUTPUT "import java.util.$imp;\n"; + } + } + } + close (OUTPUT); + close (INPUT); +} + +my $file; + +for $file (@javalangclasses) { + my $infile = "$classpath/java/lang/$file.java"; + my $outfile = "$destpath/$file.java"; + print "$outfile\n"; + convert ($file, $infile, $outfile); +} + +for $file (@javautilclasses) { + my $infile = "$classpath/java/util/$file.java"; + my $outfile = "$destpath/$file.java"; + print "$outfile\n"; + convert ($file, $infile, $outfile); +} diff --git a/libjava/classpath/lib/mkdep.pl.in b/libjava/classpath/lib/mkdep.pl.in new file mode 100755 index 00000000000..b30fd7ae974 --- /dev/null +++ b/libjava/classpath/lib/mkdep.pl.in @@ -0,0 +1,336 @@ +#!@PERL@ +# +# Create a dependency file for use with make that will +# a) not have duplicate entries +# b) not include the source of a file as a dependency to separate file, +# just the class of the file +# c) use jikes .u files +# d) includes classes which need native compilation via simple parsing +# to find native methods requiring use of javah + +use strict; + +my ( $dir, $dep ) = ""; +my @dirs = ( 'java', 'javax', 'gnu' ); +my ( $depout ) = "makefile.dep"; +my ( $classout ) = "classes.dep"; +my ( $headerout ) = "headers.dep"; +my ( $javaout ) = "java.dep"; +my @deps = (); +my @natives = (); +use vars qw ( $classout $headerout @dirs @deps @natives $dir $dep $depout ); + +# main +{ + if ($#ARGV == 0) + { + if ($ARGV[0] =~ /^-h/) + { + findNativeFiles(); + writeNativeFile(); + } + elsif ($ARGV[0] =~ /^-d/) + { + foreach $dir (@dirs) + { + # find all .u files recursively and parse'm + findDepFiles($dir); + } + writeDepFile(); + } + elsif ($ARGV[0] =~ /^-c/) + { + findClassFiles(); + writeClassFile(); + } + elsif ($ARGV[0] =~ /^-j/) + { + findJavaFiles(); + writeJavaFile(); + } + } + else + { + print "Usage:\n"; + print "mkdep.pl -h \tfor header files\n"; + print "mkdep.pl -c \tfor a list of classes\n"; + print "mkdep.pl -j \tfor a list of java files\n"; + print "mkdep.pl -d \tfor dependency generation from jikes .u files\n"; + } +} + +sub writeNativeFile +{ + my ($i, $j, $k, $l) = ""; + my $top_srcdir = "../"; + if (defined $ENV{'top_srcdir'}) { + $top_srcdir = $ENV{'top_srcdir'}; + } + my $top_srcdir_regex = $top_srcdir; + if ($top_srcdir_regex !~ /.*\/$/) { + $top_srcdir_regex .= '/'; + } + $top_srcdir_regex =~ s/\./\\\./g; # replace . with \. + $top_srcdir_regex =~ s/\//\\\//g; # replace / with \/ +# print "regex is $top_srcdir_regex\n"; + open(MAKEDEP, ">$headerout") || die "Could not open file ", $headerout; + + # the HEADERS = ... stuff + if ($#natives > -1) + { + print MAKEDEP "CP_HEADERS = \\", "\n"; + foreach $i (0 .. $#natives-1) + { + $j = $natives[$i]; + $j =~ s/^$top_srcdir_regex//; # remove ../ or similar + $j =~ s/^(\.\.\/)+//g; # remove all preceding ../ + $j =~ s/^vm\/reference\///; # remove vm/reference/ + $j =~ s/\//_/g; # replace / with _ + $j =~ s/\.java$/\.h/; # replace .java with .h + print MAKEDEP " \$(top_builddir)/include/", $j, " \\", "\n"; + } + $j = $natives[$#natives]; + $j =~ s/^$top_srcdir_regex//; # remove ../ + $j =~ s/^(\.\.\/)+//g; # remove all preceding ../ + $j =~ s/^vm\/reference\///; # remove vm/reference/ + $j =~ s/\//_/g; # replace / with _ + $j =~ s/\.java/\.h/; # replace .java with .h + print MAKEDEP " \$(top_builddir)/include/", $j, "\n\n"; + + # print rules to make .h files + # y/x.h : z/x.class + # y/x.h : ../z/x.java + # javah -jni z.x + # mv y_x.h $(top_srcdir)/include + + # j = y/x.h + # k = z/x.class + # k = ../z/x.java + # l = z.x + foreach $i (0 .. $#natives-1) + { + $j = $natives[$i]; + $j =~ s/^$top_srcdir_regex//; # remove ../ + $j =~ s/^(\.\.\/)+//g; # remove all preceding ../ + $j =~ s/^vm\/reference\///; # remove vm/reference/ +# $k = $l = $j; + $l = $j; + $j =~ s/\//_/g; # replace / with _ + $j =~ s/\.java$/\.h/; # replace .java with .h + + $k = $natives[$i]; # the original .java file +# $k =~ s/\.java$/\.class/; # replace .java with .class + + $l =~ s/\.java$//; # remove .class + $l =~ s/\//\./g; # replace / with . + + print MAKEDEP "\$(top_builddir)/include/", $j, " : ", $k, "\n"; + print MAKEDEP "\t\$(JAVAH) ", $l, "\n"; + print MAKEDEP "\tmv ", $j, " \$(top_builddir)/include\n\n"; + } + $j = $natives[$#natives]; + $j =~ s/^$top_srcdir_regex//; # remove ../ + $j =~ s/^(\.\.\/)+//g; # remove all preceding ../ + $j =~ s/^vm\/reference\///; # remove vm/reference/ +# $k = $l = $j; + $l = $j; + $j =~ s/\//_/g; # replace / with _ + $j =~ s/\.java/\.h/; # replace .java with .h + + $k = $natives[$#natives]; # the original .java file +# $k =~ s/\.java$/\.class/; # replace .java with .class + + $l =~ s/\.java$//; # remove .class + $l =~ s/\//\./g; # replace / with . + + print MAKEDEP "\$(top_builddir)/include/", $j, " : ", $k, "\n"; + print MAKEDEP "\t\$(JAVAH) ", $l, "\n"; + print MAKEDEP "\tmv ", $j, " \$(top_builddir)/include\n\n"; + } + close(MAKEDEP); +} + +sub writeJavaFile +{ + my ($i, $j, $class, $depend, $source, $depend_source) = ""; + + open(MAKEDEP, ">$javaout") || die "Could not open file ", $classout; + + # the JAVA_SRCS = ... stuff + if ($#natives > -1) + { + print MAKEDEP "JAVA_SRCS = \\", "\n"; + foreach $i (0 .. $#natives-1) + { + $j = $natives[$i]; + print MAKEDEP " ", $j, " \\", "\n"; + } + $j = $natives[$#natives]; + print MAKEDEP " ", $j, "\n\n"; + } + close(MAKEDEP); +} + +sub writeClassFile +{ + my ($i, $j, $class, $depend, $source, $depend_source) = ""; + + open(MAKEDEP, ">$classout") || die "Could not open file ", $classout; + + # the CLASSES = ... stuff + if ($#natives > -1) + { + print MAKEDEP "CLASSES = \\", "\n"; + foreach $i (0 .. $#natives-1) + { + $j = $natives[$i]; + $j =~ s/\.java$/\.class/; + print MAKEDEP " ", $j, " \\", "\n"; + } + $j = $natives[$#natives]; + $j =~ s/\.java$/\.class/; + print MAKEDEP " ", $j, "\n\n"; + } + close(MAKEDEP); +} + +sub writeDepFile +{ + my ($i, $j, $class, $depend, $source, $depend_source) = ""; + + open(MAKEDEP, ">$depout") || die "Could not open file ", $depout; + + # the class dependencies + foreach $i (@deps) + { + open(FILE, "<$i") || die "Could not open file ", $i, "\n"; + while(<FILE>) + { + chop; + ($class, $depend) = /(.+) : (.+)$/; + $source = $class; + $source =~ s/\.class$/\.java/; + if (($source eq $depend) || ($depend !~ /\.java$/)) + { + if ($depend =~ /^\.\.\/.+\.class$/) + { + $depend =~ s/^\.\.\///; + } + if (($depend =~ /\.java$/) && ($depend !~ /^\.\.\//)) + { + $depend = "../" . $depend; + } + print MAKEDEP $class, " : ", $depend, "\n"; + } + } + print MAKEDEP "\n"; + close(FILE); + } + close(MAKEDEP); +} + +sub findJavaFiles +{ + my ($file) = ""; + open(CLASSES, "<classes") || die "Could not open file classes\n"; + while(<CLASSES>) + { + chop; + $file = $_; + push @natives, $file; + } + close(CLASSES); +} + +sub findClassFiles +{ + my ($file) = ""; + open(CLASSES, "<classes") || die "Could not open file classes\n"; + while(<CLASSES>) + { + chop; + $file = $_; + $file =~ s/^\.\.\///; + push @natives, $file; + } + close(CLASSES); +} + +sub findNativeFiles +{ + my ($file) = ""; + open(CLASSES, "<classes") || die "Could not open file classes\n"; + while(<CLASSES>) + { + chop; + $file = $_; + if (hasNativeMethod($file)) + { + push @natives, $file; + } + + } + close(CLASSES); +} + +sub hasNativeMethod +{ + my ($file) = @_; + my ($line, $one, $two) = ""; + open(FILE, "<$file") || die "Could not open file ", $file, "\n"; + while(<FILE>) + { + chop; + $one = $two; + $two = $_; + + $line = $one . " " . $two; + if ( ($line =~ /^\s*public\s.*native\s+\S+\s+\S+\s*\(/) || + ($line =~ /^\s*public\s.*native\s+\S+\s+\S+\s+\S+\s*\(/) || + ($line =~ /^\s*protected\s.*native\s+\S+\s+\S+\s*\(/) || + ($line =~ /^\s*protected\s.*native\s+\S+\s+\S+\s+\S+\s*\(/) || + ($line =~ /^\s*private\s.*native\s+\S+\s+\S+\s*\(/) || + ($line =~ /^\s*private\s.*native\s+\S+\s+\S+\s+\S+\s*\(/) || + ($line =~ /^\s*abstract\s.*native\s+\S+\s+\S+\s*\(/) || + ($line =~ /^\s*final\s.*native\s+\S+\s+\S+\s*\(/) || + ($line =~ /^\s*synchronized\s.*native\s+\S+\s+\S+\s*\(/) || + ($line =~ /^\s*native\s.*/) ) + { + close(FILE); + return 1; + } + } + close(FILE); + return 0; +} + +sub findDepFiles +{ + + my ($dir) = @_; + my (@dirs) = (); + my (@local_deps) = (); + my (@entries) = (); + my ($i, $local_dep) = ""; + if (opendir(DIR, $dir)) + { + @entries = grep(-d "$dir/$_" && !/^\.\.?$/, readdir(DIR)); + foreach $i (@entries) + { + push @dirs, "$dir/$i"; + } + rewinddir(DIR); + @entries= grep(/\.u$/, readdir(DIR)); + closedir(DIR); + foreach $i (@entries) + { + push @local_deps, "$dir/$i"; + } + push @deps, @local_deps; + foreach $i (@dirs) + { + findDepFiles($i); + } + } +} + diff --git a/libjava/classpath/lib/split-for-gcj.sh b/libjava/classpath/lib/split-for-gcj.sh new file mode 100755 index 00000000000..bda7fda8805 --- /dev/null +++ b/libjava/classpath/lib/split-for-gcj.sh @@ -0,0 +1,28 @@ +#! /bin/sh + +# Split in multiple parts for gcj. This uses a somewhat hacky +# procedure for finding the package of a given file. +echo "Splitting for gcj" +rm -f Makefile.deps > /dev/null 2>&1 +test -d lists || mkdir lists +for dir in java javax gnu org; do + for file in `cat classes | fgrep /$dir/`; do + pkg=`echo "$file " | sed -n -e "s,^.*/\($dir/.*\)/[^/]*$,\1,p"` + list=lists/`echo $pkg | sed -e 's,/,-,g'` + echo "$file" >> ${list}.list.1 + f2=`echo "$file" | sed -n -e "s,^.*/\($dir/.*\)$,\1,p"` + f2=${f2%.java}.class + echo "$f2: ${list}.stamp" >> Makefile.deps + echo "${list}.list: $file" >> Makefile.deps + done +done + +# Only update a .list file if it changed. +for file in lists/*.list.1; do + real=${file%.1} + if ! cmp -s $real $file; then + mv $file $real + else + rm $file + fi +done diff --git a/libjava/classpath/lib/standard.omit b/libjava/classpath/lib/standard.omit new file mode 100644 index 00000000000..66f5a78cd99 --- /dev/null +++ b/libjava/classpath/lib/standard.omit @@ -0,0 +1,4 @@ +../gnu/test/.*$ +../gnu/javax/swing/plaf/gtk/.*java$ +../gnu/javax/swing/plaf/gtk/README$ +../gnu/classpath/jdwp/.*$ |