Fixed get_share_file_name() for installed yosys

This commit is contained in:
Clifford Wolf 2013-10-27 10:05:19 +01:00
parent 88cd2eadf5
commit f39c0c9928
1 changed files with 3 additions and 2 deletions

View File

@ -430,12 +430,13 @@ std::string get_share_file_name(std::string file)
log_error("Can't find file `%s': reading of /proc/self/exe failed!\n", file.c_str());
buffer[buflen] = 0;
const char *dir = dirname(buffer);
std::string newfile_inplace = stringf("%s/share/%s", dirname(buffer), file.c_str());
std::string newfile_inplace = stringf("%s/share/%s", dir, file.c_str());
if (access(newfile_inplace.c_str(), F_OK) == 0)
return newfile_inplace;
std::string newfile_system = stringf("%s/../share/yosys/%s", dirname(buffer), file.c_str());
std::string newfile_system = stringf("%s/../share/yosys/%s", dir, file.c_str());
if (access(newfile_system.c_str(), F_OK) == 0)
return newfile_system;