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