work build# into version string
diff --git a/Modules/Makefile.pre.in b/Modules/Makefile.pre.in
index a5f0d9a..de2b107 100644
--- a/Modules/Makefile.pre.in
+++ b/Modules/Makefile.pre.in
@@ -93,7 +93,7 @@
OBJS= $(MODOBJS)
-ADDOBJS= main.o config.o getpath.o
+ADDOBJS= main.o config.o getpath.o getbuildinfo.o
LIB= libModules.a
@@ -120,11 +120,18 @@
$(AR) cr $(LIB) $(OBJS)
$(RANLIB) $(LIB)
-../python: $(MYLIBS) $(ADDOBJS) Makefile
+../python: $(MYLIBS) $(ADDOBJS) Makefile buildno
+ expr `cat buildno` + 1 >@buildno
+ mv @buildno buildno
+ $(CC) -c $(CFLAGS) -DBUILD=`cat buildno` $(srcdir)/getbuildinfo.c
+ $(AR) r $(LIB) getbuildinfo.o
$(LINKCC) $(LDFLAGS) $(OPT) $(LINKFORSHARED) $(ADDOBJS) \
$(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python
mv python ../python
+buildno:
+ echo 0 >buildno
+
clean:
-rm -f *.o python core *~ [@,#]* *.old *.orig *.rej