Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.equinox.executable/.cdtproject29
-rw-r--r--bundles/org.eclipse.equinox.executable/.project20
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipse.c4
-rw-r--r--bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c37
-rw-r--r--bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/JNIBridge.java12
-rw-r--r--bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java9
6 files changed, 81 insertions, 30 deletions
diff --git a/bundles/org.eclipse.equinox.executable/.cdtproject b/bundles/org.eclipse.equinox.executable/.cdtproject
index 66a469dc8..b14678f65 100644
--- a/bundles/org.eclipse.equinox.executable/.cdtproject
+++ b/bundles/org.eclipse.equinox.executable/.cdtproject
@@ -58,55 +58,62 @@
</item>
<item id="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
-<target name="all-mingw" path="library/win32" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<target name="all" path="library/carbon" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
-<buildArguments>-f make_mingw.mak</buildArguments>
+<buildArguments>-f make_macosx.mak</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
-<target name="clean" path="library/win32" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<target name="clean" path="library/carbon" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
-<buildArguments>-f make_mingw.mak</buildArguments>
+<buildArguments>-f make_macosx.mak</buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
-<target name="linux-all" path="library/gtk" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<target name="linux-all" path="library/motif" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-f make_linux.mak</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
-<target name="clean" path="library/gtk" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<target name="clean" path="library/motif" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-f make_linux.mak</buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
-<target name="all" path="library/carbon" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<target name="all-mingw" path="library/win32" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
-<buildArguments>-f make_macosx.mak</buildArguments>
+<buildArguments>-f make_mingw.mak</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
-<target name="clean" path="library/carbon" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<target name="clean" path="library/win32" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
-<buildArguments>-f make_macosx.mak</buildArguments>
+<buildArguments>-f make_mingw.mak</buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
-<target name="linux-all" path="library/motif" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<target name="linux-all" path="library/gtk" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-f make_linux.mak</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
+<target name="clean" path="library/gtk" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<buildCommand>make</buildCommand>
+<buildArguments>-f make_linux.mak</buildArguments>
+<buildTarget>clean</buildTarget>
+<stopOnError>false</stopOnError>
+<useDefaultCommand>false</useDefaultCommand>
+</target>
</buildTargets>
</item>
</data>
diff --git a/bundles/org.eclipse.equinox.executable/.project b/bundles/org.eclipse.equinox.executable/.project
index 16ad5c453..14e84f8f7 100644
--- a/bundles/org.eclipse.equinox.executable/.project
+++ b/bundles/org.eclipse.equinox.executable/.project
@@ -18,22 +18,22 @@
<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
</dictionary>
<dictionary>
- <key>org.eclipse.cdt.make.core.environment</key>
- <value>JAVA_JNI=C:/Dev/Java/IBM_1.5.0/include|DEFAULT_OS=${system_property:osgi.os}|DEFAULT_WS=${system_property:osgi.ws}|DEFAULT_OS_ARCH=${system_property:osgi.arch}|</value>
- </dictionary>
- <dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
- <key>org.eclipse.cdt.make.core.build.target.inc</key>
- <value>all</value>
+ <key>org.eclipse.cdt.make.core.environment</key>
+ <value>JAVA_JNI=C:/Dev/Java/IBM_1.5.0/include|X11_HOME=/usr/X11R6|DEFAULT_OS=${system_property:osgi.os}|DEFAULT_WS=${system_property:osgi.ws}|MOTIF_HOME=/usr/X11|DEFAULT_OS_ARCH=${system_property:osgi.arch}|</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
+ <key>org.eclipse.cdt.make.core.build.target.inc</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
<value>true</value>
</dictionary>
@@ -42,14 +42,14 @@
<value>\org.eclipse.equinox.executable\library\${system_property:osgi.ws}</value>
</dictionary>
<dictionary>
- <key>org.eclipse.cdt.make.core.build.command</key>
- <value>make</value>
- </dictionary>
- <dictionary>
<key>org.eclipse.cdt.make.core.build.target.clean</key>
<value>clean</value>
</dictionary>
<dictionary>
+ <key>org.eclipse.cdt.make.core.build.command</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipse.c b/bundles/org.eclipse.equinox.executable/library/eclipse.c
index 1cf7825ff..c034e7306 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipse.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipse.c
@@ -349,7 +349,8 @@ JNIEXPORT int run(int argc, _TCHAR* argv[], _TCHAR* vmArgs[])
parseArgs( &argc, argv );
/* Initialize official program name */
- officialName = name != NULL ? _tcsdup( name ) : getDefaultOfficialName();
+ if (officialName != NULL)
+ officialName = name != NULL ? _tcsdup( name ) : getDefaultOfficialName();
/* Initialize the window system. */
initWindowSystem( &argc, argv, !noSplash );
@@ -555,7 +556,6 @@ JNIEXPORT int run(int argc, _TCHAR* argv[], _TCHAR* vmArgs[])
free( jarFile );
free( programDir );
free( program );
- free( officialName );
if ( vmCommand != NULL ) free( vmCommand );
if ( cp != JAR ) free( cp );
if ( cpValue != NULL) free( cpValue );
diff --git a/bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c b/bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c
index f63c84f4f..83b694e92 100644
--- a/bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c
+++ b/bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c
@@ -74,6 +74,9 @@ static const char* jvmLocations [] = { "j9vm",
extern XtAppContext appContext;
extern Widget topWindow;
+static pid_t jvmProcess = 0;
+static int jvmExitCode;
+
/* Define local variables for handling the splash window and its image. */
static Widget shellHandle = 0;
@@ -406,3 +409,37 @@ void restartLauncher( char* program, char* args[] )
/* just restart in-place */
execv(program, args);
}
+
+int launchJavaVM( char* args[] )
+{
+ int exitCode;
+
+#ifdef NETSCAPE_FIX
+ fixEnvForNetscape();
+#endif /* NETSCAPE_FIX */
+#ifdef MOZILLA_FIX
+ fixEnvForMozilla();
+#endif /* MOZILLA_FIX */
+
+ /* Create a child process for the JVM. */
+ jvmProcess = fork();
+ if (jvmProcess == 0)
+ {
+ /* Child process ... start the JVM */
+ execv( args[0], args );
+
+ /* The JVM would not start ... return error code to parent process. */
+ jvmExitCode = errno;
+ exit( jvmExitCode );
+ }
+
+ /* If the JVM is still running, wait for it to terminate. */
+ if (jvmProcess != 0)
+ {
+ wait( &exitCode );
+ jvmExitCode = ((exitCode & 0x00ff) == 0 ? (exitCode >> 8) : exitCode); /* see wait(2) */
+ }
+
+ /* Return the exit code from the JVM. */
+ return jvmExitCode;
+}
diff --git a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/JNIBridge.java b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/JNIBridge.java
index 9d923c924..84884b714 100644
--- a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/JNIBridge.java
+++ b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/JNIBridge.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,7 +16,7 @@ package org.eclipse.equinox.launcher;
*
*/
public class JNIBridge {
- private native void _set_exit_data(String data);
+ private native void _set_exit_data(String sharedId, String data);
private native void _update_splash();
private native long _get_splash_handle();
private native void _show_splash(String bitmap);
@@ -39,14 +39,14 @@ public class JNIBridge {
libraryLoaded = true;
}
- public boolean setExitData(String data) {
+ public boolean setExitData(String sharedId, String data) {
try {
- _set_exit_data(data);
+ _set_exit_data(sharedId, data);
return true;
} catch (UnsatisfiedLinkError e) {
if(!libraryLoaded){
loadLibrary();
- return setExitData(data);
+ return setExitData(sharedId, data);
}
return false;
}
@@ -79,7 +79,7 @@ public class JNIBridge {
}
public long getSplashHandle() {
- try {
+ try {
return _get_splash_handle();
} catch (UnsatisfiedLinkError e) {
if(!libraryLoaded){
diff --git a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java
index 35ad05f60..0dfd354fd 100644
--- a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java
+++ b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java
@@ -79,6 +79,7 @@ public class Main {
// private String name = null; // The name to brand the launcher
// private String launcher = null; // The full path to the launcher
private String library = null;
+ private String exitData = null;
private String vm = null;
private String[] vmargs = null;
@@ -115,6 +116,7 @@ public class Main {
private static final String CONFIGURATION = "-configuration"; //$NON-NLS-1$
private static final String NOSPLASH = "-nosplash"; //$NON-NLS-1$
private static final String SHOWSPLASH = "-showsplash"; //$NON-NLS-1$
+ private static final String EXITDATA = "-exitdata"; //$NON-NLS-1$
// private static final String NAME = "-name"; //$NON-NLS-1$
// private static final String LAUNCHER = "-launcher"; //$NON-NLS-1$
private static final String LIBRARY = "-library"; //$NON-NLS-1$
@@ -1157,7 +1159,7 @@ public class Main {
String data = System.getProperty(PROP_EXITDATA);
if (data == null)
return;
- bridge.setExitData(data);
+ bridge.setExitData(exitData, data);
}
/**
@@ -1297,6 +1299,11 @@ public class Main {
found = true;
}
+ if (args[i - 1].equalsIgnoreCase(EXITDATA)) {
+ exitData = arg;
+ found = true;
+ }
+
// // look for the name to use by the launcher
// if (args[i - 1].equalsIgnoreCase(NAME)) {
// name = arg;

Back to the top