osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-abis/+/40503?usp=email )
Change subject: Generate a version.h file
......................................................................
Generate a version.h file
Related: OS#6626
Change-Id: I7fc28a976c922caa29f4e5b3832cdd743c939fa3
---
M .gitignore
M include/Makefile.am
A include/osmocom/abis/version.h.tpl
3 files changed, 27 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/03/40503/1
diff --git a/.gitignore b/.gitignore
index 80e6834..ee4b9f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,3 +54,4 @@
*.sw?
contrib/libosmo-abis.spec
+include/osmocom/abis/version.h
diff --git a/include/Makefile.am b/include/Makefile.am
index 0e53031..c1ae8dd 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,5 +1,14 @@
noinst_HEADERS=mISDNif.h internal.h
+osmocom/abis/version.h: osmocom/abis/version.h.tpl
+ $(AM_V_GEN)$(MKDIR_P) $(dir $@)
+ $(AM_V_GEN)sed \
+ -e "s/{{VERSION}}/$$(echo '@VERSION@' | cut -d. -f1-3)/g" \
+ -e "s/{{VERSION_MAJOR}}/$$(echo '@VERSION@' | cut -d. -f1)/g" \
+ -e "s/{{VERSION_MINOR}}/$$(echo '@VERSION@' | cut -d. -f2)/g" \
+ -e "s/{{VERSION_PATCH}}/$$(echo '@VERSION@' | cut -d. -f3)/g" \
+ $< > $@
+
nobase_include_HEADERS = \
osmocom/abis/abis.h \
osmocom/abis/e1_input.h \
@@ -10,6 +19,7 @@
osmocom/abis/subchan_demux.h \
osmocom/abis/trau_frame.h \
osmocom/abis/unixsocket_proto.h \
+ osmocom/abis/version.h \
osmocom/trau/csd_ra2.h \
osmocom/trau/csd_raa_prime.h \
osmocom/trau/trau_frame.h \
diff --git a/include/osmocom/abis/version.h.tpl b/include/osmocom/abis/version.h.tpl
new file mode 100644
index 0000000..87f0ccf
--- /dev/null
+++ b/include/osmocom/abis/version.h.tpl
@@ -0,0 +1,16 @@
+#pragma once
+
+#define LIBOSMO_ABIS_VERSION {{VERSION}}
+#define LIBOSMO_ABIS_VERSION_STR "{{VERSION}}"
+
+#define LIBOSMO_ABIS_VERSION_MAJOR {{VERSION_MAJOR}}
+#define LIBOSMO_ABIS_VERSION_MINOR {{VERSION_MINOR}}
+#define LIBOSMO_ABIS_VERSION_PATCH {{VERSION_PATCH}}
+
+#define LIBOSMO_ABIS_VERSION_GREATER_EQUAL(major, minor, patch) \
+ (LIBOSMO_ABIS_VERSION_MAJOR > (major) || \
+ (LIBOSMO_ABIS_VERSION_MAJOR == (major) && \
+ LIBOSMO_ABIS_VERSION_MINOR > (minor)) || \
+ (LIBOSMO_ABIS_VERSION_MAJOR == (major) && \
+ LIBOSMO_ABIS_VERSION_MINOR == (minor) && \
+ LIBOSMO_ABIS_VERSION_PATCH >= (patch)))
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-abis/+/40503?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I7fc28a976c922caa29f4e5b3832cdd743c939fa3
Gerrit-Change-Number: 40503
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>