[fpc-devel] revision.inc

Marco van de Voort marcov at stack.nl
Sat Nov 13 23:26:09 CET 2010

In our previous episode, Dimitrios Chr. Ioannidis said:
> > 
> > https://sourceforge.net/projects/win32svn/
> Thx, for the tip.But IMHO the majority of the windows users are using
> TortoiseSVN, so a solution which include the TortoiseSVN's SubWCRev
> alternative for the svn's 'svnversion' will be better.

I've played with both systems a bit. The problem seems to be that "make"
can't properly resolve exes in directories with spaces.

With the below patch, "make revision" does something if I copy subwcrev.exe
to a dir without spaces in the PATH (don't forget to run fpcmake -Tall -w
after applying this patch)

Index: Makefile.fpc
--- Makefile.fpc	(revision 16341)
+++ Makefile.fpc	(working copy)
@@ -162,7 +162,7 @@
 # Default message file
+SUBWCREV:=$(wildcard $(addsuffix /subwcrev$(SRCEXEEXT),$(SEARCHPATH)))
 SVNVERSION:=$(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH)))
 # Check if revision.inc is present
 REVINC:=$(wildcard revision.inc)
@@ -412,13 +412,24 @@
 # revision.inc rule
 revision.inc :
+	$(ECHO) $(REVSTR)	
 ifneq ($(REVSTR),)
+ifeq ($(REVSTR),exported)
+ifneq ($(SUBWCREV),)	
+	$(SUBWCREV) ..  revision.inc.template revision.inc    
 ifneq ($(ECHOREDIR),echo)
         $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
         $(ECHOREDIR) '$(REVSTR)' > revision.inc
         $(ECHOREDIR) "'$(REVSTR)'" > revision.inc

More information about the fpc-devel mailing list