aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-11-27 13:29:55 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-11-27 13:29:55 +0100
commit8b8ee53bc73769bb25d967ba259dabc9b23e2e6f (patch)
tree79aab3b316d632fc663c1c78da25a88425f4275e /src/libstore
parent5943f41b8bd95b8559cb6768bb0a1151f6bee68d (diff)
Add builtin constants ‘langVersion’ and ‘nixVersion’
The integer constant ‘langVersion’ denotes the current language version. It gets increased every time a language feature is added/changed/removed. It's currently 1. The string constant ‘nixVersion’ contains the current Nix version, e.g. "1.2pre2980_9de6bc5".
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/Makefile.am1
-rw-r--r--src/libstore/globals.cc3
-rw-r--r--src/libstore/globals.hh3
3 files changed, 7 insertions, 0 deletions
diff --git a/src/libstore/Makefile.am b/src/libstore/Makefile.am
index 46e18be23..3dfb1e0c3 100644
--- a/src/libstore/Makefile.am
+++ b/src/libstore/Makefile.am
@@ -23,6 +23,7 @@ AM_CXXFLAGS = -Wall \
-DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \
-DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \
-DNIX_BIN_DIR=\"$(bindir)\" \
+ -DNIX_VERSION=\"$(VERSION)\" \
-I$(srcdir)/.. -I$(srcdir)/../libutil \
-I$(srcdir)/../libstore
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index 7b881d1d2..bb453a451 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -197,4 +197,7 @@ Settings::SettingsMap Settings::getOverrides()
}
+const string nixVersion = NIX_VERSION;
+
+
}
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index d25ee6adc..953eed9c3 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -190,4 +190,7 @@ private:
extern Settings settings;
+extern const string nixVersion;
+
+
}