blob: 806e6d38000b405882f1e2360ea3408d738c9c34 [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
Philip Triccae290e262015-08-10 12:36:13 -07008C Library Development Libraries and Header Files (for pthreads headers)
Philip Triccab194be92016-03-15 13:27:09 -07009cmocka unit test framework
Philip Triccae1df9a62016-06-22 04:33:05 -070010pkg-config
Philip Triccae290e262015-08-10 12:36:13 -070011
12Currently the tpm2.0-tss is only distributed via GitHub as we have not yet
13produced an official source release. To obtain the tpm2.0-tss sources you
14must clone them from the 01.org GitHub organization TPM2.0-TSS git repository:
15git clone https://github.com/01org/TPM2.0-TSS
16
Philip Triccadaeb5bb2016-05-26 19:27:45 -070017To configure the tpm2.0-tss source code first define the environment for your
18build using a config.site file. The default for the project is kept at
Philip Triccae1df9a62016-06-22 04:33:05 -070019./lib/default_config.site. Pass this environment to the build through the
20CONFIG_SITE variable:
Philip Triccae290e262015-08-10 12:36:13 -070021$ ./bootstrap
Philip Triccae1df9a62016-06-22 04:33:05 -070022$ CONFIG_SITE=$(pwd)/lib/default_config.site ./configure
23
24You may also customize the config.site to your needs (please read the GNU
25documentation for config.site files) or use your platform / distro default
26by leaving the CONFIG_SITE environment variable undefined.
Philip Triccadaeb5bb2016-05-26 19:27:45 -070027
28Then compile the code:
Philip Triccae290e262015-08-10 12:36:13 -070029$ make
30
Philip Triccae1df9a62016-06-22 04:33:05 -070031Once you've built the tpm2.0-tss software it can be installed with:
32$ sudo make install
33
34This will install the libraries and the resource manager to locations
35determined at configure time. See the output of ./configure --help for the
36available options. Typically you won't need to do much more than provide an
37alternative --prefix option at configure time, and maybe DESTDIR at install
38time if you're packaging for a distro.
39
Michael Nixf9a2e672016-12-13 17:01:44 +010040NOTE: It may be necessary to run ldconfig (as root) to update the run-time
41bindings before executing a program that links against libsapi or a TCTI
42library (including the resourcemgr):
43$ sudo ldconfig
44
Philip Tricca63d40ae2015-08-14 15:43:47 -070045We now have basic VPATH support which allows us to separate the source
46directory from the build directory. This allows for a developer to do a debug
47build and a regular build from the same sources. Any changes to the source
48will be buildable from both build directories. Before you attempt this be sure
49that the source directory is clean.
50
51Our example requires 3 directories:
52TPM2.0-TSS where the sources reside,
Philip Triccae1df9a62016-06-22 04:33:05 -070053tpm2tss-default to hold the build with default configuration
Philip Tricca63d40ae2015-08-14 15:43:47 -070054tpm2tss-debug to hold a build with debug configuration
55
56In the TPM2.0-TSS directory bootstrap the build:
wcarthurb3754072016-04-01 17:34:56 -040057$ ./bootstrap
Philip Tricca63d40ae2015-08-14 15:43:47 -070058
Philip Triccae1df9a62016-06-22 04:33:05 -070059From the tpm2tss-default directory build the TPM2.0-TSS source code with the
60project's default configuration:
61$ CONFIG_SITE=$(pwd)/../TPM2.0-TSS/lib/default_config.site \
62 ../TPM2.0-TSS/configure
Philip Tricca63d40ae2015-08-14 15:43:47 -070063$ make
64
65From the tpm2tss-debug directory build the TPM2.0-TSS source code with
66optimization disabled and debug symbols:
Philip Triccae1df9a62016-06-22 04:33:05 -070067$ CONFIG_SITE=$(pwd)/../TPM2.0-TSS/lib/debug_config.site \
68 ../TPM2.0-TSS/configure
Philip Tricca63d40ae2015-08-14 15:43:47 -070069$ make