Philip Tricca | e1df9a6 | 2016-06-22 04:33:05 -0700 | [diff] [blame] | 1 | To build and install the tpm2.0-tss software the following dependencies are |
| 2 | required: |
Philip Tricca | e290e26 | 2015-08-10 12:36:13 -0700 | [diff] [blame] | 3 | GNU Autoconf |
Philip Tricca | 0069247 | 2015-09-16 13:09:54 -0700 | [diff] [blame] | 4 | GNU Autoconf archive |
Philip Tricca | e290e26 | 2015-08-10 12:36:13 -0700 | [diff] [blame] | 5 | GNU Automake |
Philip Tricca | a509a68 | 2015-09-14 15:34:52 -0700 | [diff] [blame] | 6 | GNU Libtool |
Philip Tricca | e290e26 | 2015-08-10 12:36:13 -0700 | [diff] [blame] | 7 | C compiler |
Philip Tricca | e290e26 | 2015-08-10 12:36:13 -0700 | [diff] [blame] | 8 | C Library Development Libraries and Header Files (for pthreads headers) |
Philip Tricca | b194be9 | 2016-03-15 13:27:09 -0700 | [diff] [blame] | 9 | cmocka unit test framework |
Philip Tricca | e1df9a6 | 2016-06-22 04:33:05 -0700 | [diff] [blame] | 10 | pkg-config |
Philip Tricca | e290e26 | 2015-08-10 12:36:13 -0700 | [diff] [blame] | 11 | |
| 12 | Currently the tpm2.0-tss is only distributed via GitHub as we have not yet |
| 13 | produced an official source release. To obtain the tpm2.0-tss sources you |
| 14 | must clone them from the 01.org GitHub organization TPM2.0-TSS git repository: |
| 15 | git clone https://github.com/01org/TPM2.0-TSS |
| 16 | |
Philip Tricca | daeb5bb | 2016-05-26 19:27:45 -0700 | [diff] [blame] | 17 | To configure the tpm2.0-tss source code first define the environment for your |
| 18 | build using a config.site file. The default for the project is kept at |
Philip Tricca | e1df9a6 | 2016-06-22 04:33:05 -0700 | [diff] [blame] | 19 | ./lib/default_config.site. Pass this environment to the build through the |
| 20 | CONFIG_SITE variable: |
Philip Tricca | e290e26 | 2015-08-10 12:36:13 -0700 | [diff] [blame] | 21 | $ ./bootstrap |
Philip Tricca | e1df9a6 | 2016-06-22 04:33:05 -0700 | [diff] [blame] | 22 | $ CONFIG_SITE=$(pwd)/lib/default_config.site ./configure |
| 23 | |
| 24 | You may also customize the config.site to your needs (please read the GNU |
| 25 | documentation for config.site files) or use your platform / distro default |
| 26 | by leaving the CONFIG_SITE environment variable undefined. |
Philip Tricca | daeb5bb | 2016-05-26 19:27:45 -0700 | [diff] [blame] | 27 | |
| 28 | Then compile the code: |
Philip Tricca | e290e26 | 2015-08-10 12:36:13 -0700 | [diff] [blame] | 29 | $ make |
| 30 | |
Philip Tricca | e1df9a6 | 2016-06-22 04:33:05 -0700 | [diff] [blame] | 31 | Once you've built the tpm2.0-tss software it can be installed with: |
| 32 | $ sudo make install |
| 33 | |
| 34 | This will install the libraries and the resource manager to locations |
| 35 | determined at configure time. See the output of ./configure --help for the |
| 36 | available options. Typically you won't need to do much more than provide an |
| 37 | alternative --prefix option at configure time, and maybe DESTDIR at install |
| 38 | time if you're packaging for a distro. |
| 39 | |
Michael Nix | f9a2e67 | 2016-12-13 17:01:44 +0100 | [diff] [blame] | 40 | NOTE: It may be necessary to run ldconfig (as root) to update the run-time |
| 41 | bindings before executing a program that links against libsapi or a TCTI |
| 42 | library (including the resourcemgr): |
| 43 | $ sudo ldconfig |
| 44 | |
Philip Tricca | 63d40ae | 2015-08-14 15:43:47 -0700 | [diff] [blame] | 45 | We now have basic VPATH support which allows us to separate the source |
| 46 | directory from the build directory. This allows for a developer to do a debug |
| 47 | build and a regular build from the same sources. Any changes to the source |
| 48 | will be buildable from both build directories. Before you attempt this be sure |
| 49 | that the source directory is clean. |
| 50 | |
| 51 | Our example requires 3 directories: |
| 52 | TPM2.0-TSS where the sources reside, |
Philip Tricca | e1df9a6 | 2016-06-22 04:33:05 -0700 | [diff] [blame] | 53 | tpm2tss-default to hold the build with default configuration |
Philip Tricca | 63d40ae | 2015-08-14 15:43:47 -0700 | [diff] [blame] | 54 | tpm2tss-debug to hold a build with debug configuration |
| 55 | |
| 56 | In the TPM2.0-TSS directory bootstrap the build: |
wcarthur | b375407 | 2016-04-01 17:34:56 -0400 | [diff] [blame] | 57 | $ ./bootstrap |
Philip Tricca | 63d40ae | 2015-08-14 15:43:47 -0700 | [diff] [blame] | 58 | |
Philip Tricca | e1df9a6 | 2016-06-22 04:33:05 -0700 | [diff] [blame] | 59 | From the tpm2tss-default directory build the TPM2.0-TSS source code with the |
| 60 | project's default configuration: |
| 61 | $ CONFIG_SITE=$(pwd)/../TPM2.0-TSS/lib/default_config.site \ |
| 62 | ../TPM2.0-TSS/configure |
Philip Tricca | 63d40ae | 2015-08-14 15:43:47 -0700 | [diff] [blame] | 63 | $ make |
| 64 | |
| 65 | From the tpm2tss-debug directory build the TPM2.0-TSS source code with |
| 66 | optimization disabled and debug symbols: |
Philip Tricca | e1df9a6 | 2016-06-22 04:33:05 -0700 | [diff] [blame] | 67 | $ CONFIG_SITE=$(pwd)/../TPM2.0-TSS/lib/debug_config.site \ |
| 68 | ../TPM2.0-TSS/configure |
Philip Tricca | 63d40ae | 2015-08-14 15:43:47 -0700 | [diff] [blame] | 69 | $ make |