aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Kvachonok <ravenexp@gmail.com>2016-03-26 11:01:53 +0300
committerSergey Kvachonok <ravenexp@gmail.com>2016-03-26 11:16:53 +0300
commit963c0d2525c9d7af9a2c7640b554923f3a4f647e (patch)
tree28d4993d9bfd3c1eb86905ccd6506939b6347eb9
parenta922d705d4c5e5c2f0cfc59f31fa11901ef307e1 (diff)
downloadyosys-963c0d2525c9d7af9a2c7640b554923f3a4f647e.tar.gz
yosys-963c0d2525c9d7af9a2c7640b554923f3a4f647e.tar.bz2
yosys-963c0d2525c9d7af9a2c7640b554923f3a4f647e.zip
Embed DATDIR make variable value into yosys binary.
Use it as the last resort in the share/ directory location search.
-rw-r--r--Makefile1
-rw-r--r--kernel/yosys.cc5
2 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b1d94e16a..7f4e5c9b1 100644
--- a/Makefile
+++ b/Makefile
@@ -281,6 +281,7 @@ $(eval $(call add_include_file,backends/ilang/ilang_backend.h))
OBJS += kernel/driver.o kernel/register.o kernel/rtlil.o kernel/log.o kernel/calc.o kernel/yosys.o kernel/cellaigs.o
kernel/log.o: CXXFLAGS += -DYOSYS_SRC='"$(YOSYS_SRC)"'
+kernel/yosys.o: CXXFLAGS += -DYOSYS_DATDIR='"$(DATDIR)"'
OBJS += libs/bigint/BigIntegerAlgorithms.o libs/bigint/BigInteger.o libs/bigint/BigIntegerUtils.o
OBJS += libs/bigint/BigUnsigned.o libs/bigint/BigUnsignedInABase.o
diff --git a/kernel/yosys.cc b/kernel/yosys.cc
index eba1aef11..a69a85447 100644
--- a/kernel/yosys.cc
+++ b/kernel/yosys.cc
@@ -701,6 +701,11 @@ std::string proc_share_dirname()
proc_share_path = proc_self_path + "../share/yosys/";
if (check_file_exists(proc_share_path, true))
return proc_share_path;
+# ifdef YOSYS_DATDIR
+ proc_share_path = YOSYS_DATDIR "/";
+ if (check_file_exists(proc_share_path, true))
+ return proc_share_path;
+# endif
# endif
log_error("proc_share_dirname: unable to determine share/ directory!\n");
}