changeset in /hg/icedtea: Fix make dist.
gnu_andrew at member.fsf.org
gnu_andrew at member.fsf.org
Fri May 30 07:53:07 PDT 2008
changeset df0892463d09 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=df0892463d09
description:
Fix make dist.
diffstat:
8 files changed, 271 insertions(+), 61 deletions(-)
.hgignore | 1
ChangeLog | 16 ++
Makefile.am | 17 --
Makefile.in | 18 --
acinclude.m4 | 15 --
configure | 18 --
configure.ac | 1
generated/java/lang/UNIXProcess.java | 246 ++++++++++++++++++++++++++++++++++
diffs (495 lines):
diff -r ccaf170c726a -r df0892463d09 .hgignore
--- a/.hgignore Fri May 30 01:16:24 2008 +0100
+++ b/.hgignore Fri May 30 15:50:34 2008 +0100
@@ -430,4 +430,3 @@ rt/java/io/
rt/java/io/
rt/sun/awt
generated/sun/awt/X11/generator/sizer.32.orig
-generated/java/lang/UNIXProcess.java
diff -r ccaf170c726a -r df0892463d09 ChangeLog
--- a/ChangeLog Fri May 30 01:16:24 2008 +0100
+++ b/ChangeLog Fri May 30 15:50:34 2008 +0100
@@ -1,3 +1,19 @@ 2008-05-30 Andrew John Hughes <gnu_and
+2008-05-30 Andrew John Hughes <gnu_andrew at member.fsf.org>
+
+ * .hgignore:
+ Don't ignore UNIXProcess.java.
+ * Makefile.am:
+ Remove generated.stamp and make the ports
+ dist dependency explicitly on the directory,
+ not the make target.
+ * b/Makefile.in: Regenerated.
+ * b/acinclude.m4:
+ (SET_OS): Removed.
+ * b/configure: Regenerated.
+ * b/configure.ac: Remove call to SET_OS.
+ * b/generated/java/lang/UNIXProcess.java:
+ Readded.
+
2008-05-30 Andrew John Hughes <gnu_andrew at member.fsf.org>
* aclocal.m4,
diff -r ccaf170c726a -r df0892463d09 Makefile.am
--- a/Makefile.am Fri May 30 01:16:24 2008 +0100
+++ b/Makefile.am Fri May 30 15:50:34 2008 +0100
@@ -37,7 +37,7 @@ install:
hotspot hotspot-helper clean-extra clean-jtreg clean-jtreg-reports
EXTRA_DIST = rt generated $(ICEDTEA_PATCHES) $(ICEDTEA_ECJ_PATCH) \
- gcjwebplugin.cc tools-copy contrib ports \
+ gcjwebplugin.cc tools-copy contrib ${abs_top_srcdir}/ports \
patches/icedtea-gcc-4.3.patch extra $(ZERO_PATCHES) \
patches/icedtea-cacao.patch $(OPENJDK_PATCHES) \
javaws.png javaws.desktop patches/icedtea-netx-plugin.patch \
@@ -784,12 +784,6 @@ clean-copy:
rm -rf rt/$$copy_dir ; \
done
-stamps/generated.stamp:
- mkdir -p $(abs_top_srcdir)/generated/java/lang
- cp $(SOLARIS)/java/lang/UNIXProcess.java.$(BUILD_OS) \
- $(abs_top_srcdir)/generated/java/lang/UNIXProcess.java ;
- touch stamps/generated.stamp
-
SHARE = openjdk/jdk/src/share/classes
SOLARIS = openjdk/jdk/src/solaris/classes
LANGTOOLS = openjdk/langtools/src/share/classes
@@ -834,8 +828,7 @@ hotspot-tools-source-files.txt: stamps/c
find hotspot-tools -name '*.java' | sort > $@
mkdir -p lib/hotspot-tools
-stamps/hotspot-tools-class-files.stamp: hotspot-tools-source-files.txt \
- stamps/generated.stamp
+stamps/hotspot-tools-class-files.stamp: hotspot-tools-source-files.txt
if ! test -d $(ICEDTEA_BOOT_DIR) ; \
then \
$(JAVAC) $(MEMORY_LIMIT) -g -d lib/hotspot-tools \
@@ -881,7 +874,7 @@ rt-source-files.txt: stamps/clone.stamp
rt-source-files.txt: stamps/clone.stamp stamps/copy-source-files.stamp
find $(abs_top_srcdir)/rt $(abs_top_builddir)/rt -name '*.java' | sort -u > $@
-stamps/rt-class-files.stamp: rt-source-files.txt stamps/generated.stamp
+stamps/rt-class-files.stamp: rt-source-files.txt
mkdir -p lib/rt
if ! test -d $(ICEDTEA_BOOT_DIR) ; \
then \
@@ -932,7 +925,7 @@ stamps/extra-class-files.stamp: extra-so
then \
$(JAVAC) $(MEMORY_LIMIT) -g -d extra-lib \
-source 1.5 \
- -sourcepath extra -cp bootstrap/jdk1.7.0/jre/lib/rt-closed.jar \
+ -sourcepath extra -cp bootstrap/jdk1.7.0/jre/lib/rt-closed.jar \
-bootclasspath '' @extra-source-files.txt ; \
else \
$(ICEDTEA_BOOT_DIR)/bin/javac $(MEMORY_LIMIT) -g -d extra-lib \
@@ -1039,8 +1032,6 @@ copy-source-files: stamps/copy-source-fi
download: stamps/download.stamp
-generated: stamps/generated.stamp
-
icedtea-against-ecj: stamps/icedtea-against-ecj.stamp
icedtea-ecj: stamps/icedtea-ecj.stamp
diff -r ccaf170c726a -r df0892463d09 Makefile.in
--- a/Makefile.in Fri May 30 01:16:24 2008 +0100
+++ b/Makefile.in Fri May 30 15:50:34 2008 +0100
@@ -94,7 +94,6 @@ AUTOMAKE = @AUTOMAKE@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_ARCH_DIR = @BUILD_ARCH_DIR@
-BUILD_OS = @BUILD_OS@
CACAO = @CACAO@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
@@ -255,7 +254,7 @@ OPENJDK_VERSION = b26
@NETX_PLUGIN_FALSE at NETX_PATCH =
@NETX_PLUGIN_TRUE at NETX_PATCH = patches/icedtea-netx-plugin.patch
EXTRA_DIST = rt generated $(ICEDTEA_PATCHES) $(ICEDTEA_ECJ_PATCH) \
- gcjwebplugin.cc tools-copy contrib ports \
+ gcjwebplugin.cc tools-copy contrib ${abs_top_srcdir}/ports \
patches/icedtea-gcc-4.3.patch extra $(ZERO_PATCHES) \
patches/icedtea-cacao.patch $(OPENJDK_PATCHES) \
javaws.png javaws.desktop patches/icedtea-netx-plugin.patch \
@@ -1235,12 +1234,6 @@ clean-copy:
rm -rf rt/$$copy_dir ; \
done
-stamps/generated.stamp:
- mkdir -p $(abs_top_srcdir)/generated/java/lang
- cp $(SOLARIS)/java/lang/UNIXProcess.java.$(BUILD_OS) \
- $(abs_top_srcdir)/generated/java/lang/UNIXProcess.java ;
- touch stamps/generated.stamp
-
# tools.jar class files.
stamps/hotspot-tools-copy-source-files.stamp: stamps/patch.stamp stamps/overlay.stamp
for copy_dir in `cat $(abs_top_srcdir)/tools-copy/tools-jdk-copy-files.txt` ; \
@@ -1275,8 +1268,7 @@ hotspot-tools-source-files.txt: stamps/c
find hotspot-tools -name '*.java' | sort > $@
mkdir -p lib/hotspot-tools
-stamps/hotspot-tools-class-files.stamp: hotspot-tools-source-files.txt \
- stamps/generated.stamp
+stamps/hotspot-tools-class-files.stamp: hotspot-tools-source-files.txt
if ! test -d $(ICEDTEA_BOOT_DIR) ; \
then \
$(JAVAC) $(MEMORY_LIMIT) -g -d lib/hotspot-tools \
@@ -1322,7 +1314,7 @@ rt-source-files.txt: stamps/clone.stamp
rt-source-files.txt: stamps/clone.stamp stamps/copy-source-files.stamp
find $(abs_top_srcdir)/rt $(abs_top_builddir)/rt -name '*.java' | sort -u > $@
-stamps/rt-class-files.stamp: rt-source-files.txt stamps/generated.stamp
+stamps/rt-class-files.stamp: rt-source-files.txt
mkdir -p lib/rt
if ! test -d $(ICEDTEA_BOOT_DIR) ; \
then \
@@ -1373,7 +1365,7 @@ stamps/extra-class-files.stamp: extra-so
then \
$(JAVAC) $(MEMORY_LIMIT) -g -d extra-lib \
-source 1.5 \
- -sourcepath extra -cp bootstrap/jdk1.7.0/jre/lib/rt-closed.jar \
+ -sourcepath extra -cp bootstrap/jdk1.7.0/jre/lib/rt-closed.jar \
-bootclasspath '' @extra-source-files.txt ; \
else \
$(ICEDTEA_BOOT_DIR)/bin/javac $(MEMORY_LIMIT) -g -d extra-lib \
@@ -1480,8 +1472,6 @@ copy-source-files: stamps/copy-source-fi
download: stamps/download.stamp
-generated: stamps/generated.stamp
-
icedtea-against-ecj: stamps/icedtea-against-ecj.stamp
icedtea-ecj: stamps/icedtea-ecj.stamp
diff -r ccaf170c726a -r df0892463d09 acinclude.m4
--- a/acinclude.m4 Fri May 30 01:16:24 2008 +0100
+++ b/acinclude.m4 Fri May 30 15:50:34 2008 +0100
@@ -665,18 +665,3 @@ AC_DEFUN([AC_CHECK_WITH_CACAO],
AC_SUBST(CACAO)
])
-AC_DEFUN([SET_OS],
-[
- case "${host_os}" in
- linux-gnu)
- BUILD_OS=linux
- ;;
- solaris*)
- BUILD_OS=solaris
- ;;
- *)
- BUILD_OS=$(uname -o)
- ;;
- esac
- AC_SUBST(BUILD_OS)
-])
diff -r ccaf170c726a -r df0892463d09 configure
--- a/configure Fri May 30 01:16:24 2008 +0100
+++ b/configure Fri May 30 15:50:34 2008 +0100
@@ -734,7 +734,6 @@ PARALLEL_JOBS
PARALLEL_JOBS
BUILD_ARCH_DIR
INSTALL_ARCH_DIR
-BUILD_OS
JAVA
JAVAC
JAVAH
@@ -5985,20 +5984,6 @@ fi
-
- case "${host_os}" in
- linux-gnu)
- BUILD_OS=linux
- ;;
- solaris*)
- BUILD_OS=solaris
- ;;
- *)
- BUILD_OS=$(uname -o)
- ;;
- esac
-
-
if test "${with_openjdk}" == true
then
JAVA=$SYSTEM_OPENJDK_DIR/bin/java
@@ -13104,7 +13089,6 @@ PARALLEL_JOBS!$PARALLEL_JOBS$ac_delim
PARALLEL_JOBS!$PARALLEL_JOBS$ac_delim
BUILD_ARCH_DIR!$BUILD_ARCH_DIR$ac_delim
INSTALL_ARCH_DIR!$INSTALL_ARCH_DIR$ac_delim
-BUILD_OS!$BUILD_OS$ac_delim
JAVA!$JAVA$ac_delim
JAVAC!$JAVAC$ac_delim
JAVAH!$JAVAH$ac_delim
@@ -13175,7 +13159,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff -r ccaf170c726a -r df0892463d09 configure.ac
--- a/configure.ac Fri May 30 01:16:24 2008 +0100
+++ b/configure.ac Fri May 30 15:50:34 2008 +0100
@@ -159,7 +159,6 @@ AC_SUBST(PARALLEL_JOBS)
AC_SUBST(PARALLEL_JOBS)
SET_ARCH_DIRS
-SET_OS
if test "${with_openjdk}" == true
then
JAVA=$SYSTEM_OPENJDK_DIR/bin/java
diff -r ccaf170c726a -r df0892463d09 generated/java/lang/UNIXProcess.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/generated/java/lang/UNIXProcess.java Fri May 30 15:50:34 2008 +0100
@@ -0,0 +1,246 @@
+/*
+ * Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+import java.io.*;
+
+/* java.lang.Process subclass in the UNIX environment.
+ *
+ * @author Mario Wolczko and Ross Knippel.
+ * @author Konstantin Kladko (ported to Linux)
+ */
+
+final class UNIXProcess extends Process {
+ private static final sun.misc.JavaIOFileDescriptorAccess fdAccess
+ = sun.misc.SharedSecrets.getJavaIOFileDescriptorAccess();
+
+ private int pid;
+ private int exitcode;
+ private boolean hasExited;
+
+ private OutputStream stdin_stream;
+ private InputStream stdout_stream;
+ private InputStream stderr_stream;
+
+ /* this is for the reaping thread */
+ private native int waitForProcessExit(int pid);
+
+ /**
+ * Create a process using fork(2) and exec(2).
+ *
+ * @param std_fds array of file descriptors. Indexes 0, 1, and
+ * 2 correspond to standard input, standard output and
+ * standard error, respectively. On input, a value of -1
+ * means to create a pipe to connect child and parent
+ * processes. On output, a value which is not -1 is the
+ * parent pipe fd corresponding to the pipe which has
+ * been created. An element of this array is -1 on input
+ * if and only if it is <em>not</em> -1 on output.
+ * @return the pid of the subprocess
+ */
+ private native int forkAndExec(byte[] prog,
+ byte[] argBlock, int argc,
+ byte[] envBlock, int envc,
+ byte[] dir,
+ int[] std_fds,
+ boolean redirectErrorStream)
+ throws IOException;
+
+ /* In the process constructor we wait on this gate until the process */
+ /* has been created. Then we return from the constructor. */
+ /* fork() is called by the same thread which later waits for the process */
+ /* to terminate */
+
+ private static class Gate {
+
+ private boolean exited = false;
+ private IOException savedException;
+
+ synchronized void exit() { /* Opens the gate */
+ exited = true;
+ this.notify();
+ }
+
+ synchronized void waitForExit() { /* wait until the gate is open */
+ boolean interrupted = false;
+ while (!exited) {
+ try {
+ this.wait();
+ } catch (InterruptedException e) {
+ interrupted = true;
+ }
+ }
+ if (interrupted) {
+ Thread.currentThread().interrupt();
+ }
+ }
+
+ void setException (IOException e) {
+ savedException = e;
+ }
+
+ IOException getException() {
+ return savedException;
+ }
+ }
+
+ UNIXProcess(final byte[] prog,
+ final byte[] argBlock, final int argc,
+ final byte[] envBlock, final int envc,
+ final byte[] dir,
+ final int[] std_fds,
+ final boolean redirectErrorStream)
+ throws IOException {
+
+ final Gate gate = new Gate();
+ /*
+ * For each subprocess forked a corresponding reaper thread
+ * is started. That thread is the only thread which waits
+ * for the subprocess to terminate and it doesn't hold any
+ * locks while doing so. This design allows waitFor() and
+ * exitStatus() to be safely executed in parallel (and they
+ * need no native code).
+ */
+
+ java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction<Void>() {
+ public Void run() {
+ Thread t = new Thread("process reaper") {
+ public void run() {
+ try {
+ pid = forkAndExec(prog,
+ argBlock, argc,
+ envBlock, envc,
+ dir,
+ std_fds,
+ redirectErrorStream);
+ } catch (IOException e) {
+ gate.setException(e); /*remember to rethrow later*/
+ gate.exit();
+ return;
+ }
+ java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction<Void>() {
+ public Void run() {
+ if (std_fds[0] == -1)
+ stdin_stream = new ProcessBuilder.NullOutputStream();
+ else {
+ FileDescriptor stdin_fd = new FileDescriptor();
+ fdAccess.set(stdin_fd, std_fds[0]);
+ stdin_stream = new BufferedOutputStream(
+ new FileOutputStream(stdin_fd));
+ }
+
+ if (std_fds[1] == -1)
+ stdout_stream = new ProcessBuilder.NullInputStream();
+ else {
+ FileDescriptor stdout_fd = new FileDescriptor();
+ fdAccess.set(stdout_fd, std_fds[1]);
+ stdout_stream = new BufferedInputStream(
+ new FileInputStream(stdout_fd));
+ }
+
+ if (std_fds[2] == -1)
+ stderr_stream = new ProcessBuilder.NullInputStream();
+ else {
+ FileDescriptor stderr_fd = new FileDescriptor();
+ fdAccess.set(stderr_fd, std_fds[2]);
+ stderr_stream = new FileInputStream(stderr_fd);
+ }
+
+ return null; }});
+ gate.exit(); /* exit from constructor */
+ int res = waitForProcessExit(pid);
+ synchronized (UNIXProcess.this) {
+ hasExited = true;
+ exitcode = res;
+ UNIXProcess.this.notifyAll();
+ }
+ }
+ };
+ t.setDaemon(true);
+ t.start();
+ return null; }});
+ gate.waitForExit();
+ IOException e = gate.getException();
+ if (e != null)
+ throw new IOException(e.toString());
+ }
+
+ public OutputStream getOutputStream() {
+ return stdin_stream;
+ }
+
+ public InputStream getInputStream() {
+ return stdout_stream;
+ }
+
+ public InputStream getErrorStream() {
+ return stderr_stream;
+ }
+
+ public synchronized int waitFor() throws InterruptedException {
+ while (!hasExited) {
+ wait();
+ }
+ return exitcode;
+ }
+
+ public synchronized int exitValue() {
+ if (!hasExited) {
+ throw new IllegalThreadStateException("process hasn't exited");
+ }
+ return exitcode;
+ }
+
+ private static native void destroyProcess(int pid);
+ public void destroy() {
+ // There is a risk that pid will be recycled, causing us to
+ // kill the wrong process! So we only terminate processes
+ // that appear to still be running. Even with this check,
+ // there is an unavoidable race condition here, but the window
+ // is very small, and OSes try hard to not recycle pids too
+ // soon, so this is quite safe.
+ synchronized (this) {
+ if (!hasExited)
+ destroyProcess(pid);
+ }
+ try {
+ stdin_stream.close();
+ stdout_stream.close();
+ stderr_stream.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+
+ /* This routine initializes JNI field offsets for the class */
+ private static native void initIDs();
+
+ static {
+ initIDs();
+ }
+}
More information about the distro-pkg-dev
mailing list