lib/util: Factor out subsystem samba-util-core from samba-util
[obnox/samba/samba-obnox.git] / lib / util / wscript_build
1 #!/usr/bin/env python
2
3 bld.SAMBA_SUBSYSTEM('time-basic',
4                     source='time_basic.c',
5                     deps='replace',
6                     local_include=False)
7
8 bld.SAMBA_SUBSYSTEM('tini',
9                     source='tini.c',
10                     deps='',
11                     local_include=False)
12
13 bld.SAMBA_SUBSYSTEM('tiniparser',
14                     source='tiniparser.c',
15                     deps='tini',
16                     local_include=False)
17
18 bld.SAMBA_SUBSYSTEM('close-low-fd',
19                     source='close_low_fd.c',
20                     deps='replace',
21                     local_include=False)
22
23 bld.SAMBA_LIBRARY('samba-debug',
24                   source='debug.c',
25                   deps='replace time-basic close-low-fd talloc',
26                   local_include=False,
27                   private_library=True)
28
29 bld.SAMBA_LIBRARY('socket-blocking',
30                   source='blocking.c',
31                   local_include=False,
32                   private_library=True)
33
34 bld.SAMBA_SUBSYSTEM('samba-util-core',
35                     source='''xfile.c data_blob.c util_file.c time.c
36                               signal.c util.c idtree.c fault.c
37                               substitute.c''',
38                     deps='''time-basic samba-debug socket-blocking talloc
39                             tevent execinfo pthread''',
40                     local_include=False)
41
42 if not bld.env.SAMBA_UTIL_CORE_ONLY:
43
44     bld.SAMBA_LIBRARY('samba-util',
45                   source='''talloc_stack.c smb_threads.c
46                     rbtree.c rfc1738.c become_daemon.c system.c select.c getpass.c
47                     genrand.c fsusage.c
48                     params.c util_id.c util_net.c
49                     util_strlist.c util_paths.c idtree_random.c base64.c
50                     util_str.c util_str_common.c ms_fnmatch.c
51                     server_id.c dprintf.c parmlist.c bitmap.c pidfile.c
52                     tevent_debug.c util_process.c memcache.c''',
53                   deps='samba-util-core DYNCONFIG close-low-fd tini tiniparser',
54
55                   public_deps='talloc tevent execinfo pthread LIBCRYPTO charset util_setid systemd-daemon',
56                   public_headers='debug.h attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h samba_util.h string_wrappers.h idtree.h idtree_random.h blocking.h signal.h substitute.h fault.h',
57                   header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ],
58                   local_include=False,
59                   vnum='0.0.1',
60                   pc_files='samba-util.pc'
61                   )
62
63     bld.SAMBA_LIBRARY('samba-modules',
64                       source='modules.c',
65                       deps='errors samba-util',
66                       local_include=False,
67                       private_library=True)
68
69     bld.SAMBA_LIBRARY('asn1util',
70                       source='asn1.c',
71                       deps='talloc samba-util',
72                       private_library=True,
73                       local_include=False)
74
75
76     bld.SAMBA_SUBSYSTEM('UNIX_PRIVS',
77                         source='unix_privs.c',
78                         autoproto='unix_privs.h',
79                         deps='replace talloc',
80                         local_include=False,
81                         )
82
83
84     bld.SAMBA_LIBRARY('util_tdb',
85                       source='util_tdb.c',
86                       local_include=False,
87                       public_deps='tdb talloc',
88                       private_library=True
89                       )
90
91     if not bld.env.disable_ntdb:
92         bld.SAMBA_LIBRARY('util_ntdb',
93                           source='util_ntdb.c',
94                           local_include=False,
95                           public_deps='ntdb talloc samba-util samba-hostconfig',
96                           private_library=True
97                           )
98
99     bld.SAMBA_LIBRARY('tevent-util',
100                       source='tevent_unix.c tevent_ntstatus.c tevent_werror.c',
101                       local_include=False,
102                       public_deps='tevent errors',
103                       public_headers='tevent_ntstatus.h tevent_unix.h tevent_werror.h',
104                       header_path=[ ('*', 'util') ],
105                       pc_files=[],
106                       vnum='0.0.1'
107                       )
108
109     bld.SAMBA_LIBRARY('util_setid',
110                       source='setid.c',
111                       local_include=False,
112                       private_library=True
113                       )
114
115     bld.SAMBA_SUBSYSTEM('util_ldb',
116                         source='util_ldb.c',
117                         local_include=False,
118                         public_deps='ldb',
119                         public_headers='util_ldb.h'
120                         )
121
122
123     bld.SAMBA_SUBSYSTEM('UTIL_RUNCMD',
124                         source='util_runcmd.c',
125                         local_include=False,
126                         public_deps='tevent'
127                         )
128
129     bld.SAMBA_SUBSYSTEM('UTIL_PW',
130                         source='util_pw.c',
131                         local_include=False,
132                         public_deps='talloc'
133                         )
134