replace: Only build replace-test in standalone build.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 30 Oct 2010 13:59:14 +0000 (15:59 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 30 Oct 2010 15:49:38 +0000 (17:49 +0200)
This allows turning libreplace-test back into a subsystem.

lib/replace/wscript

index 9340ded1a9512ade80dec306be5447ef394891a6..563e689d208acb689ee392985db80dc2502d1ff8 100644 (file)
@@ -27,6 +27,8 @@ def set_options(opt):
 def configure(conf):
     conf.RECURSE('buildtools/wafsamba')
 
+    conf.env.standalone_replace = conf.IN_LAUNCH_DIR()
+
     conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
 
     # on Tru64 certain features are only available with _OSF_SOURCE set to 1
@@ -407,17 +409,17 @@ def build(bld):
                       private_library=True,
                       deps='crypt dl nsl socket rt')
 
-    bld.SAMBA_LIBRARY('replace-test',
+    bld.SAMBA_SUBSYSTEM('replace-test',
                       source='''test/testsuite.c test/strptime.c
                       test/os2_delete.c test/getifaddrs.c''',
                       autoproto='replace-test.h',
-                      deps='replace',
-                      private_library=True)
+                      deps='replace')
 
-    bld.SAMBA_BINARY('replace_testsuite',
-                     source='test/main.c',
-                     deps='replace replace-test',
-                     install=False)
+    if bld.env.standalone_replace:
+        bld.SAMBA_BINARY('replace_testsuite',
+                         source='test/main.c',
+                         deps='replace replace-test',
+                         install=False)
 
     # build replacements for stdint.h and stdbool.h if needed
     bld.SAMBA_GENERATOR('replace_stdint_h',