OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/base_paths.h" | 5 #include "base/base_paths.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #elif defined(OS_SOLARIS) | 61 #elif defined(OS_SOLARIS) |
62 char bin_dir[PATH_MAX + 1]; | 62 char bin_dir[PATH_MAX + 1]; |
63 if (realpath(getexecname(), bin_dir) == NULL) { | 63 if (realpath(getexecname(), bin_dir) == NULL) { |
64 NOTREACHED() << "Unable to resolve " << getexecname() << "."; | 64 NOTREACHED() << "Unable to resolve " << getexecname() << "."; |
65 return false; | 65 return false; |
66 } | 66 } |
67 *result = FilePath(bin_dir); | 67 *result = FilePath(bin_dir); |
68 return true; | 68 return true; |
69 #elif defined(OS_OPENBSD) | 69 #elif defined(OS_OPENBSD) |
70 // There is currently no way to get the executable path on OpenBSD | 70 // There is currently no way to get the executable path on OpenBSD |
71 *result = FilePath("/usr/local/chrome/chrome"); | 71 char *cpath; |
| 72 if ((cpath = getenv("CHROME_EXE_PATH")) != NULL) |
| 73 *result = FilePath(cpath); |
| 74 else |
| 75 *result = FilePath("/usr/local/chrome/chrome"); |
72 return true; | 76 return true; |
73 #endif | 77 #endif |
74 } | 78 } |
75 case base::DIR_SOURCE_ROOT: { | 79 case base::DIR_SOURCE_ROOT: { |
76 // Allow passing this in the environment, for more flexibility in build | 80 // Allow passing this in the environment, for more flexibility in build |
77 // tree configurations (sub-project builds, gyp --output_dir, etc.) | 81 // tree configurations (sub-project builds, gyp --output_dir, etc.) |
78 scoped_ptr<base::Environment> env(base::Environment::Create()); | 82 scoped_ptr<base::Environment> env(base::Environment::Create()); |
79 std::string cr_source_root; | 83 std::string cr_source_root; |
80 if (env->GetVar("CR_SOURCE_ROOT", &cr_source_root)) { | 84 if (env->GetVar("CR_SOURCE_ROOT", &cr_source_root)) { |
81 path = FilePath(cr_source_root); | 85 path = FilePath(cr_source_root); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 scoped_ptr<base::Environment> env(base::Environment::Create()); | 125 scoped_ptr<base::Environment> env(base::Environment::Create()); |
122 FilePath cache_dir(base::nix::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", | 126 FilePath cache_dir(base::nix::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", |
123 ".cache")); | 127 ".cache")); |
124 *result = cache_dir; | 128 *result = cache_dir; |
125 return true; | 129 return true; |
126 } | 130 } |
127 return false; | 131 return false; |
128 } | 132 } |
129 | 133 |
130 } // namespace base | 134 } // namespace base |
OLD | NEW |