[Python-Dev] Compiling Python 2.5 and settinf UCS2 flag

Thomas Wouters thomas at python.org
Tue Sep 11 11:33:22 CEST 2007


On 9/11/07, Tennessee Leeuwenburg <tleeuwenburg at gmail.com> wrote:
>
> Hi all,
>
> I have an unusual use case in which some software I work on compiles a
> version of Python for distribution. I'm not 100% across this as it's not at
> all my area of responsibility, but I have been having some issues lately.
>
> My hand-compiled version of Python 2.5 works just fine, and in turn uses a
> hand-compiled Tcl/Tk with threading disabled.
>
> The system then re-compiles Python2.5 for its own purposes. At this point,
> it appears to ignore some of the options originally set using configure for
> Python.
>
> I have enough knowledge/control over the system to pass in some additional
> compiler flags. I would like to try to force some behaviour normally set as
> a flag to the configure script.
>
> Is there a C compiler flag I can use to force the use of UCS2 unicode?


This isn't really a python-dev question, more a python-list one. Python dev
is for the development of Python, not with Python or your system ;)

The choice between UCS2 and UCS4 is made by configure, based on two things:
what you pass with the --enable-unicode argument (if anything), and what the
version of Tcl you're linking against seems to use. Tcl's choice is only
used if no explicit choice is given. configure also determines the proper
type for the actual UCS2/UCS4 data -- wchar_t, unsigned short or unsigned
long. Both choices are stored in pyconfig.h as is usual for configure. You
can't override them with C compiler flags, but you can edit pyconfig.h if
you can't change the configure flags. Keep in mind that you change both of
those (you probably want to just diff the two pyconfig.h's to see what else
is different.)

-- 
Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20070911/e816911d/attachment.htm 


More information about the Python-Dev mailing list