Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2022-12-07 23:14:27 +0300
committerCorinna Vinschen <corinna@vinschen.de>2022-12-07 23:30:23 +0300
commit97eb64b909bc0a47b3159ae7f7ef2060e4bb8d54 (patch)
tree693f5232f1d6a354cda30a25d76cf5212f8976b5 /winsup/cygwin/Makefile.am
parent792b1c6a6d4acee79e1287369498f6ad8e75c1bf (diff)
Cygwin: uname: generate default release string from git as well
When building a release with cygport, we get uname version info from cygport, which in turn gets version info from `git describe'. During development, the release info for local builds was not that helpful yet. Fix that, by creating version info from `git describe' if CYGPORT_RELEASE_INFO isn't given. Make sure to always force rebuild of the version info to pick up source file changes as well as git actions. Rearrange code slightly to generate machine info first, release info after that. Use snprintf to generate release string safely. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/Makefile.am')
-rw-r--r--winsup/cygwin/Makefile.am8
1 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/Makefile.am b/winsup/cygwin/Makefile.am
index 8ba5ae271..b1849d5a6 100644
--- a/winsup/cygwin/Makefile.am
+++ b/winsup/cygwin/Makefile.am
@@ -365,7 +365,8 @@ GMON_FILES= \
profil.c
GENERATED_FILES= \
- sigfe.s
+ sigfe.s \
+ uname_version.c
liblib_a_SOURCES= \
$(LIB_FILES)
@@ -418,6 +419,11 @@ dirs = $(srcdir) $(srcdir)/fhandler $(srcdir)/lib $(srcdir)/libc $(srcdir)/math
find_src_files = $(wildcard $(dir)/*.[chS]) $(wildcard $(dir)/*.cc)
src_files := $(foreach dir,$(dirs),$(find_src_files))
+uname_version.c: .FORCE
+ $(AM_V_GEN)cd $(srcdir) && \
+ echo "const char *uname_dev_version = \"$$(git describe --dirty | sed -e 's/cygwin-//')\";" > $(abs_builddir)/uname_version.c
+.FORCE:
+
# mkvers.sh creates version.cc in the first place, winver.o always
# second, so version.cc is always older than winver.o
version.cc: scripts/mkvers.sh include/cygwin/version.h winver.rc $(src_files)