Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2007-05-16 21:15:12 +0000
committerAndrew Niefer2007-05-16 21:15:12 +0000
commitda0c531afabee43a9a32aa11336dd2e16f232847 (patch)
treecb9d7b75cc04ee03da6fd9c0877144d0f371095d /bundles/org.eclipse.equinox.executable
parentc13d04fe5adf1caf39962bbf257df6332aafc00e (diff)
downloadrt.equinox.framework-da0c531afabee43a9a32aa11336dd2e16f232847.tar.gz
rt.equinox.framework-da0c531afabee43a9a32aa11336dd2e16f232847.tar.xz
rt.equinox.framework-da0c531afabee43a9a32aa11336dd2e16f232847.zip
Diffstat (limited to 'bundles/org.eclipse.equinox.executable')
-rw-r--r--bundles/org.eclipse.equinox.executable/bin/carbon/macosx/ppc/Eclipse.app/Contents/MacOS/eclipse.ini2
-rw-r--r--bundles/org.eclipse.equinox.executable/bin/carbon/macosx/x86/Eclipse.app/Contents/MacOS/eclipse.ini2
-rw-r--r--bundles/org.eclipse.equinox.executable/library/carbon/eclipseCarbon.c6
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipse.c32
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseNix.c5
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseOS.h4
-rw-r--r--bundles/org.eclipse.equinox.executable/library/make_version.mak2
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c48
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/make_mingw.mak2
-rw-r--r--bundles/org.eclipse.equinox.executable/library/win32/make_win32.mak2
-rw-r--r--bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp46
-rw-r--r--bundles/org.eclipse.equinox.executable/library/wpf/make_wpf.mak2
12 files changed, 148 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.executable/bin/carbon/macosx/ppc/Eclipse.app/Contents/MacOS/eclipse.ini b/bundles/org.eclipse.equinox.executable/bin/carbon/macosx/ppc/Eclipse.app/Contents/MacOS/eclipse.ini
index 00f12affc..cedbe2da9 100644
--- a/bundles/org.eclipse.equinox.executable/bin/carbon/macosx/ppc/Eclipse.app/Contents/MacOS/eclipse.ini
+++ b/bundles/org.eclipse.equinox.executable/bin/carbon/macosx/ppc/Eclipse.app/Contents/MacOS/eclipse.ini
@@ -1,5 +1,7 @@
-showsplash
org.eclipse.platform
+--launcher.XXMaxPermSize
+256m
-vmargs
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
diff --git a/bundles/org.eclipse.equinox.executable/bin/carbon/macosx/x86/Eclipse.app/Contents/MacOS/eclipse.ini b/bundles/org.eclipse.equinox.executable/bin/carbon/macosx/x86/Eclipse.app/Contents/MacOS/eclipse.ini
index 00f12affc..cedbe2da9 100644
--- a/bundles/org.eclipse.equinox.executable/bin/carbon/macosx/x86/Eclipse.app/Contents/MacOS/eclipse.ini
+++ b/bundles/org.eclipse.equinox.executable/bin/carbon/macosx/x86/Eclipse.app/Contents/MacOS/eclipse.ini
@@ -1,5 +1,7 @@
-showsplash
org.eclipse.platform
+--launcher.XXMaxPermSize
+256m
-vmargs
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
diff --git a/bundles/org.eclipse.equinox.executable/library/carbon/eclipseCarbon.c b/bundles/org.eclipse.equinox.executable/library/carbon/eclipseCarbon.c
index 7dcb89d84..27fcf4b23 100644
--- a/bundles/org.eclipse.equinox.executable/library/carbon/eclipseCarbon.c
+++ b/bundles/org.eclipse.equinox.executable/library/carbon/eclipseCarbon.c
@@ -434,4 +434,8 @@ void processVMArgs(char **vmargs[] )
_stprintf( c, APP_ICON_PATTERN, pid );
setenv(c, icon, 1);
}
-} \ No newline at end of file
+}
+
+int isSunVM( _TCHAR * vm ) {
+ return (strncmp(vm, JAVA_FRAMEWORK, strlen(JAVA_FRAMEWORK)) == 0);
+}
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipse.c b/bundles/org.eclipse.equinox.executable/library/eclipse.c
index 1e1591e6b..bdd9879c0 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipse.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipse.c
@@ -228,6 +228,9 @@ home directory.");
#define SUPRESSERRORS _T_ECLIPSE("--launcher.suppressErrors")
#define INI _T_ECLIPSE("--launcher.ini")
#define SECOND_THREAD _T_ECLIPSE("--launcher.secondThread")
+#define PERM_GEN _T_ECLIPSE("--launcher.XXMaxPermSize")
+
+#define XXPERMGEN _T_ECLIPSE("-XX:MaxPermSize=")
/* constants for ee options file */
#define EE_EXECUTABLE _T_ECLIPSE("-Dee.executable=")
@@ -250,6 +253,7 @@ static _TCHAR * startupArg = NULL; /* path of the startup.jar the user want
static _TCHAR* vmName = NULL; /* Java VM that the user wants to run */
static _TCHAR* name = NULL; /* program name */
static _TCHAR* library = NULL; /* the shared library */
+static _TCHAR* permGen = NULL; /* perm gen size for sun */
/* variables for ee options */
static _TCHAR* eeExecutable = NULL;
@@ -291,6 +295,7 @@ static Option options[] = {
{ STARTUP, &startupArg, 0, 2 },
{ VM, &vmName, 0, 2 },
{ NAME, &name, 0, 2 },
+ { PERM_GEN, &permGen, 0, 2 },
{ WS, &wsArg, 0, 2 } };
static int optionsSize = (sizeof(options) / sizeof(options[0]));
@@ -656,6 +661,31 @@ static _TCHAR** parseArgList( _TCHAR* data ) {
return execArg;
}
+static void adjustVMArgs( _TCHAR *vm, _TCHAR **vmArgv[] ) {
+ /* Sun VMs need some extra perm gen space */
+ if (isSunVM(vm) && permGen != NULL) {
+ int specified = 0, i = -1;
+
+ /* first check to see if it is already specified */
+ while ( (*vmArgv)[++i] != NULL) {
+ /* we are also counting the number of args here */
+ if (!specified && _tcsncmp((*vmArgv)[i], XXPERMGEN, _tcslen(XXPERMGEN)) == 0) {
+ specified = 1;
+ }
+ }
+
+ if (!specified) {
+ _TCHAR ** oldArgs = *vmArgv;
+ _TCHAR *newArg = malloc((_tcslen(XXPERMGEN) + _tcslen(permGen) + 1) * sizeof(_TCHAR));
+ _stprintf(newArg, _T_ECLIPSE("%s%s"), XXPERMGEN, permGen);
+
+ *vmArgv = malloc((i + 1) * sizeof(_TCHAR *));
+ memcpy(*vmArgv, oldArgs, i * sizeof(_TCHAR *));
+ (*vmArgv)[i] = newArg;
+ (*vmArgv)[i + 1] = 0;
+ }
+ }
+}
/*
* Get the command and arguments to start the Java VM.
*
@@ -681,6 +711,8 @@ static void getVMCommand( int argc, _TCHAR* argv[], _TCHAR **vmArgv[], _TCHAR **
/* If the user specified "-vmargs", add them instead of the default VM args. */
vmArg = (userVMarg != NULL) ? userVMarg : getArgVM( javaVM != NULL ? javaVM : jniLib );
+ adjustVMArgs(javaVM != NULL ? javaVM : jniLib, &vmArg);
+
/* Calculate the number of VM arguments. */
while (vmArg[ nVMarg ] != NULL)
nVMarg++;
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseNix.c b/bundles/org.eclipse.equinox.executable/library/eclipseNix.c
index 475fac8f0..c48f21a66 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseNix.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseNix.c
@@ -216,3 +216,8 @@ int startJavaVM( _TCHAR* libPath, _TCHAR* vmArgs[], _TCHAR* progArgs[] )
{
return startJavaJNI(libPath, vmArgs, progArgs);
}
+
+int isSunVM( _TCHAR * vm ) {
+ /* don't know how to decide on this platform */
+ return 0;
+}
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseOS.h b/bundles/org.eclipse.equinox.executable/library/eclipseOS.h
index 1e33cf612..2bb9d2c4d 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseOS.h
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseOS.h
@@ -35,6 +35,7 @@
#define processVMArgs processVMArgsW
#define initialArgv initialArgvW
#define secondThread secondThreadW
+#define isSunVM isSunVMW
#endif
#ifdef MACOSX
@@ -127,5 +128,8 @@ extern int startJavaVM( _TCHAR* libPath, _TCHAR* vmArgs[], _TCHAR* progArgs[] );
/* do any platform specific processing of the user vmargs */
extern void processVMArgs(_TCHAR **vmargs[] );
+/* is this a Sun VM, returns 0 if we don't know */
+extern int isSunVM( _TCHAR * vm );
+
#endif /* ECLIPSE_OS_H */
diff --git a/bundles/org.eclipse.equinox.executable/library/make_version.mak b/bundles/org.eclipse.equinox.executable/library/make_version.mak
index deb3af0a8..29da52300 100644
--- a/bundles/org.eclipse.equinox.executable/library/make_version.mak
+++ b/bundles/org.eclipse.equinox.executable/library/make_version.mak
@@ -10,5 +10,5 @@
#*******************************************************************************
maj_ver=1
-min_ver=016
+min_ver=017
LIB_VERSION = $(maj_ver)$(min_ver)
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c b/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c
index 6fa03dbd5..f7772c9f5 100644
--- a/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c
+++ b/bundles/org.eclipse.equinox.executable/library/win32/eclipseWin.c
@@ -58,6 +58,16 @@ static const _TCHAR* jvmLocations [] = { _T("j9vm"), _T("..\\jre\\bin\\j9vm"),
_T("classic"), _T("..\\jre\\bin\\classic"),
_T("jrockit"), _T("..\\jre\\bin\\jrockit"),
NULL };
+
+/* for detecting sun vms */
+typedef struct {
+ WORD language;
+ WORD codepage;
+} TRANSLATIONS;
+
+#define COMPANY_NAME_KEY _T_ECLIPSE("\\StringFileInfo\\%04x%04x\\CompanyName")
+#define SUN_MICROSYSTEMS _T_ECLIPSE("Sun Microsystems")
+
/* Show the Splash Window
*
* Open the bitmap, insert into the splash window and display it.
@@ -442,3 +452,41 @@ int startJavaVM( _TCHAR* libPath, _TCHAR* vmArgs[], _TCHAR* progArgs[] )
{
return startJavaJNI(libPath, vmArgs, progArgs);
}
+
+int isSunVM( _TCHAR * vm ) {
+ int result = 0;
+ DWORD infoSize;
+ DWORD handle;
+ void * info;
+
+ _TCHAR * key, *value;
+ int i, valueSize;
+
+ if (vm == NULL)
+ return 0;
+
+ infoSize = GetFileVersionInfoSize(vm, &handle);
+ if (infoSize > 0) {
+ info = malloc(infoSize);
+ if (GetFileVersionInfo(vm, 0, infoSize, info)) {
+ TRANSLATIONS * translations;
+ int translationsSize;
+ VerQueryValue(info, _T_ECLIPSE("\\VarFileInfo\\Translation"), (void *) &translations, &translationsSize);
+
+ /* this size is only right because %04x is 4 characters */
+ key = malloc( (_tcslen(COMPANY_NAME_KEY) + 1) * sizeof(_TCHAR));
+ for (i = 0; i < (translationsSize / sizeof(TRANSLATIONS)); i++) {
+ _stprintf(key, COMPANY_NAME_KEY, translations[i].language, translations[i].codepage);
+
+ VerQueryValue(info, key, (void *)&value, &valueSize);
+ if (_tcsncmp(value, SUN_MICROSYSTEMS, _tcslen(SUN_MICROSYSTEMS)) == 0) {
+ result = 1;
+ break;
+ }
+ }
+ free(key);
+ }
+ free(info);
+ }
+ return result;
+}
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/make_mingw.mak b/bundles/org.eclipse.equinox.executable/library/win32/make_mingw.mak
index ff8e9fb21..cd810365b 100644
--- a/bundles/org.eclipse.equinox.executable/library/win32/make_mingw.mak
+++ b/bundles/org.eclipse.equinox.executable/library/win32/make_mingw.mak
@@ -54,7 +54,7 @@ COMMON_OBJS = eclipseConfig.o eclipseCommon.o eclipseWinCommon.o\
DLL_OBJS = eclipse.o eclipseWin.o eclipseUtil.o eclipseJNI.o eclipseShm.o\
aeclipse.o aeclipseWin.o aeclipseUtil.o aeclipseJNI.o aeclipseShm.o
-LIBS = -lkernel32 -luser32 -lgdi32 -lcomctl32 -lmsvcrt
+LIBS = -lkernel32 -luser32 -lgdi32 -lcomctl32 -lmsvcrt -lversion
LDFLAGS = -mwindows -mno-cygwin
CONSOLEFLAGS = -mconsole -mno-cygwin
DLL_LDFLAGS = -mno-cygwin -shared -Wl,--export-all-symbols -Wl,--kill-at
diff --git a/bundles/org.eclipse.equinox.executable/library/win32/make_win32.mak b/bundles/org.eclipse.equinox.executable/library/win32/make_win32.mak
index cf3019293..b12bfe148 100644
--- a/bundles/org.eclipse.equinox.executable/library/win32/make_win32.mak
+++ b/bundles/org.eclipse.equinox.executable/library/win32/make_win32.mak
@@ -34,7 +34,7 @@ DLL_OBJS = eclipse.obj eclipseWin.obj eclipseUtil.obj eclipseJNI.obj eclipseS
aeclipse.obj aeclipseWin.obj aeclipseUtil.obj aeclipseJNI.obj aeclipseShm.obj
LIBS = kernel32.lib user32.lib comctl32.lib msvcrt.lib
-DLL_LIBS = kernel32.lib user32.lib comctl32.lib gdi32.lib Advapi32.lib msvcrt.lib
+DLL_LIBS = kernel32.lib user32.lib comctl32.lib gdi32.lib Advapi32.lib msvcrt.lib version.lib
LFLAGS = /NODEFAULTLIB /INCREMENTAL:NO /RELEASE /NOLOGO -subsystem:windows,4.0 -entry:wmainCRTStartup
CONSOLEFLAGS = /NODEFAULTLIB /INCREMENTAL:NO /RELEASE /NOLOGO -subsystem:console,4.0 -entry:wmainCRTStartup
DLL_LFLAGS = /NODEFAULTLIB /INCREMENTAL:NO /PDB:NONE /RELEASE /NOLOGO -entry:_DllMainCRTStartup@12 -dll /BASE:0x10000000 /DLL
diff --git a/bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp b/bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp
index 94328c761..390cb14a3 100644
--- a/bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp
+++ b/bundles/org.eclipse.equinox.executable/library/wpf/eclipseWpf.cpp
@@ -64,6 +64,14 @@ static const _TCHAR* jvmLocations [] = { _T("j9vm"), _T("..\\jre\\bin\\j9vm"),
_T("classic"), _T("..\\jre\\bin\\classic"),
_T("jrockit"), _T("..\\jre\\bin\\jrockit"),
NULL };
+/* for detecting sun vms */
+typedef struct {
+ WORD language;
+ WORD codepage;
+} TRANSLATIONS;
+
+#define COMPANY_NAME_KEY _T_ECLIPSE("\\StringFileInfo\\%04x%04x\\CompanyName")
+#define SUN_MICROSYSTEMS _T_ECLIPSE("Sun Microsystems")
delegate void NoArgsHandler ();
@@ -513,4 +521,42 @@ int startJavaVM( _TCHAR* libPath, _TCHAR* vmArgs[], _TCHAR* progArgs[] )
return startJavaJNI(libPath, vmArgs, progArgs);
}
+int isSunVM( _TCHAR * vm ) {
+ int result = 0;
+ DWORD infoSize;
+ DWORD handle;
+ void * info;
+
+ _TCHAR * key, *value;
+ int i, valueSize;
+
+ if (vm == NULL)
+ return 0;
+
+ infoSize = GetFileVersionInfoSize(vm, &handle);
+ if (infoSize > 0) {
+ info = malloc(infoSize);
+ if (GetFileVersionInfo(vm, 0, infoSize, info)) {
+ TRANSLATIONS * translations;
+ int translationsSize;
+ VerQueryValue(info, _T_ECLIPSE("\\VarFileInfo\\Translation"), (LPVOID *) &translations, (PUINT)&translationsSize);
+
+ /* this size is only right because %04x is 4 characters */
+ key = (_TCHAR *) malloc( (_tcslen(COMPANY_NAME_KEY) + 1) * sizeof(_TCHAR));
+ for (i = 0; i < (translationsSize / sizeof(TRANSLATIONS)); i++) {
+ _stprintf(key, COMPANY_NAME_KEY, translations[i].language, translations[i].codepage);
+
+ VerQueryValue(info, key, (LPVOID *)&value, (PUINT)&valueSize);
+ if (_tcsncmp(value, SUN_MICROSYSTEMS, _tcslen(SUN_MICROSYSTEMS)) == 0) {
+ result = 1;
+ break;
+ }
+ }
+ free(key);
+ }
+ free(info);
+ }
+ return result;
+}
+
} // extern "C"
diff --git a/bundles/org.eclipse.equinox.executable/library/wpf/make_wpf.mak b/bundles/org.eclipse.equinox.executable/library/wpf/make_wpf.mak
index aa548cb62..2afca3cab 100644
--- a/bundles/org.eclipse.equinox.executable/library/wpf/make_wpf.mak
+++ b/bundles/org.eclipse.equinox.executable/library/wpf/make_wpf.mak
@@ -31,7 +31,7 @@ COMMON_OBJS = eclipseConfig.obj eclipseCommon.obj eclipseWpfCommon.obj
DLL_OBJS = eclipse.obj eclipseWpf.obj eclipseUtil.obj eclipseJNI.obj eclipseShm.obj
LIBS = kernel32.lib msvcrt.lib mscoree.lib
-DLL_LIBS = kernel32.lib Advapi32.lib msvcrt.lib
+DLL_LIBS = kernel32.lib Advapi32.lib msvcrt.lib version.lib
LFLAGS = -CLRTHREADATTRIBUTE:STA /NODEFAULTLIB:LIBCMT /INCREMENTAL:NO /RELEASE /NOLOGO -subsystem:windows,4.0 -entry:wmainCRTStartup
CONSOLEFLAGS = -CLRTHREADATTRIBUTE:STA /NODEFAULTLIB:LIBCMT /INCREMENTAL:NO /RELEASE /NOLOGO -subsystem:console,4.0 -entry:wmainCRTStartup
DLL_LFLAGS = -CLRTHREADATTRIBUTE:STA /NODEFAULTLIB:LIBCMT /INCREMENTAL:NO /PDB:NONE -dll /BASE:0x10000000 /DLL

Back to the top