Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2006-12-06 19:56:29 +0000
committerAndrew Niefer2006-12-06 19:56:29 +0000
commit6882b54cfda45cd1b550ab8b13ee0506157bf1db (patch)
tree0fcdfff3e8369c62ced4e5b07428ac0dc30421be /bundles/org.eclipse.equinox.executable
parent996cfeb08f163d2af8a65ddb1fd367630b696b2f (diff)
downloadrt.equinox.framework-6882b54cfda45cd1b550ab8b13ee0506157bf1db.tar.gz
rt.equinox.framework-6882b54cfda45cd1b550ab8b13ee0506157bf1db.tar.xz
rt.equinox.framework-6882b54cfda45cd1b550ab8b13ee0506157bf1db.zip
update launcher to look for library in new org.eclipse.equinox.launcher fragments.
Also update JNI calls to look for org.eclipse.equinox.launcher instead of org.eclipse.core.launcher
Diffstat (limited to 'bundles/org.eclipse.equinox.executable')
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipse.c8
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseCommon.c3
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseCommon.h9
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseJNI.c4
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseJNI.h20
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseMain.c58
6 files changed, 62 insertions, 40 deletions
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipse.c b/bundles/org.eclipse.equinox.executable/library/eclipse.c
index 24ec891a3..e38961804 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipse.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipse.c
@@ -235,7 +235,6 @@ static _TCHAR* homeMsg =
_T_ECLIPSE("The %s executable launcher was unable to locate its \n\
companion startup.jar file (in the same directory as the executable).");
-#define DEFAULT_EQUINOX_STARTUP _T_ECLIPSE("org.eclipse.equinox.startup")
#define DEFAULT_STARTUP _T_ECLIPSE("startup.jar")
#define CLASSPATH_PREFIX _T_ECLIPSE("-Djava.class.path=")
@@ -255,19 +254,16 @@ companion startup.jar file (in the same directory as the executable).");
#define VMARGS _T_ECLIPSE("-vmargs") /* special option processing required */
#define CP _T_ECLIPSE("-cp")
#define CLASSPATH _T_ECLIPSE("-classpath")
-
#define JAR _T_ECLIPSE("-jar")
/* Define the variables to receive the option values. */
static int needConsole = 0; /* True: user wants a console */
static int debug = 0; /* True: output debugging info */
static int noSplash = 0; /* True: do not show splash win */
-static _TCHAR* osArg = _T_ECLIPSE(DEFAULT_OS);
-static _TCHAR* osArchArg = _T_ECLIPSE(DEFAULT_OS_ARCH);
+
static _TCHAR* showSplashArg = NULL; /* showsplash data (main launcher window) */
static _TCHAR * startupArg = NULL; /* path of the startup.jar the user wants to run relative to the program path */
static _TCHAR* vmName = NULL; /* Java VM that the user wants to run */
-static _TCHAR* wsArg = _T_ECLIPSE(DEFAULT_WS); /* the SWT supported GUI to be used */
static _TCHAR* name = NULL; /* program name */
/* Define a table for processing command line options. */
@@ -841,7 +837,7 @@ static _TCHAR* findStartupJar(){
_tcscat(pluginsPath, _T_ECLIPSE("plugins"));
/* equinox startup jar? */
- file = findFile(pluginsPath, _T_ECLIPSE("org.eclipse.equinox.startup"));
+ file = findFile(pluginsPath, DEFAULT_EQUINOX_STARTUP);
if(file != NULL)
return file;
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseCommon.c b/bundles/org.eclipse.equinox.executable/library/eclipseCommon.c
index cde658660..5dc48abaf 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseCommon.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseCommon.c
@@ -26,6 +26,9 @@
/* Global Variables */
_TCHAR* officialName = NULL;
+_TCHAR* osArg = _T_ECLIPSE(DEFAULT_OS);
+_TCHAR* osArchArg = _T_ECLIPSE(DEFAULT_OS_ARCH);
+_TCHAR* wsArg = _T_ECLIPSE(DEFAULT_WS); /* the SWT supported GUI to be used */
/* Local Variables */
#ifndef _WIN32
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseCommon.h b/bundles/org.eclipse.equinox.executable/library/eclipseCommon.h
index ddae32a4a..cd7a4a4c6 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseCommon.h
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseCommon.h
@@ -34,6 +34,9 @@
#define run runW
#define setInitialArgs setInitialArgsW
#define toNarrow toNarrowW
+#define osArg osArgW
+#define wsArg wsArgW
+#define osArchArg osArchArgW
#endif
#ifdef UNICODE
@@ -44,6 +47,12 @@
#define SET_INITIAL_ARGS _T_ECLIPSE("setInitialArgs")
#endif
+#define DEFAULT_EQUINOX_STARTUP _T_ECLIPSE("org.eclipse.equinox.launcher")
+
+extern _TCHAR* osArg;
+extern _TCHAR* osArchArg;
+extern _TCHAR* wsArg;
+
extern _TCHAR dirSeparator; /* '/' or '\\' */
extern _TCHAR pathSeparator; /* separator used in PATH variable */
extern _TCHAR* officialName; /* Program official name */
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseJNI.c b/bundles/org.eclipse.equinox.executable/library/eclipseJNI.c
index 9f7e55fe9..283b4c21c 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseJNI.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseJNI.c
@@ -88,7 +88,7 @@ JNIEXPORT void JNICALL takedown_splash(JNIEnv * env, jobject obj){
#endif
static void registerNatives(JNIEnv *env) {
- jclass bridge = (*env)->FindClass(env, "org/eclipse/core/launcher/JNIBridge");
+ jclass bridge = (*env)->FindClass(env, "org/eclipse/equinox/launcher/JNIBridge");
if(bridge != NULL) {
int numNatives = sizeof(natives) / sizeof(natives[0]);
(*env)->RegisterNatives(env, bridge, natives, numNatives);
@@ -217,7 +217,7 @@ int startJavaVM( _TCHAR* libPath, _TCHAR* vmArgs[], _TCHAR* progArgs[] )
if( createJavaVM(&jvm, &env, &init_args) == 0 ) {
registerNatives(env);
- mainClass = (*env)->FindClass(env, "org/eclipse/core/launcher/Main");
+ mainClass = (*env)->FindClass(env, "org/eclipse/equinox/launcher/Main");
if(mainClass != NULL) {
mainConstructor = (*env)->GetMethodID(env, mainClass, "<init>", "()V");
mainObject = (*env)->NewObject(env, mainClass, mainConstructor);
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseJNI.h b/bundles/org.eclipse.equinox.executable/library/eclipseJNI.h
index e961f47f1..579d4ee2b 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseJNI.h
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseJNI.h
@@ -34,41 +34,41 @@ typedef jint (JNICALL *JNI_createJavaVM)(JavaVM **pvm, JNIEnv **env, void *args)
/* JNI Callback methods */
/* Use name mangling since we may be linking these from java with System.LoadLibrary */
-#define set_exit_data Java_org_eclipse_core_launcher_JNIBridge__1set_1exit_1data
-#define update_splash Java_org_eclipse_core_launcher_JNIBridge__1update_1splash
-#define show_splash Java_org_eclipse_core_launcher_JNIBridge__1show_1splash
-#define get_splash_handle Java_org_eclipse_core_launcher_JNIBridge__1get_1splash_1handle
-#define takedown_splash Java_org_eclipse_core_launcher_JNIBridge__1takedown_1splash
+#define set_exit_data Java_org_eclipse_equinox_launcher_JNIBridge__1set_1exit_1data
+#define update_splash Java_org_eclipse_equinox_launcher_JNIBridge__1update_1splash
+#define show_splash Java_org_eclipse_equinox_launcher_JNIBridge__1show_1splash
+#define get_splash_handle Java_org_eclipse_equinox_launcher_JNIBridge__1get_1splash_1handle
+#define takedown_splash Java_org_eclipse_equinox_launcher_JNIBridge__1takedown_1splash
#ifdef __cplusplus
extern "C" {
#endif
/*
- * org_eclipse_core_launcher_JNIBridge#_set_exit_data
+ * org_eclipse_equinox_launcher_JNIBridge#_set_exit_data
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL set_exit_data(JNIEnv *, jobject, jstring);
/*
- * org_eclipse_core_launcher_JNIBridge#_update_splash
+ * org_eclipse_equinox_launcher_JNIBridge#_update_splash
* Signature: ()V
*/
JNIEXPORT void JNICALL update_splash(JNIEnv *, jobject);
/*
- * org_eclipse_core_launcher_JNIBridge#_get_splash_handle
+ * org_eclipse_equinox_launcher_JNIBridge#_get_splash_handle
* Signature: ()J
*/
JNIEXPORT jlong JNICALL get_splash_handle(JNIEnv *, jobject);
/*
- * org_eclipse_core_launcher_JNIBridge#_show_splash
+ * org_eclipse_equinox_launcher_JNIBridge#_show_splash
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL show_splash(JNIEnv *, jobject, jstring);
/*
- * org_eclipse_core_launcher_JNIBridge#_takedown_splash
+ * org_eclipse_equinox_launcher_JNIBridge#_takedown_splash
* Signature: ()V
*/
JNIEXPORT void JNICALL takedown_splash(JNIEnv *, jobject);
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseMain.c b/bundles/org.eclipse.equinox.executable/library/eclipseMain.c
index f1c42b690..535db0a86 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseMain.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseMain.c
@@ -306,31 +306,25 @@ static _TCHAR* getDefaultOfficialName(_TCHAR* program)
static _TCHAR* findLibrary(_TCHAR* program)
{
_TCHAR* c;
- _TCHAR* libraryPrefix;
_TCHAR* path;
+ _TCHAR* fragment;
_TCHAR* result;
+ _TCHAR* dot = _T_ECLIPSE(".");
int length;
+ int fragmentLength;
- /* find the last segment */
- c = _tcsrchr(program, dirSeparator);
- if(c == NULL)
- libraryPrefix = _tcsdup(program);
- else
- libraryPrefix = _tcsdup(++c); /* next character is start of prefix */
-
-#ifdef _WIN32
- {
- /* Search for the extension .exe and remove it */
- _TCHAR *extension = _tcsrchr(libraryPrefix, _T_ECLIPSE('.'));
- if (extension == NULL || _tcslen(extension) < 4)
- {
- free(libraryPrefix);
- return NULL;
- }
- extension[0] = 0;
- }
-#endif
+ /* build the equinox.launcher fragment name */
+ fragmentLength = _tcslen(DEFAULT_EQUINOX_STARTUP) + 1 + _tcslen(wsArg) + 1 + _tcslen(osArg) + 1 + _tcslen(osArchArg) + 1;
+ fragment = malloc(fragmentLength * sizeof(_TCHAR));
+ _tcscpy(fragment, DEFAULT_EQUINOX_STARTUP);
+ _tcscat(fragment, dot);
+ _tcscat(fragment, wsArg);
+ _tcscat(fragment, dot);
+ _tcscat(fragment, osArg);
+ _tcscat(fragment, dot);
+ _tcscat(fragment, osArchArg);
+ /* get the plugins path */
length = _tcslen(programDir);
if(programDir[length - 1] == dirSeparator){
path = _tcsdup(programDir);
@@ -338,9 +332,29 @@ static _TCHAR* findLibrary(_TCHAR* program)
} else {
path = programDir;
}
- result = findFile(path, libraryPrefix);
- free(libraryPrefix);
+ length = _tcslen(programDir);
+#ifdef MACOSX
+ length += 9;
+#endif
+ path = malloc( (length + 1 + 7) * sizeof(char));
+ _tcscpy(path, programDir);
+ if(path[length - 1] != dirSeparator) {
+ path[length] = dirSeparator;
+ path[length + 1] = 0;
+ }
+#ifdef MACOSX
+ _tcscat(path, _T_ECLIPSE("../../../"));
+#endif
+ _tcscat(path, _T_ECLIPSE("plugins"));
+
+ c = findFile(path, fragment);
+ free(fragment);
+ fragment = c;
+
+ result = findFile(fragment, _T_ECLIPSE("eclipse"));
+
+ free(fragment);
if(path != programDir)
free(path);

Back to the top