blob: 7253101ca42df7e090fa0838071effd9b38336be [file] [log] [blame]
Philip Triccae1df9a62016-06-22 04:33:05 -07001To build and install the tpm2.0-tss software the following dependencies are
2required:
Philip Triccae290e262015-08-10 12:36:13 -07003GNU Autoconf
Philip Tricca00692472015-09-16 13:09:54 -07004GNU Autoconf archive
Philip Triccae290e262015-08-10 12:36:13 -07005GNU Automake
Philip Triccaa509a682015-09-14 15:34:52 -07006GNU Libtool
Philip Triccae290e262015-08-10 12:36:13 -07007C compiler
8C++ compiler
9C Library Development Libraries and Header Files (for pthreads headers)
Philip Triccab194be92016-03-15 13:27:09 -070010cmocka unit test framework
Philip Triccae1df9a62016-06-22 04:33:05 -070011pkg-config
Philip Triccae290e262015-08-10 12:36:13 -070012
13Currently the tpm2.0-tss is only distributed via GitHub as we have not yet
14produced an official source release. To obtain the tpm2.0-tss sources you
15must clone them from the 01.org GitHub organization TPM2.0-TSS git repository:
16git clone https://github.com/01org/TPM2.0-TSS
17
Philip Triccadaeb5bb2016-05-26 19:27:45 -070018To configure the tpm2.0-tss source code first define the environment for your
19build using a config.site file. The default for the project is kept at
Philip Triccae1df9a62016-06-22 04:33:05 -070020./lib/default_config.site. Pass this environment to the build through the
21CONFIG_SITE variable:
Philip Triccae290e262015-08-10 12:36:13 -070022$ ./bootstrap
Philip Triccae1df9a62016-06-22 04:33:05 -070023$ CONFIG_SITE=$(pwd)/lib/default_config.site ./configure
24
25You may also customize the config.site to your needs (please read the GNU
26documentation for config.site files) or use your platform / distro default
27by leaving the CONFIG_SITE environment variable undefined.
Philip Triccadaeb5bb2016-05-26 19:27:45 -070028
29Then compile the code:
Philip Triccae290e262015-08-10 12:36:13 -070030$ make
31
Philip Triccae1df9a62016-06-22 04:33:05 -070032Once you've built the tpm2.0-tss software it can be installed with:
33$ sudo make install
34
35This will install the libraries and the resource manager to locations
36determined at configure time. See the output of ./configure --help for the
37available options. Typically you won't need to do much more than provide an
38alternative --prefix option at configure time, and maybe DESTDIR at install
39time if you're packaging for a distro.
40
Philip Tricca63d40ae2015-08-14 15:43:47 -070041We now have basic VPATH support which allows us to separate the source
42directory from the build directory. This allows for a developer to do a debug
43build and a regular build from the same sources. Any changes to the source
44will be buildable from both build directories. Before you attempt this be sure
45that the source directory is clean.
46
47Our example requires 3 directories:
48TPM2.0-TSS where the sources reside,
Philip Triccae1df9a62016-06-22 04:33:05 -070049tpm2tss-default to hold the build with default configuration
Philip Tricca63d40ae2015-08-14 15:43:47 -070050tpm2tss-debug to hold a build with debug configuration
51
52In the TPM2.0-TSS directory bootstrap the build:
wcarthurb3754072016-04-01 17:34:56 -040053$ ./bootstrap
Philip Tricca63d40ae2015-08-14 15:43:47 -070054
Philip Triccae1df9a62016-06-22 04:33:05 -070055From the tpm2tss-default directory build the TPM2.0-TSS source code with the
56project's default configuration:
57$ CONFIG_SITE=$(pwd)/../TPM2.0-TSS/lib/default_config.site \
58 ../TPM2.0-TSS/configure
Philip Tricca63d40ae2015-08-14 15:43:47 -070059$ make
60
61From the tpm2tss-debug directory build the TPM2.0-TSS source code with
62optimization disabled and debug symbols:
Philip Triccae1df9a62016-06-22 04:33:05 -070063$ CONFIG_SITE=$(pwd)/../TPM2.0-TSS/lib/debug_config.site \
64 ../TPM2.0-TSS/configure
Philip Tricca63d40ae2015-08-14 15:43:47 -070065$ make