~ chicken-core (chicken-5) 33f30b9c447ca588ee53786c6662d94b51fe5118


commit 33f30b9c447ca588ee53786c6662d94b51fe5118
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Fri Jan 1 23:52:16 2010 +0100
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Fri Jan 1 23:52:16 2010 +0100

    identify branchname in banner

diff --git a/Makefile.mingw b/Makefile.mingw
index e338d574..e90dbdc3 100644
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -235,15 +235,18 @@ chicken-defaults.h:
 	echo #endif >>$@
 	echo #ifndef C_CSC_PROGRAM" >>$@
 	echo # define C_CSC_PROGRAM "$(CSC_PROGRAM)" >>$@
-	echo #endif" >>$@
+	echo #endif >>$@
 	echo #ifndef C_CSI_PROGRAM" >>$@
 	echo # define C_CSI_PROGRAM "$(CSI_PROGRAM)" >>$@
-	echo #endif" >>$@
+	echo #endif >>$@
 	echo #ifndef C_CHICKEN_BUG_PROGRAM" >>$@
 	echo # define C_CHICKEN_BUG_PROGRAM "$(CHICKEN_BUG_PROGRAM)" >>$@
-	echo #endif" >>$@
+	echo #endif >>$@
 	echo #ifndef C_BINARY_VERSION >>$@
 	echo # define C_BINARY_VERSION $(BINARYVERSION) >>$@
 	echo #endif >>$@
+	echo #ifndef C_BRANCH_NAME >>$@
+	echo # define C_BRANCH_NAME "" >>$@
+	echo #endif >>$@
 
 include $(SRCDIR)rules.make
diff --git a/defaults.make b/defaults.make
index adc65485..cd098372 100644
--- a/defaults.make
+++ b/defaults.make
@@ -57,6 +57,7 @@ CHICKENLIBDIR = $(VARDIR)/chicken
 EGGDIR = $(CHICKENLIBDIR)/$(BINARYVERSION)
 
 ifdef WINDOWS_SHELL
+BRANCHNAME = ""
 SPREFIX = $(subst /,$(SEP),$(PREFIX))
 IBINDIR = $(SPREFIX)$(SEP)bin
 ILIBDIR = $(SPREFIX)$(SEP)lib
@@ -69,6 +70,7 @@ IDOCDIR = $(IDATADIR)$(SEP)doc
 ICHICKENLIBDIR = $(ILIBDIR)$(SEP)chicken
 IEGGDIR = $(ICHICKENLIBDIR)$(SEP)$(BINARYVERSION)
 else
+BRANCHNAME = $(shell scripts/identify-branch)
 SPREFIX = $(PREFIX)
 IBINDIR = $(BINDIR)
 ILIBDIR = $(LIBDIR)
@@ -468,4 +470,7 @@ endif
 	echo "#ifndef C_BINARY_VERSION" >>$@
 	echo "# define C_BINARY_VERSION $(BINARYVERSION)" >>$@
 	echo "#endif" >>$@
+	echo "#ifndef C_BRANCH_NAME" >>$@
+	echo "# define C_BRANCH_NAME \"$(BRANCHNAME)\"" >>$@
+	echo "#endif" >>$@
 endif
diff --git a/distribution/manifest b/distribution/manifest
index 961d4d4b..3918141e 100644
--- a/distribution/manifest
+++ b/distribution/manifest
@@ -238,6 +238,7 @@ scripts/makedist.scm
 scripts/README
 scripts/henrietta.scm
 scripts/henrietta.cgi
+scripts/identify-branch
 synrules.scm
 expand.scm
 expand.c
diff --git a/library.scm b/library.scm
index 3742fc9b..122f9ca1 100644
--- a/library.scm
+++ b/library.scm
@@ -184,6 +184,7 @@ EOF
 (define-constant maximal-string-length #x00ffffff)
 
 (define-foreign-variable +build-tag+ c-string "C_BUILD_TAG")
+(define-foreign-variable +branch-name+ c-string "C_BRANCH_NAME")
 
 
 ;;; System routines:
@@ -3383,7 +3384,7 @@ EOF
 		   (if (##sys#fudge 32) " gchooks" "") 
 		   (if (##sys#fudge 39) " cross" "") ) ) )
 	(string-append
-	 "Version " +build-version+ "\n"
+	 "Version " +build-version+ " " +branch-name+ "\n"
 	 (get-config)
 	 (if (zero? (##sys#size spec))
 	     ""
Trap