This should reduce the memory requirement during build of icetime, not
trying to compile one huge file all at once
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Like yosys and arachne-pnr, allow for searching for the desired chipdb
file relative to the executing binaries directory. This allows for
portable builds of icetime without needing to specify the exact path to
the needed chipdb file with the -C arg.
In order to support this icetime must be able to get the
"proc_self_dirname" path just like yosys and arachne-pnr. As such copy
the equivalent code to get this path information. To avoid cluttering
the icetime.cc file with this code, place it in a separate iceutil.cc
file.
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
used in $(PREFIX)/share/ to install the chip database. This provides a
mechanism to choose a directory different than icebox (default).
I.e. fpga-icestorm/chipdb for Debian.
Icetime was hardcoding the path to chipdb as /usr/local/share causing
icetime to not find the chip db on Arch Linux where the prefix is just
/usr/share.
With this commit the PREFIX is passed as a preprocessor define and used
in icetime.cc to create the correct path. I don't know what the
canonical way of dealing with this is, but this was the least intrusive
way I could think of to get this fixed.