Ben Konrath f014554
### Eclipse Workspace Patch 1.0
Ben Konrath f014554
#P platform-launcher
Ben Konrath f014554
Index: library/eclipseConfig.c
Ben Konrath f014554
===================================================================
Ben Konrath f014554
RCS file: /cvsroot/eclipse/platform-launcher/library/eclipseConfig.c,v
Ben Konrath f014554
retrieving revision 1.11
Ben Konrath f014554
diff -u -r1.11 eclipseConfig.c
Ben Konrath f014554
--- library/eclipseConfig.c	15 Apr 2005 19:17:10 -0000	1.11
Ben Konrath f014554
+++ library/eclipseConfig.c	25 Oct 2006 22:10:20 -0000
Ben Konrath f014554
@@ -30,8 +30,11 @@
Ben Konrath f014554
 
Ben Konrath f014554
 #endif
Ben Konrath f014554
 
Ben Konrath f014554
-int readConfigFile(_TCHAR* program, _TCHAR* arg0, int *argc, _TCHAR ***argv) 
Ben Konrath f014554
+/* installDir must end in path separator */
Ben Konrath f014554
+int readConfigFile(_TCHAR* installDir, _TCHAR* arg0, int *argc, _TCHAR ***argv) 
Ben Konrath f014554
 {
Ben Konrath f014554
+	_TCHAR* temp;
Ben Konrath f014554
+	_TCHAR* programName;
Ben Konrath f014554
 	_TCHAR* config_file = NULL;
Ben Konrath f014554
 	_TCHAR buffer[1024];
Ben Konrath f014554
 	_TCHAR argument[1024];
Ben Konrath f014554
@@ -39,11 +42,20 @@
Ben Konrath f014554
 	int maxArgs = 128;
Ben Konrath f014554
 	int index;
Ben Konrath f014554
 	
Ben Konrath f014554
-	if (program == NULL || argc == NULL || argv == NULL) return -1;
Ben Konrath f014554
-
Ben Konrath f014554
-	/* Get a copy */
Ben Konrath f014554
-	config_file = _tcsdup(program);
Ben Konrath f014554
+	if (installDir == NULL || argc == NULL || argv == NULL) return -1;
Ben Konrath f014554
 	
Ben Konrath f014554
+    /* Determine the name of the executable */
Ben Konrath f014554
+	temp = malloc( (_tcslen( arg0 ) + 1) * sizeof(_TCHAR) );
Ben Konrath f014554
+    _tcscpy( temp, arg0 );
Ben Konrath f014554
+    programName = _tcsrchr( temp, dirSeparator );
Ben Konrath f014554
+	if (programName == NULL)
Ben Konrath f014554
+		programName = temp;		
Ben Konrath f014554
+	else 
Ben Konrath f014554
+		programName++;
Ben Konrath f014554
+		
Ben Konrath f014554
+	/* Get a copy */
Ben Konrath f014554
+	config_file = _tcsdup(installDir);
Ben Konrath f014554
+
Ben Konrath f014554
 #ifdef _WIN32
Ben Konrath f014554
 	{
Ben Konrath f014554
 		/* Search for the extension .exe and replace it with .ini */
Ben Konrath f014554
@@ -57,8 +69,11 @@
Ben Konrath f014554
 	}
Ben Konrath f014554
 #else
Ben Konrath f014554
 	/* Append the extension */
Ben Konrath f014554
-	config_file = (char*)realloc(config_file, strlen(config_file) + 5);
Ben Konrath f014554
-	strcat(config_file, ".ini");
Ben Konrath f014554
+	config_file = (char*)realloc(config_file, strlen(config_file) + strlen(programName) + 5);
Ben Konrath f014554
+	strcat(config_file, programName);
Ben Konrath f014554
+	free(temp);
Ben Konrath f014554
+	programName = NULL;
Ben Konrath f014554
+	strcat(config_file, ".ini");
Ben Konrath f014554
 #endif
Ben Konrath f014554
 	
Ben Konrath f014554
 	/* Open the config file as a text file 
Ben Konrath f014554
Index: library/eclipse.c
Ben Konrath f014554
===================================================================
Ben Konrath f014554
RCS file: /cvsroot/eclipse/platform-launcher/library/eclipse.c,v
Ben Konrath f014554
retrieving revision 1.71
Ben Konrath f014554
diff -u -r1.71 eclipse.c
Ben Konrath f014554
--- library/eclipse.c	25 Apr 2006 14:31:50 -0000	1.71
Ben Konrath f014554
+++ library/eclipse.c	25 Oct 2006 22:10:20 -0000
Ben Konrath f014554
@@ -295,7 +295,8 @@
Ben Konrath f014554
 
Ben Konrath f014554
 /* Define the required VM arguments (all platforms). */
Ben Konrath f014554
 static _TCHAR* jar = _T_ECLIPSE("-jar");
Ben Konrath f014554
-static _TCHAR**  reqVMarg[] = { &jar, &jarFile, NULL };
Ben Konrath f014554
+static _TCHAR* sharedConfigurationDir = _T_ECLIPSE("-Dosgi.sharedConfiguration.area=/usr/lib/eclipse/configuration");
Ben Konrath f014554
+static _TCHAR**  reqVMarg[] = { &sharedConfigurationDir, &jar, &jarFile, NULL };
Ben Konrath f014554
 
Ben Konrath f014554
 /* Local methods */
Ben Konrath f014554
 static int createUserArgs(int configArgc, _TCHAR **configArgv, int *argc, _TCHAR ***argv);
Ben Konrath f014554
@@ -387,8 +388,19 @@
Ben Konrath f014554
 #endif
Ben Konrath f014554
     }
