build: Remove zlib from the cache if we failed to pass all the tests
authorMatthieu Patou <mat@matws.net>
Sat, 30 Oct 2010 16:47:45 +0000 (20:47 +0400)
committerMatthieu Patou <mat@samba.org>
Sat, 30 Oct 2010 16:50:03 +0000 (16:50 +0000)
This will avoid problems with redefinition of libs tests

lib/zlib/wscript

index bc6de346118483f81901c7edcab70e5c5e014cf0..a091de6b5f10ce8c499ef265aa6d1171d6516822 100644 (file)
@@ -15,6 +15,12 @@ def configure(conf):
                     msg='Checking for ZLIB_VERNUM >= 0x1230',
                     define='HAVE_ZLIB')
 
+    # If we don't do this then we will receive an error that lib 'z'
+    # is already declared as a system lib (for the cases where zlibVersion
+    # is defined
+    if not conf.env['HAVE_ZLIB']:
+                conf.LOCAL_CACHE_SET('TARGET_TYPE', 'z', 'EMPTY')
+
 def build(bld):
     if not bld.CONFIG_SET('HAVE_ZLIB'):
         bld.SAMBA_LIBRARY('z',