[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
 MSGFILE=msg/error$(FPCLANG).msg
 
-
+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) $(SUBWCREV)
+	$(ECHO) $(REVSTR)	
+	$(ECHO) $(SVNVERSION)		
+	$(ECHO) $(SRCEXEEXT)
+	$(ECHO) $(SEARCHPATH)))
 ifneq ($(REVSTR),)
 ifdef USEZIPWRAPPER
+ifeq ($(REVSTR),exported)
+ifneq ($(SUBWCREV),)	
+	$(SUBWCREV) ..  revision.inc.template revision.inc    
+else
 ifneq ($(ECHOREDIR),echo)
         $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
 else
         $(ECHOREDIR) '$(REVSTR)' > revision.inc
 endif
+endif
+endif
 else
         $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
 endif



More information about the fpc-devel mailing list