blob: 61d17ea5ce5254702b13ef087b7f8c022a7bd475 [file] [log] [blame]
To build and install the tpm2.0-tss software the following dependencies are
required:
GNU Autoconf
GNU Autoconf archive
GNU Automake
GNU Libtool
C compiler
C++ compiler
C Library Development Libraries and Header Files
cmocka unit test framework
pkg-config
Currently the tpm2.0-tss is only distributed via GitHub as we have not yet
produced an official source release. To obtain the tpm2.0-tss sources you
must clone them from the 01.org GitHub organization TPM2.0-TSS git repository:
git clone https://github.com/01org/TPM2.0-TSS
To configure the tpm2.0-tss source code first define the environment for your
build using a config.site file. The default for the project is kept at
./lib/default_config.site. Pass this environment to the build through the
CONFIG_SITE variable:
$ ./bootstrap
$ CONFIG_SITE=$(pwd)/lib/default_config.site ./configure
You may also customize the config.site to your needs (please read the GNU
documentation for config.site files) or use your platform / distro default
by leaving the CONFIG_SITE environment variable undefined.
Then compile the code:
$ make
Once you've built the tpm2.0-tss software it can be installed with:
$ sudo make install
This will install the libraries and the resource manager to locations
determined at configure time. See the output of ./configure --help for the
available options. Typically you won't need to do much more than provide an
alternative --prefix option at configure time, and maybe DESTDIR at install
time if you're packaging for a distro.
We now have basic VPATH support which allows us to separate the source
directory from the build directory. This allows for a developer to do a debug
build and a regular build from the same sources. Any changes to the source
will be buildable from both build directories. Before you attempt this be sure
that the source directory is clean.
Our example requires 3 directories:
TPM2.0-TSS where the sources reside,
tpm2tss-default to hold the build with default configuration
tpm2tss-debug to hold a build with debug configuration
In the TPM2.0-TSS directory bootstrap the build:
$ ./bootstrap
From the tpm2tss-default directory build the TPM2.0-TSS source code with the
project's default configuration:
$ CONFIG_SITE=$(pwd)/../TPM2.0-TSS/lib/default_config.site \
../TPM2.0-TSS/configure
$ make
From the tpm2tss-debug directory build the TPM2.0-TSS source code with
optimization disabled and debug symbols:
$ CONFIG_SITE=$(pwd)/../TPM2.0-TSS/lib/debug_config.site \
../TPM2.0-TSS/configure
$ make