Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Properly detect if libarchive is built with zstd support
Baptiste Daroussin committed 6 years ago
commit 7a968326795fc5333f2de9726450c7e4d24a57af
parent 6b49f74
2 files changed +13 -1
modified auto.def
@@ -259,6 +259,18 @@ if {[pkg-config-init 0]} {
			user-error "Unable to find libarchive"
		} else {
			define PKG_LIBARCHIVE_LIBS_STATIC [exec pkg-config --static --libs-only-l libarchive]
+
			cc-with { -libs { -larchive }} {
+
				cc-check-functions archive_write_add_filter_zstd
+
			}
+
		}
+
	} else {
+
		# check if the privatelibzstd is there
+
		cc-with { -libs { -larchive }} {
+
			if {[cc-check-functions archive_write_add_filter_zstd]} {
+
				define ZSTDLIB "-lprivatezstd"
+
			} else {
+
				define ZSTDLIB ""
+
			}
		}
	}
}
modified src/Makefile.autosetup
@@ -49,7 +49,7 @@ OTHER_LIBS= @EXTRA_LIBS@
@if HAVE_PKG_LIBARCHIVE
OTHER_LIBS+=	@PKG_LIBARCHIVE_LDFLAGS@ @PKG_LIBARCHIVE_LIBS_STATIC@
@else
-
OTHER_LIBS+=	-larchive -lbz2 -lz -llzma
+
OTHER_LIBS+=	-larchive -lbz2 -lz -llzma @ZSTDLIB@
@endif
OTHER_LIBS+=	-lm -lssl -lcrypto -pthread
@if HAVE_LIBUTIL