xref: /freebsd/lib/libarchive/Makefile.inc (revision 8f9aabbdbcd55b25b698bd762e8693d43f295bbd)
1# These defines are needed for both libarchive and the tests. If we don't keep
2# them in sync we can get run-time crashes while running tests due to mismatches
3# between structures such as archive_md5_ctx, etc.
4
5_LIBARCHIVEDIR=	${SRCTOP}/contrib/libarchive
6LIBARCHIVE_VERSION_ONLY_STRING!= \
7	sed -n '/define.*ARCHIVE_VERSION_ONLY_STRING/{s,[^0-9.],,gp;q;}' \
8	    ${_LIBARCHIVEDIR}/libarchive/archive.h
9
10LIBADD+=	z bz2 lzma bsdxml zstd
11CFLAGS+=	-DPLATFORM_CONFIG_H=\"config_freebsd.h\"
12CFLAGS+=	-I${SRCTOP}/lib/libarchive
13CFLAGS+=	-I${_LIBARCHIVEDIR}/libarchive
14CFLAGS+=	-I${_LIBARCHIVEDIR}/libarchive_fe
15CFLAGS+=	-I${SRCTOP}/sys/contrib/zstd/lib
16
17.if ${MK_OPENSSL} != "no"
18CFLAGS+=	-DWITH_OPENSSL
19CFLAGS+=	-DOPENSSL_API_COMPAT=0x10100000L
20LIBADD+=	crypto
21CFLAGS.archive_hmac.c+=-Wno-error=cast-qual
22.else
23LIBADD+=	md
24.endif
25
26.if ${MK_ICONV} != "no"
27# TODO: This can be changed back to CFLAGS once iconv works correctly
28# with statically linked binaries.
29SHARED_CFLAGS+=	-DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=
30.endif
31