[Python-checkins] python/dist/src/PC make_versioninfo.c, NONE, 1.1.2.1 .cvsignore, NONE, 1.1.2.1 python_nt.rc, 1.27.4.3, 1.27.4.4

theller at users.sourceforge.net theller at users.sourceforge.net
Wed Oct 22 15:38:06 EDT 2003


Update of /cvsroot/python/python/dist/src/PC
In directory sc8-pr-cvs1:/tmp/cvs-serv13765

Modified Files:
      Tag: release23-maint
	python_nt.rc 
Added Files:
      Tag: release23-maint
	make_versioninfo.c .cvsignore 
Log Message:
Backport from the trunk.

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.


--- NEW FILE: make_versioninfo.c ---
#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;
}

--- NEW FILE: .cvsignore ---
pythonnt_rc.h
pythonnt_rc_d.h

Index: python_nt.rc
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/python_nt.rc,v
retrieving revision 1.27.4.3
retrieving revision 1.27.4.4
diff -C2 -d -r1.27.4.3 -r1.27.4.4
*** python_nt.rc	1 Oct 2003 17:35:01 -0000	1.27.4.3
--- python_nt.rc	22 Oct 2003 19:38:04 -0000	1.27.4.4
***************
*** 7,45 ****
  #include "modsupport.h"
  #include "patchlevel.h"
! 
! /* Across releases, change:
!  *    MS_DLL_ID if the minor version number changes.
!  *    PYTHON_DLL_NAME ditto.
!  * MS_DLL_ID must match PY_VERSION in the Windows install script.
!  */
! #define MS_DLL_ID "2.3"
! 
! #ifndef PYTHON_DLL_NAME
! #define PYTHON_DLL_NAME "python23.dll"
  #endif
- 
- /* Nothing below this should need to be changed except for copyright
-  * notices, company name, and FIELD3.  Unfortunately, all attempts
-  * to get the resource compiler to do arithmetic in macros have
-  * failed miserably -- it gives syntax errors, ignores operators,
-  * or does stuff that's simply bizarre.
-  */
- 
- 
- /* 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.  The
-  * following comment and #define are output from PCbuild\field3.py:
-  *
-  * For 2.3.2,
-  * PY_MICRO_VERSION = 2
-  * PY_RELEASE_LEVEL = 'final' = 0xf
-  * PY_RELEASE_SERIAL = 0
-  *
-  * and 2*1000 + 15*10 + 0 = 2150
-  */
- #define FIELD3 2150
  
  /* e.g., 2.1a2
--- 7,15 ----
  #include "modsupport.h"
  #include "patchlevel.h"
! #ifdef _DEBUG
! #   include "pythonnt_rc_d.h"
! #else
! #   include "pythonnt_rc.h"
  #endif
  
  /* e.g., 2.1a2





More information about the Python-checkins mailing list