lib/util: Avoid splitting tevent-unix-util as public library
authorAmitay Isaacs <amitay@gmail.com>
Thu, 2 Jun 2016 07:17:19 +0000 (17:17 +1000)
committerVolker Lendecke <vl@samba.org>
Mon, 6 Jun 2016 10:26:19 +0000 (12:26 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11946

Commit 670db6ac1d678babd25dd82c4467c0f094cfabc5 split tevent-util public
library to create tevent-unix-util public library for standalone ctdb
use.  This created a public library dependency between samba and ctdb
for packaging.

Bundle tevent_unix.c in public library tevent-util as before.  However,
to avoid the dependencies for packaging, standalone ctdb build will
build tevent-util as a private library with only tevent_unix.c

This simplifies any new subsystems (or libraries) which need tevent-util
and are linked in both samba and ctdb.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
ctdb/wscript
lib/util/wscript_build

index cf60e8629f6b893ce238e0fa47016fdba72ee42b..744ba966cc9966246df92c1ba593e38922f6e392 100755 (executable)
@@ -341,7 +341,7 @@ def build(bld):
                                           '''db_hash.c srvid.c reqid.c
                                              pkt_read.c pkt_write.c comm.c
                                              logging.c rb_tree.c'''),
-                        deps='replace talloc tevent tdb tevent-unix-util')
+                        deps='replace talloc tevent tdb tevent-util')
 
     bld.SAMBA_SUBSYSTEM('ctdb-protocol',
                         source=bld.SUBDIR('protocol',
@@ -654,7 +654,7 @@ def build(bld):
 
         bld.SAMBA_BINARY(target,
                          source=src,
-                         deps='talloc tevent tdb tevent-unix-util',
+                         deps='talloc tevent tdb tevent-util',
                          install_path='${CTDB_TEST_LIBDIR}')
 
     bld.SAMBA_BINARY('reqid_test',
@@ -708,7 +708,7 @@ def build(bld):
     bld.SAMBA_BINARY('fake_ctdbd',
                      source='tests/src/fake_ctdbd.c',
                      deps='''ctdb-util ctdb-protocol ctdb-system
-                             samba-util tevent-unix-util popt''',
+                             samba-util tevent-util popt''',
                      install_path='${CTDB_TEST_LIBDIR}')
 
     if bld.env.HAVE_INFINIBAND:
index aa0586ca6e3f19fc5301c5e057928c5d33926f68..713946d27a5d40afbe95af64726977ee8711ee69 100755 (executable)
@@ -70,16 +70,15 @@ bld.SAMBA_SUBSYSTEM('samba-util-core',
                             tevent execinfo pthread strv''',
                     local_include=False)
 
-bld.SAMBA_LIBRARY('tevent-unix-util',
-                  source='tevent_unix.c',
-                  local_include=False,
-                  deps='tevent',
-                  public_headers='tevent_unix.h',
-                  header_path=[ ('*', 'util') ],
-                  pc_files=[],
-                  vnum='0.0.1')
+if bld.env.SAMBA_UTIL_CORE_ONLY:
+
+    bld.SAMBA_LIBRARY('tevent-util',
+                      source='tevent_unix.c',
+                      local_include=False,
+                      deps='tevent',
+                      private_library=True)
 
-if not bld.env.SAMBA_UTIL_CORE_ONLY:
+else:
 
     bld.env.public_headers_skip.append('charset_compat.h')
 
@@ -143,10 +142,10 @@ if not bld.env.SAMBA_UTIL_CORE_ONLY:
                       )
 
     bld.SAMBA_LIBRARY('tevent-util',
-                      source='tevent_ntstatus.c tevent_werror.c',
+                      source='tevent_unix.c tevent_ntstatus.c tevent_werror.c',
                       local_include=False,
-                      public_deps='tevent samba-errors tevent-unix-util',
-                      public_headers='tevent_ntstatus.h tevent_werror.h',
+                      public_deps='tevent samba-errors',
+                      public_headers='tevent_ntstatus.h tevent_unix.h tevent_werror.h',
                       header_path=[ ('*', 'util') ],
                       pc_files=[],
                       vnum='0.0.1'