s3: fix --with-libarchive bug, remove useless DEFINE()
authorAurélien Aptel <aurelien.aptel@gmail.com>
Wed, 7 Aug 2013 15:50:15 +0000 (17:50 +0200)
committerAndreas Schneider <asn@samba.org>
Wed, 19 Feb 2014 17:22:29 +0000 (18:22 +0100)
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/wscript

index 8382160d1c8d39db1ee406f3337e9dc51d9b1757..39ab1f335c612f155ca7d0bad4ceee14deb9c988 100644 (file)
@@ -195,19 +195,13 @@ main() {
             Logs.warn('no suitable FAM library found')
 
     # check for libarchive (tar command in smbclient)
-    use_libarchive = False
-    # None means autodetect
-    if Options.options.with_libarchive is None:
+    # None means autodetect, True/False means enable/disable
+    if Options.options.with_libarchive is not False:
+        libarchive_mandatory = Options.options.with_libarchive == True
         Logs.info("Checking for libarchive existence")
-        if conf.CHECK_HEADERS('archive.h') and conf.CHECK_LIB('archive'):
-            use_libarchive = True
-    elif Options.options.with_libarchive == True:
-        conf.CHECK_HEADERS('archive.h', mandatory=True)
-        conf.CHECK_LIB('archive', mandatory=True)
-        use_libarchive = True
-
-    if use_libarchive:
-        conf.DEFINE('SAMBA_LIBARCHIVE_LIBS', '-larchive')
+        conf.CHECK_LIB('archive', mandatory=libarchive_mandatory)
+        if not conf.CHECK_HEADERS('archive.h') and libarchive_mandatory:
+            conf.fatal('libarchive support requested, but no suitable header found')
 
     # check for DMAPI libs
     Logs.info("Checking for DMAPI library existence")