[PATCHv2 1/x] Re: Disabling Python Modules

Ian Stakenvicius axs at gentoo.org
Fri Jan 27 19:21:38 UTC 2017


On 27/01/17 11:36 AM, Ian Stakenvicius wrote:
> On 27/01/17 01:10 AM, Andrew Bartlett wrote:
>> On Wed, 2017-01-25 at 23:56 -0500, Ian Stakenvicius wrote:
>>>>
>>>> For all others we should use something like
>>>> enabled=bld.PYTHON_BUILD_IS_ENABLED(),
>>>> see git grep 'enabled=' for examples.
>>>
>>>
>>> Is this just for style? or..
>>
>> No, it is more than style.  It allows the build system to know that the
>>  name of the target subsystem exists, but it not in use.  This allows
>> dependencies to be resolved as nothing, rather than having 'if python'
>> in dep strings.  While this may just move the dep problem to the C
>> layer, it allow an #ifdef at that layer.  
>>
>> It is also cleaner, in general, and while not totally consistent, it is
>> how we have tried to handle other features.  
>>
> 

OK, let me know if this is a bit more on track.

The following patch adds the --disable-python option globally.

It also adds some code to skip meat in SAMBA_PYTHON_CHECK_HEADERS , so
that even if python is available the HAVE_PYTHON_H will not be defined
(an appropriate exception is raised if this check is mandatory).

It also adds bld.PYTHON_BUILD_IS_ENABLED() which uses HAVE_PYTHON_H to
determine its value.

My thought here is that, since the codebase has the HAVE_PYTHON_H
define, there's no need to make a PYTHON_BUILD_IS_ENABLED define to
essentially do the same thing.  Also, the check sets 'disable_python'
in the env so that the subprojects do not need to update their checks
and logic to some new variable.

If this looks good, I'll adjust the rest of the patchset using this as
the starting point.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01-global.patch
Type: text/x-diff
Size: 4157 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170127/64214ba2/01-global.diff>


More information about the samba-technical mailing list