build: check for libarchive version via pkgconfig
authorDavid Disseldorp <ddiss@samba.org>
Wed, 19 Feb 2014 16:17:45 +0000 (17:17 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 19 Feb 2014 19:19:07 +0000 (20:19 +0100)
The previous libarchive linker and header file check was not suitible
for older libarchive versions that do not provide the function
archive_read_support_filter_all().

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Feb 19 20:19:07 CET 2014 on sn-devel-104

source3/wscript

index 99ec1beb8dbd378bf39c65300156da42a9ffc634..45eb33ba01be93c5d98eee038f0583697f7dcc2a 100644 (file)
@@ -200,10 +200,10 @@ main() {
     if Options.options.with_libarchive is not False:
         libarchive_mandatory = Options.options.with_libarchive == True
         Logs.info("Checking for libarchive existence")
-        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')
+        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')
 
     # check for DMAPI libs
     Logs.info("Checking for DMAPI library existence")