Skip to content

Latest commit

 

History

History
125 lines (96 loc) · 4.03 KB

File metadata and controls

125 lines (96 loc) · 4.03 KB

Building and installing the XML Security Library

Prerequisites

XML Security Library requires the following libraries:

And at least one of the following cryptographic libraries:

For example, install the following packages on Ubuntu to build the XML Security Library:

# common build tools
apt install automake autoconf libtool libtool-bin gcc

# ltdl is required to support dynamic crypto libs loading
apt install libltdl7 libltdl-dev

# core libxml2 and libxslt libraries
apt install libxml2 libxml2-dev libxslt1.1 libxslt1-dev

# openssl libraries
apt install openssl libssl3 libssl-dev

# nspr/nss libraries
apt install libnspr4 libnspr4-dev libnss3 libnss3-dev libnss3-tools

# gnutls libraries
apt install libgnutls30

# gnutls libraries
apt install libgcrypt20 libgcrypt20-dev

# required for building man pages and docs
apt install help2man pandoc doxygen python3

Building the XML Security Library on Linux, Unix, macOS, MinGW, Cygwin, etc.

To build and install XML Security Library on Unix-like systems from a release tarball, run the following commands:

gunzip -c xmlsec1-<version>.tar.gz | tar xvf -
cd xmlsec1-<version>
./configure [possible configure options]
make
make check
make install

To build from GitHub, run the following commands:

git clone https://github.com/lsh123/xmlsec.git
cd xmlsec
autoreconf -i -f
./configure [possible configure options]
make
make check
make install

To see the configuration options, run:

./configure --help

Building the XML Security Library on Windows using Microsoft Visual Studio

Building from the command line is the only supported method. To build from the command line, you must make sure that your compiler works there as well. The simplest way is to launch the x64 Native Tools Command Prompt for VS 2022 (or a similar) specialized shell environment that automatically sets the necessary environment variables. Alternatively, you can use vcvars64.bat (or similar) scripts.

The XML Security Library on Windows uses JScript to configure the build automatically. JScript is widely available, but if it is not available on your machine for any reason, you can also configure the build manually.

To build and install XML Security Library on Windows using Microsoft Visual Studio, run the following commands:

gunzip -c xmlsec1-<version>.tar.gz | tar xvf -
cd xmlsec1-<version>\win32
powershell -ExecutionPolicy Bypass -File configure.ps1 [possible configure options]
nmake
nmake install

To see the configuration options, run:

powershell -ExecutionPolicy Bypass -File configure.ps1 help

Note: Do not use path names that contain spaces. This will fail.

Example

The following command configures the build as follows:

  • Use Microsoft Cryptography API: Next Generation (CNG);
  • Use the multithreaded, DLL-specific version of the Microsoft Visual Studio C Runtime libraries;
  • Use c:\opt\include and c:\opt\lib as additional search paths for the compiler and the linker;
  • Include debug symbols in the binaries.
powershell -ExecutionPolicy Bypass -File configure.ps1 crypto=mscng cruntime=/MD prefix=c:\opt include=c:\opt\include lib=c:\opt\lib debug=yes