Index: /trunk/ppArith/configure.ac
===================================================================
--- /trunk/ppArith/configure.ac	(revision 23794)
+++ /trunk/ppArith/configure.ac	(revision 23795)
@@ -26,8 +26,5 @@
 CFLAGS="${CFLAGS} -Wall -Werror"
 
-IPP_VERSION(PPARITH)
-AC_SUBST(PPARITH_VERSION,[$PPARITH_VERSION])
-AC_SUBST(PPARITH_BRANCH,[$PPARITH_BRANCH])
-AC_SUBST(PPARITH_SOURCE,[$PPARITH_SOURCE])
+IPP_VERSION
 
 AC_SUBST([PPARITH_CFLAGS])
Index: /trunk/ppArith/src/Makefile.am
===================================================================
--- /trunk/ppArith/src/Makefile.am	(revision 23794)
+++ /trunk/ppArith/src/Makefile.am	(revision 23795)
@@ -1,10 +1,29 @@
 bin_PROGRAMS = ppArith
 
+if HAVE_SVNVERSION
+PSLIB_VERSION=`$(SVNVERSION) ../..`
+else
+PSLIB_VERSION="UNKNOWN"
+endif
+
+if HAVE_SVN
+PSLIB_BRANCH=`$(SVN) info ../.. | $(SED) -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'`
+PSLIB_SOURCE=`$(SVN) info | $(SED) -n -e 's/Repository UUID: // p'`
+else
+PSLIB_BRANCH="UNKNOWN"
+PSLIB_SOURCE="UNKNOWN"
+endif
+
 # Force recompilation of ppArithVersion.c, since it gets the version information
-ppArithVersion.c: FORCE
-	touch ppArith.c
+ppArithVersion.c: ppArithVersionDefinitions.h
+ppArithVersionDefinitions.h: ppArithVersionDefinitions.h.in FORCE
+	-$(RM) ppArithVersionDefinitions.h
+	$(SED) -e "s|@PPARITH_VERSION@|\"$(PPARITH_VERSION)\"|" -e "s|@PPARITH_BRANCH@|\"$(PPARITH_BRANCH)\"|" -e "s|@PPARITH_SOURCE@|\"$(PPARITH_SOURCE)\"|" ppArithVersionDefinitions.h.in > ppArithVersionDefinitions.h
 FORCE: ;
 
-ppArith_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSPHOT_CFLAGS) $(PPARITH_CFLAGS) -DPPARITH_VERSION=$(PPARITH_VERSION) -DPPARITH_BRANCH=$(PPARITH_BRANCH) -DPPARITH_SOURCE=$(PPARITH_SOURCE)
+BUILT_SOURCES = ppArithVersionDefinitions.h
+
+
+ppArith_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSPHOT_CFLAGS) $(PPARITH_CFLAGS)
 ppArith_LDFLAGS  = $(PSLIB_LIBS)   $(PSMODULE_LIBS)   $(PPSTATS_LIBS)   $(PSPHOT_LIBS)   $(PPARITH_LIBS)
 
Index: /trunk/ppArith/src/ppArithVersion.c
===================================================================
--- /trunk/ppArith/src/ppArithVersion.c	(revision 23794)
+++ /trunk/ppArith/src/ppArithVersion.c	(revision 23795)
@@ -21,4 +21,5 @@
 
 #include "ppArith.h"
+#include "ppArithVersionDefinitions.h"
 
 #ifndef PPARITH_VERSION
@@ -32,11 +33,8 @@
 #endif
 
-#define xstr(s) str(s)
-#define str(s) #s
-
 psString ppArithVersion(void)
 {
     char *value = NULL;
-    psStringAppend(&value, "%s@%s", xstr(PPARITH_BRANCH), xstr(PPARITH_VERSION));
+    psStringAppend(&value, "%s@%s", PPARITH_BRANCH, PPARITH_VERSION);
     return value;
 }
@@ -44,5 +42,5 @@
 psString ppArithSource(void)
 {
-    return psStringCopy(xstr(PPARITH_SOURCE));
+    return psStringCopy(PPARITH_SOURCE);
 }
 
Index: /trunk/ppArith/src/ppArithVersionDefinitions.h.in
===================================================================
--- /trunk/ppArith/src/ppArithVersionDefinitions.h.in	(revision 23795)
+++ /trunk/ppArith/src/ppArithVersionDefinitions.h.in	(revision 23795)
@@ -0,0 +1,8 @@
+#ifndef PPARITH_VERSION_DEFINITIONS_H
+#define PPARITH_VERSION_DEFINITIONS_H
+
+#define PPARITH_VERSION @PPARITH_VERSION@ // SVN version
+#define PPARITH_BRANCH  @PPARITH_BRANCH@  // SVN branch
+#define PPARITH_SOURCE  @PPARITH_SOURCE@  // SVN source
+
+#endif
