Alexandre Julliard : loader: Update the reported version from the current git HEAD if available.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 6 08:48:46 CST 2006


Module: wine
Branch: master
Commit: 5776a72361c00aba1cd170ca91e080fcf17bdc17
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5776a72361c00aba1cd170ca91e080fcf17bdc17

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Nov  6 13:33:11 2006 +0100

loader: Update the reported version from the current git HEAD if available.

---

 loader/.gitignore  |    2 ++
 loader/Makefile.in |   12 +++++++++---
 loader/main.c      |    4 ++--
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/loader/.gitignore b/loader/.gitignore
index e3e92e4..677df33 100644
--- a/loader/.gitignore
+++ b/loader/.gitignore
@@ -1,3 +1,5 @@
+/version-stamp
+/version.c
 /wine
 /wine-glibc
 /wine-kthread
diff --git a/loader/Makefile.in b/loader/Makefile.in
index 9cb6ba6..94c2428 100644
--- a/loader/Makefile.in
+++ b/loader/Makefile.in
@@ -11,8 +11,8 @@ C_SRCS = \
 	preloader.c \
 	pthread.c
 
-KTHREAD_OBJS = kthread.o main.o
-PTHREAD_OBJS = pthread.o main.o
+KTHREAD_OBJS = kthread.o main.o version.o
+PTHREAD_OBJS = pthread.o main.o version.o
 
 MAIN_BINARY    = @MAIN_BINARY@
 EXTRA_BINARIES = @EXTRA_BINARIES@
@@ -58,6 +58,12 @@ uninstall::
 	$(RM) $(DESTDIR)$(mandir)/man$(prog_manext)/wine.$(prog_manext)
 
 clean::
-	$(RM) $(WINE_BINARIES) $(MODULE)
+	$(RM) $(WINE_BINARIES) $(MODULE) version.c version-stamp
+
+version-stamp: dummy
+	(GIT_DIR=$(TOPSRCDIR)/.git git describe 2>/dev/null || echo "wine- at PACKAGE_VERSION@") | sed -e 's/\(.*\)/const char wine_version[] = "\1";/' >$@ || ($(RM) $@ && exit 1)
+
+version.c: version-stamp
+	@cmp -s version-stamp $@ || cp version-stamp $@
 
 @DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/loader/main.c b/loader/main.c
index dd5d769..5e0f330 100644
--- a/loader/main.c
+++ b/loader/main.c
@@ -68,7 +68,7 @@ #endif  /* __APPLE__ */
  */
 static void check_command_line( int argc, char *argv[] )
 {
-    static const char version[] = PACKAGE_STRING;
+    extern const char wine_version[];
     static const char usage[] =
         "Usage: wine PROGRAM [ARGUMENTS...]   Run the specified program\n"
         "       wine --help                   Display this help and exit\n"
@@ -86,7 +86,7 @@ static void check_command_line( int argc
     }
     if (!strcmp( argv[1], "--version" ))
     {
-        printf( "%s\n", version );
+        printf( "%s\n", wine_version );
         exit(0);
     }
 }




More information about the wine-cvs mailing list