osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/40508?usp=email )
Change subject: Generate version.h files ......................................................................
Generate version.h files
Related: OS#6626 Change-Id: Icf0319d4b7c27f80a696cb951aa40e2add64749b --- M .gitignore M include/osmocom/csn1/Makefile.am A include/osmocom/csn1/version.h.tpl M include/osmocom/gprs/gmm/Makefile.am A include/osmocom/gprs/gmm/version.h.tpl M include/osmocom/gprs/llc/Makefile.am A include/osmocom/gprs/llc/version.h.tpl M include/osmocom/gprs/rlcmac/Makefile.am A include/osmocom/gprs/rlcmac/version.h.tpl M include/osmocom/gprs/sm/Makefile.am A include/osmocom/gprs/sm/version.h.tpl M include/osmocom/gprs/sndcp/Makefile.am A include/osmocom/gprs/sndcp/version.h.tpl 13 files changed, 155 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/08/40508/1
diff --git a/.gitignore b/.gitignore index 020b541..93b84ab 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ /deps
contrib/libosmo-gprs.spec +include/osmocom/**/version.h diff --git a/include/osmocom/csn1/Makefile.am b/include/osmocom/csn1/Makefile.am index d16b724..1b981b1 100644 --- a/include/osmocom/csn1/Makefile.am +++ b/include/osmocom/csn1/Makefile.am @@ -1,6 +1,17 @@ +version.h: 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" \ + $< > $@ + + csn1_HEADERS = \ wireshark_compat.h \ csn1.h \ + version.h \ $(NULL)
csn1dir = $(includedir)/osmocom/csn1 diff --git a/include/osmocom/csn1/version.h.tpl b/include/osmocom/csn1/version.h.tpl new file mode 100644 index 0000000..2f90851 --- /dev/null +++ b/include/osmocom/csn1/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_CSN1_VERSION {{VERSION}} +#define LIBOSMO_CSN1_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_CSN1_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_CSN1_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_CSN1_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_CSN1_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_CSN1_VERSION_MAJOR > (major) || \ + (LIBOSMO_CSN1_VERSION_MAJOR == (major) && \ + LIBOSMO_CSN1_VERSION_MINOR > (minor)) || \ + (LIBOSMO_CSN1_VERSION_MAJOR == (major) && \ + LIBOSMO_CSN1_VERSION_MINOR == (minor) && \ + LIBOSMO_CSN1_VERSION_PATCH >= (patch))) diff --git a/include/osmocom/gprs/gmm/Makefile.am b/include/osmocom/gprs/gmm/Makefile.am index 2adfed1..efa45c3 100644 --- a/include/osmocom/gprs/gmm/Makefile.am +++ b/include/osmocom/gprs/gmm/Makefile.am @@ -1,3 +1,11 @@ +version.h: 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" \ + $< > $@
noinst_HEADERS = \ gmm_ms_fsm.h \ @@ -8,6 +16,7 @@ gmm_HEADERS = \ gmm.h \ gmm_prim.h \ + version.h \ $(NULL)
gmmdir = $(includedir)/osmocom/gprs/gmm diff --git a/include/osmocom/gprs/gmm/version.h.tpl b/include/osmocom/gprs/gmm/version.h.tpl new file mode 100644 index 0000000..f6135ff --- /dev/null +++ b/include/osmocom/gprs/gmm/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_GPRS_GMM_VERSION {{VERSION}} +#define LIBOSMO_GPRS_GMM_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_GPRS_GMM_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_GPRS_GMM_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_GPRS_GMM_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_GPRS_GMM_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_GPRS_GMM_VERSION_MAJOR > (major) || \ + (LIBOSMO_GPRS_GMM_VERSION_MAJOR == (major) && \ + LIBOSMO_GPRS_GMM_VERSION_MINOR > (minor)) || \ + (LIBOSMO_GPRS_GMM_VERSION_MAJOR == (major) && \ + LIBOSMO_GPRS_GMM_VERSION_MINOR == (minor) && \ + LIBOSMO_GPRS_GMM_VERSION_PATCH >= (patch))) diff --git a/include/osmocom/gprs/llc/Makefile.am b/include/osmocom/gprs/llc/Makefile.am index df56a08..97e1aa2 100644 --- a/include/osmocom/gprs/llc/Makefile.am +++ b/include/osmocom/gprs/llc/Makefile.am @@ -1,3 +1,12 @@ +version.h: 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" \ + $< > $@ + noinst_HEADERS = \ llc_private.h \ $(NULL) @@ -5,6 +14,7 @@ llc_HEADERS = \ llc.h \ llc_prim.h \ + version.h \ $(NULL)
llcdir = $(includedir)/osmocom/gprs/llc diff --git a/include/osmocom/gprs/llc/version.h.tpl b/include/osmocom/gprs/llc/version.h.tpl new file mode 100644 index 0000000..dcae17d --- /dev/null +++ b/include/osmocom/gprs/llc/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_GPRS_LLC_VERSION {{VERSION}} +#define LIBOSMO_GPRS_LLC_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_GPRS_LLC_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_GPRS_LLC_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_GPRS_LLC_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_GPRS_LLC_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_GPRS_LLC_VERSION_MAJOR > (major) || \ + (LIBOSMO_GPRS_LLC_VERSION_MAJOR == (major) && \ + LIBOSMO_GPRS_LLC_VERSION_MINOR > (minor)) || \ + (LIBOSMO_GPRS_LLC_VERSION_MAJOR == (major) && \ + LIBOSMO_GPRS_LLC_VERSION_MINOR == (minor) && \ + LIBOSMO_GPRS_LLC_VERSION_PATCH >= (patch))) diff --git a/include/osmocom/gprs/rlcmac/Makefile.am b/include/osmocom/gprs/rlcmac/Makefile.am index a117a34..ecc5024 100644 --- a/include/osmocom/gprs/rlcmac/Makefile.am +++ b/include/osmocom/gprs/rlcmac/Makefile.am @@ -1,3 +1,12 @@ +version.h: 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" \ + $< > $@ + noinst_HEADERS = \ codel.h \ coding_scheme.h \ @@ -27,6 +36,7 @@ rlcmac.h \ rlcmac_prim.h \ types.h \ + version.h \ $(NULL)
rlcmacdir = $(includedir)/osmocom/gprs/rlcmac diff --git a/include/osmocom/gprs/rlcmac/version.h.tpl b/include/osmocom/gprs/rlcmac/version.h.tpl new file mode 100644 index 0000000..16776bd --- /dev/null +++ b/include/osmocom/gprs/rlcmac/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_GPRS_RLCMAC_VERSION {{VERSION}} +#define LIBOSMO_GPRS_RLCMAC_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_GPRS_RLCMAC_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_GPRS_RLCMAC_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_GPRS_RLCMAC_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_GPRS_RLCMAC_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_GPRS_RLCMAC_VERSION_MAJOR > (major) || \ + (LIBOSMO_GPRS_RLCMAC_VERSION_MAJOR == (major) && \ + LIBOSMO_GPRS_RLCMAC_VERSION_MINOR > (minor)) || \ + (LIBOSMO_GPRS_RLCMAC_VERSION_MAJOR == (major) && \ + LIBOSMO_GPRS_RLCMAC_VERSION_MINOR == (minor) && \ + LIBOSMO_GPRS_RLCMAC_VERSION_PATCH >= (patch))) diff --git a/include/osmocom/gprs/sm/Makefile.am b/include/osmocom/gprs/sm/Makefile.am index f6bede4..5e08915 100644 --- a/include/osmocom/gprs/sm/Makefile.am +++ b/include/osmocom/gprs/sm/Makefile.am @@ -1,3 +1,11 @@ +version.h: 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" \ + $< > $@
noinst_HEADERS = \ sm_ms_fsm.h \ @@ -9,6 +17,7 @@ sm.h \ sm_prim.h \ sm_qos.h \ + version.h \ $(NULL)
smdir = $(includedir)/osmocom/gprs/sm diff --git a/include/osmocom/gprs/sm/version.h.tpl b/include/osmocom/gprs/sm/version.h.tpl new file mode 100644 index 0000000..ea4ad50 --- /dev/null +++ b/include/osmocom/gprs/sm/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_GPRS_SM_VERSION {{VERSION}} +#define LIBOSMO_GPRS_SM_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_GPRS_SM_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_GPRS_SM_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_GPRS_SM_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_GPRS_SM_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_GPRS_SM_VERSION_MAJOR > (major) || \ + (LIBOSMO_GPRS_SM_VERSION_MAJOR == (major) && \ + LIBOSMO_GPRS_SM_VERSION_MINOR > (minor)) || \ + (LIBOSMO_GPRS_SM_VERSION_MAJOR == (major) && \ + LIBOSMO_GPRS_SM_VERSION_MINOR == (minor) && \ + LIBOSMO_GPRS_SM_VERSION_PATCH >= (patch))) diff --git a/include/osmocom/gprs/sndcp/Makefile.am b/include/osmocom/gprs/sndcp/Makefile.am index 0546475..6b5ef99 100644 --- a/include/osmocom/gprs/sndcp/Makefile.am +++ b/include/osmocom/gprs/sndcp/Makefile.am @@ -1,3 +1,11 @@ +version.h: 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" \ + $< > $@
noinst_HEADERS = \ comp.h \ @@ -13,6 +21,7 @@ sndcp_HEADERS = \ sndcp.h \ sndcp_prim.h \ + version.h \ $(NULL)
sndcpdir = $(includedir)/osmocom/gprs/sndcp diff --git a/include/osmocom/gprs/sndcp/version.h.tpl b/include/osmocom/gprs/sndcp/version.h.tpl new file mode 100644 index 0000000..16b2ca5 --- /dev/null +++ b/include/osmocom/gprs/sndcp/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_GPRS_SNDCP_VERSION {{VERSION}} +#define LIBOSMO_GPRS_SNDCP_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_GPRS_SNDCP_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_GPRS_SNDCP_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_GPRS_SNDCP_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_GPRS_SNDCP_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_GPRS_SNDCP_VERSION_MAJOR > (major) || \ + (LIBOSMO_GPRS_SNDCP_VERSION_MAJOR == (major) && \ + LIBOSMO_GPRS_SNDCP_VERSION_MINOR > (minor)) || \ + (LIBOSMO_GPRS_SNDCP_VERSION_MAJOR == (major) && \ + LIBOSMO_GPRS_SNDCP_VERSION_MINOR == (minor) && \ + LIBOSMO_GPRS_SNDCP_VERSION_PATCH >= (patch)))