Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2007-01-30 23:46:30 +0000
committerAndrew Niefer2007-01-30 23:46:30 +0000
commit9c964f1d859ad377a5f69faba4a373f5f00d1bc3 (patch)
tree44267201a4ca4c50f9ecf65a0585b201df285157 /bundles/org.eclipse.equinox.executable/library/motif
parent62915ffa181b27eca8acff582cd3fd730aa97193 (diff)
downloadrt.equinox.framework-9c964f1d859ad377a5f69faba4a373f5f00d1bc3.tar.gz
rt.equinox.framework-9c964f1d859ad377a5f69faba4a373f5f00d1bc3.tar.xz
rt.equinox.framework-9c964f1d859ad377a5f69faba4a373f5f00d1bc3.zip
choosing a vm & reading .ee files
Diffstat (limited to 'bundles/org.eclipse.equinox.executable/library/motif')
-rw-r--r--bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c139
-rw-r--r--bundles/org.eclipse.equinox.executable/library/motif/make_aix.mak9
-rw-r--r--bundles/org.eclipse.equinox.executable/library/motif/make_hpux_PA_RISC.mak11
-rw-r--r--bundles/org.eclipse.equinox.executable/library/motif/make_hpux_ia64_32.mak9
-rw-r--r--bundles/org.eclipse.equinox.executable/library/motif/make_linux.mak6
-rw-r--r--bundles/org.eclipse.equinox.executable/library/motif/make_solaris.mak6
6 files changed, 33 insertions, 147 deletions
diff --git a/bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c b/bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c
index 53a4cc151..3237fc9d1 100644
--- a/bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c
+++ b/bundles/org.eclipse.equinox.executable/library/motif/eclipseMotif.c
@@ -52,23 +52,6 @@ static char* argVM_JAVA_AIX131[] = { "-Xquickstart", NULL };
#endif
static char* argVM_J9[] = { "-jit", "-mca:1024", "-mco:1024", "-mn:256", "-mo:4096",
"-moi:16384", "-mx:262144", "-ms:16", "-mr:16", NULL };
-
-#ifdef i386
-#define JAVA_ARCH "i386"
-#elif defined(__ppc__)
-#define JAVA_ARCH "ppc"
-#elif defined(SOLARIS)
-#define JAVA_ARCH "sparc"
-#else
-#define JAVA_ARCH DEFAULT_OS_ARCH
-#endif
-
-#define MAX_LOCATION_LENGTH 3330 /* none of the jvmLocations strings should be longer than this */
-static const char* jvmLocations [] = { "j9vm",
- "classic",
- "../lib/" JAVA_ARCH "/client",
- "../lib/" JAVA_ARCH "/server",
- NULL };
/* Define local variables for the main window. */
extern XtAppContext appContext;
@@ -82,9 +65,6 @@ static Widget shellHandle = 0;
extern void centreShell( Widget widget, Widget expose );
-static void adjustLibraryPath( char * vmLibrary );
-static char * findLib(char * command);
-
#ifdef NETSCAPE_FIX
static void fixEnvForNetscape();
#endif /* NETSCAPE_FIX */
@@ -284,127 +264,8 @@ static void fixEnvForNetscape()
free( netscapePath );
free( netscapeResource );
}
-
}
#endif /* NETSCAPE_FIX */
-char * findVMLibrary( char* command ) {
- char * lib = findLib(command);
- if( lib != NULL ) {
- adjustLibraryPath(lib);
- }
- return lib;
-}
-static char * findLib(char * command) {
- int i;
- int pathLength;
- struct stat stats;
- char * path; /* path to resulting jvm shared library */
- char * location; /* points to begining of jvmLocations section of path */
-
- if (command != NULL) {
- location = strrchr( command, dirSeparator ) + 1;
-
- /*check first to see if command already points to the library */
- if (strcmp(location, vmLibrary) == 0) {
- return command;
- }
-
- pathLength = location - command;
- path = malloc((pathLength + MAX_LOCATION_LENGTH + 1 + strlen(vmLibrary) + 1) * sizeof(char));
- strncpy(path, command, pathLength);
- location = &path[pathLength];
-
- /*
- * We are trying base/jvmLocations[*]/vmLibrary
- * where base is the directory containing the given java command, normally jre/bin
- */
- i = -1;
- while(jvmLocations[++i] != NULL) {
- int length = strlen(jvmLocations[i]);
- strcpy(location, jvmLocations[i]);
- location[length] = dirSeparator;
- location[length + 1] = 0;
- strcat(location, vmLibrary);
- if (stat( path, &stats ) == 0 && (stats.st_mode & S_IFREG) != 0)
- { /* found it */
- return path;
- }
- }
- }
- return NULL;
-}
-
-/* adjust the LD_LIBRARY_PATH for the vmLibrary */
-static void adjustLibraryPath( char * vmLibrary ) {
- char * buffer;
- char * path;
- char * c;
- char * vmPath;
- char * vmParent;
- char * ldPath;
- char * newPath;
- int vmPathFound = 0;
- int vmParentFound = 0;
- int ldPathLength = 0;
-
-#ifdef MOZILLA_FIX
- fixEnvForMozilla();
-#endif /* MOZILLA_FIX */
-
- /* we want the directory containing the library, and the parent directory of that */
- buffer = strdup(vmLibrary);
- c = strrchr(buffer, dirSeparator);
- *c = 0;
- vmPath = strdup(buffer);
-
- c = strrchr(buffer, dirSeparator);
- *c = 0;
- vmParent = strdup(buffer);
- free(buffer);
-
- ldPath = (char*)getenv("LD_LIBRARY_PATH");
- if(!ldPath)
- ldPath = "";
- buffer = malloc((strlen(ldPath) + 2) * sizeof(char));
- strcpy(buffer, ldPath);
- strcat(buffer, ":");
- path = buffer;
- while( (c = strchr(path, pathSeparator)) != NULL ) {
- *c++ = 0;
- if( !vmPathFound && strcmp(path, vmPath) == 0 ) {
- vmPathFound = 1;
- } else if( !vmParentFound && strcmp(path, vmParent) == 0 ) {
- vmParentFound = 1;
- }
- if(vmPathFound && vmParentFound)
- break;
- path = c;
- }
- free(buffer);
-
- if( vmPathFound && vmParentFound ){
- /*found both on the LD_LIBRARY_PATH, don't need to set it */
- return;
- }
-
- /* set the value for LD_LIBRARY_PATH */
- ldPathLength = strlen(ldPath);
- /* ldPath + separator + vmPath + separator + vmParent + NULL */
- newPath = malloc((ldPathLength + 1 + strlen(vmPath) + 1 + strlen(vmParent) + 1) * sizeof(char));
- strcpy(newPath, vmPath);
- strncat(newPath, &pathSeparator, 1);
- strcat(newPath, vmParent);
- strncat(newPath, &pathSeparator, 1);
- strcat(newPath, ldPath);
- setenv( "LD_LIBRARY_PATH", newPath, 1);
-
- free(vmPath);
- free(vmParent);
-
- /* now we must restart for this to take affect */
- /* TODO what args do we restart with? */
- execv(initialArgv[0], initialArgv);
-}
void restartLauncher( char* program, char* args[] )
{
diff --git a/bundles/org.eclipse.equinox.executable/library/motif/make_aix.mak b/bundles/org.eclipse.equinox.executable/library/motif/make_aix.mak
index 0eb97fbe2..5fa1d0da8 100644
--- a/bundles/org.eclipse.equinox.executable/library/motif/make_aix.mak
+++ b/bundles/org.eclipse.equinox.executable/library/motif/make_aix.mak
@@ -28,10 +28,10 @@ PROGRAM_LIBRARY=eclipse_$(LIB_VERSION).so
CC = cc_r
# Define the object modules to be compiled and flags.
-#OBJS = eclipse.o eclipseUtil.o eclipseShm.o eclipseConfig.o eclipseMotif.o NgCommon.o NgImage.o NgImageData.o NgWinBMPFileFormat.o
MAIN_OBJS = eclipseMain.o
COMMON_OBJS = eclipseConfig.o eclipseCommon.o eclipseMotifCommon.o
-DLL_OBJS = eclipse.o eclipseMotif.o eclipseUtil.o eclipseJNI.o NgCommon.o NgImage.o NgImageData.o NgWinBMPFileFormat.o eclipseShm.o
+DLL_OBJS = eclipse.o eclipseMotif.o eclipseUtil.o eclipseJNI.o eclipseShm.o eclipseNix.o\
+ NgCommon.o NgImage.o NgImageData.o NgWinBMPFileFormat.o
EXEC = $(PROGRAM_OUTPUT)
DLL = $(PROGRAM_LIBRARY)
@@ -74,7 +74,10 @@ eclipseConfig.o: ../eclipseConfig.c ../eclipseConfig.h ../eclipseOS.h
eclipseShm.o: ../eclipseShm.h ../eclipseUnicode.h ../eclipseShm.c
$(CC) $(CFLAGS) -c $< -o $@
-
+
+eclipseNix.o: ../eclipseNix.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
$(EXEC): $(MAIN_OBJS) $(COMMON_OBJS)
$(CC) -o $(EXEC) $(MAIN_OBJS) $(COMMON_OBJS) $(LIBS)
diff --git a/bundles/org.eclipse.equinox.executable/library/motif/make_hpux_PA_RISC.mak b/bundles/org.eclipse.equinox.executable/library/motif/make_hpux_PA_RISC.mak
index 98bd3707a..d09d9efe2 100644
--- a/bundles/org.eclipse.equinox.executable/library/motif/make_hpux_PA_RISC.mak
+++ b/bundles/org.eclipse.equinox.executable/library/motif/make_hpux_PA_RISC.mak
@@ -30,7 +30,8 @@ PROGRAM_LIBRARY=eclipse_$(LIB_VERSION).so
# Define the object modules to be compiled and flags.
MAIN_OBJS = eclipseMain.o
COMMON_OBJS = eclipseConfig.o eclipseCommon.o eclipseMotifCommon.o
-DLL_OBJS = eclipse.o eclipseMotif.o eclipseUtil.o eclipseJNI.o NgCommon.o NgImage.o NgImageData.o NgWinBMPFileFormat.o
+DLL_OBJS = eclipse.o eclipseMotif.o eclipseUtil.o eclipseJNI.o eclipseNix.o eclipseShm.o\
+ NgCommon.o NgImage.o NgImageData.o NgWinBMPFileFormat.o
EXEC = $(PROGRAM_OUTPUT)
DLL = $(PROGRAM_LIBRARY)
@@ -72,7 +73,13 @@ eclipseJNI.o: ../eclipseJNI.c ../eclipseCommon.h ../eclipseOS.h ../eclipseJNI.h
eclipseConfig.o: ../eclipseConfig.c ../eclipseConfig.h ../eclipseOS.h
$(CC) $(CFLAGS) -c ../eclipseConfig.c -o $@
-
+
+eclipseShm.o: ../eclipseShm.h ../eclipseUnicode.h ../eclipseShm.c
+ $(CC) $(CFLAGS) -c ../eclipseShm.c -o $@
+
+eclipseNix.o: ../eclipseNix.c
+ $(CC) $(CFLAGS) -c ../eclipseNix.c -o $@
+
$(EXEC): $(MAIN_OBJS) $(COMMON_OBJS)
$(CC) -o $(EXEC) $(MAIN_OBJS) $(COMMON_OBJS) $(LIBS)
diff --git a/bundles/org.eclipse.equinox.executable/library/motif/make_hpux_ia64_32.mak b/bundles/org.eclipse.equinox.executable/library/motif/make_hpux_ia64_32.mak
index d5fbebcdf..39de805a4 100644
--- a/bundles/org.eclipse.equinox.executable/library/motif/make_hpux_ia64_32.mak
+++ b/bundles/org.eclipse.equinox.executable/library/motif/make_hpux_ia64_32.mak
@@ -31,7 +31,8 @@ PROGRAM_LIBRARY=eclipse_$(LIB_VERSION).so
# Define the object modules to be compiled and flags.
MAIN_OBJS = eclipseMain.o
COMMON_OBJS = eclipseConfig.o eclipseCommon.o eclipseMotifCommon.o
-DLL_OBJS = eclipse.o eclipseMotif.o eclipseUtil.o eclipseJNI.o NgCommon.o NgImage.o NgImageData.o NgWinBMPFileFormat.o
+DLL_OBJS = eclipse.o eclipseMotif.o eclipseUtil.o eclipseJNI.o eclipseNix.o eclipseShm.o \
+ NgCommon.o NgImage.o NgImageData.o NgWinBMPFileFormat.o
EXEC = $(PROGRAM_OUTPUT)
DLL = $(PROGRAM_LIBRARY)
@@ -71,6 +72,12 @@ eclipseJNI.o: ../eclipseJNI.c ../eclipseCommon.h ../eclipseOS.h ../eclipseJNI.h
eclipseConfig.o: ../eclipseConfig.c ../eclipseConfig.h ../eclipseOS.h
$(CC) $(CFLAGS) -c ../eclipseConfig.c -o $@
+
+eclipseShm.o: ../eclipseShm.h ../eclipseUnicode.h ../eclipseShm.c
+ $(CC) $(CFLAGS) -c ../eclipseShm.c -o $@
+
+eclipseNix.o: ../eclipseNix.c
+ $(CC) $(CFLAGS) -c ../eclipseNix.c -o $@
$(EXEC): $(MAIN_OBJS) $(COMMON_OBJS)
$(CC) -o $(EXEC) $(MAIN_OBJS) $(COMMON_OBJS) $(LIBS)
diff --git a/bundles/org.eclipse.equinox.executable/library/motif/make_linux.mak b/bundles/org.eclipse.equinox.executable/library/motif/make_linux.mak
index c9b83e89c..1c0ab8594 100644
--- a/bundles/org.eclipse.equinox.executable/library/motif/make_linux.mak
+++ b/bundles/org.eclipse.equinox.executable/library/motif/make_linux.mak
@@ -33,7 +33,8 @@ PROGRAM_LIBRARY=eclipse_$(LIB_VERSION).so
CC=gcc
MAIN_OBJS = eclipseMain.o
COMMON_OBJS = eclipseConfig.o eclipseCommon.o eclipseMotifCommon.o
-DLL_OBJS = eclipse.o eclipseMotif.o eclipseUtil.o eclipseJNI.o eclipseMozilla.o NgCommon.o NgImage.o NgImageData.o NgWinBMPFileFormat.o eclipseShm.o
+DLL_OBJS = eclipse.o eclipseMotif.o eclipseUtil.o eclipseJNI.o eclipseMozilla.o eclipseShm.o eclipseNix.o \
+ NgCommon.o NgImage.o NgImageData.o NgWinBMPFileFormat.o
EXEC = $(PROGRAM_OUTPUT)
DLL = $(PROGRAM_LIBRARY)
@@ -81,6 +82,9 @@ eclipseMozilla.o: ../eclipseMozilla.c ../eclipseMozilla.h ../eclipseOS.h
eclipseShm.o: ../eclipseShm.h ../eclipseUnicode.h ../eclipseShm.c
$(CC) $(CFLAGS) -c $< -o $@
+eclipseNix.o: ../eclipseNix.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
$(EXEC): $(MAIN_OBJS) $(COMMON_OBJS)
$(CC) -o $(EXEC) $(MAIN_OBJS) $(COMMON_OBJS) $(LIBS)
diff --git a/bundles/org.eclipse.equinox.executable/library/motif/make_solaris.mak b/bundles/org.eclipse.equinox.executable/library/motif/make_solaris.mak
index b9293a9f5..dfda68dc8 100644
--- a/bundles/org.eclipse.equinox.executable/library/motif/make_solaris.mak
+++ b/bundles/org.eclipse.equinox.executable/library/motif/make_solaris.mak
@@ -31,7 +31,8 @@ PROGRAM_LIBRARY=eclipse_$(LIB_VERSION).so
# Define the object modules to be compiled and flags.
MAIN_OBJS = eclipseMain.o
COMMON_OBJS = eclipseConfig.o eclipseCommon.o eclipseMotifCommon.o
-DLL_OBJS = eclipse.o eclipseMotif.o eclipseUtil.o eclipseJNI.o NgCommon.o NgImage.o NgImageData.o NgWinBMPFileFormat.o eclipseShm.o
+DLL_OBJS = eclipse.o eclipseMotif.o eclipseUtil.o eclipseJNI.o eclipseShm.o eclipseNix.o\
+ NgCommon.o NgImage.o NgImageData.o NgWinBMPFileFormat.o
EXEC = $(PROGRAM_OUTPUT)
DLL = $(PROGRAM_LIBRARY)
@@ -76,6 +77,9 @@ eclipseConfig.o: ../eclipseConfig.c ../eclipseConfig.h ../eclipseOS.h
eclipseShm.o: ../eclipseShm.h ../eclipseUnicode.h ../eclipseShm.c
$(CC) $(CFLAGS) -c $^ -o $@
+eclipseNix.o: ../eclipseNix.c
+ $(CC) $(CFLAGS) -c $^ -o $@
+
$(EXEC): $(MAIN_OBJS) $(COMMON_OBJS)
$(CC) -o $(EXEC) $(MAIN_OBJS) $(COMMON_OBJS) $(LIBS)

Back to the top