summaryrefslogtreecommitdiffstats
path: root/PC/make_versioninfo.c
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2003-10-10 16:57:45 (GMT)
committerThomas Heller <theller@ctypes.org>2003-10-10 16:57:45 (GMT)
commit13dbabe46e3b9f788873377b05a237c5bebfd8f9 (patch)
treefc7bbf32087e3d9e01d290e63679301f97a1e349 /PC/make_versioninfo.c
parentb97f0b7654ca5d6d4e15937e87a539a38c4d4c4b (diff)
downloadcpython-13dbabe46e3b9f788873377b05a237c5bebfd8f9.zip
cpython-13dbabe46e3b9f788873377b05a237c5bebfd8f9.tar.gz
cpython-13dbabe46e3b9f788873377b05a237c5bebfd8f9.tar.bz2
To build on windows, the manual editing of the python_nt.rc file to
change the version number is no longer required. Instead, a make_versioninfo.exe is compiled, which spits out an include file for python_nt.rc. Will backport to 2.3
Diffstat (limited to 'PC/make_versioninfo.c')
-rw-r--r--PC/make_versioninfo.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/PC/make_versioninfo.c b/PC/make_versioninfo.c
new file mode 100644
index 0000000..41c026f
--- /dev/null
+++ b/PC/make_versioninfo.c
@@ -0,0 +1,33 @@
+#include <stdio.h>
+#include "patchlevel.h"
+/*
+ * This program prints out an include file containing fields required to build
+ * the version info resource of pythonxx.dll because the resource compiler
+ * cannot do the arithmetic.
+ */
+/*
+ * FIELD3 is the third field of the version number.
+ * This is what we'd like FIELD3 to be:
+ *
+ * #define FIELD3 (PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL)
+ *
+ * but that neither gives an error nor comes anywhere close to working.
+ *
+ * For 2.4a0,
+ * PY_MICRO_VERSION = 0
+ * PY_RELEASE_LEVEL = 'alpha' = 0xa
+ * PY_RELEASE_SERIAL = 0
+ *
+ * gives FIELD3 = 0*1000 + 10*10 + 0 = 100
+ */
+int main(int argc, char **argv)
+{
+ printf("/* This file created by make_versioninfo.exe */\n");
+ printf("#define FIELD3 %d\n",
+ PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL);
+ printf("#define MS_DLL_ID \"%d.%d\"\n",
+ PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ printf("#define PYTHON_DLL_NAME \"python%d%d.dll\"\n",
+ PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ return 0;
+}