[PATCH] build: fix libarchive detection

Björn Jacke bj at sernet.de
Thu May 28 08:52:53 MDT 2015


our libarchive detection was solidly broken, we also don't rely on pkgconfig now.

Signed-off-by: Bjoern Jacke <bj at sernet.de>

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11296
---
 source3/wscript       | 9 ++++-----
 source3/wscript_build | 3 ++-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/source3/wscript b/source3/wscript
index 0276684..42bbb8f 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -193,14 +193,13 @@ main() {
 
     # check for libarchive (tar command in smbclient)
     # None means autodetect, True/False means enable/disable
-    conf.env['archive_lib'] = ''
+    conf.SET_TARGET_TYPE('archive', 'EMPTY')
     if Options.options.with_libarchive is not False:
         libarchive_mandatory = Options.options.with_libarchive == True
         Logs.info("Checking for libarchive existence")
-        if conf.CHECK_BUNDLED_SYSTEM('libarchive', minversion='3.1.2'):
-            conf.env['archive_lib'] = 'libarchive'
-        elif libarchive_mandatory:
-            conf.fatal('libarchive support requested, but no suitable pkgconfig found')
+	if not conf.CHECK_FUNCS_IN('archive_read_support_filter_all', 'archive'):
+            if libarchive_mandatory:
+                conf.fatal('libarchive support requested, but not found')
 
     # check for DMAPI libs
     if Options.options.with_dmapi == False:
diff --git a/source3/wscript_build b/source3/wscript_build
index ef4c986..3af60ae 100755
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -1067,7 +1067,8 @@ bld.SAMBA3_BINARY('client/smbclient',
                  msrpc3
                  RPC_NDR_SRVSVC
                  cli_smb_common
-                 ''' + bld.env['archive_lib'])
+		 archive
+                 ''')
 
 bld.SAMBA3_BINARY('net',
                  source='''utils/net.c
-- 
2.3.0



More information about the samba-technical mailing list