From 4e52a160c73905a2c0412afb6ab26daf0eb7f7d7 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Sat, 9 May 2020 11:27:22 -0300 Subject: [PATCH] Setting version strings from configure. --- configure.ac | 12 +++++------- src/core/properties/unsigned.c | 4 ---- src/core/rpq.c | 10 +++++----- src/core/util.c | 9 +++++++-- src/core/version.c.in | 8 -------- src/include/config.h.in | 6 ++++++ src/include/internals.h | 2 ++ 7 files changed, 25 insertions(+), 26 deletions(-) delete mode 100644 src/core/version.c.in diff --git a/configure.ac b/configure.ac index 0c3fc4b..866f0aa 100644 --- a/configure.ac +++ b/configure.ac @@ -201,12 +201,12 @@ rpq_revision=`$date +"%Y%m%d"` sccs_date=`$date +%Y/%m/%d` sccs_user=$USER -AC_SUBST(RPQ_BUILD_DATE,$rpq_build_date) -AC_SUBST(RPQ_TIMESTAMP,$rpq_timestamp) -AC_SUBST(RPQ_REVISION,$rpq_revision) +AC_DEFINE_UNQUOTED(RPQ_BUILD_DATE,"$rpq_build_date") +AC_DEFINE_UNQUOTED(RPQ_TIMESTAMP_VALUE,"$rpq_timestamp") +AC_DEFINE_UNQUOTED(RPQ_REVISION,"$rpq_revision") -AC_SUBST(SCCS_USER,$USER) -AC_SUBST(SCCS_DATE,$sccs_date) +AC_DEFINE_UNQUOTED(SCCS_USER,"$USER") +AC_DEFINE_UNQUOTED(SCCS_DATE,"$sccs_date") dnl --------------------------------------------------------------------------- dnl Check for libintl @@ -665,8 +665,6 @@ AC_SUBST(INSTALL_PACKAGES) AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(locale/Makefile) -AC_CONFIG_FILES(src/core/version.c) - AC_CONFIG_FILES(sdk/lib3270.pc) AC_CONFIG_FILES(sdk/lib3270-static.pc) diff --git a/src/core/properties/unsigned.c b/src/core/properties/unsigned.c index 6798897..cecdede 100644 --- a/src/core/properties/unsigned.c +++ b/src/core/properties/unsigned.c @@ -178,8 +178,4 @@ static unsigned int lib3270_get_host_type_number(const H3270 *hSession) return properties; } - LIB3270_EXPORT const char * lib3270_get_build_rpq_timestamp(void) - { - return build_rpq_timestamp; - } diff --git a/src/core/rpq.c b/src/core/rpq.c index ebd4a63..db0680f 100644 --- a/src/core/rpq.c +++ b/src/core/rpq.c @@ -199,26 +199,26 @@ void do_qr_rpqnames(H3270 *hSession) break; case RPQ_VERSION: /* program version */ - x = strlen(build_rpq_version); + x = strlen(PACKAGE_VERSION); omit_due_space_limit = (x > remaining); if (!omit_due_space_limit) { for (i = 0; i < x; i++) { - *hSession->output.ptr++ = hSession->charset.asc2ebc[(int)(*(build_rpq_version+i) & 0xff)]; + *hSession->output.ptr++ = hSession->charset.asc2ebc[(int)(*(PACKAGE_VERSION+i) & 0xff)]; } } break; case RPQ_TIMESTAMP: /* program build time (yyyymmddhhmmss bcd) */ - x = strlen(build_rpq_timestamp); + x = strlen(RPQ_TIMESTAMP_VALUE); omit_due_space_limit = ((x+1)/2 > remaining) ? 1 : 0; if (!omit_due_space_limit) { for (i=0; i < x; i+=2) { - *hSession->output.ptr++ = ((*(build_rpq_timestamp+i) - '0') << 4) - + (*(build_rpq_timestamp+i+1) - '0'); + *hSession->output.ptr++ = ((*(RPQ_TIMESTAMP_VALUE+i) - '0') << 4) + + (*(RPQ_TIMESTAMP_VALUE+i+1) - '0'); } } break; diff --git a/src/core/util.c b/src/core/util.c index 749d72c..d7b4491 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -357,12 +357,17 @@ LIB3270_EXPORT void * lib3270_strdup(const char *str) LIB3270_EXPORT const char * lib3270_get_version(void) { - return build_rpq_version; + return PACKAGE_VERSION; } LIB3270_EXPORT const char * lib3270_get_revision(void) { - return build_rpq_revision; + return RPQ_REVISION; +} + +LIB3270_EXPORT const char * lib3270_get_build_rpq_timestamp(void) +{ + return RPQ_TIMESTAMP_VALUE; } void lib3270_popup_an_errno(H3270 *hSession, int errn, const char *fmt, ...) diff --git a/src/core/version.c.in b/src/core/version.c.in deleted file mode 100644 index cb9733b..0000000 --- a/src/core/version.c.in +++ /dev/null @@ -1,8 +0,0 @@ -char *build = "@PACKAGE_TARNAME@ v@PACKAGE_VERSION@ @RPQ_BUILD_DATE@ @SCCS_USER@"; -char *app_defaults_version = "@PACKAGE_VERSION@"; -char *sccsid = "@(#)@PACKAGE_TARNAME@ v@PACKAGE_VERSION@ @SCCS_DATE@ @SCCS_USER@"; - -const char *build_rpq_timestamp = "@RPQ_TIMESTAMP@"; -const char *build_rpq_version = "@PACKAGE_VERSION@"; -const char *build_rpq_revision = "@RPQ_REVISION@"; - diff --git a/src/include/config.h.in b/src/include/config.h.in index 15956e3..778fd67 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -39,6 +39,12 @@ #undef LIB3270_NAME #undef GETTEXT_PACKAGE + #undef RPQ_BUILD_DATE + #undef RPQ_TIMESTAMP_VALUE + #undef RPQ_REVISION + #undef SCCS_USER + #undef SCCS_DATE + /* Default settings */ /** @brief The lib3270's default host URL */ diff --git a/src/include/internals.h b/src/include/internals.h index d4ce6cc..1ef9b78 100644 --- a/src/include/internals.h +++ b/src/include/internals.h @@ -136,12 +136,14 @@ enum iaction { }; // Version strings +/* LIB3270_INTERNAL const char * build; LIB3270_INTERNAL const char * app_defaults_version; LIB3270_INTERNAL const char * sccsid; LIB3270_INTERNAL const char * build_rpq_timestamp; LIB3270_INTERNAL const char * build_rpq_version; LIB3270_INTERNAL const char * build_rpq_revision; +*/ #if defined(X3270_DBCS) /*[*/ LIB3270_INTERNAL Boolean dbcs; -- libgit2 0.21.2