Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2007-03-14 21:01:36 +0000
committerAndrew Niefer2007-03-14 21:01:36 +0000
commit274dc3dd288ab2c0755002d259b1ea30ccbc9109 (patch)
treee70b566eec472b2513abe2e49bdb5c9b264b1b4f /bundles/org.eclipse.equinox.executable
parent23ea7baa0f39a57bf7dda38f8cb84beb01fc8eb0 (diff)
downloadrt.equinox.framework-274dc3dd288ab2c0755002d259b1ea30ccbc9109.tar.gz
rt.equinox.framework-274dc3dd288ab2c0755002d259b1ea30ccbc9109.tar.xz
rt.equinox.framework-274dc3dd288ab2c0755002d259b1ea30ccbc9109.zip
bug 170135
Diffstat (limited to 'bundles/org.eclipse.equinox.executable')
-rw-r--r--bundles/org.eclipse.equinox.executable/.cproject50
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipse.c2
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseNix.c35
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseOS.h1
-rw-r--r--bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.c2
-rw-r--r--bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c2
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c71
7 files changed, 123 insertions, 40 deletions
diff --git a/bundles/org.eclipse.equinox.executable/.cproject b/bundles/org.eclipse.equinox.executable/.cproject
index d561d8d59..f43ce5ca0 100644
--- a/bundles/org.eclipse.equinox.executable/.cproject
+++ b/bundles/org.eclipse.equinox.executable/.cproject
@@ -52,6 +52,30 @@
<pathentry kind="out" path=""/>
<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
</storageModule>
+
+<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="converted.config.1797282818" moduleId="org.eclipse.cdt.core.settings" name="convertedConfig">
+
+
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser">
+<attribute key="addr2line" value="addr2line"/>
+<attribute key="c++filt" value="c++filt"/>
+</extension>
+<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser">
+<attribute key="addr2line" value="addr2line"/>
+<attribute key="cygpath" value="cygpath"/>
+<attribute key="nm" value="nm"/>
+<attribute key="c++filt" value="c++filt"/>
+</extension>
+<extension id="org.eclipse.cdt.core.MachO" point="org.eclipse.cdt.core.BinaryParser">
+<attribute key="c++filt" value="c++filt"/>
+</extension>
+</extensions>
+</storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="all" path="library/carbon" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
@@ -68,30 +92,30 @@
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
-<target name="linux-all" path="library/motif" 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_linux.mak</buildArguments>
+<buildArguments>-f make_mingw.mak JAVA_HOME=C:/Dev/Java/IBM_1.5.0</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
-<target name="clean" path="library/motif" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<target name="clean" path="library/win32" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
-<buildArguments>-f make_linux.mak</buildArguments>
+<buildArguments>-f make_mingw.mak</buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
</target>
-<target name="all-mingw" path="library/win32" 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_mingw.mak</buildArguments>
+<buildArguments>-f make_linux.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/motif" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>make</buildCommand>
-<buildArguments>-f make_mingw.mak</buildArguments>
+<buildArguments>-f make_linux.mak</buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
@@ -112,16 +136,6 @@
</target>
</buildTargets>
</storageModule>
-<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="converted.config.1797282818" moduleId="org.eclipse.cdt.core.settings" name="convertedConfig">
-<externalSettings/>
-<extensions>
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
-<extension id="org.eclipse.cdt.core.MachO" point="org.eclipse.cdt.core.BinaryParser">
-<attribute key="c++filt" value="c++filt"/>
-</extension>
-</extensions>
-</storageModule>
</cconfiguration>
</storageModule>
</cproject>
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipse.c b/bundles/org.eclipse.equinox.executable/library/eclipse.c
index e56cbe77f..d7d011d4b 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipse.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipse.c
@@ -170,7 +170,7 @@ static _TCHAR* officialName = NULL;
_TCHAR* exitData = NULL; /* exit data set from Java */
int initialArgc;
-_TCHAR** initialArgv;
+_TCHAR** initialArgv = NULL;
/* Define the special exit codes returned from Eclipse. */
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseNix.c b/bundles/org.eclipse.equinox.executable/library/eclipseNix.c
index f5f33aa6e..be0d4bcac 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseNix.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseNix.c
@@ -141,31 +141,25 @@ static void adjustLibraryPath( char * vmLibrary ) {
} else {
numPaths = 2;
/* we want the directory containing the library, and the parent directory of that */
- paths = malloc( 2 * sizeof(char*));
- buffer = strdup(vmLibrary);
- c = strrchr(buffer, dirSeparator);
- *c = 0;
- paths[0] = resolveSymlinks(buffer);
- length = strlen(paths[0]);
- paths[0] = realloc(paths[0], (length + 2) * sizeof(char));
- paths[0][length] = pathSeparator;
- paths[0][length + 1] = 0;
-
- c = strrchr(buffer, dirSeparator);
- *c = 0;
- paths[1] = resolveSymlinks(buffer);
- length = strlen(paths[1]);
- paths[1] = realloc(paths[1], (length + 2) * sizeof(char));
- paths[1][length] = pathSeparator;
- paths[1][length + 1] = 0;
-
+ paths = malloc( numPaths * sizeof(char*));
+ buffer = strdup(vmLibrary);
+ for (i = 0; i < numPaths; i++) {
+ c = strrchr(buffer, dirSeparator);
+ *c = 0;
+ paths[i] = resolveSymlinks(buffer);
+ length = strlen(paths[i]);
+ paths[i] = realloc(paths[i], (length + 2) * sizeof(char));
+ paths[i][length] = pathSeparator;
+ paths[i][length + 1] = 0;
+ }
free(buffer);
}
ldPath = (char*)getenv(_T_ECLIPSE("LD_LIBRARY_PATH"));
- if(!ldPath)
+ if (!ldPath) {
ldPath = _T_ECLIPSE("");
- else {
+ needAdjust = 1;
+ } else {
buffer = malloc((strlen(ldPath) + 2) * sizeof(char));
sprintf(buffer, "%s%c", ldPath, pathSeparator);
for (i = 0; i < numPaths; i++) {
@@ -177,6 +171,7 @@ static void adjustLibraryPath( char * vmLibrary ) {
break;
}
}
+ free(buffer);
}
if (!needAdjust) {
for (i = 0; i < numPaths; i++)
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseOS.h b/bundles/org.eclipse.equinox.executable/library/eclipseOS.h
index 4567a374e..4074ced86 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseOS.h
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseOS.h
@@ -32,6 +32,7 @@
#define launchJavaVM launchJavaVMW
#define eeLibPath eeLibPathW
#define processVMArgs processVMArgsW
+#define initialArgv initialArgvW
#endif
/* Operating System Dependent Information */
diff --git a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.c b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.c
index 70957a838..a86c0ccda 100644
--- a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.c
+++ b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.c
@@ -66,6 +66,8 @@ int showSplash( const char* featureImage )
if (featureImage == NULL)
return -1;
+ if (initialArgv == NULL)
+ initialArgc = 0;
initWindowSystem(&initialArgc, initialArgv, 1);
shellHandle = gtk_window_new(GTK_WINDOW_TOPLEVEL);
diff --git a/bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c b/bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c
index 3e6d781bc..3596347b8 100644
--- a/bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c
+++ b/bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c
@@ -90,6 +90,8 @@ int showSplash( const char* featureImage )
Screen* screen;
Widget scrolledHandle, drawingHandle, image;
+ if (initialArgv == NULL)
+ initialArgc = 0;
initWindowSystem(&initialArgc, initialArgv, 1);
xDisplay = XtDisplay(topWindow);
screen = XDefaultScreenOfDisplay( xDisplay );
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c b/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c
index 8d7363363..3c6a37bfd 100644
--- a/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c
+++ b/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c
@@ -44,6 +44,8 @@ static int jvmExitTimerId = 99;
static void CALLBACK detectJvmExit( HWND hwnd, UINT uMsg, UINT id, DWORD dwTime );
static _TCHAR* checkVMRegistryKey(HKEY jrekey, _TCHAR* subKeyName);
+static void adjustSearchPath( _TCHAR * vmLibrary );
+static _TCHAR* findLib( _TCHAR* command );
/* define default locations in which to find the jvm shared library
* these are paths relative to the java exe, the shared library is
@@ -144,10 +146,77 @@ _TCHAR** getArgVM( _TCHAR *vm )
/* Local functions */
+_TCHAR * findVMLibrary( _TCHAR* command ) {
+ _TCHAR* lib = findLib(command);
+ if( lib != NULL ) {
+ adjustSearchPath(lib);
+ }
+ return lib;
+}
+
+void adjustSearchPath( _TCHAR* vmLib ){
+ _TCHAR ** paths;
+ _TCHAR * path = NULL, *newPath = NULL;
+ _TCHAR * buffer, *c;
+ int i, length;
+ int needAdjust = 0, freePath = 0;
+
+ /* we want the directory containing the library, and the parent directory of that */
+ paths = (_TCHAR**) malloc( 2 * sizeof(_TCHAR*));
+ buffer = _tcsdup(vmLib);
+ for (i = 0; i < 2; i++ ){
+ c = _tcsrchr(buffer, dirSeparator);
+ *c = 0;
+ length = _tcslen(buffer);
+ paths[i] = malloc((length + 2) * sizeof(_TCHAR));
+ _stprintf( paths[i], _T_ECLIPSE("%s%c"), buffer, pathSeparator );
+ }
+ free(buffer);
+
+ /* first call to GetEnvironmentVariable tells us how big to make the buffer */
+ length = GetEnvironmentVariable(_T_ECLIPSE("PATH"), path, 0);
+ if (length > 0) {
+ path = malloc(length * sizeof(_TCHAR));
+ GetEnvironmentVariable(_T_ECLIPSE("PATH"), path, length);
+ freePath = 1;
+ } else {
+ path = _T_ECLIPSE("");
+ freePath = 0;
+ needAdjust = 1;
+ }
+
+ if(length > 0) {
+ buffer = malloc((_tcslen(path) + 2) * sizeof(_TCHAR));
+ _stprintf(buffer, _T_ECLIPSE("%s%c"), path, pathSeparator);
+ /* check if each of our paths is already on the search path */
+ for (i = 0; i < 2; i++) {
+ c = _tcsstr(buffer, paths[i]);
+ if ( c == NULL || !(c == buffer || *(c - 1) == pathSeparator))
+ {
+ /* entry not found */
+ needAdjust = 1;
+ break;
+ }
+ }
+ free(buffer);
+ }
+
+ newPath = malloc((length + 1 + _tcslen(paths[0]) + 1 + _tcslen(paths[1]) + 1) * sizeof(_TCHAR));
+ _stprintf(newPath, _T_ECLIPSE("%s%s%s"), paths[0], paths[1], path);
+
+ SetEnvironmentVariable( _T_ECLIPSE("PATH"), newPath);
+
+ for (i = 0; i < 2; i++)
+ free(paths[i]);
+ free(paths);
+ free(newPath);
+ if (freePath)
+ free(path);
+}
/*
* Find the VM shared library starting from the java executable
*/
-_TCHAR* findVMLibrary( _TCHAR* command ) {
+static _TCHAR* findLib( _TCHAR* command ) {
int i, j;
int pathLength;
struct _stat stats;

Back to the top