~ubuntu-branches/ubuntu/utopic/tdb/utopic-proposed

« back to all changes in this revision

Viewing changes to buildtools/wafsamba/samba_python.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2010-10-04 21:55:48 UTC
  • mfrom: (1.1.12 upstream) (3.2.5 sid)
  • Revision ID: james.westby@ubuntu.com-20101004215548-43p3vge27fml13jz
Tags: 1.2.7-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# waf build tool for building IDL files with pidl
 
2
 
 
3
import Build
 
4
from samba_utils import *
 
5
from samba_autoconf import *
 
6
 
 
7
 
 
8
def SAMBA_PYTHON(bld, name,
 
9
                 source='',
 
10
                 deps='',
 
11
                 public_deps='',
 
12
                 realname=None,
 
13
                 cflags='',
 
14
                 includes='',
 
15
                 init_function_sentinal=None,
 
16
                 local_include=True,
 
17
                 vars=None,
 
18
                 enabled=True):
 
19
    '''build a python extension for Samba'''
 
20
 
 
21
    # when we support static python modules we'll need to gather
 
22
    # the list from all the SAMBA_PYTHON() targets
 
23
    if init_function_sentinal is not None:
 
24
        cflags += '-DSTATIC_LIBPYTHON_MODULES=%s' % init_function_sentinal
 
25
 
 
26
    source = bld.EXPAND_VARIABLES(source, vars=vars)
 
27
 
 
28
    if realname is None:
 
29
        # a SAMBA_PYTHON target without a realname is just a
 
30
        # library with pyembed=True
 
31
        bld.SAMBA_LIBRARY(name,
 
32
                          source=source,
 
33
                          deps=deps,
 
34
                          public_deps=public_deps,
 
35
                          includes=includes,
 
36
                          cflags=cflags,
 
37
                          local_include=local_include,
 
38
                          vars=vars,
 
39
                          pyembed=True,
 
40
                          enabled=enabled)
 
41
        return
 
42
 
 
43
    link_name = 'python/%s' % realname
 
44
 
 
45
    bld.SAMBA_LIBRARY(name,
 
46
                      source=source,
 
47
                      deps=deps,
 
48
                      public_deps=public_deps,
 
49
                      includes=includes,
 
50
                      cflags=cflags,
 
51
                      realname=realname,
 
52
                      local_include=local_include,
 
53
                      vars=vars,
 
54
                      link_name=link_name,
 
55
                      pyembed=True,
 
56
                      target_type='PYTHON',
 
57
                      install_path='${PYTHONDIR}',
 
58
                      enabled=enabled)
 
59
 
 
60
Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON