diff options
author | 2015-04-09 20:11:35 +0000 | |
---|---|---|
committer | 2015-04-10 08:02:25 +0000 | |
commit | 6379d2e4dc41bf32dfada75a001c39684083acd6 (patch) | |
tree | 77c3dc78d160091c3696af0100ad75190b83fd35 /src/main/cpp/blaze_startup_options.cc | |
parent | 9b43c60e9a82d5435a0bb9807c15d701500d739b (diff) |
Fix the compilation of blaze_startup_options.cc on old Ubuntu systems.
Ubuntu LTS has a gcc version that generates broken code for certain newer C++
constructs. Change the code to avoid those constructs.
Fixes #68.
--
Change-Id: 4a0420a6c996d0e7785e5cdf39bbd0602472449f
MOS_MIGRATED_REVID=90739507
Diffstat (limited to 'src/main/cpp/blaze_startup_options.cc')
-rw-r--r-- | src/main/cpp/blaze_startup_options.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main/cpp/blaze_startup_options.cc b/src/main/cpp/blaze_startup_options.cc index 0bb1c0860d..ed60add08f 100644 --- a/src/main/cpp/blaze_startup_options.cc +++ b/src/main/cpp/blaze_startup_options.cc @@ -126,15 +126,13 @@ string BlazeStartupOptions::GetJvm() { } exit(1); } - for (string rt_jar : { - // If the full JDK is installed - GetHostJavabase() + "/jre/lib/rt.jar", - // If just the JRE is installed - GetHostJavabase() + "/lib/rt.jar" - }) { - if (access(rt_jar.c_str(), R_OK) == 0) { - return java_program; - } + // If the full JDK is installed + string jdk_rt_jar = GetHostJavabase() + "/jre/lib/rt.jar"; + // If just the JRE is installed + string jre_rt_jar = GetHostJavabase() + "/lib/rt.jar"; + if ((access(jdk_rt_jar.c_str(), R_OK) == 0) + || (access(jre_rt_jar.c_str(), R_OK) == 0)) { + return java_program; } fprintf(stderr, "Problem with java installation: " "couldn't find/access rt.jar in %s\n", GetHostJavabase().c_str()); |