libzip

libzip uses cmake to build.

For running the tests, you need to have perl.

You’ll need zlib (at least version 1.1.2). It
comes with most operating systems.

For supporting bzip2-compressed zip archives, you need
bzip2.

For supporting xz-compressed zip archives, you need
liblzma which is part of xz, at least version 5.2.

For AES (encryption) support, you need one of these cryptographic libraries,
listed in order of preference:

  • Apple’s CommonCrypto (available on macOS and iOS)
  • GnuTLS and Nettle (at least nettle 3.0)
  • mbed TLS
  • OpenSSL >= 1.0.
  • Microsoft Windows Cryptography Framework

If you don’t want a library even if it is installed, you can
pass -DENABLE_<LIBRARY>=OFF to cmake, where <LIBRARY> is one of
COMMONCRYPTO, GNUTLS, MBEDTLS, or OPENSSL.

The basic usage is

mkdir build
cd build
cmake ..
make
make test
make install

Some useful parameters you can pass to cmake with -Dparameter=value:

  • BUILD_SHARED_LIBS: set to ON or OFF to enable/disable building
    of shared libraries, defaults to ON
  • CMAKE_INSTALL_PREFIX: for setting the installation path
  • DOCUMENTATION_FORMAT: choose one of man, mdoc, and html for
    the installed documentation (default: decided by cmake depending on
    available tools)
  • LIBZIP_DO_INSTALL: If you include libzip as a subproject, link it
    statically and do not want to let it install its files, set this
    variable to OFF. Defaults to ON.

If you want to compile with custom CFLAGS, set them in the environment
before running cmake:

CFLAGS=-DMY_CUSTOM_FLAG cmake ..

If you are compiling on a system with a small stack size, add
-DZIP_ALLOCATE_BUFFER to CFLAGS.

If you are building on a 32-bit Linux system it might be necessary
to define _FILE_OFFSET_BITS to 64. Your distro will need to provide
a fts.h file that is new enough to support this, or the build
will break in zipcmp.

You can get verbose build output with by passing VERBOSE=1 to
make.

You can also check the cmake FAQ.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值