aboutsummaryrefslogtreecommitdiff
path: root/butl
diff options
context:
space:
mode:
Diffstat (limited to 'butl')
-rw-r--r--butl/.gitignore1
-rw-r--r--butl/buildfile9
-rw-r--r--butl/version26
-rw-r--r--butl/version.in40
4 files changed, 47 insertions, 29 deletions
diff --git a/butl/.gitignore b/butl/.gitignore
new file mode 100644
index 0000000..088eda4
--- /dev/null
+++ b/butl/.gitignore
@@ -0,0 +1 @@
+version
diff --git a/butl/buildfile b/butl/buildfile
index 04e6e09..8a86b2c 100644
--- a/butl/buildfile
+++ b/butl/buildfile
@@ -58,13 +58,16 @@ lib{butl}: file{sha256c.c}
#
lib{butl}: file{strptime.c timelocal.h timelocal.c}
+hxx{version}: in{version} $src_root/file{manifest}
+hxx{version}: dist = true
+
# For pre-releases use the complete version to make sure they cannot be used
# in place of another pre-release or the final version.
#
-if $abi_prerelease
- lib{butl}: bin.lib.version = @-$version
+if $version.pre_release
+ lib{butl}: bin.lib.version = @"-$version.project_id"
else
- lib{butl}: bin.lib.version = @-$abi_major.$abi_minor
+ lib{butl}: bin.lib.version = @"-$version.major.$version.minor"
cxx.poptions =+ "-I$src_root"
obja{*}: cxx.poptions += -DLIBBUTL_STATIC_BUILD
diff --git a/butl/version b/butl/version
deleted file mode 100644
index a7756ef..0000000
--- a/butl/version
+++ /dev/null
@@ -1,26 +0,0 @@
-// file : butl/version -*- C++ -*-
-// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
-// license : MIT; see accompanying LICENSE file
-
-#ifndef LIBBUTL_VERSION // Note: using the version macro itself.
-
-// Version format is AABBCCDD where
-//
-// AA - major version number
-// BB - minor version number
-// CC - bugfix version number
-// DD - alpha / beta (DD + 50) version number
-//
-// When DD is not 00, 1 is subtracted from AABBCC. For example:
-//
-// Version AABBCCDD
-// 2.0.0 02000000
-// 2.1.0 02010000
-// 2.1.1 02010100
-// 2.2.0-a1 02019901
-// 3.0.0-b2 02999952
-//
-#define LIBBUTL_VERSION 49901
-#define LIBBUTL_VERSION_STR "0.5.0-a1"
-
-#endif // LIBBUTL_VERSION
diff --git a/butl/version.in b/butl/version.in
new file mode 100644
index 0000000..ef6b7f7
--- /dev/null
+++ b/butl/version.in
@@ -0,0 +1,40 @@
+// file : butl/version.in -*- C++ -*-
+// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#ifndef LIBBUTL_VERSION // Note: using the version macro itself.
+
+// Note: using build2 standard versioning scheme. The numeric version format
+// is AAABBBCCCDDDE where:
+//
+// AAA - major version number
+// BBB - minor version number
+// CCC - bugfix version number
+// DDD - alpha / beta (DDD + 500) version number
+// E - final (0) / snapshot (1)
+//
+// When DDDE is not 0, 1 is subtracted from AAABBBCCC. For example:
+//
+// Version AAABBBCCCDDDE
+//
+// 0.1.0 0000010000000
+// 0.1.2 0000010010000
+// 1.2.3 0010020030000
+// 2.2.0-a.1 0020019990010
+// 3.0.0-b.2 0029999995020
+// 2.2.0-a.1.z 0020019990011
+//
+#define LIBBUTL_VERSION $libbutl.version.project_number$ULL
+#define LIBBUTL_VERSION_STR "$libbutl.version.project$"
+#define LIBBUTL_VERSION_ID "$libbutl.version.project_id$"
+
+#define LIBBUTL_VERSION_MAJOR $libbutl.version.major$
+#define LIBBUTL_VERSION_MINOR $libbutl.version.minor$
+#define LIBBUTL_VERSION_PATCH $libbutl.version.patch$
+
+#define LIBBUTL_PRE_RELEASE $libbutl.version.pre_release$
+
+#define LIBBUTL_SNAPSHOT $libbutl.version.snapshot_sn$ULL
+#define LIBBUTL_SNAPSHOT_ID "$libbutl.version.snapshot_id$"
+
+#endif // LIBBUTL_VERSION