DATA_DIR override with environment variable (#333)

This commit is contained in:
Gwenhael Goavec-Merou
2023-04-17 20:55:10 +02:00
parent 1bdb117b74
commit cd8a143164
7 changed files with 85 additions and 7 deletions
+4 -4
View File
@@ -9,6 +9,7 @@
#include <string>
#include "common.hpp"
#include "jtag.hpp"
#include "device.hpp"
#include "epcq.hpp"
@@ -181,12 +182,11 @@ bool Altera::load_bridge()
return false;
}
// DATA_DIR is defined at compile time.
bitname = DATA_DIR "/openFPGALoader/spiOverJtag_";
bitname = get_shell_env_var("OPENFPGALOADER_SOJ_DIR", DATA_DIR "/openFPGALoader");
#ifdef HAS_ZLIB
bitname += _device_package + ".rbf.gz";
bitname += "/spiOverJtag_" + _device_package + ".rbf.gz";
#else
bitname += _device_package + ".rbf";
bitname += "/spiOverJtag_" + _device_package + ".rbf";
#endif
}