build: use configure var for libarchive depenency
authorDavid Disseldorp <ddiss@samba.org>
Sat, 15 Feb 2014 09:37:28 +0000 (10:37 +0100)
committerAndreas Schneider <asn@samba.org>
Wed, 19 Feb 2014 17:22:29 +0000 (18:22 +0100)
Avoid CONFIG_SET('HAVE_LIBARCHIVE') checks in wscript_build, by using a
simple archive_lib variable.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/wscript
source3/wscript_build

index 39ab1f335c612f155ca7d0bad4ceee14deb9c988..99ec1beb8dbd378bf39c65300156da42a9ffc634 100644 (file)
@@ -196,10 +196,12 @@ main() {
 
     # check for libarchive (tar command in smbclient)
     # None means autodetect, True/False means enable/disable
+    conf.env['archive_lib'] = ''
     if Options.options.with_libarchive is not False:
         libarchive_mandatory = Options.options.with_libarchive == True
         Logs.info("Checking for libarchive existence")
-        conf.CHECK_LIB('archive', mandatory=libarchive_mandatory)
+        if conf.CHECK_LIB('archive', mandatory=libarchive_mandatory):
+            conf.env['archive_lib'] = 'archive'
         if not conf.CHECK_HEADERS('archive.h') and libarchive_mandatory:
             conf.fatal('libarchive support requested, but no suitable header found')
 
index 9265e00c395d3494272f5072de8b08b5236ff913..9d3071a74cd6eee21b430c7e124caa00d4977012 100755 (executable)
@@ -1005,8 +1005,7 @@ bld.SAMBA3_BINARY('client/smbclient',
                  msrpc3
                  RPC_NDR_SRVSVC
                  cli_smb_common
-                 '''+
-                  ('archive' if bld.CONFIG_SET('HAVE_LIBARCHIVE') else ''))
+                 ''' + bld.env['archive_lib'])
 
 bld.SAMBA3_BINARY('net',
                  source='''utils/net.c