Fix case of libUTIL_LDB.
[kai/samba-autobuild/.git] / lib / util / wscript_build
1 #!/usr/bin/env python
2
3 common_util_sources = '''talloc_stack.c smb_threads.c xfile.c data_blob.c
4                     util_file.c time.c rbtree.c rfc1738.c select.c
5                     genrand.c fsusage.c blocking.c become_daemon.c
6                     signal.c system.c params.c util.c util_id.c util_net.c
7                     util_strlist.c idtree.c debug.c fault.c base64.c
8                     util_str_common.c'''
9
10 common_util_headers = 'debug.h'
11 common_util_public_deps = 'talloc pthread LIBCRYPTO'
12 s4_util_sources = '''dprintf.c ms_fnmatch.c parmlist.c substitute.c util_str.c'''
13 s4_util_deps = 'DYNCONFIG'
14 s4_util_public_deps = 'talloc CHARSET execinfo uid_wrapper'
15 s4_util_public_headers = 'attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h util.h'
16 s4_util_header_path = [ ('dlinklist.h util.h', '.'), ('*', 'util') ]
17
18 if bld.env.enable_s3build or bld.env._SAMBA_BUILD_ == 3:
19     # as we move files into common between samba-util and samba-util3, move them here.
20     # Both samba-util and samba-util3 depend on this private library
21     bld.SAMBA_LIBRARY('samba-util-common',
22                     source=common_util_sources,
23                     public_deps=common_util_public_deps,
24                     # until we get all the dependencies in this library in common
25                     # we need to allow this library to be built with unresolved symbols
26                     allow_undefined_symbols=True,
27                     local_include=False,
28                     public_headers=common_util_headers,
29                     header_path= [('*', 'util') ],
30                     private_library=True
31                     )
32
33     if bld.env._SAMBA_BUILD_ == 4:
34         bld.SAMBA_LIBRARY('samba-util',
35                         source=s4_util_sources,
36                         deps=s4_util_deps + ' samba-util-common',
37                         public_deps=s4_util_public_deps,
38                         public_headers=s4_util_public_headers,
39                         header_path= s4_util_header_path,
40                         local_include=False,
41                         vnum='0.0.1',
42                         pc_files='samba-util.pc'
43                         )
44
45 else:
46     if bld.env._SAMBA_BUILD_ == 4:
47         bld.SAMBA_LIBRARY('samba-util',
48                         source=s4_util_sources + " " + common_util_sources,
49                         deps=s4_util_deps,
50                         public_deps=s4_util_public_deps + ' ' + common_util_public_deps,
51                         public_headers=s4_util_public_headers + ' ' + common_util_headers,
52                         header_path= s4_util_header_path,
53                         local_include=False,
54                         vnum='0.0.1',
55                         pc_files='samba-util.pc'
56                         )
57
58     # dummy subsystem for avoid wider deps changes.
59     bld.SAMBA_SUBSYSTEM('samba-util-common',
60                         source=[],
61                         deps='samba-util',
62                         local_include=False,)
63
64 bld.SAMBA_LIBRARY('asn1util',
65                   source='asn1.c',
66                   deps='talloc samba-util-common',
67                   private_library=True,
68                   local_include=False)
69
70
71 bld.SAMBA_SUBSYSTEM('UNIX_PRIVS',
72         source='unix_privs.c',
73         autoproto='unix_privs.h',
74         deps='replace talloc',
75         local_include=False,
76         )
77
78
79 bld.SAMBA_LIBRARY('wrap_xattr',
80         source='wrap_xattr.c',
81         public_deps='attr',
82         deps='talloc',
83         local_include=False,
84         private_library=True
85         )
86
87
88 bld.SAMBA_LIBRARY('UTIL_TDB',
89         source='util_tdb.c',
90         local_include=False,
91         public_deps='tdb talloc',
92                   private_library=True
93         )
94
95 bld.SAMBA_SUBSYSTEM('UTIL_TEVENT',
96         source='tevent_unix.c tevent_ntstatus.c tevent_werror.c',
97         local_include=False,
98         public_deps='tevent',
99         public_headers='tevent_ntstatus.h tevent_unix.h tevent_werror.h',
100         header_path=[ ('*', 'util') ],
101         )
102
103
104 if bld.env._SAMBA_BUILD_ == 4:
105         bld.SAMBA_SUBSYSTEM('util_ldb',
106                 source='util_ldb.c',
107                 local_include=False,
108                 public_deps='ldb',
109                 public_headers='util_ldb.h'
110                 )
111
112
113 bld.SAMBA_SUBSYSTEM('UTIL_RUNCMD',
114         source='util_runcmd.c',
115         local_include=False,
116         public_deps='tevent'
117         )
118
119 bld.SAMBA_SUBSYSTEM('UTIL_PW',
120         source='util_pw.c',
121         local_include=False,
122         public_deps='talloc'
123         )