aboutsummaryrefslogtreecommitdiff
path: root/bpkg/bpkg-version
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-09-25 07:10:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-09-25 07:10:57 +0200
commit287c71ddc00f0db1436d557042b69c03dc448b13 (patch)
tree824d66203c59530b856151c94c4bd322eff28562 /bpkg/bpkg-version
parent5ab55b3efa7be536af146c778ebe457462a886a6 (diff)
Add support for fetching remote repositories
Wget, curl, and (FreeBSD) fetch are supported.
Diffstat (limited to 'bpkg/bpkg-version')
-rw-r--r--bpkg/bpkg-version77
1 files changed, 77 insertions, 0 deletions
diff --git a/bpkg/bpkg-version b/bpkg/bpkg-version
new file mode 100644
index 0000000..381fa56
--- /dev/null
+++ b/bpkg/bpkg-version
@@ -0,0 +1,77 @@
+// file : bpkg/bpkg-version -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BPKG_VERSION // Note: using the version macro itself.
+
+#include <bpkg/version> // LIBBPKG_VERSION
+
+// 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
+//
+
+// Generally, we expect minor versions to be source code backwards-
+// compatible, thought we might have a minimum version requirement.
+//
+// AABBCCDD
+#if (LIBBPKG_VERSION < 10000 || \
+ LIBBPKG_VERSION > 990000)
+# error incompatible libbpkg version
+#endif
+
+// AABBCCDD
+#define BPKG_VERSION 10000
+#define BPKG_VERSION_STR "0.1.0"
+
+// User agent.
+//
+#if defined(_WIN32)
+# if defined(__MINGW32__)
+# define BPKG_OS "MinGW"
+# else
+# define BPKG_OS "Windows"
+# endif
+#elif defined(__linux)
+# define BPKG_OS "GNU/Linux"
+#elif defined(__APPLE__)
+# define BPKG_OS "MacOS"
+#elif defined(__CYGWIN__)
+# define BPKG_OS "Cygwin"
+#elif defined(__FreeBSD__)
+# define BPKG_OS "FreeBSD"
+#elif defined(__OpenBSD__)
+# define BPKG_OS "OpenBSD"
+#elif defined(__NetBSD__)
+# define BPKG_OS "NetBSD"
+#elif defined(__sun)
+# define BPKG_OS "Solaris"
+#elif defined(__hpux)
+# define BPKG_OS "HP-UX"
+#elif defined(_AIX)
+# define BPKG_OS "AIX"
+#elif defined(__unix)
+# define BPKG_OS "Unix"
+#elif defined(__posix)
+# define BPKG_OS "Posix"
+#else
+# define BPKG_OS "Other"
+#endif
+
+#define BPKG_USER_AGENT \
+ "bpkg/" BPKG_VERSION_STR " (" BPKG_OS "; +http://build2.org) " \
+ "libbpkg/" LIBBPKG_VERSION_STR
+
+#endif // BPKG_VERSION