[Bf-committers] scons vs. python

Nathan Letwory jesterking at letwory.net
Sat Feb 4 21:36:25 CET 2006


Quick test shows that works

BF_PYTHON_VERSION = '2.4'
BF_PYTHON_INC = BF_PYTHON + '/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = BF_PYTHON+'/bin/python${BF_PYTHON_VERSION}'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'

and in user-config.py BF_PYTHON_VERSION='2.3'

I'll commit this later (unless someone beats me to it ;) I'll be a while
afk more, but will be back later.

/Nathan

> I might have a way to fix this, but I need to test it. In short:
>
> In the platform-config.py change all subsequent BF_PYTHON_VERSION
> -occurrences to '${BF_PYTHON_VERSION}'. This should make it so it
> evaluates the string only on actual usage.
>
> /Nathan
>
>> OK, this is bad. I want to use python 2.3, so
>> I put into user-config.py:
>>
>> BF_PYTHON_VERSION = '2.3'
>>
>> Guess what scons does? Here's some output
>> from scons -h:
>>
>> ---
>> BF_PYTHON_VERSION: Python version to use
>>      default:
>>      actual: 2.3
>>
>> BF_PYTHON_INC: include path for Python headers
>>      default:
>>      actual: /usr/include/python2.4
>>
>> BF_PYTHON_BINARY: Path to the Python interpreter
>>      default:
>>      actual: /usr/bin/python2.4
>>
>> BF_PYTHON_LIB: Python library
>>      default:
>>      actual: python2.4
>> ---
>>
>> It appears that it evaluates the config/linux2-config.py
>> first, then reads the user-config.py
>>
>> Maybe scons needs something akin to the ?= operator
>> from make? So what should be done is that the
>> user-config.mk is read first, then values in
>> config/linux2-config.py are only set if the
>> variable is currently unset. e.g.,
>> maybe a function is needed so a line is a
>> platform configuration file looks like this:
>>
>> set_if_unset(BF_PYTHON_VERSION, "2.4")
>>
>> Anyways, that would take care of problems related to
>> overriding and variable dependencies.
>>
>> Chris
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at projects.blender.org
>> http://projects.blender.org/mailman/listinfo/bf-committers
>>
>
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>




More information about the Bf-committers mailing list