5423 } |
5423 } |
5424 } |
5424 } |
5425 |
5425 |
5426 // is_headless_jre() |
5426 // is_headless_jre() |
5427 // |
5427 // |
5428 // Test for the existence of libmawt in motif21 or xawt directories |
5428 // Test for the existence of xawt/libmawt.so or libawt_xawt.so |
5429 // in order to report if we are running in a headless jre |
5429 // in order to report if we are running in a headless jre |
|
5430 // |
|
5431 // Since JDK8 xawt/libmawt.so was moved into the same directory |
|
5432 // as libawt.so, and renamed libawt_xawt.so |
5430 // |
5433 // |
5431 bool os::is_headless_jre() { |
5434 bool os::is_headless_jre() { |
5432 struct stat statbuf; |
5435 struct stat statbuf; |
5433 char buf[MAXPATHLEN]; |
5436 char buf[MAXPATHLEN]; |
5434 char libmawtpath[MAXPATHLEN]; |
5437 char libmawtpath[MAXPATHLEN]; |
5435 const char *xawtstr = "/xawt/libmawt.so"; |
5438 const char *xawtstr = "/xawt/libmawt.so"; |
5436 const char *motifstr = "/motif21/libmawt.so"; |
5439 const char *new_xawtstr = "/libawt_xawt.so"; |
5437 char *p; |
5440 char *p; |
5438 |
5441 |
5439 // Get path to libjvm.so |
5442 // Get path to libjvm.so |
5440 os::jvm_path(buf, sizeof(buf)); |
5443 os::jvm_path(buf, sizeof(buf)); |
5441 |
5444 |
5452 // check xawt/libmawt.so |
5455 // check xawt/libmawt.so |
5453 strcpy(libmawtpath, buf); |
5456 strcpy(libmawtpath, buf); |
5454 strcat(libmawtpath, xawtstr); |
5457 strcat(libmawtpath, xawtstr); |
5455 if (::stat(libmawtpath, &statbuf) == 0) return false; |
5458 if (::stat(libmawtpath, &statbuf) == 0) return false; |
5456 |
5459 |
5457 // check motif21/libmawt.so |
5460 // check libawt_xawt.so |
5458 strcpy(libmawtpath, buf); |
5461 strcpy(libmawtpath, buf); |
5459 strcat(libmawtpath, motifstr); |
5462 strcat(libmawtpath, new_xawtstr); |
5460 if (::stat(libmawtpath, &statbuf) == 0) return false; |
5463 if (::stat(libmawtpath, &statbuf) == 0) return false; |
5461 |
5464 |
5462 return true; |
5465 return true; |
5463 } |
5466 } |
5464 |
5467 |