Ben Konrath f014554
 	
Ben Konrath f014554
+    /* Find the directory where Eclipse is installed. */
Ben Konrath f014554
+    programDir = getProgramDir();
Ben Konrath f014554
+    if (programDir == NULL)
Ben Konrath f014554
+    {
Ben Konrath f014554
+        errorMsg = malloc( (_tcslen(homeMsg) + _tcslen(officialName) + 10) * sizeof(_TCHAR) );
Ben Konrath f014554
+        _stprintf( errorMsg, homeMsg, officialName );
Ben Konrath f014554
+        displayMessage( officialName, errorMsg );
Ben Konrath f014554
+        free( errorMsg );
Ben Konrath f014554
+    	exit( 1 );
Ben Konrath f014554
+    }
Ben Konrath f014554
+
Ben Konrath f014554
 	/* Parse configuration file arguments */
Ben Konrath f014554
-	if (isMainEclipse(argc, argv) && readConfigFile(program, argv[0], &configArgc, &configArgv) == 0)
Ben Konrath f014554
+	if (isMainEclipse(argc, argv) && readConfigFile(programDir, argv[0], &configArgc, &configArgv) == 0)
Ben Konrath f014554
 	{
Ben Konrath f014554
 		parseArgs (&configArgc, configArgv);
Ben Konrath f014554
 	}
Ben Konrath f014554
@@ -411,17 +423,6 @@
Ben Konrath f014554
     /* Initialize the window system. */
Ben Konrath f014554
     initWindowSystem( &argc, argv, (showSplashArg != NULL) );
Ben Konrath f014554
 
Ben Konrath f014554
-    /* Find the directory where the Eclipse program is installed. */
Ben Konrath f014554
-    programDir = getProgramDir();
Ben Konrath f014554
-    if (programDir == NULL)
Ben Konrath f014554
-    {
Ben Konrath f014554
-        errorMsg = malloc( (_tcslen(homeMsg) + _tcslen(officialName) + 10) * sizeof(_TCHAR) );
Ben Konrath f014554
-        _stprintf( errorMsg, homeMsg, officialName );
Ben Konrath f014554
-        displayMessage( officialName, errorMsg );
Ben Konrath f014554
-        free( errorMsg );
Ben Konrath f014554
-    	exit( 1 );
Ben Konrath f014554
-    }
Ben Konrath f014554
-
Ben Konrath f014554
     /* If the exit data option was given, set exit data */
Ben Konrath f014554
     if (exitDataArg != NULL)
Ben Konrath f014554
     {
Ben Konrath f014554
@@ -1078,19 +1079,12 @@
Ben Konrath f014554
  */
Ben Konrath f014554
 _TCHAR* getProgramDir( )
Ben Konrath f014554
 {
Ben Konrath f014554
-	_TCHAR*  ch;
Ben Konrath f014554
 	_TCHAR*  programDir;
Ben Konrath f014554
+	_TCHAR* temp = _T_ECLIPSE("/usr/share/eclipse/");
Ben Konrath f014554
 
Ben Konrath f014554
-    programDir = malloc( (_tcslen( program ) + 1) * sizeof(_TCHAR) );
Ben Konrath f014554
-    _tcscpy( programDir, program );
Ben Konrath f014554
-    ch = _tcsrchr( programDir, dirSeparator );
Ben Konrath f014554
-	if (ch != NULL)
Ben Konrath f014554
-    {
Ben Konrath f014554
-    	*(ch+1) = _T_ECLIPSE('\0');
Ben Konrath f014554
-   		return programDir;
Ben Konrath f014554
-    }
Ben Konrath f014554
-
Ben Konrath f014554
-    free( programDir );
Ben Konrath f014554
-    return NULL;
Ben Konrath f014554
+    programDir = malloc( (_tcslen( temp + 1 )) * sizeof(_TCHAR) );
Ben Konrath f014554
+    _tcscpy( programDir, temp );
Ben Konrath f014554
+   	return programDir;
Ben Konrath f014554
 }
Ben Konrath f014554
 
Ben Konrath f014554
+
Ben Konrath f014554
Index: library/gtk/make_linux.mak
Ben Konrath f014554
===================================================================
Ben Konrath f014554
RCS file: /cvsroot/eclipse/platform-launcher/library/gtk/make_linux.mak,v
Ben Konrath f014554
retrieving revision 1.11
Ben Konrath f014554
diff -u -r1.11 make_linux.mak
Ben Konrath f014554
--- library/gtk/make_linux.mak	9 Mar 2006 19:01:05 -0000	1.11
Ben Konrath f014554
+++ library/gtk/make_linux.mak	25 Oct 2006 22:10:20 -0000
Ben Konrath f014554
@@ -27,7 +27,7 @@
Ben Konrath f014554
 OBJS = eclipse.o eclipseUtil.o eclipseShm.o eclipseConfig.o eclipseMozilla.o eclipseGtk.o
Ben Konrath f014554
 EXEC = $(PROGRAM_OUTPUT)
Ben Konrath f014554
 LIBS = `pkg-config --libs-only-L gtk+-2.0` -lgtk-x11-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lgdk-x11-2.0
Ben Konrath f014554
-CFLAGS = -O -s \
Ben Konrath f014554
+CFLAGS = -O -s -g \
Ben Konrath f014554
 	-fpic \
Ben Konrath f014554
 	-DLINUX \
Ben Konrath f014554
 	-DMOZILLA_FIX \