*/
if (ReadKnownVMs(jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), JNI_TRUE) < 1) {
goto EndDataModelSpeculate;
}
jvmpath[0] = '\0';
jvmtype = CheckJvmType(_argcp, _argvp, JNI_TRUE);
/* exec child can do error checking on the existence of the path */
jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath,
((wanted==64)?LIBARCH64NAME:LIBARCH32NAME));
}
EndDataModelSpeculate: /* give up and let other code report error message */
;
#else
fprintf(stderr, "Running a %d-bit JVM is not supported on this platform.\n", wanted);
exit(1);
#endif
}
/*
* We will set the LD_LIBRARY_PATH as follows:
*
* o $JVMPATH (directory portion only)
* o $JRE/lib/$LIBARCHNAME
* o $JRE/../lib/$LIBARCHNAME
*
* followed by the user's previous effective LD_LIBRARY_PATH, if
* any.
*/
#ifdef __sun
/*
* Starting in Solaris 7, ld.so.1 supports three LD_LIBRARY_PATH
* variables:
*
* 1. LD_LIBRARY_PATH -- used for 32 and 64 bit searches if
* data-model specific variables are not set.
*
* 2. LD_LIBRARY_PATH_64 -- overrides and replaces LD_LIBRARY_PATH
* for 64-bit binaries.
*
* 3. LD_LIBRARY_PATH_32 -- overrides and replaces LD_LIBRARY_PATH
* for 32-bit binaries.
*
* The vm uses LD_LIBRARY_PATH to set the java.library.path system
* property. To shield the vm from the complication of multiple
* LD_LIBRARY_PATH variables, if the appropriate data model
* specific variable is set, we will act as if LD_LIBRARY_PATH had
* the value of the data model specific variant and the data model
* specific variant will be unset. Note that the variable for the
* *wanted* data model must be used (if it is set), not simply the
* current running data model.
*/
switch(wanted) {
case 0:
if(running == 32) {
dmpath = getenv("LD_LIBRARY_PATH_32");
wanted = 32;
}
else {
dmpath = getenv("LD_LIBRARY_PATH_64");
wanted = 64;
}
break;
case 32:
dmpath = getenv("LD_LIBRARY_PATH_32");
break;
case 64:
dmpath = getenv("LD_LIBRARY_PATH_64");
break;
default:
fprintf(stderr, "Improper value at line %d.", __LINE__);
exit(1); /* unknown value in wanted */
break;
}
/*
* If dmpath is NULL, the relevant data model specific variable is
* not set and normal LD_LIBRARY_PATH should be used.
*/
if( dmpath == NULL) {
runpath = getenv("LD_LIBRARY_PATH");
}
else {
runpath = dmpath;
}
#else
/*
* If not on Solaris, assume only a single LD_LIBRARY_PATH
* variable.
*/
runpath = getenv("LD_LIBRARY_PATH");
#endif /* __sun */
#ifdef __linux
/*
=4= |