summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-03-28 14:37:17 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-04-15 09:59:34 -0700
commit22c6a2b2d93e127fbb33427b42b7ea2637072e0e (patch)
tree08996d1619c0f089f4d6f387c721b172f584b905
parentb73dd2b7a5c2507c8199e2849ddf1b58ae58915a (diff)
mc: Allow setting the TET_ROOT at build time
meson doesn't allow us to pass an environment variable, so we need another method. I tried using a python wrapper, but that doesn't work with a generator because there's no way to correctly describe the dependency. Instead I've justed added a #define that we can se in meson to get the behavior we want.
-rw-r--r--xts5/src/bin/mc/files.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xts5/src/bin/mc/files.c b/xts5/src/bin/mc/files.c
index a9198e13..d5a8b62d 100644
--- a/xts5/src/bin/mc/files.c
+++ b/xts5/src/bin/mc/files.c
@@ -370,8 +370,12 @@ int size;
rp = getenv("TET_ROOT");
if (rp == NULL) {
+#ifdef BUILD_TET_ROOT
+ rp = BUILD_TET_ROOT;
+#else
fprintf(stderr, "TET_ROOT not set in environment\n");
errexit();
+#endif
}
size = strlen(rp)+strlen(MC_LOC)+strlen(file)+1;
path = malloc((size_t)size);