]>
Commit | Line | Data |
---|---|---|
a0098eda CB |
1 | This document contains the following sections: |
2 | ============================================== | |
3 | ||
edd8da86 | 4 | - Quick start |
a0098eda | 5 | - Building libtpms |
edd8da86 CB |
6 | - Installing libtpms, include files and man pages |
7 | - Uninstalling libtpms, include files and man pages | |
8 | - More on man pages | |
a0098eda | 9 | |
edd8da86 CB |
10 | Quick start: |
11 | ------------ | |
12 | ||
0466fcf6 SB |
13 | The libtpms library can be built using the steps (after installing |
14 | dependencies): | |
edd8da86 | 15 | |
0466fcf6 | 16 | # ./autogen.sh --with-tpm2 --with-openssl --prefix=/usr |
edd8da86 | 17 | # make |
0466fcf6 | 18 | # make check |
edd8da86 | 19 | # sudo make install |
a0098eda CB |
20 | |
21 | Building libtpms: | |
22 | ----------------- | |
23 | ||
edd8da86 CB |
24 | The configure script needs to be run first, and can be done using: |
25 | ||
0466fcf6 | 26 | ./autogen.sh --with-tpm2 --with-openssl |
a0098eda | 27 | |
edd8da86 CB |
28 | By default, files will be installed in '/usr/local/lib', etc. If you |
29 | would like to have these files installed in '/usr/lib', etc, then run | |
0466fcf6 SB |
30 | configure using the following command line. On some distributions it may |
31 | be necessary to also pass --libdir=/lib64 (for 64 bit systems). | |
a0098eda | 32 | |
0466fcf6 | 33 | ./autogen.sh --prefix=/usr --with-tpm2 --with-openssl |
a0098eda | 34 | |
edd8da86 CB |
35 | For more details on configure options, run "./configure -h". |
36 | ||
37 | Building libtpms can be done using: | |
38 | ||
0466fcf6 | 39 | make all |
a0098eda CB |
40 | |
41 | The library is known to build on Linux and Cygwin systems and possible | |
42 | other Operating Systems that use .so as library extensions. | |
43 | ||
44 | On Linux systems, libtpms can be built with either one of the following | |
45 | crypto backends: | |
46 | ||
47 | - openssl | |
0466fcf6 | 48 | - freebl (TPM 1.2 support only) |
a0098eda CB |
49 | |
50 | On Cygwin only openssl is available and therefore can only be built with | |
51 | openssl. | |
52 | ||
53 | To build for openssl, the following development packages must have been | |
54 | installed: | |
55 | ||
03d25ba0 | 56 | Fedora/RedHat: |
0466fcf6 SB |
57 | - automake |
58 | - autoconf | |
59 | - libtool | |
60 | - make | |
61 | - gcc | |
a0098eda CB |
62 | - glibc-headers |
63 | - openssl-devel | |
64 | ||
03d25ba0 | 65 | Ubuntu: |
0466fcf6 SB |
66 | - automake |
67 | - autoconf | |
68 | - libtool | |
69 | - make | |
70 | - gcc | |
71 | - libc-dev | |
03d25ba0 SB |
72 | - libssl-dev |
73 | ||
0466fcf6 SB |
74 | To build for freebl (TPM 1.2 support only), the following development |
75 | packages must have been installed prior to compilation: | |
a0098eda | 76 | |
03d25ba0 | 77 | Fedora/RedHat: |
a0098eda CB |
78 | - glibc-headers |
79 | - nss-softokn-freebl-devel (preferably version 3.12.9-2 or newer) | |
80 | - nss-softokn-devel (preferably version 3.12.9-2 or newer) | |
81 | - gmp-devel | |
82 | ||
03d25ba0 SB |
83 | Ubuntu: |
84 | - libc6-dev | |
85 | - libgmp-dev | |
86 | - libnspr4-dev | |
87 | - libnss3-dev (preferably version 3.17.2; needs to have blapi.h) | |
88 | ||
a0098eda CB |
89 | By default, libtpms is built with the openssl crypto library, which was |
90 | shown above. To build with the freebl crypto library the following command | |
0466fcf6 | 91 | line can be used (TPM 1.2 support only): |
a0098eda | 92 | |
0466fcf6 SB |
93 | ./autogen.sh --prefix=/usr |
94 | make all install | |
a0098eda CB |
95 | |
96 | To verify that libtpms was built with freebl as the crypto backend, one | |
edd8da86 | 97 | can run: |
a0098eda | 98 | |
0466fcf6 | 99 | ldd /usr/lib/libtpms.so or ldd /usr/lib64/libtpms.so |
a0098eda CB |
100 | |
101 | linux-vdso.so.1 => (0x00007fff8d5ff000) | |
102 | libgmp.so.3 => /usr/lib64/libgmp.so.3 (0x00007f5352a13000) | |
103 | libnspr4.so => /lib64/libnspr4.so (0x00007f53527d6000) | |
104 | libnssutil3.so => /usr/lib64/libnssutil3.so (0x00007f53525b6000) | |
105 | libnss3.so => /usr/lib64/libnss3.so (0x00007f535227c000) | |
106 | libc.so.6 => /lib64/libc.so.6 (0x00007f5351ed8000) | |
107 | libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5351cba000) | |
108 | libdl.so.2 => /lib64/libdl.so.2 (0x00007f5351ab6000) | |
109 | libplc4.so => /lib64/libplc4.so (0x00007f53518b2000) | |
110 | libplds4.so => /lib64/libplds4.so (0x00007f53516ae000) | |
111 | /lib64/ld-linux-x86-64.so.2 (0x0000003a1c000000) | |
112 | ||
113 | The fact that the libraries libgmp, libnspr4, libnssutil3, libnss3, | |
bbd7b75d | 114 | libpc4, and libplds4 are linked against is an indication that the freebl |
a0098eda CB |
115 | library was used for linking. |
116 | ||
edd8da86 | 117 | In case of openssl's libcrypto the output would be the following: |
a0098eda CB |
118 | |
119 | linux-vdso.so.1 => (0x00007fffcbdff000) | |
120 | libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007fdb1d00e000) | |
121 | libc.so.6 => /lib64/libc.so.6 (0x00007fdb1cc6a000) | |
122 | libdl.so.2 => /lib64/libdl.so.2 (0x00007fdb1ca65000) | |
123 | libz.so.1 => /lib64/libz.so.1 (0x00007fdb1c84e000) | |
124 | /lib64/ld-linux-x86-64.so.2 (0x0000003a1c000000) | |
125 | ||
126 | ||
edd8da86 CB |
127 | Installing libtpms, include files and man pages: |
128 | ------------------------------------------------ | |
a0098eda CB |
129 | |
130 | The installation of libtpms, the development include files (headers) and | |
131 | man pages can be achieved through: | |
132 | ||
edd8da86 | 133 | make install |
a0098eda CB |
134 | |
135 | This will copy libtpms into the standard library directory on your Linux | |
136 | system such as /usr/lib or /usr/lib64, depending on whether you built for | |
137 | a 32 bit or 64 bit machine. | |
138 | ||
139 | The public include files of libtpms will be copied to /usr/include/libtpms. | |
140 | ||
141 | The man pages explaining the libtpms API will be copied to /usr/share/man. | |
142 | ||
143 | ||
edd8da86 CB |
144 | Uninstalling libtpms, include files and man pages: |
145 | -------------------------------------------------- | |
a0098eda CB |
146 | |
147 | The libtpms library, its development include files (headers) and man pages | |
148 | can be uninstalled from their standard locations using | |
149 | ||
edd8da86 | 150 | make uninstall |
a0098eda CB |
151 | |
152 | ||
edd8da86 CB |
153 | More on man pages |
154 | ----------------- | |
a0098eda | 155 | |
edd8da86 CB |
156 | All of the libtpms APIs have a man page. The man pages contain explanations |
157 | on how to use the APIs as well as examples. Once installed, they can be | |
158 | viewed as a typical man page: | |
a0098eda | 159 | |
edd8da86 | 160 | man TPMLIB_MainInit |
a0098eda | 161 | |
edd8da86 CB |
162 | Otherwise, if they are not installed, they can then be viewed from the |
163 | libtpms root directory using: | |
a0098eda CB |
164 | |
165 | man -M ./man TPMLIB_MainInit |