Only files that need the commit info #include "git_commit_info.h".
This way only those files are rebuilt after git_commit_info.h has
been updated.
Now lzma_version_string() and xz --version show the commit date
and commit ID of the latest commit if the .git directory and the
"git" tool were available when building the package.
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+#ifdef HAVE_GIT_COMMIT_INFO_H
+# include "git_commit_info.h"
+#else
+# define GIT_COMMIT_INFO ""
+#endif
#define LZMA_H_INTERNAL
#define LZMA_H_INTERNAL_RC
#include "lzma/version.h"
BEGIN
VALUE "CompanyName", MY_COMPANY
VALUE "FileDescription", MY_DESC
- VALUE "FileVersion", LZMA_VERSION_STRING
+ VALUE "FileVersion", LZMA_VERSION_STRING GIT_COMMIT_INFO
VALUE "InternalName", MY_NAME
VALUE "OriginalFilename", MY_FILENAME
VALUE "ProductName", MY_PRODUCT
- VALUE "ProductVersion", LZMA_VERSION_STRING
+ VALUE "ProductVersion", LZMA_VERSION_STRING GIT_COMMIT_INFO
END
END
BLOCK "VarFileInfo"
#include "common.h"
+#ifdef HAVE_GIT_COMMIT_INFO_H
+# include "git_commit_info.h"
+#else
+# define GIT_COMMIT_INFO ""
+#endif
+
/////////////
// Version //
extern LZMA_API(const char *)
lzma_version_string(void)
{
- return LZMA_VERSION_STRING;
+ return LZMA_VERSION_STRING GIT_COMMIT_INFO;
}
# include <io.h>
#endif
+#ifdef HAVE_GIT_COMMIT_INFO_H
+# include "git_commit_info.h"
+#else
+# define GIT_COMMIT_INFO ""
+#endif
+
tuklib_attr_noreturn
static void
static void
version(void)
{
- puts("lzmainfo (" PACKAGE_NAME ") " LZMA_VERSION_STRING);
+ puts("lzmainfo (" PACKAGE_NAME ") "
+ LZMA_VERSION_STRING GIT_COMMIT_INFO);
tuklib_exit(EXIT_SUCCESS, EXIT_FAILURE, true);
}
#include "tuklib_mbstr_wrap.h"
#include <stdarg.h>
+#ifdef HAVE_GIT_COMMIT_INFO_H
+# include "git_commit_info.h"
+#else
+# define GIT_COMMIT_INFO ""
+#endif
+
/// Number of the current file
static unsigned int files_pos = 0;
printf("XZ_VERSION=%" PRIu32 "\nLIBLZMA_VERSION=%" PRIu32 "\n",
LZMA_VERSION, lzma_version_number());
} else {
- printf("xz (" PACKAGE_NAME ") " LZMA_VERSION_STRING "\n");
+ printf("xz (" PACKAGE_NAME ") "
+ LZMA_VERSION_STRING GIT_COMMIT_INFO "\n");
printf("liblzma %s\n", lzma_version_string());
}
# endif
#endif
+#ifdef HAVE_GIT_COMMIT_INFO_H
+# include "git_commit_info.h"
+#else
+# define GIT_COMMIT_INFO ""
+#endif
+
#ifdef LZMADEC
# define TOOL_FORMAT "lzma"
static void
version(void)
{
- printf(TOOL_FORMAT "dec (" PACKAGE_NAME ") " LZMA_VERSION_STRING "\n"
+ printf(TOOL_FORMAT "dec (" PACKAGE_NAME ") "
+ LZMA_VERSION_STRING GIT_COMMIT_INFO "\n"
"liblzma %s\n", lzma_version_string());
tuklib_exit(EXIT_SUCCESS, EXIT_FAILURE, display_errors);