osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-iuh/+/40515?usp=email )
Change subject: Generate version.h files ......................................................................
Generate version.h files
Related: OS#6626 Change-Id: I7cba0d32f024797e1360ed250a2e4f2d8ca501ee --- M .gitignore M include/osmocom/hnbap/Makefile.am A include/osmocom/hnbap/version.h.tpl M include/osmocom/ranap/Makefile.am A include/osmocom/ranap/version.h.tpl M include/osmocom/rua/Makefile.am A include/osmocom/rua/version.h.tpl M include/osmocom/sabp/Makefile.am A include/osmocom/sabp/version.h.tpl 9 files changed, 139 insertions(+), 7 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/.gitignore b/.gitignore index 209421b..48dd415 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,4 @@ doc/manuals/*.pdf
contrib/osmo-iuh.spec +include/osmocom/*/version.h diff --git a/include/osmocom/hnbap/Makefile.am b/include/osmocom/hnbap/Makefile.am index 6db9966..87492e5 100644 --- a/include/osmocom/hnbap/Makefile.am +++ b/include/osmocom/hnbap/Makefile.am @@ -1,3 +1,16 @@ +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" \ + $< > $@ + +EXTRA_DIST = \ + version.h.tpl \ + $(NULL) + hnbap_HEADERS = \ hnbap_common.h hnbap_ies_defs.h \ HNBAP_AccessResult.h \ @@ -115,9 +128,13 @@ HNBAP_U-RNTI.h \ HNBAP_U-RNTIQueryRequest.h \ HNBAP_U-RNTIQueryResponse.h \ - HNBAP_UTRANCellID.h + HNBAP_UTRANCellID.h \ + version.h \ + $(NULL)
hnbapdir = $(includedir)/osmocom/hnbap
DISTCLEANFILES = \ - hnbap_ies_defs.h + hnbap_ies_defs.h \ + version.h \ + $(NULL) diff --git a/include/osmocom/hnbap/version.h.tpl b/include/osmocom/hnbap/version.h.tpl new file mode 100644 index 0000000..4ad1c79 --- /dev/null +++ b/include/osmocom/hnbap/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_HNBAP_VERSION {{VERSION}} +#define LIBOSMO_HNBAP_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_HNBAP_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_HNBAP_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_HNBAP_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_HNBAP_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_HNBAP_VERSION_MAJOR > (major) || \ + (LIBOSMO_HNBAP_VERSION_MAJOR == (major) && \ + LIBOSMO_HNBAP_VERSION_MINOR > (minor)) || \ + (LIBOSMO_HNBAP_VERSION_MAJOR == (major) && \ + LIBOSMO_HNBAP_VERSION_MINOR == (minor) && \ + LIBOSMO_HNBAP_VERSION_PATCH >= (patch))) diff --git a/include/osmocom/ranap/Makefile.am b/include/osmocom/ranap/Makefile.am index 71e2feb..cef1cd3 100644 --- a/include/osmocom/ranap/Makefile.am +++ b/include/osmocom/ranap/Makefile.am @@ -6,6 +6,19 @@ ranap_ies_defs.h: $(MAKE) -C $(top_builddir)/src/ gen_ranap.stamp
+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" \ + $< > $@ + +EXTRA_DIST = \ + version.h.tpl \ + $(NULL) + ranap_HEADERS = \ ranap_ies_defs.h \ ranap_common.h \ @@ -605,9 +618,13 @@ RANAP_VerticalAccuracyCode.h \ RANAP_VerticalSpeedDirection.h \ RANAP_VerticalVelocity.h \ - RANAP_VoiceSupportMatchIndicator.h + RANAP_VoiceSupportMatchIndicator.h \ + version.h \ + $(NULL)
ranapdir = $(includedir)/osmocom/ranap
DISTCLEANFILES = \ - ranap_ies_defs.h + ranap_ies_defs.h \ + version.h \ + $(NULL) diff --git a/include/osmocom/ranap/version.h.tpl b/include/osmocom/ranap/version.h.tpl new file mode 100644 index 0000000..1a2f117 --- /dev/null +++ b/include/osmocom/ranap/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_RANAP_VERSION {{VERSION}} +#define LIBOSMO_RANAP_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_RANAP_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_RANAP_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_RANAP_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_RANAP_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_RANAP_VERSION_MAJOR > (major) || \ + (LIBOSMO_RANAP_VERSION_MAJOR == (major) && \ + LIBOSMO_RANAP_VERSION_MINOR > (minor)) || \ + (LIBOSMO_RANAP_VERSION_MAJOR == (major) && \ + LIBOSMO_RANAP_VERSION_MINOR == (minor) && \ + LIBOSMO_RANAP_VERSION_PATCH >= (patch))) diff --git a/include/osmocom/rua/Makefile.am b/include/osmocom/rua/Makefile.am index e85f1e6..5880784 100644 --- a/include/osmocom/rua/Makefile.am +++ b/include/osmocom/rua/Makefile.am @@ -1,3 +1,16 @@ +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" \ + $< > $@ + +EXTRA_DIST = \ + version.h.tpl \ + $(NULL) + rua_HEADERS = \ rua_common.h rua_ies_defs.h rua_msg_factory.h \ RUA_Ansi-41-IDNNS.h \ @@ -35,9 +48,13 @@ RUA_SuccessfulOutcome.h \ RUA_TriggeringMessage.h \ RUA_TypeOfError.h \ - RUA_UnsuccessfulOutcome.h + RUA_UnsuccessfulOutcome.h \ + version.h \ + $(NULL)
ruadir = $(includedir)/osmocom/rua
DISTCLEANFILES = \ - rua_ies_defs.h + rua_ies_defs.h \ + version.h \ + $(NULL) diff --git a/include/osmocom/rua/version.h.tpl b/include/osmocom/rua/version.h.tpl new file mode 100644 index 0000000..60fe1cd --- /dev/null +++ b/include/osmocom/rua/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_RUA_VERSION {{VERSION}} +#define LIBOSMO_RUA_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_RUA_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_RUA_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_RUA_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_RUA_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_RUA_VERSION_MAJOR > (major) || \ + (LIBOSMO_RUA_VERSION_MAJOR == (major) && \ + LIBOSMO_RUA_VERSION_MINOR > (minor)) || \ + (LIBOSMO_RUA_VERSION_MAJOR == (major) && \ + LIBOSMO_RUA_VERSION_MINOR == (minor) && \ + LIBOSMO_RUA_VERSION_PATCH >= (patch))) diff --git a/include/osmocom/sabp/Makefile.am b/include/osmocom/sabp/Makefile.am index 848bb39..2533daa 100644 --- a/include/osmocom/sabp/Makefile.am +++ b/include/osmocom/sabp/Makefile.am @@ -6,6 +6,19 @@ sabp_ies_defs.h: $(MAKE) -C $(top_builddir)/src/ gen_sabp.stamp
+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" \ + $< > $@ + +EXTRA_DIST = \ + version.h.tpl \ + $(NULL) + sabp_HEADERS = \ sabp_ies_defs.h \ sabp_common.h \ @@ -72,9 +85,12 @@ SABP_Failure.h \ SABP_Error-Indication.h \ SABP_IE.h \ + version.h \ $(NULL)
sabpdir = $(includedir)/osmocom/sabp
DISTCLEANFILES = \ - sabp_ies_defs.h + sabp_ies_defs.h \ + version.h \ + $(NULL) diff --git a/include/osmocom/sabp/version.h.tpl b/include/osmocom/sabp/version.h.tpl new file mode 100644 index 0000000..d7487ec --- /dev/null +++ b/include/osmocom/sabp/version.h.tpl @@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMO_SABP_VERSION {{VERSION}} +#define LIBOSMO_SABP_VERSION_STR "{{VERSION}}" + +#define LIBOSMO_SABP_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMO_SABP_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMO_SABP_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMO_SABP_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMO_SABP_VERSION_MAJOR > (major) || \ + (LIBOSMO_SABP_VERSION_MAJOR == (major) && \ + LIBOSMO_SABP_VERSION_MINOR > (minor)) || \ + (LIBOSMO_SABP_VERSION_MAJOR == (major) && \ + LIBOSMO_SABP_VERSION_MINOR == (minor) && \ + LIBOSMO_SABP_VERSION_PATCH >= (patch)))