summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-01-20 18:34:26 (GMT)
committerGuido van Rossum <guido@python.org>1997-01-20 18:34:26 (GMT)
commit2fff2e6b05b8eb11898186f218d1656ec64a6091 (patch)
tree57c0be226e1e5293275df623edbd2bcaf7386379
parent3bb63a8dbe19592641330a8f1e12bec5dfd147d2 (diff)
downloadcpython-2fff2e6b05b8eb11898186f218d1656ec64a6091.zip
cpython-2fff2e6b05b8eb11898186f218d1656ec64a6091.tar.gz
cpython-2fff2e6b05b8eb11898186f218d1656ec64a6091.tar.bz2
work build# into version string
-rw-r--r--Modules/Makefile.pre.in11
-rw-r--r--Modules/getbuildinfo.c30
2 files changed, 39 insertions, 2 deletions
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 @@ MAKESETUP= $(srcdir)/makesetup
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 @@ $(LIB): $& $(OBJS) Makefile
$(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
diff --git a/Modules/getbuildinfo.c b/Modules/getbuildinfo.c
new file mode 100644
index 0000000..0bf031a
--- /dev/null
+++ b/Modules/getbuildinfo.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+
+#ifndef DATE
+#ifdef __DATE__
+#define DATE __DATE__
+#else
+#define DATE "xx/xx/xx"
+#endif
+#endif
+
+#ifndef TIME
+#ifdef __TIME__
+#define TIME __TIME__
+#else
+#define TIME "xx:xx:xx"
+#endif
+#endif
+
+#ifndef BUILD
+#define BUILD 0
+#endif
+
+
+const char *
+Py_GetBuildInfo()
+{
+ static char buildinfo[40];
+ sprintf(buildinfo, "#%d, %.12s, %.8s", BUILD, DATE, TIME);
+ return buildinfo;
+}