diff options
author | Barry Warsaw <barry@python.org> | 2005-12-18 01:27:35 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2005-12-18 01:27:35 (GMT) |
commit | 2a38a86c1c48adbf9cf76d485c515002f042fd56 (patch) | |
tree | 728b60b9fdc895f23a1a18dca41d49ce38a5ce62 /Makefile.pre.in | |
parent | 11ca77e6deb795a697ce00849c2f081e9bdbabb7 (diff) | |
download | cpython-2a38a86c1c48adbf9cf76d485c515002f042fd56.zip cpython-2a38a86c1c48adbf9cf76d485c515002f042fd56.tar.gz cpython-2a38a86c1c48adbf9cf76d485c515002f042fd56.tar.bz2 |
Expose Subversion revision number (calculated via "svnversion .") to Python.
Add C API function Py_GetBuildNumber(), add it to the interactive prompt
banner (i.e. Py_GetBuildInfo()), and add it as the sys.build_number
attribute. The build number is a string instead of an int because it may
contain a trailing 'M' if there are local modifications.
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r-- | Makefile.pre.in | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in index ab01deb..0ce2afa 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -349,7 +349,9 @@ buildno: $(PARSER_OBJS) \ $(SIGNAL_OBJS) \ $(MODOBJS) \ $(srcdir)/Modules/getbuildinfo.c - if test -f buildno; then \ + if test -d .svn; then \ + svnversion . >buildno; \ + elif test -f buildno; then \ expr `cat buildno` + 1 >buildno1; \ mv -f buildno1 buildno; \ else echo 1 >buildno; fi @@ -444,7 +446,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist # Special rules for object files Modules/getbuildinfo.o: $(srcdir)/Modules/getbuildinfo.c buildno - $(CC) -c $(PY_CFLAGS) -DBUILD=`cat buildno` -o $@ $(srcdir)/Modules/getbuildinfo.c + $(CC) -c $(PY_CFLAGS) -DBUILD=\"`cat buildno`\" -o $@ $(srcdir)/Modules/getbuildinfo.c Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ |