diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2016-11-04 11:48:14 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2016-11-04 11:48:14 -0700 |
commit | 38826d66d239aaea376bc315dee2a6c1bd33de52 (patch) | |
tree | e2d7f6e4a824fbf4732d05f60ccdef6f2d571187 | |
parent | 0847be677ab311523330aa9ed921752e056d50a2 (diff) | |
parent | 1c129248e62f00f8e7a3cf2db2a309415441729d (diff) |
Merge remote-tracking branch 'josh/gr_snaps'
-rw-r--r-- | gnuradio-runtime/lib/constants.cc.in | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gnuradio-runtime/lib/constants.cc.in b/gnuradio-runtime/lib/constants.cc.in index 516e2f8798..b368e9dc3f 100644 --- a/gnuradio-runtime/lib/constants.cc.in +++ b/gnuradio-runtime/lib/constants.cc.in @@ -24,6 +24,7 @@ #include <config.h> #endif +#include <stdlib.h> #include <gnuradio/constants.h> namespace gr { @@ -31,18 +32,36 @@ namespace gr { const std::string prefix() { + //Use "GR_PREFIX" environment variable when specified + const char *prefix = getenv("GR_PREFIX"); + if (prefix != NULL) return prefix; + return "@prefix@"; } const std::string sysconfdir() { + //Provide the sysconfdir in terms of prefix() + //when the "GR_PREFIX" environment var is specified. + if (getenv("GR_PREFIX") != NULL) + { + return prefix() + "/@GR_CONF_DIR@"; + } + return "@SYSCONFDIR@"; } const std::string prefsdir() { + //Provide the prefsdir in terms of sysconfdir() + //when the "GR_PREFIX" environment var is specified. + if (getenv("GR_PREFIX") != NULL) + { + return sysconfdir() + "/@CMAKE_PROJECT_NAME@/conf.d"; + } + return "@GR_PREFSDIR@"; } |