/**
* Minor version number i.e. the y in x.y.z
*/
-#define RTE_VER_MINOR 6
+#define RTE_VER_MINOR 7
/**
* Patch level number i.e. the z in x.y.z
#define RTE_VER_PATCH_LEVEL 0
/**
- * Patch release number i.e. the w in x.y.zrw
+ * Extra string to be appended to version number
*/
-#define RTE_VER_PATCH_RELEASE 2
+#define RTE_VER_SUFFIX "-rc"
+
+/**
+ * Patch release number
+ * 0-15 = release candidates
+ * 16 = release
+ */
+#define RTE_VER_PATCH_RELEASE 0
/**
* Macro to compute a version number usable for comparisons
RTE_VER_PATCH_RELEASE)
/**
- * Extra string to be appended to version number,
- * for example: pre1, EAR, final etc.
- */
-#define RTE_VER_SUFFIX ""
-
-/**
- * Function returning string of version number: "RTE x.y.zrw"
+ * Function returning version string
* @return
* string
*/
static inline const char *
-rte_version(void) {
- if (sizeof(RTE_VER_SUFFIX) > sizeof(""))
- return RTE_VER_PREFIX" "
- RTE_STR(RTE_VER_MAJOR)"."
- RTE_STR(RTE_VER_MINOR)"."
- RTE_STR(RTE_VER_PATCH_LEVEL)"r"
- RTE_STR(RTE_VER_PATCH_RELEASE)
- "-"RTE_VER_SUFFIX;
+rte_version(void)
+{
+ static char version[32];
+ if (version[0] != 0)
+ return version;
+ if (strlen(RTE_VER_SUFFIX) == 0)
+ sprintf(version, "%s %d.%d.%d",
+ RTE_VER_PREFIX,
+ RTE_VER_MAJOR,
+ RTE_VER_MINOR,
+ RTE_VER_PATCH_LEVEL);
else
- return RTE_VER_PREFIX" "
- RTE_STR(RTE_VER_MAJOR)"."
- RTE_STR(RTE_VER_MINOR)"."
- RTE_STR(RTE_VER_PATCH_LEVEL)"r"
- RTE_STR(RTE_VER_PATCH_RELEASE);
+ sprintf(version, "%s %d.%d.%d%s%d",
+ RTE_VER_PREFIX,
+ RTE_VER_MAJOR,
+ RTE_VER_MINOR,
+ RTE_VER_PATCH_LEVEL,
+ RTE_VER_SUFFIX,
+ RTE_VER_PATCH_RELEASE < 16 ?
+ RTE_VER_PATCH_RELEASE :
+ RTE_VER_PATCH_RELEASE - 16);
+ return version;
}
#ifdef __cplusplus
.PHONY: showversion
showversion:
- @sed -rn 's,^#define RTE_VER_[A-Z_]*[[:space:]]+([0-9]+).*,\1,p' \
- $(RTE_SRCDIR)/lib/librte_eal/common/include/rte_version.h | \
- tr '\n' '.' | sed -r 's,\.([0-9]+)\.$$,r\1\n,'
+ @set -- \
+ $$(sed -rne 's,^#define RTE_VER_[A-Z_]*[[:space:]]+([0-9]+).*,\1,p' \
+ -e 's,^#define RTE_VER_SUFFIX[[:space:]]+"(.*)",\1,p' \
+ $(RTE_SRCDIR)/lib/librte_eal/common/include/rte_version.h) ;\
+ printf '%d.%d.%d' "$$1" "$$2" "$$3"; \
+ if [ -z "$$4" ]; then echo; \
+ else printf '%s' "$$4"; \
+ if [ $$5 -lt 16 ] ; then echo $$5; \
+ else echo $$(($$5 - 16)); fi; \
+ fi
INSTALL_CONFIGS := $(sort $(filter-out %~,\
$(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\