3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-12 23:46:40 +00:00

Look for yosys-abc and yosys-svgviewer where the main exe is

This commit is contained in:
Clifford Wolf 2013-06-09 00:07:26 +02:00
parent 6c8a424872
commit bf59a28f80
4 changed files with 23 additions and 3 deletions

View file

@ -22,6 +22,7 @@
#include <readline/history.h>
#include <string.h>
#include <unistd.h>
#include <libgen.h>
#include <dlfcn.h>
#include "kernel/rtlil.h"
@ -343,6 +344,22 @@ struct TclPass : public Pass {
} TclPass;
#endif
std::string rewrite_yosys_exe(std::string exe)
{
char buffer[1024];
ssize_t buflen = readlink("/proc/self/exe", buffer, sizeof(buffer)-1);
if (buflen < 0)
return exe;
buffer[buflen] = 0;
std::string newexe = stringf("%s/%s", dirname(buffer), exe.c_str());
if (access(newexe.c_str(), X_OK) == 0)
return newexe;
return exe;
}
int main(int argc, char **argv)
{
std::string frontend_command = "auto";